Update 0.1.1 to support Spotify 1.1.46
This commit is contained in:
parent
e4151c42ef
commit
270debbdd0
@ -20,6 +20,7 @@ This project uses C++14 on Visual Studio 2019
|
|||||||
* 1.1.30
|
* 1.1.30
|
||||||
* 1.1.44
|
* 1.1.44
|
||||||
* 1.1.45
|
* 1.1.45
|
||||||
|
* 1.1.46
|
||||||
|
|
||||||
If you want a specific version, DM me.
|
If you want a specific version, DM me.
|
||||||
|
|
||||||
|
@ -2,11 +2,19 @@
|
|||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "Hooks.h"
|
#include "Hooks.h"
|
||||||
|
|
||||||
typedef int(__cdecl* keyToLE_v25)(unsigned int* dest, int* key, int bits);
|
typedef int (__cdecl* keyToLE_v25)(unsigned int* dest, int* key, int bits);
|
||||||
keyToLE_v25 keyToLEFunc_v25_hook = nullptr;
|
keyToLE_v25 keyToLE_v25_hook = nullptr;
|
||||||
|
|
||||||
typedef int(__cdecl* keyToLE_v28)(unsigned int* dest, int* key, int bits, bool isEncoded);
|
typedef int (__cdecl* keyToLE_v28)(unsigned int* dest, int* key, int bits, bool isEncoded);
|
||||||
keyToLE_v28 keyToLEFunc_v28_hook = nullptr;
|
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();
|
std::string prevKeyStr = std::string();
|
||||||
|
|
||||||
@ -26,13 +34,11 @@ int __cdecl keyToLE_hook_v25(unsigned int* dest, int* key, int bits)
|
|||||||
prevKeyStr = newKeyStr;
|
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)
|
int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEncoded)
|
||||||
{
|
{
|
||||||
//std::cout << "TEST" << std::endl;
|
|
||||||
|
|
||||||
if (bits == 128)
|
if (bits == 128)
|
||||||
{
|
{
|
||||||
void* decodedKeyPtr = key;
|
void* decodedKeyPtr = key;
|
||||||
@ -62,7 +68,8 @@ int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEnco
|
|||||||
keyDecoded[index & 3] +
|
keyDecoded[index & 3] +
|
||||||
(((((uVar1 + index + keyPtr & uVar1 * 16 + uVar3) * 2 + uVar1 * -17) -
|
(((((uVar1 + index + keyPtr & uVar1 * 16 + uVar3) * 2 + uVar1 * -17) -
|
||||||
index) - uVar3) - keyPtr);
|
index) - uVar3) - keyPtr);
|
||||||
index = index - 1;
|
|
||||||
|
index--;
|
||||||
}
|
}
|
||||||
while (index >= 0);
|
while (index >= 0);
|
||||||
|
|
||||||
@ -82,10 +89,33 @@ int __cdecl keyToLE_hook_v28(unsigned int* dest, int* key, int bits, bool isEnco
|
|||||||
prevKeyStr = newKeyStr;
|
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 ref_v19 = 0x55;
|
||||||
BYTE* byteAtAddrStr = (BYTE*)0x010800C0;
|
BYTE* byteAtAddrStr = (BYTE*)0x010800C0;
|
||||||
@ -97,7 +127,7 @@ char* GetAddrV26()
|
|||||||
return (char*)0x0107FEC0;
|
return (char*)0x0107FEC0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* GetAddrV27()
|
char* GetKeyFuncAddrV27()
|
||||||
{
|
{
|
||||||
BYTE ref_v7 = 0x55;
|
BYTE ref_v7 = 0x55;
|
||||||
BYTE* byteAtAddrStr = (BYTE*)0x01068F90;
|
BYTE* byteAtAddrStr = (BYTE*)0x01068F90;
|
||||||
@ -109,7 +139,6 @@ char* GetAddrV27()
|
|||||||
return (char*)0x01068F20;
|
return (char*)0x01068F20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Hooks::Init()
|
void Hooks::Init()
|
||||||
{
|
{
|
||||||
int spotifyVer = Utils::GetSpotifyVersion();
|
int spotifyVer = Utils::GetSpotifyVersion();
|
||||||
@ -120,30 +149,35 @@ void Hooks::Init()
|
|||||||
switch (spotifyVer)
|
switch (spotifyVer)
|
||||||
{
|
{
|
||||||
case 25:
|
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;
|
break;
|
||||||
case 26:
|
case 26:
|
||||||
// Two 1.1.26 versions
|
// 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;
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
// Two 1.1.27 versions
|
// 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;
|
break;
|
||||||
case 28:
|
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;
|
break;
|
||||||
case 29:
|
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;
|
break;
|
||||||
case 30:
|
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;
|
break;
|
||||||
case 44:
|
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;
|
break;
|
||||||
case 45:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "Hooks.h"
|
#include "Hooks.h"
|
||||||
|
|
||||||
static const char* VERSION = "0.1";
|
static const char* VERSION = "0.1.1";
|
||||||
|
|
||||||
DWORD WINAPI InitMain(LPVOID lpParam)
|
DWORD WINAPI InitMain(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user