diff --git a/README.md b/README.md index d55aa73..0d527df 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ This project uses C++14 on Visual Studio 2019 * 1.1.30 * 1.1.44 * 1.1.45 +* 1.1.46 If you want a specific version, DM me. diff --git a/SpotifyKeyDumper/Hooks.cpp b/SpotifyKeyDumper/Hooks.cpp index 5f1d254..3fa9c07 100644 --- a/SpotifyKeyDumper/Hooks.cpp +++ b/SpotifyKeyDumper/Hooks.cpp @@ -2,11 +2,19 @@ #include "Utils.h" #include "Hooks.h" -typedef int(__cdecl* keyToLE_v25)(unsigned int* dest, int* key, int bits); -keyToLE_v25 keyToLEFunc_v25_hook = nullptr; +typedef int (__cdecl* keyToLE_v25)(unsigned int* dest, int* key, int bits); +keyToLE_v25 keyToLE_v25_hook = nullptr; -typedef int(__cdecl* keyToLE_v28)(unsigned int* dest, int* key, int bits, bool isEncoded); -keyToLE_v28 keyToLEFunc_v28_hook = nullptr; +typedef int (__cdecl* keyToLE_v28)(unsigned int* dest, int* key, int bits, bool isEncoded); +keyToLE_v28 keyToLE_v28_hook = nullptr; + +typedef int (__thiscall* authTokenHook_v45)(void* This, char* authToken, int a3, int a4, int a5, size_t tokenLength, + int a7, int a8, int a9, __int64 bearerStr, int a11, int a12, int a13, int a14, char a15, int a16, int int_40, + int a18, char a19, int a20); +authTokenHook_v45 authToken_v45_hook = nullptr; + +typedef char* (__cdecl* getFileId_v45)(char* dest, char* src, size_t srcLength); +getFileId_v45 getFileId_v45_hook = nullptr; std::string prevKeyStr = std::string(); @@ -26,13 +34,11 @@ int __cdecl keyToLE_hook_v25(unsigned int* dest, int* key, int bits) prevKeyStr = newKeyStr; } - return keyToLEFunc_v25_hook(dest, key, bits); + return keyToLE_v25_hook(dest, key, bits); } int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEncoded) { - //std::cout << "TEST" << std::endl; - if (bits == 128) { void* decodedKeyPtr = key; @@ -62,7 +68,8 @@ int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEnco keyDecoded[index & 3] + (((((uVar1 + index + keyPtr & uVar1 * 16 + uVar3) * 2 + uVar1 * -17) - index) - uVar3) - keyPtr); - index = index - 1; + + index--; } while (index >= 0); @@ -82,10 +89,33 @@ int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEnco prevKeyStr = newKeyStr; } - return keyToLEFunc_v28_hook(dest, key, bits, isEncoded); + return keyToLE_v28_hook(dest, key, bits, isEncoded); } -char* GetAddrV26() +int __fastcall authTokenHook_hook_v45(void* This, void* _EDX, char* authToken, int a3, int a4, int a5, + size_t tokenLength, int a7, int a8, int a9, __int64 bearerStr, int a11, int a12, int a13, int a14, char a15, + int a16, int int_40, int a18, char a19, int a20) +{ + if (tokenLength == 311) + { + std::cout << "Auth token: " << authToken << std::endl << std::endl; + } + + return authToken_v45_hook(This, authToken, a3, a4, a5, tokenLength, a7, a8, a9, bearerStr, a11, a12, a13, a14, 15, + a16, int_40, a18, a19, a20); +} + +char* __cdecl hexToStr_hook_v45(char* dest, char* src, size_t srcLength) +{ + if (srcLength == 20) + { + // Assume it is file id + } + + return getFileId_v45_hook(dest, src, srcLength); +} + +char* GetKeyFuncAddrV26() { BYTE ref_v19 = 0x55; BYTE* byteAtAddrStr = (BYTE*)0x010800C0; @@ -97,7 +127,7 @@ char* GetAddrV26() return (char*)0x0107FEC0; } -char* GetAddrV27() +char* GetKeyFuncAddrV27() { BYTE ref_v7 = 0x55; BYTE* byteAtAddrStr = (BYTE*)0x01068F90; @@ -109,7 +139,6 @@ char* GetAddrV27() return (char*)0x01068F20; } - void Hooks::Init() { int spotifyVer = Utils::GetSpotifyVersion(); @@ -120,30 +149,35 @@ void Hooks::Init() switch (spotifyVer) { case 25: - keyToLEFunc_v25_hook = (keyToLE_v25)Utils::TrampHook32((char*)0x0106B920, (char*)keyToLE_hook_v25, 6); + keyToLE_v25_hook = (keyToLE_v25)Utils::TrampHook32((char*)0x0106B920, (char*)keyToLE_hook_v25, 6); break; case 26: // Two 1.1.26 versions - keyToLEFunc_v25_hook = (keyToLE_v25)Utils::TrampHook32(GetAddrV26(), (char*)keyToLE_hook_v25, 6); + keyToLE_v25_hook = (keyToLE_v25)Utils::TrampHook32(GetKeyFuncAddrV26(), (char*)keyToLE_hook_v25, 6); break; case 27: // Two 1.1.27 versions - keyToLEFunc_v25_hook = (keyToLE_v25)Utils::TrampHook32(GetAddrV27(), (char*)keyToLE_hook_v25, 6); + keyToLE_v25_hook = (keyToLE_v25)Utils::TrampHook32(GetKeyFuncAddrV27(), (char*)keyToLE_hook_v25, 6); break; case 28: - keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x01074650, (char*)keyToLE_hook_v28, 6); + keyToLE_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x01074650, (char*)keyToLE_hook_v28, 6); break; case 29: - keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010861B0, (char*)keyToLE_hook_v28, 6); + keyToLE_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010861B0, (char*)keyToLE_hook_v28, 6); break; case 30: - keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x0108E840, (char*)keyToLE_hook_v28, 6); + keyToLE_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x0108E840, (char*)keyToLE_hook_v28, 6); break; case 44: - keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010CABC0, (char*)keyToLE_hook_v28, 6); + keyToLE_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010CABC0, (char*)keyToLE_hook_v28, 6); break; case 45: - keyToLEFunc_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010CF780, (char*)keyToLE_hook_v28, 6); + keyToLE_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010CF780, (char*)keyToLE_hook_v28, 6); + //authToken_v45_hook = (authTokenHook_v45)Utils::TrampHook32((char*)0x00EBA4F0, (char*)authTokenHook_hook_v45, 5); + //authToken_v45_hook = (authTokenHook_v45)Utils::TrampHook32((char*)0x00EBA4F0, (char*)authTokenHook_hook_v45, 5); + break; + case 46: + keyToLE_v28_hook = (keyToLE_v28)Utils::TrampHook32((char*)0x010C2FB0, (char*)keyToLE_hook_v28, 6); break; } } \ No newline at end of file diff --git a/SpotifyKeyDumper/SpotifyKeyDumper.cpp b/SpotifyKeyDumper/SpotifyKeyDumper.cpp index 20f9d6d..efdabd2 100644 --- a/SpotifyKeyDumper/SpotifyKeyDumper.cpp +++ b/SpotifyKeyDumper/SpotifyKeyDumper.cpp @@ -1,7 +1,7 @@ #include "pch.h" #include "Hooks.h" -static const char* VERSION = "0.1"; +static const char* VERSION = "0.1.1"; DWORD WINAPI InitMain(LPVOID lpParam) {