r5sdk/r5dev/opcptc.cpp
Amos 850bbc19ef Code refactor + improvents
* Move all utilities to single implementation file
* Remove unnecessary code in .cpp and .h
* Patch opcodes in runtime instead of patching raw PE file
* Move launch parameters to cfg folder instead
* Move back to pattern scan instead of hardcoded offsets
* Change langauge to new ISO C++17 standard
2021-06-08 10:54:49 -07:00

28 lines
1.3 KiB
C++

#include "windows.h"
#include "opcptc.h"
/*-----------------------------------------------------------------------------
* opcptc.cpp
*-----------------------------------------------------------------------------*/
void InstallOpcodes()
{
HANDLE GameProcess = GetCurrentProcess();
// JNZ --> JMP | Prevent OriginSDK from initializing on the client
//WriteProcessMemory(GetCurrentProcess(), LPVOID(dst000 + 0x0B), "\xE9\x63\x02\x00\x00\x00", 6, NULL);
// JE --> NOP | Allow execution of map commands even if the OriginSDK is not running
WriteProcessMemory(GameProcess, LPVOID(dst001 + 0x2B), "\x90\x90\x90\x90\x90\x90", 6, NULL);
WriteProcessMemory(GameProcess, LPVOID(dst001 + 0x39), "\x90\x90\x90\x90\x90\x90", 6, NULL);
WriteProcessMemory(GameProcess, LPVOID(dst001 + 0x46), "\x90\x90\x90\x90\x90\x90", 6, NULL);
// JL --> NOP | Enable clientcommand callbacks without persistent player data
WriteProcessMemory(GameProcess, LPVOID(dst002 + 0x76), "\x90\x90", 2, NULL);
// JA --> JMP | Disable client-side verification for duplicate accounts on the server
WriteProcessMemory(GameProcess, LPVOID(dst003 + 0x269), "\xEB\x39", 2, NULL);
// JA --> JMP | Prevent FairFight anti-cheat from initializing on the server
WriteProcessMemory(GameProcess, LPVOID(dst004 + 0x72), "\xE9\xE4\x00\x00\x00\x00", 6, NULL);
}