Fix potential crashes from bad pointers (typically after ads)
This commit is contained in:
parent
70f6695b72
commit
44a7190b7a
@ -200,6 +200,10 @@ int* __fastcall log_hook_v45(void* This, void* _EDX, int a2, int a3, void* a4, c
|
|||||||
|
|
||||||
void __fastcall fileIdWriter_hook_v45(void* This, void* _EDX, int* a2)
|
void __fastcall fileIdWriter_hook_v45(void* This, void* _EDX, int* a2)
|
||||||
{
|
{
|
||||||
|
// Program sometimes crashes after ads. Could possibly be due to bad pointers
|
||||||
|
if (Utils::BadPtr(a2) || Utils::BadPtr(a2 + 16) || Utils::BadPtr((char*)*(DWORD*)(a2 + 16)))
|
||||||
|
return;
|
||||||
|
|
||||||
// [[ebp+8]+28]
|
// [[ebp+8]+28]
|
||||||
char* fileId = (char*) *(DWORD*)(a2 + 16); // 0x40 / 4 = 16
|
char* fileId = (char*) *(DWORD*)(a2 + 16); // 0x40 / 4 = 16
|
||||||
::fileId = std::string(fileId);
|
::fileId = std::string(fileId);
|
||||||
|
Loading…
Reference in New Issue
Block a user