Skip to content

Commit

Permalink
added additional ad removal
Browse files Browse the repository at this point in the history
  • Loading branch information
W1lliam1337 committed Jul 29, 2022
1 parent 2e9df39 commit fdd1c77
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions DigitalSpotify/DigitalSpotify.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand Down Expand Up @@ -102,6 +102,7 @@
<EnableUAC>false</EnableUAC>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -122,6 +123,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down
8 changes: 8 additions & 0 deletions DigitalSpotify/hooks/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ void hooks::instance()

static const auto create_track_target = static_cast<void*>(utils::find_sig(ctx::modules::m_spotify_image, "68 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 89 8D ? ? ? ? 8B 45 18"));
static const auto playback_track_target = static_cast<void*>(utils::find_sig(ctx::modules::m_spotify_image, "6A 70 B8 ? ? ? ? E8 ? ? ? ? 8B D9 8B 45 14"));
static const auto unk_target = static_cast<void*>(reinterpret_cast<uint8_t*>(0x6A8BF9));

HOOK(create_track_target, create_track, og::m_create_track);
HOOK(unk_target, unk_sub, og::m_unk_sub);
//HOOK(playback_track_target, playback_track, og::m_playback_track);
}

int __cdecl hooks::unk_sub(int a1, int arg4)
{
// @note: removes extra ads (advertiser, title, duration, ad_type, test_ad, non_explicit, skippable, line_item_id etc)
return 0;
}

void __fastcall hooks::create_track(void* ecx, void* edx, ctx::structs::player_meta_t* a2,
ctx::structs::player_track_meta_t* a3,
double a4,
Expand Down
3 changes: 2 additions & 1 deletion DigitalSpotify/hooks/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@

namespace hooks
{

inline std::vector<LPVOID> m_targets{};
void unhook(LPVOID target);
void __fastcall create_track(void* ecx, void* edx, ctx::structs::player_meta_t* a2, ctx::structs::player_track_meta_t* a3, double a4, int a5, int a6, int a7, int a8, int a9);
void __fastcall playback_track(void* ecx, void* edx, void* a2, double a3, int a4, int a5, int a6, int a7);
void disable_all_hooks();
void instance();
int __cdecl unk_sub(int a1, int arg4);

namespace og
{
inline decltype(&create_track) m_create_track;
inline decltype(&playback_track) m_playback_track;
inline decltype(&unk_sub) m_unk_sub;
}
};
3 changes: 2 additions & 1 deletion DigitalSpotify/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#include <array>
#include <string>
#include <iostream>
#include <MinHook.h>
#include <cstdio>
#include <intrin.h>
#include <MinHook.h>
#pragma comment( lib, "MinHook.lib" )

namespace ctx
{
Expand Down

0 comments on commit fdd1c77

Please sign in to comment.