From df13090d2e3feeca9f0bd7bb266546d657c38058 Mon Sep 17 00:00:00 2001 From: Nukem Date: Sat, 24 Sep 2016 00:01:57 -0400 Subject: [PATCH 1/2] r_noborder fix for R_ResizeWindow --- components/game_mod/dvar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/game_mod/dvar.cpp b/components/game_mod/dvar.cpp index 6a140087..e4adee38 100644 --- a/components/game_mod/dvar.cpp +++ b/components/game_mod/dvar.cpp @@ -37,7 +37,8 @@ void R_RegisterCustomDvars() if (r_noborder->current.enabled) style = WS_VISIBLE | WS_POPUP; - PatchMemory(0x006B7A74, (PBYTE)&style, sizeof(DWORD)); + PatchMemory(0x006B7A74, (PBYTE)&style, sizeof(DWORD));// R_CreateWindow + PatchMemory(0x006B7EC1, (PBYTE)&style, sizeof(DWORD));// R_ResizeWindow } void* rtn_R_RegisterDvars = (void*)0x006CA283; From 1e421d7d5619c92318aaac7bb7e9154f04b52a53 Mon Sep 17 00:00:00 2001 From: Nukem Date: Sat, 24 Sep 2016 01:04:30 -0400 Subject: [PATCH 2/2] Patch CEG exception generated on init --- components/game_mod/CEG.cpp | 11 +++++++++++ components/game_mod/CEG.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/components/game_mod/CEG.cpp b/components/game_mod/CEG.cpp index bc4efd23..7578b8fd 100644 --- a/components/game_mod/CEG.cpp +++ b/components/game_mod/CEG.cpp @@ -49,6 +49,8 @@ void Patch_CEG() Detours::X86::DetourFunction((PBYTE)0x8EF04F, (PBYTE)&hk_inline_memcpy); Detours::X86::DetourFunction((PBYTE)0x8EF168, (PBYTE)&hk_inline_memcpy2); + Detours::X86::DetourFunction((PBYTE)0x8EE640, (PBYTE)&sub_8EE640); + FixupFunction(0x0060CC10, 0x004F20F0);// CEGObfuscate => LiveStats_Init FixupFunction(0x00580460, 0x0079E6D0);// CEGObfuscate => Con_Restricted_SetLists } @@ -119,6 +121,15 @@ void __declspec(naked) hk_inline_memcpy2() } } +void *sub_8EE640(void *Nullptr1, void *Nullptr2) +{ + if (Nullptr1 != nullptr || Nullptr2 != nullptr) + __debugbreak(); + + *(void **)0xBA1C24 = Nullptr2; + return (void *)0xBA1C24; +} + void __fastcall sub_5CBF00(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize) { DWORD dwNew = GetNewAddress(address); diff --git a/components/game_mod/CEG.h b/components/game_mod/CEG.h index c561743a..fb1cdb12 100644 --- a/components/game_mod/CEG.h +++ b/components/game_mod/CEG.h @@ -6,6 +6,8 @@ void hk_inline_memcpy(); void hk_inline_memcpy2(); void *hk_memcpy(void *dest, const void *src, size_t size); +void *sub_8EE640(void *Nullptr1, void *Nullptr2); + void __fastcall sub_5CBF00(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize); void __fastcall sub_661450(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize); void __fastcall sub_4E9880(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize);