#pragma once #include #include #include using ByteArray = std::vector; namespace RemoteCode { // Used for TransactionStart using ImportedModule = char[64]; using ImportList = std::vector; // Used for TransactionContinue struct ExportedFunction { // I've never seen modules / functions with names // that were larger than 64 characters. char m_Module[64]; char m_Function[64]; // Address of exported module / function uintptr_t m_ModuleAddress; uintptr_t m_FunctionAddress; }; using ExportList = std::vector; // Used for TransactionCommit struct RemoteInjectionHeader { // Used to decrypt the cheat header (first 1000 bytes of image sent back). uint8_t m_HeaderKey; // Used to call entrypoint/TLS callbacks. uintptr_t m_EntryPoint; uintptr_t m_TlsDirectory; }; struct RemoteInjectionCode { RemoteInjectionHeader m_Header; // Actual injection code. ByteArray m_Code; }; 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); }; }