Skip to content

Commit

Permalink
Patch CEG exception generated on init
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukem9 committed Sep 24, 2016
1 parent df13090 commit 1e421d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/game_mod/CEG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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> => LiveStats_Init
FixupFunction(0x00580460, 0x0079E6D0);// CEGObfuscate<Con_Restricted_SetLists> => Con_Restricted_SetLists
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions components/game_mod/CEG.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e421d7

Please sign in to comment.