#pragma once #define NULL 0 //DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING! //######################################################################### //size, in bytes, of the various injected machine code #define SIZE_FUNCTION_ASM 58+5 #define SIZE_FUNCCALL_ASM 9 #define SIZE_FUNCCALL_RES_ASM 7 #define SIZE_FUNCTION_RESTORE 28+5 #define SIZE_FUNCCALL_PASS 9 #define SIZE_FUNCTION_PASS_GRAB 84 #define SIZE_FUNCTION_PASS_INJECT 116 #define SIZE_FUNCCALL_SENDFLAG 8 #define SIZE_FUNCTION_SENDFLAG 24 #define SIZE_FUNCCALL_RECVFLAG 14 #define SIZE_FUNCTION_RECVFLAG 31 #define SIZE_FUNCTION_PCKDUMP 73 //These should be left alone unless the encryption function in GW was modified //If these are changed, extract the new opcodes from the dll #define INJECT_KEY_RESTORE_OFF 0x51 //where to overwrite gw code with our pop ecx #define RETURN_IK_OFF 0x09 //inc ESI is the start of the crypto loop #define RETURN_IKR_OFF 0x07 //pop esi is the place we resume game code #define RETURN_PASS_INJECT 49 //data storage offsets, must go in chronological order #define DATA_OFFSET 0x220 //400 decimal, CODECAVE+this=where our data begins #define KEY_BACKUP DATA_OFFSET+264+5 #define OLD_ECX_OFF KEY_BACKUP+264+5//0x6e //offset from CODECAVE to our org ECX value #define PASSWORD_STORE_OFF OLD_ECX_OFF+8 //offset for the password stuff #define END_PASS_GRAB_OFF 0x0F #define PASS_GRAB_REP 29 #define PASS_JBACK_OFF 0x09 #define NO_PASS_FLAG_OFF 0x07 //code offsets #define RESTORE_CODE_OFFSET SIZE_FUNCTION_ASM+5//0x3c //offset from CODECAVE to our reset code #define PASSWORD_CODE_OFFSET RESTORE_CODE_OFFSET+SIZE_FUNCTION_RESTORE+5//0x7f #define PASSWORD_INJECT_CODE_OFFSET PASSWORD_CODE_OFFSET+SIZE_FUNCTION_PASS_GRAB+5 //packet dump code offsets #define SEND_FLAG_CODE_OFFSET 100 #define RECV_FLAG_CODE_OFFSET 200 //packet dump data offsets #define PCKD_DATA_AVAILABLE DATA_OFFSET+5 #define PCKD_DATA_SIZE PCKD_DATA_AVAILABLE+5 #define PCKD_DATA_ADDR PCKD_DATA_SIZE+5 #define PCKD_KEY_ADDR PCKD_DATA_ADDR+5 extern unsigned char ASMFunction[SIZE_FUNCTION_ASM]; extern unsigned char ASMFunctionCall[SIZE_FUNCCALL_ASM]; extern unsigned char ASMFunctionCallRestore[SIZE_FUNCCALL_RES_ASM]; extern unsigned char ASMFunctionRestore[SIZE_FUNCTION_RESTORE]; extern unsigned char ASMFunctionCallPass[SIZE_FUNCCALL_PASS]; extern unsigned char ASMFunctionPassGrab[SIZE_FUNCTION_PASS_GRAB]; extern unsigned char ASMFunctionPassInject[SIZE_FUNCTION_PASS_INJECT]; extern unsigned char ASMFunctionCallSendFlag[SIZE_FUNCCALL_SENDFLAG]; extern unsigned char ASMFunctionSendFlag[SIZE_FUNCTION_SENDFLAG]; extern unsigned char ASMFunctionCallRecvFlag[SIZE_FUNCCALL_RECVFLAG]; extern unsigned char ASMFunctionRecvFlag[SIZE_FUNCTION_RECVFLAG]; extern unsigned char ASMFunctionPckDump[SIZE_FUNCTION_PCKDUMP]; struct DATA { char encrypted; unsigned char *data; unsigned int dataSize; char hash[32]; unsigned char key[264]; unsigned long timeSinceLastPck; DATA() { data=0; } }; #define IGNORE_SERVER 3 #define IGNORE_CLIENT 4 #define REPORT_CLIENT 5 extern unsigned long lastRecv;