Browse Source

Add support for versions 28 and 29; rename v30 hook to v28

main
_ 1 year ago
parent
commit
c080101683
  1. 24
      SpotifyKeyDumper/Hooks.cpp

24
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;
}
}
Loading…
Cancel
Save