struct MessageHeader {MessageType m_eType; // Message typeDWORD m_cbDataBlock; // Size of following data block (can be zero)DWORD m_dwId; // Message ID from senderDWORD m_dwReplyId; // Reply-to Message IDDWORD m_dwLastSeenId; // Last seen Message ID by senderDWORD m_dwReserved; // Reserved for future (initialize to zero)union {struct {DWORD m_dwMajorVersion; // Requested/accepted protocol versionDWORD m_dwMinorVersion;} VersionInfo;...} TypeSpecificData;BYTE m_sMustBeZero[8];}
boolreadMemory(void*addr,int len,unsignedchar**output) {// Allocation and initialization...// Write header and read response...// Read the memory from the debuggee...returntrue;}
boolwriteMemory(void*addr,int len,unsignedchar*input) {// Increment IDs, set message type, and specify memory location...// Write header and data, then read the response...// Confirm memory write was successful...returntrue;}