#pragma once #include #include #include using ByteArray = std::vector; namespace RemoteCode { // What the server sends to the client upon transaction start. struct RemoteServerHeader { // Does the cheat support the DirectX thread execution exploit? bool m_ThreadExploitSupported; // This will be used for allocating the remote memory. uintptr_t m_SizeOfImage; // OPTIONAL: The cheat might be using the DllMain function // to do injection. Make sure to call that. uintptr_t m_EntryPoint; // OPTIONAL: The cheat might be using TLS callbacks to // do injection. Make sure to call that. uintptr_t m_TlsCallbackDirectory; }; // Requests supported by the server. // These are stored in a vector and later looked up. struct RemoteServerRequest { // Hash to look up requests by. uint64_t m_LookupHash; // Name printed on the console when a user injects. char m_DebugName[128]; // File name that's used to load the DLL server-side. char m_FileName[260]; // Does the cheat support the DirectX exploit for creating threads? bool m_ThreadExploitSupported; }; // The initial header we receive from the client. struct RemoteClientRequest { uint64_t m_LookupHash; }; // The response we receive from the client upon transaction start. struct RemoteClientHeader { // Address of remote allocation. uintptr_t m_RemoteAddress; // Up to six remote modules. // NOTE: Stop iterating once a module is NULL. uintptr_t m_RemoteModules[6]; }; class RemoteInjectionServer { public: // Receive hash of selected cheat. // Reply with size of image to allocate. ByteArray Start(ByteArray &Response); // Receive client header, send over list of imported functions ByteArray TransactionStart(ByteArray &Response); // Receive list of modules & export addresses ByteArray TransactionContinue(ByteArray &Response); }; }