Skip to content

Commit

Permalink
1.1.71.560.gc21c3367
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpond committed Oct 29, 2021
1 parent 6694a62 commit 8db7392
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<h4 align="center">A multi-purpose adblocker and skip-bypass for the <strong>Windows</strong> Spotify desktop application.</h4>
<h5 align="center">Please support Spotify by purchasing premium</h5>
<p align="center">
<strong>Last updated:</strong> 2 October 2021<br>
<strong>Last tested version:</strong> 1.1.70.610.g4585142b
<strong>Last updated:</strong> 29 October 2021<br>
<strong>Last tested version:</strong> 1.1.71.560.gc21c3367
</p>
</center>

Expand Down
109 changes: 93 additions & 16 deletions src/BlockTheSpot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,82 @@

#include "stdafx.h"

bool AddDllToBlacklist (const wchar_t* dll_name) { return true; }
void __stdcall LoadAPI (LPVOID* destination, LPCSTR apiName)
{
if (*destination)
return;

char path[MAX_PATH];
//wchar_t windows[MAX_PATH];
//GetSystemDirectoryW(windows, MAX_PATH);
//wsprintf(path, L"%s\\netutils.dll", windows);
wsprintf (path, ".\\chrome_elf.dll.bak");
HMODULE hModule = GetModuleHandle (path);
if (!hModule && !(hModule = LoadLibrary (path)))
return;
*destination = GetProcAddress (hModule, apiName);
}

#define API_EXPORT_ORIG(N) \
static LPVOID _##N = NULL; \
char S_##N[] = "" # N; \
extern "C" __declspec(dllexport) __declspec(naked) void N ## () \
{ \
__asm pushad \
__asm push offset S_##N \
__asm push offset _##N \
__asm call LoadAPI \
__asm popad \
__asm jmp [_##N] \
} \


API_EXPORT_ORIG (ClearReportsBetween_ExportThunk)
API_EXPORT_ORIG (CrashForException_ExportThunk)
API_EXPORT_ORIG (DisableHook)
API_EXPORT_ORIG (DrainLog)
API_EXPORT_ORIG (DumpHungProcessWithPtype_ExportThunk)
API_EXPORT_ORIG (DumpProcessWithoutCrash)
API_EXPORT_ORIG (GetApplyHookResult)
API_EXPORT_ORIG (GetBlockedModulesCount)
API_EXPORT_ORIG (GetCrashReports_ExportThunk)
API_EXPORT_ORIG (GetCrashpadDatabasePath_ExportThunk)
API_EXPORT_ORIG (GetHandleVerifier)
API_EXPORT_ORIG (GetInstallDetailsPayload)
API_EXPORT_ORIG (GetUniqueBlockedModulesCount)
API_EXPORT_ORIG (GetUserDataDirectoryThunk)
API_EXPORT_ORIG (InjectDumpForHungInput_ExportThunk)
API_EXPORT_ORIG (IsBrowserProcess)
API_EXPORT_ORIG (IsCrashReportingEnabledImpl)
API_EXPORT_ORIG (IsThirdPartyInitialized)
API_EXPORT_ORIG (RegisterLogNotification)
API_EXPORT_ORIG (RequestSingleCrashUpload_ExportThunk)
API_EXPORT_ORIG (SetCrashKeyValueImpl)
API_EXPORT_ORIG (SetMetricsClientId)
API_EXPORT_ORIG (SetUploadConsent_ExportThunk)
API_EXPORT_ORIG (SignalChromeElf)
API_EXPORT_ORIG (SignalInitializeCrashReporting)

#define API_COPY(M, N) \
_##N = GetProcAddress(M, #N);


/*
//bool AddDllToBlacklist (const wchar_t* dll_name) { return true; }
void ClearReportsBetween_ExportThunk (time_t begin, time_t end) {}
int CrashForException_ExportThunk (EXCEPTION_POINTERS* info) {
return EXCEPTION_CONTINUE_SEARCH;
return UnhandledExceptionFilter (info);
}
void DisableHook () {}
UINT32 DrainLog (UINT8* buffer,
UINT32 buffer_size,
UINT32* log_remaining) {
uint32_t DrainLog (uint8_t* buffer,
uint32_t buffer_size,
uint32_t* log_remaining) {
return 0;
return 0;
}
bool DumpHungProcessWithPtype_ExportThunk (HANDLE process_handle,
Expand All @@ -25,8 +88,9 @@ bool DumpHungProcessWithPtype_ExportThunk (HANDLE process_handle,
void DumpProcessWithoutCrash (void* task_port) {}
INT32 GetApplyHookResult () { return 0; }
UINT32 GetBlockedModulesCount () { return 0; }
int32_t GetApplyHookResult () { return 0; }
uint32_t GetBlockedModulesCount () { return 0; }
size_t GetCrashReports_ExportThunk (void* reports,
size_t reports_size) {
Expand All @@ -36,36 +100,49 @@ size_t GetCrashReports_ExportThunk (void* reports,
const wchar_t* GetCrashpadDatabasePath_ExportThunk () {
return nullptr;
}
void* GetHandleVerifier () {
void* GetHandleVerifier () { return NULL; };
const void* GetInstallDetailsPayload () {
return nullptr;
}
UINT32 GetInstallDetailsPayload () { return 0; }
UINT32 GetUniqueBlockedModulesCount () { return 0; }
uint32_t GetUniqueBlockedModulesCount () {
return 0;
}
bool GetUserDataDirectoryThunk (wchar_t* user_data_dir,
size_t user_data_dir_length,
wchar_t* invalid_user_data_dir,
size_t invalid_user_data_dir_length) {
return true;
}
HANDLE InjectDumpForHungInput_ExportThunk (HANDLE process) {
return nullptr;
}
bool IsBlacklistInitialized () {
return false;
bool IsBrowserProcess () {
return true;
}
bool IsCrashReportingEnabledImpl () {
bool IsCrashReportingEnabledImpl (const void* local_state) {
return false;
}
bool IsThirdPartyInitialized () {
return false;
}
bool RegisterLogNotification (HANDLE event_handle) {
return false;
}
void RequestSingleCrashUpload_ExportThunk (const char* local_id) {}
void SetCrashKeyValueImpl () {}
void SetCrashKeyValueImpl (const char*, const char*) {}
void SetMetricsClientId (const char* client_id) {}
void SetUploadConsent_ExportThunk (bool consent) {}
void SignalChromeElf () {}
void SignalInitializeCrashReporting () {}
void SuccessfullyBlocked (const wchar_t** blocked_dlls, int* size) {}
//void SuccessfullyBlocked (const wchar_t** blocked_dlls, int* size) {}
*/
1 change: 0 additions & 1 deletion src/BlockTheSpot.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
</ItemGroup>
<ItemGroup>
<None Include="..\README.md" />
<None Include="chrome_elf.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
Expand Down
1 change: 0 additions & 1 deletion src/BlockTheSpot.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<ClInclude Include="Logger.h" />
</ItemGroup>
<ItemGroup>
<None Include="chrome_elf.def" />
<None Include="..\README.md" />
</ItemGroup>
</Project>
6 changes: 2 additions & 4 deletions src/chrome_elf.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
LIBRARY "chrome_elf"

EXPORTS
AddDllToBlacklist
ClearReportsBetween_ExportThunk
CrashForException_ExportThunk
DisableHook
Expand All @@ -17,7 +16,7 @@ GetInstallDetailsPayload
GetUniqueBlockedModulesCount
GetUserDataDirectoryThunk
InjectDumpForHungInput_ExportThunk
IsBlacklistInitialized
IsBrowserProcess
IsCrashReportingEnabledImpl
IsThirdPartyInitialized
RegisterLogNotification
Expand All @@ -26,5 +25,4 @@ SetCrashKeyValueImpl
SetMetricsClientId
SetUploadConsent_ExportThunk
SignalChromeElf
SignalInitializeCrashReporting
SuccessfullyBlocked
SignalInitializeCrashReporting

0 comments on commit 8db7392

Please sign in to comment.