Skip to content

Commit 1e421d7

Browse files
committed
Patch CEG exception generated on init
1 parent df13090 commit 1e421d7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

components/game_mod/CEG.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ void Patch_CEG()
4949
Detours::X86::DetourFunction((PBYTE)0x8EF04F, (PBYTE)&hk_inline_memcpy);
5050
Detours::X86::DetourFunction((PBYTE)0x8EF168, (PBYTE)&hk_inline_memcpy2);
5151

52+
Detours::X86::DetourFunction((PBYTE)0x8EE640, (PBYTE)&sub_8EE640);
53+
5254
FixupFunction(0x0060CC10, 0x004F20F0);// CEGObfuscate<LiveStats_Init> => LiveStats_Init
5355
FixupFunction(0x00580460, 0x0079E6D0);// CEGObfuscate<Con_Restricted_SetLists> => Con_Restricted_SetLists
5456
}
@@ -119,6 +121,15 @@ void __declspec(naked) hk_inline_memcpy2()
119121
}
120122
}
121123

124+
void *sub_8EE640(void *Nullptr1, void *Nullptr2)
125+
{
126+
if (Nullptr1 != nullptr || Nullptr2 != nullptr)
127+
__debugbreak();
128+
129+
*(void **)0xBA1C24 = Nullptr2;
130+
return (void *)0xBA1C24;
131+
}
132+
122133
void __fastcall sub_5CBF00(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize)
123134
{
124135
DWORD dwNew = GetNewAddress(address);

components/game_mod/CEG.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ void hk_inline_memcpy();
66
void hk_inline_memcpy2();
77
void *hk_memcpy(void *dest, const void *src, size_t size);
88

9+
void *sub_8EE640(void *Nullptr1, void *Nullptr2);
10+
911
void __fastcall sub_5CBF00(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize);
1012
void __fastcall sub_661450(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize);
1113
void __fastcall sub_4E9880(void *thisptr, PVOID _EDX, DWORD address, size_t scanSize);

0 commit comments

Comments
 (0)