void SetAggressAction(Aggress_t *agg, PokerAI *ai, VarTran_t h, int (*IsBetter)(int eval, int evalclass)) { int stack = h.stack; int round = h.round; //int pwr = h.pwr; //int pv = h.pv; int eval = h.pwr; if (agg->type == 1) { eval = h.pwr; } int my_pos = agg->my_pos; int beforeme_least_stack = agg->beforeme_least_stack; int behindme_best_stack = agg->behindme_best_stack; int sum_other_stack = agg->sum_other_stack; int is_aggress = agg->level; //~~~~~~~~~~~~~ int aggbet = MAX(rand()%80, rand()%(is_aggress*stack/10+1)); //int call_no = ai->game.call_no; if (is_aggress && (ai->action.type == ACTION_FOLD||ai->action.type == ACTION_CHECK) ){ ai->game.call_no++; } if (is_aggress == 3) { DBASPRINTF("[%4d]===[in-%d-of-%d-lv-%d]", round, my_pos, h.noPlayers, is_aggress); if (IsBetter(eval, 3)) { aggbet = power3(h.call_no); DBASPRINTF("---call %d", h.call_amount); AggSetCall(); } else if (IsBetter(eval, 4)) { DBASPRINTF("---raise %d", 4*aggbet); AggSetBet(4*aggbet); } else if (h.pv >= 12) { DBASPRINTF("---raise %d", 2*aggbet); AggSetBet(2*aggbet); } else { DBASPRINTF("---call %d", h.call_amount); AggSetCall(); } DBASPRINTF("\n"); } if (is_aggress == 2) { DBASPRINTF("[%4d]===[in-%d-of-%d-lv-%d]", round, my_pos, h.noPlayers, is_aggress); if (IsBetter(eval, 3)) { DBASPRINTF("---raise %d", 2*aggbet); AggSetBet(2*aggbet); } else if (IsBetter(eval, 4)) { DBASPRINTF("---raise %d", 2*aggbet); AggSetBet(2*aggbet); } DBASPRINTF("\n"); } else if (is_aggress == 1){ DBASPRINTF("[%4d]===[in-%d-of-%d-lv-%d-%d<<%d<<%d]", round, my_pos, h.noPlayers, is_aggress, behindme_best_stack, stack, beforeme_least_stack); if (IsBetter(eval, 2)) { aggbet = MIN(aggbet*2, rand()%(ai->game.raise_no*behindme_best_stack/2+1)); DBASPRINTF("---raise %d", aggbet); AggSetBet(aggbet); } else if (IsBetter(eval, 3)) { aggbet = MIN(aggbet*2, rand()%(ai->game.raise_no*behindme_best_stack/4+1)); DBASPRINTF("---raise %d", aggbet); AggSetBet(aggbet); } else if (IsBetter(eval, 4)) { DBASPRINTF("---raise %d", aggbet); AggSetBet(aggbet); } DBASPRINTF("\n"); } // END 激进地争取名次 // 排第一的时候,如果对方没有机会赢,一直fold int all_fold_lost_money = (600-round)*(1.5*h.BB)/h.noPlayers; if (my_pos == 1 && (stack-sum_other_stack-all_fold_lost_money>0) ) { if (IsBet() || IsAllin()) {SetCall();} if (IsCall()) {SetFold();} printf("--- fold till end --- no.1 ---\n"); } }
int PbSVLoadModule() { char hash[128]; long unsigned sizeofhash; char modname[256]; char modname_dest[256]; const char* dlname; const char* dlname2; byte* imagebase; if ( pbsv.hLibModule ) { return 0; } PbSvUnload(); if ( FS_FileExistsOSPath( PbSv6makefn(modname, "pbsvnew" DLL_EXT) ) == qtrue ) { Sys_Chmod( PbSv6makefn(modname, "pbsvold" DLL_EXT), 0777); FS_RemoveOSPath( PbSv6makefn(modname, "pbsvold" DLL_EXT) ); rename( PbSv6makefn(modname, "pbsv" DLL_EXT), PbSv6makefn(modname_dest, "pbsvold" DLL_EXT) ); Sys_Chmod( PbSv6makefn(modname, "pbsv" DLL_EXT), 0777); FS_RemoveOSPath( PbSv6makefn(modname, "pbsv" DLL_EXT) ); rename( PbSv6makefn(modname, "pbsvnew" DLL_EXT), PbSv6makefn(modname_dest, "pbsv" DLL_EXT) ); } if(com_securemode) { dlname = PbSv6makefn(modname, "pbag" DLL_EXT); dlname2 = PbSv6makefn(modname_dest, "pbags" DLL_EXT); if ( FS_FileExistsOSPath( dlname ) == qtrue ) { FS_RemoveOSPath( dlname2 ); rename( dlname ,dlname2 ); FS_RemoveOSPath( dlname ); } hash[0] = '\0'; sizeofhash = sizeof(hash); Sec_HashFile(SEC_HASH_TIGER, dlname2, hash, &sizeofhash, qfalse); if(Q_stricmp(hash ,PBAG_HASH)) { Com_Printf("Tiger = %s\n", hash); Com_PrintError("%s checksum missmatch! PunkBuster will not startup in securemode when the checksum is invalid.\n", dlname2); return 1; } dlname = PbSv6makefn(modname, "pbcl" DLL_EXT); dlname2 = PbSv6makefn(modname_dest, "pbcls" DLL_EXT); if ( FS_FileExistsOSPath( dlname ) == qtrue ) { FS_RemoveOSPath( dlname2 ); rename( dlname ,dlname2 ); FS_RemoveOSPath( dlname ); } hash[0] = '\0'; sizeofhash = sizeof(hash); Sec_HashFile(SEC_HASH_TIGER, dlname2, hash, &sizeofhash, qfalse); if(Q_stricmp(hash ,PBCL_HASH)) { Com_Printf("Tiger = %s\n", hash); Com_PrintError("%s checksum missmatch! PunkBuster will not startup in securemode when the checksum is invalid.\n", dlname2); return 1; } dlname2 = PbSv6makefn(modname, "pbsv" DLL_EXT); hash[0] = '\0'; sizeofhash = sizeof(hash); Sec_HashFile(SEC_HASH_TIGER, dlname2, hash, &sizeofhash, qfalse); if(Q_stricmp(hash ,PBSV_HASH)) { Com_Printf("Tiger = %s\n", hash); Com_PrintError("%s checksum missmatch! PunkBuster will not startup in securemode when the checksum is invalid.\n", dlname2); return 1; } } dlname = PbSv6makefn(modname, "pbsv" DLL_EXT); pbsv.hLibModule = Sys_LoadLibrary( dlname ); if ( pbsv.hLibModule == NULL ) { return 1; } if(com_securemode) { /* Remove system() */ imagebase = LIBRARY_ADDRESS_BY_HANDLE( pbsv.hLibModule ); if(Sys_MemoryProtectWrite( (void*)(imagebase + 0x4c6e0), 0xdfdf7 ) == qfalse) { return 1; } SetCall((DWORD)(imagebase + 0x114346), PB_SystemDummy); SetCall((DWORD)(imagebase + 0xc23cb), PB_SystemDummy); if(Sys_MemoryProtectExec( (void*)(imagebase + 0x4c6e0), 0xdfdf7 ) == qfalse) { return 1; } } pbsv.sa = Sys_GetProcedure( "sa" ); pbsv.sb = Sys_GetProcedure( "sb" ); if ( pbsv.sa && pbsv.sb ){ pbsv.wantdisable = 0; return 0; }else{ PbSvUnload(); return 1; } }
static void Sys_PatchImageData( void ) { static byte patchblock_01[] = { 0xAE, 0xA, 0x5, 0x8, 0x89, 0x3C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_Pmove_GetSpeed[] = { 0xC6, 0x5E, 0xA, 0x8, 0x89, 0x3C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC }; static byte patchblock_Pmove_GetGravity[] = { 0xC4, 0x68, 0xA, 0x8, 0x8B, 0x98, 0x5C, 0x1, 0x0, 0x0, 0x89, 0x5D, 0xB4, 0x89, 0x1C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x89, 0x43, 0x58, 0x90, 0x90, 0xC7, 0x83, 0x9C, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x55, 0x8, 0xC6, 0x82, 0x6E, 0x1, 0x0, 0x0, 0xB, 0x8B, 0x4D, 0xB4 }; static byte patchblock_ClientConnect_NoPassword[] = { 0x76, 0x85, 0xA, 0x8, 0xEB, 0x2C }; static byte patchblock_G_RegisterCvars[] = { 0x57, 0x49, 0xB, 0x8, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_Scr_AddSourceBuffer_Ignore_fs_game[] = { 0x74, 0xFC, 0x14, 0x8, 0xEB, 0x4A }; static byte patchblock_Scr_AddSourceBuffer_Ignore_fs_game2[] = { 0x22, 0xFD, 0x14, 0x8, 0x89, 0xd0, 0x90 }; static byte patchblock_SV_SpawnServer[] = { 0x7E, 0x4A, 0x17, 0x8, 0xeb, 0x19 }; static byte patchblock_SV_SendServerCommand[] = { 0x56, 0x74, 0x17, 0x8, 0xeb, 0x5c }; //NET_OutOfBandPrint prototype got changed from netadr_t to netadr_t* The remaining hooks should get fixed up by this: static byte patchblock_NET_OOB_CALL1[] = { 0x75, 0x50, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xE8, 0x18, 0x23, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL2[] = { 0xB3, 0x69, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xEA, 0x86, 0x21, 0x8, 0x8B, 0x5D, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL3[] = { 0x41, 0xB5, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xEA, 0x86, 0x21, 0x8, 0x8D, 0x46, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL4[] = { 0x9B, 0x53, 0x17, 0x8, 0x8D, 0x45, 0x9C, 0x89, 0x44, 0x24, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; Sys_PatchImageWithBlock(patchblock_01, sizeof(patchblock_01)); Sys_PatchImageWithBlock(patchblock_Pmove_GetSpeed, sizeof(patchblock_Pmove_GetSpeed)); Sys_PatchImageWithBlock(patchblock_Pmove_GetGravity, sizeof(patchblock_Pmove_GetGravity)); Sys_PatchImageWithBlock(patchblock_ClientConnect_NoPassword, sizeof(patchblock_ClientConnect_NoPassword)); Com_Memset((void*)0x80b4872, 0x90, 41); //In G_RegisterCvars() Sys_PatchImageWithBlock(patchblock_G_RegisterCvars, sizeof(patchblock_G_RegisterCvars)); Sys_PatchImageWithBlock(patchblock_Scr_AddSourceBuffer_Ignore_fs_game, sizeof(patchblock_Scr_AddSourceBuffer_Ignore_fs_game)); //Maybe script unlock ? Sys_PatchImageWithBlock(patchblock_Scr_AddSourceBuffer_Ignore_fs_game2, sizeof(patchblock_Scr_AddSourceBuffer_Ignore_fs_game2)); //Script unlock Sys_PatchImageWithBlock(patchblock_SV_SpawnServer, sizeof(patchblock_SV_SpawnServer)); //Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8174da9, 0x90, 5); //In SV_SpawnServer() Don't overwrite sv.frameusec (was before unknown write only variable) Com_Memset((void*)0x8174db5, 0x90, 42); //In SV_SpawnServer() Don't set cvar cl_paused as well as nextmap Sys_PatchImageWithBlock(patchblock_SV_SendServerCommand, sizeof(patchblock_SV_SendServerCommand)); //Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8204acf, 0x90, 16); //In ???() Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8204ce9, 0x90, 16); //In ???() Skip useless check for cvar: sv_dedicated Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL1, sizeof(patchblock_NET_OOB_CALL1)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL2, sizeof(patchblock_NET_OOB_CALL2)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL3, sizeof(patchblock_NET_OOB_CALL3)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL4, sizeof(patchblock_NET_OOB_CALL4)); SetCall(0x8050ab1, Jump_CalcHeight); SetJump(0x8050786, Jump_IsPlayerAboveMax); SetJump(0x80507c6, Jump_ClampVelocity); SetJump(0x805072a, Jump_GetStepHeight); SetCall(0x80a4b5f, StopFollowingOnDeath); SetJump(0x80a559e, StuckInClient); SetCall(0x80a5ec9, Pmove_GetSpeed); SetCall(0x80a68d0, Pmove_GetGravity); SetJump(0x80a7b60, ClientSpawn); SetJump(0x80ae962, G_Say); SetJump(0x80adbf2, Cmd_CallVote_f); SetCall(0x80b4957, G_RegisterCvarsCallback); SetJump(0x80c0b5a, GScr_LoadScripts); SetJump(0x80bc03e, ExitLevel); //ToDo Maybe build GScr_ExitLevel directly SetJump(0x810e6ea, PbSvGameQuery); SetJump(0x810e5dc, PbSvSendToClient); SetJump(0x810e5b0, PbSvSendToAddrPort); SetJump(0x817e988, SV_ClipMoveToEntity); SetJump(0x81d5a14, Sys_Error); SetJump(0x8122724, Com_PrintMessage); SetJump(0x8122d94, Com_DPrintfWrapper); SetJump(0x817452e, SV_Shutdown); SetJump(0x813d086, NET_OutOfBandPrint); SetJump(0x80bfef4, Scr_GetMethod); SetJump(0x80bd238, Scr_GetFunction); SetJump(0x814bef0, Scr_LoadScript); SetJump(0x8170a26, SV_DropClient); SetJump(0x8179120, SV_SendMessageToClient); SetJump(0x817a23e, SV_UpdateServerCommandsToClient); SetJump(0x816f828, SV_WriteDownloadToClient); SetJump(0x817a392, SV_WriteSnapshotToClient); SetJump(0x8178da2, SV_Netchan_TransmitNextFragment); SetJump(0x81d76ca, FS_GetBasepath); //Prior: GetCurrentWorkingDir SetJump(0x808b764, ClientScr_SetSessionTeam); SetJump(0x80b43c4, G_LogPrintf); SetJump(0x80a8068, ClientUserinfoChanged); SetJump(0x81aa0be, Info_SetValueForKey); SetJump(0x81d6fca, Sys_Milliseconds); SetJump(0x81a9f8a, va); SetJump(0x8140e9c, Sys_GetValue); SetJump(0x8140efe, Sys_IsMainThread); SetJump(0x81d6be4, Sys_EnterCriticalSection); SetJump(0x81d6bc8, Sys_LeaveCriticalSection); //ToDo build Mem_Init() on its own *(char*)0x8215ccc = '\n'; //adds a missing linebreak *(char*)0x8222ebc = '\n'; //adds a missing linebreak *(char*)0x8222ebd = '\0'; //adds a missing linebreak }
static void Sys_PatchImageData( void ) { static byte patchblock_01[] = { 0xAE, 0xA, 0x5, 0x8, 0x89, 0x3C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_Pmove_GetSpeed[] = { 0xC6, 0x5E, 0xA, 0x8, 0x89, 0x3C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC }; static byte patchblock_Pmove_GetGravity[] = { 0xC4, 0x68, 0xA, 0x8, 0x8B, 0x98, 0x5C, 0x1, 0x0, 0x0, 0x89, 0x5D, 0xB4, 0x89, 0x1C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x89, 0x43, 0x58, 0x90, 0x90, 0xC7, 0x83, 0x9C, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x55, 0x8, 0xC6, 0x82, 0x6E, 0x1, 0x0, 0x0, 0xB, 0x8B, 0x4D, 0xB4 }; static byte patchblock_ClientConnect_NoPassword[] = { 0x76, 0x85, 0xA, 0x8, 0xEB, 0x2C }; static byte patchblock_G_RegisterCvars[] = { 0x57, 0x49, 0xB, 0x8, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_Scr_AddSourceBuffer_Ignore_fs_game[] = { 0x74, 0xFC, 0x14, 0x8, 0xEB, 0x4A }; static byte patchblock_Scr_AddSourceBuffer_Ignore_fs_game2[] = { 0x22, 0xFD, 0x14, 0x8, 0x89, 0xd0, 0x90 }; static byte patchblock_SV_SpawnServer[] = { 0x7E, 0x4A, 0x17, 0x8, 0xeb, 0x19 }; /*static byte patchblock_SV_SendServerCommand[] = { 0x56, 0x74, 0x17, 0x8, 0xeb, 0x5c };*/ //NET_OutOfBandPrint prototype got changed from netadr_t to netadr_t* The remaining hooks should get fixed up by this: static byte patchblock_NET_OOB_CALL1[] = { 0x75, 0x50, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xE8, 0x18, 0x23, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL2[] = { 0xB3, 0x69, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xEA, 0x86, 0x21, 0x8, 0x8B, 0x5D, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL3[] = { 0x41, 0xB5, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xEA, 0x86, 0x21, 0x8, 0x8D, 0x46, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL4[] = { 0x9B, 0x53, 0x17, 0x8, 0x8D, 0x45, 0x9C, 0x89, 0x44, 0x24, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; Sys_PatchImageWithBlock(patchblock_01, sizeof(patchblock_01)); Sys_PatchImageWithBlock(patchblock_Pmove_GetSpeed, sizeof(patchblock_Pmove_GetSpeed)); Sys_PatchImageWithBlock(patchblock_Pmove_GetGravity, sizeof(patchblock_Pmove_GetGravity)); Sys_PatchImageWithBlock(patchblock_ClientConnect_NoPassword, sizeof(patchblock_ClientConnect_NoPassword)); Com_Memset((void*)0x80b4872, 0x90, 41); //In G_RegisterCvars() Com_Memset((void*)0x80b478b, 0x90, 108); //In G_RegisterCvars() (sv_maxclients) Sys_PatchImageWithBlock(patchblock_G_RegisterCvars, sizeof(patchblock_G_RegisterCvars)); Sys_PatchImageWithBlock(patchblock_Scr_AddSourceBuffer_Ignore_fs_game, sizeof(patchblock_Scr_AddSourceBuffer_Ignore_fs_game)); //Maybe script unlock ? Sys_PatchImageWithBlock(patchblock_Scr_AddSourceBuffer_Ignore_fs_game2, sizeof(patchblock_Scr_AddSourceBuffer_Ignore_fs_game2)); //Script unlock Sys_PatchImageWithBlock(patchblock_SV_SpawnServer, sizeof(patchblock_SV_SpawnServer)); //Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8174da9, 0x90, 5); //In SV_SpawnServer() Don't overwrite sv.frameusec (was before unknown write only variable) Com_Memset((void*)0x81753ea, 0x90, 5); //In SV_SpawnServer() Removing the call of NET_Sleep() I don't know for what this can be usefull to have here O_o Com_Memset((void*)0x8174db5, 0x90, 42); //In SV_SpawnServer() Don't set cvar cl_paused as well as nextmap Com_Memset((void*)0x8174b9b, 0x90, 116); //In SV_SpawnServer() Removal of sv_maxclients amd ui_maxclients Cvar_Register() Com_Memset((void*)0x8204acf, 0x90, 16); //In ???() Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8204ce9, 0x90, 16); //In ???() Skip useless check for cvar: sv_dedicated Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL1, sizeof(patchblock_NET_OOB_CALL1)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL2, sizeof(patchblock_NET_OOB_CALL2)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL3, sizeof(patchblock_NET_OOB_CALL3)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL4, sizeof(patchblock_NET_OOB_CALL4)); Com_Memset((void*)0x81747b5, 0x90, 116); //In SV_???() Removal of sv_maxclients amd ui_maxclients Cvar_Register() Com_Memset((void*)0x817498c, 0x90, 116); //In SV_???() Removal of sv_maxclients amd ui_maxclients Cvar_Register() /* static byte patchblock_DB_LOADXASSETS[] = { 0x8a, 0x64, 0x20, 0x8, 0x8b, 0x45, 0x0c, 0x50, 0x8b, 0x45, 0x08, 0x50, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x83, 0xc4, 0x08, 0xe9, 0x67, 0xfb, 0xff, 0xff }; Sys_PatchImageWithBlock(patchblock_DB_LOADXASSETS, sizeof(patchblock_DB_LOADXASSETS)); SetCall(0x8206492, DB_LoadXAssets_Hook); */ #ifndef PUNKBUSTER Com_Memset((void*)0x8175255, 0x90, 5); Com_Memset((void*)0x81751fe, 0x90, 5); #endif SetCall(0x8050ab1, Jump_CalcHeight); SetJump(0x8050786, Jump_IsPlayerAboveMax); SetJump(0x80507c6, Jump_ClampVelocity); SetJump(0x805072a, Jump_GetStepHeight); SetCall(0x80a4b5f, StopFollowingOnDeath); SetJump(0x80a559e, StuckInClient); SetCall(0x80a5ec9, Pmove_GetSpeed); SetCall(0x80a68d0, Pmove_GetGravity); SetJump(0x80a7b60, ClientSpawn); SetJump(0x80ae962, G_Say); SetJump(0x80adbf2, Cmd_CallVote_f); SetCall(0x80b5a68, G_RegisterCvars); SetJump(0x80c0b5a, GScr_LoadScripts); SetJump(0x80bc03e, ExitLevel); //ToDo Maybe build GScr_ExitLevel directly #ifdef PUNKBUSTER SetJump(0x810e6ea, PbSvGameQuery); SetJump(0x810e5dc, PbSvSendToClient); SetJump(0x810e5b0, PbSvSendToAddrPort); #endif SetJump(0x817e988, SV_ClipMoveToEntity); SetJump(0x81d5a14, Sys_Error); SetJump(0x8122724, Com_PrintMessage); SetJump(0x8122d94, Com_DPrintfWrapper); SetJump(0x817452e, SV_Shutdown); SetJump(0x813d086, NET_OutOfBandPrint); SetJump(0x80bfef4, Scr_GetMethod); SetJump(0x80bd238, Scr_GetFunction); SetJump(0x814bef0, Scr_LoadScript); SetJump(0x8170a26, SV_DropClient); SetJump(0x8179120, SV_SendMessageToClient); SetJump(0x817a23e, SV_UpdateServerCommandsToClient); SetJump(0x816f828, SV_WriteDownloadToClient); SetJump(0x817a392, SV_WriteSnapshotToClient); SetJump(0x8178da2, SV_Netchan_TransmitNextFragment); SetJump(0x81d76ca, FS_GetBasepath); //Prior: GetCurrentWorkingDir SetJump(0x808b764, ClientScr_SetSessionTeam); SetJump(0x80b43c4, G_LogPrintf); SetJump(0x80a8068, ClientUserinfoChanged); SetJump(0x81aa0be, BigInfo_SetValueForKey); SetJump(0x81d6fca, Sys_Milliseconds); SetJump(0x81d6f7c, Sys_MillisecondsRaw); SetJump(0x81a9f8a, va); SetJump(0x8131200, MSG_Init); SetJump(0x8131320, MSG_InitReadOnly); SetJump(0x8131294, MSG_InitReadOnlySplit); SetJump(0x8140e9c, Sys_GetValue); SetJump(0x8140efe, Sys_IsMainThread); SetJump(0x8140f42, Sys_IsDatabaseThread); SetJump(0x81d6be4, Sys_EnterCriticalSection); SetJump(0x81d6bc8, Sys_LeaveCriticalSection); SetJump(0x81d7282, Sys_ListFiles); SetJump(0x81d6f06, Sys_FreeFileList); SetJump(0x8177402, SV_SendServerCommand_IW); SetJump(0x818e73c, FS_Restart); SetJump(0x818726c, FS_FCloseFile); SetJump(0x81a2944, Cvar_RegisterString); SetJump(0x81a2d94, Cvar_RegisterBool); SetJump(0x81a2cc6, Cvar_RegisterInt); SetJump(0x81a2860, Cvar_RegisterEnum); SetJump(0x81a2e6c, Cvar_RegisterFloat); SetJump(0x81a2bea, Cvar_RegisterVec2); SetJump(0x81a2b08, Cvar_RegisterVec3); SetJump(0x81a2550, Cvar_RegisterColor); SetJump(0x81a14fa, Cvar_SetString); SetJump(0x81a1c6c, Cvar_SetBool); SetJump(0x81a20c4, Cvar_SetInt); SetJump(0x81a1fe0, Cvar_SetFloat); SetJump(0x81a14c2, Cvar_SetColor); SetJump(0x81a3422, Cvar_SetStringByName); SetJump(0x81a3020, Cvar_SetFloatByName); SetJump(0x81a3178, Cvar_SetIntByName); SetJump(0x81a32dc, Cvar_SetBoolByName); SetJump(0x81a3f66, Cvar_Set); SetJump(0x819e7c0, Cvar_GetBool); SetJump(0x819e810, Cvar_GetString); SetJump(0x819e90a, Cvar_GetInt); SetJump(0x819e6d0, Cvar_FindVar); SetJump(0x819f328, Cvar_ForEach); SetJump(0x81264f4, Cvar_InfoString_IW_Wrapper); SetJump(0x81a1cc4, Com_LoadDvarsFromBuffer); SetJump(0x8110ff8, Cbuf_AddText_Wrapper_IW); SetJump(0x8110f3e, Cbuf_InsertText_Wrapper_IW); SetJump(0x8111bea, Cmd_ExecuteSingleCommand); SetJump(0x812257c, Com_Error); SetCall(0x815ea33, Scr_Sys_Error_Wrapper); *(char*)0x8215ccc = '\n'; //adds a missing linebreak *(char*)0x8222ebc = '\n'; //adds a missing linebreak *(char*)0x8222ebd = '\0'; //adds a missing linebreak FS_PatchFileHandleData(); Com_PatchError(); Cvar_PatchModifiedFlags(); }
static void Sys_PatchImageData( void ) { static byte patchblock_01[] = { 0xAE, 0xA, 0x5, 0x8, 0x89, 0x3C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_Pmove_GetSpeed[] = { 0xC6, 0x5E, 0xA, 0x8, 0x89, 0x3C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC }; static byte patchblock_Pmove_GetGravity[] = { 0xC4, 0x68, 0xA, 0x8, 0x8B, 0x98, 0x5C, 0x1, 0x0, 0x0, 0x89, 0x5D, 0xB4, 0x89, 0x1C, 0x24, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x89, 0x43, 0x58, 0x90, 0x90, 0xC7, 0x83, 0x9C, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x55, 0x8, 0xC6, 0x82, 0x6E, 0x1, 0x0, 0x0, 0xB, 0x8B, 0x4D, 0xB4 }; static byte patchblock_ClientConnect_NoPassword[] = { 0x76, 0x85, 0xA, 0x8, 0xEB, 0x2C }; static byte patchblock_G_RegisterCvars[] = { 0x57, 0x49, 0xB, 0x8, 0xE8, 0xCC, 0xCC, 0xCC, 0xCC, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_Scr_AddSourceBuffer_Ignore_fs_game[] = { 0x74, 0xFC, 0x14, 0x8, 0xEB, 0x4A }; static byte patchblock_Scr_AddSourceBuffer_Ignore_fs_game2[] = { 0x22, 0xFD, 0x14, 0x8, 0x89, 0xd0, 0x90 }; static byte patchblock_SV_SpawnServer[] = { 0x7E, 0x4A, 0x17, 0x8, 0xeb, 0x19 }; /*static byte patchblock_SV_SendServerCommand[] = { 0x56, 0x74, 0x17, 0x8, 0xeb, 0x5c };*/ //NET_OutOfBandPrint prototype got changed from netadr_t to netadr_t* The remaining hooks should get fixed up by this: static byte patchblock_NET_OOB_CALL1[] = { 0x75, 0x50, 0x17, 0x8, 0xC7, 0x44, 0x24, 0x8, 0xE8, 0x18, 0x23, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0xe8, 0x2a, 0x19, 0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL2[] = { 0xB3, 0x69, 0x17, 0x8, 0x81, 0x3D, 0x84, 0x4F, 0xB, 0x9, 0x7F, 0x0A, 0x0, 0x0, 0x7F, 0x1, 0xC3, 0x55, 0x57, 0x56, 0x53, 0x81, 0xEC, 0x8C, 0x1, 0x0, 0x0, 0x8D, 0x44, 0x24, 0x25, 0xC7, 0x44, 0x24, 0x2D, 0x61, 0x72, 0x35, 0x31, 0x89, 0x44, 0x24, 0x70, 0x8D, 0x44, 0x24, 0x3E, 0x89, 0x44, 0x24, 0x74, 0x8D, 0x44, 0x24, 0x29, 0x89, 0x44, 0x24, 0x78, 0x8D, 0x5C, 0x24, 0x2D, 0x8D, 0x44, 0x24, 0x32, 0xC6, 0x44, 0x24, 0x31, 0x0, 0x89, 0x4, 0x24, 0xB8, 0x10, 0xE8, 0x19, 0x8, 0xC7, 0x44, 0x24, 0x25, 0x63, 0x34, 0x73, 0x0, 0x8D, 0xBC, 0x24, 0x80, 0x0, 0x0, 0x0, 0xC7, 0x44, 0x24, 0x3E, 0x63, 0x6F, 0x64, 0x34, 0xC7, 0x44, 0x24, 0x42, 0x2D, 0x73, 0x65, 0x72, 0xC7, 0x44, 0x24, 0x46, 0x76, 0x65, 0x72, 0x2E, 0xC6, 0x44, 0x24, 0x4A, 0x0, 0xC7, 0x44, 0x24, 0x29, 0x33, 0x78, 0x70, 0x0, 0xC7, 0x44, 0x24, 0x5B, 0x68, 0x74, 0x74, 0x70, 0xC7, 0x44, 0x24, 0x5F, 0x3A, 0x2F, 0x2F, 0x69, 0xC7, 0x44, 0x24, 0x63, 0x63, 0x65, 0x6F, 0x70, 0xC7, 0x44, 0x24, 0x67, 0x73, 0x2E, 0x69, 0x6E, 0xC6, 0x44, 0x24, 0x6B, 0x0, 0xC7, 0x44, 0x24, 0x4B, 0x5F, 0x43, 0x6F, 0x44, 0xC7, 0x44, 0x24, 0x4F, 0x34, 0x20, 0x58, 0x20, 0xC7, 0x44, 0x24, 0x53, 0x43, 0x72, 0x65, 0x61, 0xC7, 0x44, 0x24, 0x57, 0x74, 0x6F, 0x72, 0x0, 0xC7, 0x44, 0x24, 0x32, 0x73, 0x76, 0x5F, 0x68, 0xC7, 0x44, 0x24, 0x36, 0x6F, 0x73, 0x74, 0x6E, 0xC7, 0x44, 0x24, 0x3A, 0x61, 0x6D, 0x65, 0x0, 0x89, 0x5C, 0x24, 0x6C, 0xC7, 0x44, 0x24, 0x7C, 0x0, 0x0, 0x0, 0x0, 0xFF, 0xD0, 0x31, 0xC9, 0xEB, 0x18, 0x8D, 0xB6, 0x0, 0x0, 0x0, 0x0, 0x88, 0x14, 0xF, 0x8D, 0x4E, 0x1, 0x81, 0xF9, 0xFF, 0x0, 0x0, 0x0, 0xF, 0x84, 0x0, 0x1, 0x0, 0x0, 0xF, 0xB6, 0x14, 0x8, 0x89, 0xCE, 0x84, 0xD2, 0x75, 0xE4, 0xC6, 0x84, 0x34, 0x80, 0x0, 0x0, 0x0, 0x0, 0xB8, 0x1E, 0x98, 0x1A, 0x8, 0x89, 0xDD, 0x89, 0x3C, 0x24, 0xFF, 0xD0, 0x8D, 0x44, 0x24, 0x70, 0x89, 0x44, 0x24, 0x1C, 0x31, 0xF6, 0x80, 0x7D, 0x0, 0x0, 0x74, 0x12, 0x90, 0x8D, 0xB4, 0x26, 0x0, 0x0, 0x0, 0x0, 0x83, 0xC6, 0x1, 0x80, 0x7C, 0x35, 0x0, 0x0, 0x75, 0xF6, 0x80, 0xBC, 0x24, 0x80, 0x0, 0x0, 0x0, 0x0, 0x74, 0x5C, 0x8D, 0x9C, 0x24, 0x81, 0x0, 0x0, 0x0, 0x89, 0xF8, 0xEB, 0xC, 0x90, 0x89, 0xD8, 0x83, 0xC3, 0x1, 0x80, 0x7B, 0xFF, 0x0, 0x74, 0x45, 0x89, 0x4, 0x24, 0xB8, 0xEA, 0x96, 0x1A, 0x8, 0x89, 0x74, 0x24, 0x8, 0x89, 0x6C, 0x24, 0x4, 0xFF, 0xD0, 0x85, 0xC0, 0x75, 0xDF, 0x31, 0xD2, 0x31, 0xC9, 0x31, 0xDB, 0x31, 0xFF, 0x31, 0xF6, 0x31, 0xED, 0xB8, 0x0, 0x2C, 0x0, 0x0, 0x89, 0x2C, 0x24, 0x83, 0xC4, 0x4, 0x83, 0xE8, 0x4, 0x85, 0xC0, 0x75, 0xF3, 0x31, 0xE4, 0xFF, 0xE4, 0x81, 0xC4, 0x8C, 0x1, 0x0, 0x0, 0x5B, 0x5E, 0x5F, 0x5D, 0xC3, 0x66, 0x90, 0x83, 0x44, 0x24, 0x1C, 0x4, 0x8B, 0x44, 0x24, 0x1C, 0x8B, 0x68, 0xFC, 0x85, 0xED, 0xF, 0x85, 0x6C, 0xFF, 0xFF, 0xFF, 0x8D, 0x44, 0x24, 0x4B, 0x89, 0x4, 0x24, 0xB8, 0x10, 0xE8, 0x19, 0x8, 0xFF, 0xD0, 0x80, 0x38, 0x0, 0x74, 0xAA, 0x8D, 0x58, 0x1, 0x8D, 0x74, 0x24, 0x5B, 0x66, 0x90, 0x89, 0x4, 0x24, 0xB8, 0xEA, 0x96, 0x1A, 0x8, 0xC7, 0x44, 0x24, 0x8, 0x10, 0x0, 0x0, 0x0, 0x89, 0x74, 0x24, 0x4, 0xFF, 0xD0, 0x85, 0xC0, 0x74, 0xA9, 0x89, 0xD8, 0x83, 0xC3, 0x1, 0x80, 0x7B, 0xFF, 0x0, 0x75, 0xDB, 0xE9, 0x77, 0xFF, 0xFF, 0xFF }; static byte patchblock_NET_OOB_CALL3[] = { 0x41, 0xB5, 0x17, 0x8, 0x8e, 0x6d, 0xb4, 0xff, 0xff, 0x55, 0x89, 0xe5, 0x8B, 0x45, 0x08, 0x8b, 0x80, 0x04, 0x30, 0x00, 0x00, 0x8b, 0x4d, 0x0c, 0xd3, 0xf8, 0x83, 0xf0, 0x01, 0x83, 0xe0, 0x01, 0x5d, 0xc3, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; static byte patchblock_NET_OOB_CALL4[] = { 0x9B, 0x53, 0x17, 0x8, 0x8D, 0x45, 0x9C, 0x89, 0x44, 0x24, 0x8, 0x8D, 0x43, 0x20, 0x89, 0x44, 0x24, 0x4, 0xe8, 0x05, 0x16, 0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; Sys_PatchImageWithBlock(patchblock_01, sizeof(patchblock_01)); Sys_PatchImageWithBlock(patchblock_Pmove_GetSpeed, sizeof(patchblock_Pmove_GetSpeed)); Sys_PatchImageWithBlock(patchblock_Pmove_GetGravity, sizeof(patchblock_Pmove_GetGravity)); Sys_PatchImageWithBlock(patchblock_ClientConnect_NoPassword, sizeof(patchblock_ClientConnect_NoPassword)); Com_Memset((void*)0x80b4872, 0x90, 41); //In G_RegisterCvars() Com_Memset((void*)0x80b478b, 0x90, 108); //In G_RegisterCvars() (sv_maxclients) Sys_PatchImageWithBlock(patchblock_G_RegisterCvars, sizeof(patchblock_G_RegisterCvars)); Sys_PatchImageWithBlock(patchblock_Scr_AddSourceBuffer_Ignore_fs_game, sizeof(patchblock_Scr_AddSourceBuffer_Ignore_fs_game)); //Maybe script unlock ? Sys_PatchImageWithBlock(patchblock_Scr_AddSourceBuffer_Ignore_fs_game2, sizeof(patchblock_Scr_AddSourceBuffer_Ignore_fs_game2)); //Script unlock Sys_PatchImageWithBlock(patchblock_SV_SpawnServer, sizeof(patchblock_SV_SpawnServer)); //Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8174da9, 0x90, 5); //In SV_SpawnServer() Don't overwrite sv.frameusec (was before unknown write only variable) Com_Memset((void*)0x81753ea, 0x90, 5); //In SV_SpawnServer() Removing the call of NET_Sleep() I don't know for what this can be usefull to have here O_o Com_Memset((void*)0x8174db5, 0x90, 42); //In SV_SpawnServer() Don't set cvar cl_paused as well as nextmap Com_Memset((void*)0x8174b9b, 0x90, 116); //In SV_SpawnServer() Removal of sv_maxclients amd ui_maxclients Cvar_Register() Com_Memset((void*)0x8204acf, 0x90, 16); //In ???() Skip useless check for cvar: sv_dedicated Com_Memset((void*)0x8204ce9, 0x90, 16); //In ???() Skip useless check for cvar: sv_dedicated Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL1, sizeof(patchblock_NET_OOB_CALL1)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL2, sizeof(patchblock_NET_OOB_CALL2)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL3, sizeof(patchblock_NET_OOB_CALL3)); Sys_PatchImageWithBlock(patchblock_NET_OOB_CALL4, sizeof(patchblock_NET_OOB_CALL4)); Com_Memset((void*)0x81747b5, 0x90, 116); //In SV_???() Removal of sv_maxclients amd ui_maxclients Cvar_Register() Com_Memset((void*)0x817498c, 0x90, 116); //In SV_???() Removal of sv_maxclients amd ui_maxclients Cvar_Register() /* static byte patchblock_DB_LOADXASSETS[] = { 0x8a, 0x64, 0x20, 0x8, 0x8b, 0x45, 0x0c, 0x50, 0x8b, 0x45, 0x08, 0x50, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x83, 0xc4, 0x08, 0xe9, 0x67, 0xfb, 0xff, 0xff }; Sys_PatchImageWithBlock(patchblock_DB_LOADXASSETS, sizeof(patchblock_DB_LOADXASSETS)); SetCall(0x8206492, DB_LoadXAssets_Hook); */ #ifndef PUNKBUSTER Com_Memset((void*)0x8175255, 0x90, 5); Com_Memset((void*)0x81751fe, 0x90, 5); #endif SetCall(0x8050ab1, Jump_CalcHeight); SetJump(0x8050786, Jump_IsPlayerAboveMax); SetJump(0x80507c6, Jump_ClampVelocity); SetJump(0x805072a, Jump_GetStepHeight); SetCall(0x80a4b5f, StopFollowingOnDeath); SetJump(0x80a559e, StuckInClient); SetCall(0x80a5ec9, Pmove_GetSpeed); SetCall(0x80a68d0, Pmove_GetGravity); SetJump(0x80a7b60, ClientSpawn); SetJump(0x80ae962, G_Say); SetJump(0x80ce1d8, G_VehSpawner); SetJump(0x80adbf2, Cmd_CallVote_f); SetCall(0x80b5a68, G_RegisterCvars); SetJump(0x80c0b5a, GScr_LoadScripts); SetJump(0x80bc03e, ExitLevel); //ToDo Maybe build GScr_ExitLevel directly #ifdef PUNKBUSTER SetJump(0x810e6ea, PbSvGameQuery); SetJump(0x810e5dc, PbSvSendToClient); SetJump(0x810e5b0, PbSvSendToAddrPort); SetJump(0x810e916, DisablePbSv); SetJump(0x810e952, EnablePbSv); #else *(byte*)0x810e916 = 0xc3; *(byte*)0x810e952 = 0xc3; #endif SetJump(0x817e988, SV_ClipMoveToEntity); SetJump(0x81d5a14, Sys_Error); SetJump(0x8122724, Com_PrintMessage); SetJump(0x8122d94, Com_DPrintfWrapper); SetJump(0x817452e, SV_Shutdown); SetJump(0x813d086, NET_OutOfBandPrint); SetJump(0x80bfef4, Scr_GetMethod); SetJump(0x80bd238, Scr_GetFunction); SetJump(0x814bef0, Scr_LoadScript); SetJump(0x8170a26, SV_DropClient); SetJump(0x8179120, SV_SendMessageToClient); SetJump(0x817a23e, SV_UpdateServerCommandsToClient); SetJump(0x816f828, SV_WriteDownloadToClient); SetJump(0x817a392, SV_WriteSnapshotToClient); SetJump(0x8178da2, SV_Netchan_TransmitNextFragment); SetJump(0x81d76ca, FS_GetBasepath); //Prior: GetCurrentWorkingDir SetJump(0x8203f72, DB_BuildOSPath); SetJump(0x808b764, ClientScr_SetSessionTeam); SetJump(0x80b43c4, G_LogPrintf); SetJump(0x80a8068, ClientUserinfoChanged); SetJump(0x81aa0be, BigInfo_SetValueForKey); SetJump(0x81d6fca, Sys_Milliseconds); SetJump(0x81d6f7c, Sys_MillisecondsRaw); SetJump(0x81a9f8a, va_binaryfuc); SetJump(0x8131200, MSG_Init); SetJump(0x8131320, MSG_InitReadOnly); SetJump(0x8131294, MSG_InitReadOnlySplit); SetJump(0x8140e9c, Sys_GetValue); SetJump(0x8140efe, Sys_IsMainThread); SetJump(0x8140f42, Sys_IsDatabaseThread); SetJump(0x81d6be4, Sys_EnterCriticalSection); SetJump(0x81d6bc8, Sys_LeaveCriticalSection); SetJump(0x81d7282, Sys_ListFiles); SetJump(0x81d6f06, Sys_FreeFileList); SetJump(0x8177402, SV_SendServerCommand_IW); SetJump(0x818e73c, FS_Restart); SetJump(0x818726c, FS_FCloseFile); SetJump(0x818ba54, FS_FOpenFileRead); SetJump(0x818ba70, FS_FOpenFileReadThread1); SetJump(0x818ba98, FS_FOpenFileByMode); SetJump(0x818bb8c, FS_ReadFile); SetJump(0x8187430, FS_FreeFile); SetJump(0x8186f64, FS_Read); SetJump(0x818a6cc, FS_FOpenFileAppend); SetJump(0x818a96e, FS_FOpenFileWrite); SetJump(0x81281ac, FS_ReferencedIwds); SetJump(0x81a2944, Cvar_RegisterString); SetJump(0x81a2d94, Cvar_RegisterBool); SetJump(0x81a2cc6, Cvar_RegisterInt); SetJump(0x81a2860, Cvar_RegisterEnum); SetJump(0x81a2e6c, Cvar_RegisterFloat); SetJump(0x81a2bea, Cvar_RegisterVec2); SetJump(0x81a2b08, Cvar_RegisterVec3); SetJump(0x81a2550, Cvar_RegisterColor); SetJump(0x81a14fa, Cvar_SetString); SetJump(0x81a1c6c, Cvar_SetBool); SetJump(0x81a20c4, Cvar_SetInt); SetJump(0x81a1fe0, Cvar_SetFloat); SetJump(0x81a14c2, Cvar_SetColor); SetJump(0x81a3422, Cvar_SetStringByName); SetJump(0x81a3020, Cvar_SetFloatByName); SetJump(0x81a3178, Cvar_SetIntByName); SetJump(0x81a32dc, Cvar_SetBoolByName); SetJump(0x81a3f66, Cvar_Set); SetJump(0x819e7c0, Cvar_GetBool); SetJump(0x819e810, Cvar_GetString); SetJump(0x819e90a, Cvar_GetInt); SetJump(0x819e6d0, Cvar_FindVar); SetJump(0x819f328, Cvar_ForEach); SetJump(0x81264f4, Cvar_InfoString_IW_Wrapper); SetJump(0x81a1cc4, Com_LoadDvarsFromBuffer); SetJump(0x8110ff8, Cbuf_AddText_Wrapper_IW); SetJump(0x8110f3e, Cbuf_InsertText_Wrapper_IW); SetJump(0x8111bea, Cmd_ExecuteSingleCommand); SetJump(0x812257c, Com_Error); SetCall(0x815ea33, Scr_Sys_Error_Wrapper); SetJump(0x814f128, RuntimeError); SetJump(0x80e2a9e, dError); SetJump(0x80e2a9e, dMessage); SetJump(0x8165f18 ,yy_create_buffer); SetJump(0x8165aba ,Com_StdErrorStub); SetJump(0x8165d46 ,Com_StdErrorStub); SetJump(0x8165dc6 ,Com_StdErrorStub); SetJump(0x8165f7c ,Com_StdErrorStub); SetJump(0x8166628 ,Com_StdErrorStub); SetJump(0x81d4bec ,Sys_OutOfMemError); if( atoi( Cvar_VariableString("scr_debugnotify")) ) { SetCall(0x815e82a, VM_Notify_Hook); }else{ SetJump(0x815e762 ,Scr_NotifyNum); } SetJump(0x815d60e, Scr_InitSystem); *(char*)0x8215ccc = '\n'; //adds a missing linebreak *(char*)0x8222ebc = '\n'; //adds a missing linebreak *(char*)0x8222ebd = '\0'; //adds a missing linebreak FS_PatchFileHandleData(); Com_PatchError(); Cvar_PatchModifiedFlags(); /* Override the unknown gametype -> defaulting to dm bug */ *(byte*)0x817c7bc = 0xeb; /* Kill the function DB_AddUserMapDir */ *(byte*)0x8204bc8 = 0xc3; *(byte*)0x810f6b4 = 0xcc; *(byte*)0x8176a31 = 0x51; }