From c0801016837384b7a3e171dee8dc98d9b09672cc Mon Sep 17 00:00:00 2001 From: _ <🐱> Date: Tue, 3 Nov 2020 01:35:26 -0700 Subject: [PATCH] Add support for versions 28 and 29; rename v30 hook to v28 --- SpotifyKeyDumper/Hooks.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/SpotifyKeyDumper/Hooks.cpp b/SpotifyKeyDumper/Hooks.cpp index 7eec87f..5f1d254 100644 --- a/SpotifyKeyDumper/Hooks.cpp +++ b/SpotifyKeyDumper/Hooks.cpp @@ -5,8 +5,8 @@ typedef int(__cdecl* keyToLE_v25)(unsigned int* dest, int* key, int bits); keyToLE_v25 keyToLEFunc_v25_hook = nullptr; -typedef int(__cdecl* keyToLE_v30)(unsigned int* dest, int* key, int bits, bool isEncoded); -keyToLE_v30 keyToLEFunc_v30_hook = nullptr; +typedef int(__cdecl* keyToLE_v28)(unsigned int* dest, int* key, int bits, bool isEncoded); +keyToLE_v28 keyToLEFunc_v28_hook = nullptr; std::string prevKeyStr = std::string(); @@ -29,7 +29,7 @@ int __cdecl keyToLE_hook_v25(unsigned int* dest, int* key, int bits) return keyToLEFunc_v25_hook(dest, key, bits); } -int __cdecl keyToLE_hook_v30(unsigned int* dest, int* key, int bits, bool isEncoded) +int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEncoded) { //std::cout << "TEST" << std::endl; @@ -82,7 +82,7 @@ int __cdecl keyToLE_hook_v30(unsigned int* dest, int* key, int bits, bool isEnco prevKeyStr = newKeyStr; } - return keyToLEFunc_v30_hook(dest, key, bits, isEncoded); + return keyToLEFunc_v28_hook(dest, key, bits, isEncoded); } char* GetAddrV26() @@ -102,7 +102,7 @@ char* GetAddrV27() BYTE ref_v7 = 0x55; BYTE* byteAtAddrStr = (BYTE*)0x01068F90; - // Byte at byteAtAddr in 1.1.26-19 is 0x55 + // Byte at byteAtAddr in 1.1.27-7 is 0x55 if (*byteAtAddrStr == ref_v7) return (char*)0x01068F90; else @@ -130,20 +130,20 @@ void Hooks::Init() // Two 1.1.27 versions keyToLEFunc_v25_hook = (keyToLE_v25)Utils::TrampHook32(GetAddrV27(), (char*)keyToLE_hook_v25, 6); break; - /*case 28: - //keyToLEFunc_v25_hook = (keyToLE_v25)Utils::TrampHook32((char*)0x0106B920, (char*)keyToLE_hook_v25, 6); + case 28: + keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x01074650, (char*)keyToLE_hook_v28, 6); break; case 29: - //keyToLEFunc_v25_hook = (keyToLE_v25)Utils::TrampHook32((char*)0x0106B920, (char*)keyToLE_hook_v25, 6); - break;*/ + keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010861B0, (char*)keyToLE_hook_v28, 6); + break; case 30: - keyToLEFunc_v30_hook = (keyToLE_v30)Utils::TrampHook32((char*)0x0108E840, (char*)keyToLE_hook_v30, 6); + keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x0108E840, (char*)keyToLE_hook_v28, 6); break; case 44: - keyToLEFunc_v30_hook = (keyToLE_v30)Utils::TrampHook32((char*)0x010CABC0, (char*)keyToLE_hook_v30, 6); + keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010CABC0, (char*)keyToLE_hook_v28, 6); break; case 45: - keyToLEFunc_v30_hook = (keyToLE_v30)Utils::TrampHook32((char*)0x010CF780, (char*)keyToLE_hook_v30, 6); + keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010CF780, (char*)keyToLE_hook_v28, 6); break; } } \ No newline at end of file