aboutsummaryrefslogtreecommitdiff
path: root/CheatEngineServer/CheatEngine.h
diff options
context:
space:
mode:
Diffstat (limited to 'CheatEngineServer/CheatEngine.h')
-rw-r--r--CheatEngineServer/CheatEngine.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/CheatEngineServer/CheatEngine.h b/CheatEngineServer/CheatEngine.h
new file mode 100644
index 0000000..3cfbc32
--- /dev/null
+++ b/CheatEngineServer/CheatEngine.h
@@ -0,0 +1,74 @@
+#pragma once
+
+#include <winsock.h>
+
+#define CE_PORT "52736"
+
+typedef enum ce_command {
+ CMD_GETVERSION = 0,
+ CMD_CLOSECONNECTION,
+ CMD_TERMINATESERVER,
+ CMD_OPENPROCESS,
+ CMD_CREATETOOLHELP32SNAPSHOT,
+ CMD_PROCESS32FIRST,
+ CMD_PROCESS32NEXT,
+ CMD_CLOSEHANDLE,
+ CMD_VIRTUALQUERYEX,
+ CMD_READPROCESSMEMORY,
+ CMD_WRITEPROCESSMEMORY,
+ CMD_STARTDEBUG,
+ CMD_STOPDEBUG,
+ CMD_WAITFORDEBUGEVENT,
+ CMD_CONTINUEFROMDEBUGEVENT,
+ CMD_SETBREAKPOINT,
+ CMD_REMOVEBREAKPOINT,
+ CMD_SUSPENDTHREAD,
+ CMD_RESUMETHREAD,
+ CMD_GETTHREADCONTEXT,
+ CMD_SETTHREADCONTEXT,
+ CMD_GETARCHITECTURE,
+ CMD_MODULE32FIRST,
+ CMD_MODULE32NEXT,
+ CMD_GETSYMBOLLISTFROMFILE,
+ CMD_LOADEXTENSION,
+ CMD_ALLOC,
+ CMD_FREE,
+ CMD_CREATETHREAD,
+ CMD_LOADMODULE,
+ CMD_SPEEDHACK_SETSPEED,
+ CMD_VIRTUALQUERYEXFULL,
+ CMD_GETREGIONINFO,
+ CMD_AOBSCAN = 200,
+ CMD_COMMANDLIST2 = 255,
+
+ CMD_MAX
+} ce_command;
+
+static inline char const * ce_command_to_string(enum ce_command cmd)
+{
+ static char const * const cmd_map[] = {
+ "CMD_GETVERSION", "CMD_CLOSECONNECTION", "CMD_TERMINATESERVER", "CMD_OPENPROCESS",
+ "CMD_CREATETOOLHELP32SNAPSHOT", "CMD_PROCESS32FIRST", "CMD_PROCESS32NEXT", "CMD_CLOSEHANDLE",
+ "CMD_VIRTUALQUERYEX", "CMD_READPROCESSMEMORY", "CMD_WRITEPROCESSMEMORY", "CMD_STARTDEBUG",
+ "CMD_STOPDEBUG", "CMD_WAITFORDEBUGEVENT", "CMD_CONTINUEFROMDEBUGEVENT", "CMD_SETBREAKPOINT",
+ "CMD_REMOVEBREAKPOINT", "CMD_SUSPENDTHREAD", "CMD_RESUMETHREAD", "CMD_GETTHREADCONTEXT",
+ "CMD_SETTHREADCONTEXT", "CMD_GETARCHITECTURE", "CMD_MODULE32FIRST", "CMD_MODULE32NEXT",
+ "CMD_GETSYMBOLLISTFROMFILE", "CMD_LOADEXTENSION", "CMD_ALLOC", "CMD_FREE", "CMD_CREATETHREAD",
+ "CMD_LOADMODULE", "CMD_SPEEDHACK_SETSPEED", "CMD_VIRTUALQUERYEXFULL", "CMD_GETREGIONINFO",
+ "CMD_AOBSCAN", "CMD_COMMANDLIST2"
+ };
+ if (cmd < 0 || cmd >= CMD_MAX)
+ {
+ return "Unknown Command";
+ }
+ return cmd_map[cmd];
+}
+
+class CEConnection {
+public:
+ explicit CEConnection(SOCKET s) : sock(s) {}
+ SOCKET getSocket(void) { return sock; }
+ void closeSocket(void) { closesocket(sock); }
+private:
+ SOCKET sock;
+}; \ No newline at end of file