diff --git a/SpotifyKeyDumper/Hooks.cpp b/SpotifyKeyDumper/Hooks.cpp index c156e72..3531a62 100644 --- a/SpotifyKeyDumper/Hooks.cpp +++ b/SpotifyKeyDumper/Hooks.cpp @@ -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) { + // 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] char* fileId = (char*) *(DWORD*)(a2 + 16); // 0x40 / 4 = 16 ::fileId = std::string(fileId);