Skip to content

Commit bfeb846

Browse files
author
mrpond
committed
improvement
1 parent d5ef387 commit bfeb846

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

src/Modify.cpp

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ static _cef_urlrequest_create cef_urlrequest_create_orig;
2828
static _cef_string_userfree_utf16_free cef_string_userfree_utf16_free_orig;
2929

3030
static constexpr auto block_list = { L"/ads/", L"/ad-logic/", L"/gabo-receiver-service/" };
31+
static constexpr auto localhost_str = "localhost";
32+
//static constexpr auto premium_str = "\"premium\" }";
33+
static constexpr auto premium_free_str = "\"premium\"===e.session?.productState?.catalogue?.toLowerCase(),s=e=>null!==e.session?.productState&&1===parseInt(e.session.productState.ads,10),r=e=>\"free\"===e.session?.productState?.catalogue?.toLowerCase(),";
3134
//static constexpr char search_str[] = {0x61,0x70,0x70,0x2D,0x64,0x65,0x76,0x65,0x6C,0x6F,0x70,0x65,0x72,0x09,0x01,0x30,0x78};
3235

3336
static bool xpui_found = false;
@@ -144,12 +147,36 @@ DWORD WINAPI KillAds(LPVOID)
144147

145148
void WINAPI modify_buffer()
146149
{
147-
const auto skipPod = FindPattern((uint8_t*)buff_addr, buff_size, (BYTE*)"{height:122px}}#", "xxxxxxxxxxxxxxxx");
148-
if (skipPod)
150+
const auto skipads = FindPattern((uint8_t*)buff_addr, buff_size, (BYTE*)"adsEnabled:!0", "xxxxxxxxxxxxx");
151+
if (skipads)
149152
{
150-
memset((char*)skipPod + 8, 0x30, 3); // 122 to 000
151-
xpui_found = true;
153+
memset((char*)skipads + 12, 0x31, 1); // 122 to 000
154+
g_Logger.Log(L"adsEnabled patched!");
152155
}
156+
const auto skipsentry = FindPattern((uint8_t*)buff_addr, buff_size, (BYTE*)"sentry.io", "xxxxxxxxx");
157+
if (skipsentry)
158+
{
159+
for (size_t i = 0; i < strnlen_s(localhost_str, 15); i++) {
160+
memset((char*)skipsentry + i, localhost_str[i], 1);
161+
}
162+
g_Logger.Log(L"sentry.io -> localhost patched!");
163+
}
164+
const auto ishptohidden = FindPattern((uint8_t*)buff_addr, buff_size, (BYTE*)"isHptoHidden:!0", "xxxxxxxxxxxxxxx");
165+
if (ishptohidden)
166+
{
167+
memset((char*)ishptohidden + 14, 0x31, 1); // 122 to 000
168+
g_Logger.Log(L"isHptoHidden patched!");
169+
}
170+
const auto premium_free = FindPattern((uint8_t*)buff_addr, buff_size, (BYTE*)"\"free\"===e.session?.productState?.catalogue?.toLowerCase(),s=e=>null!==e.session?.productState&&1===parseInt(e.session.productState.ads,10),r=e=>\"premium\"===e.session?.productState?.catalogue?.toLowerCase(),",
171+
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
172+
if (premium_free)
173+
{
174+
for (size_t i = 0; i < strnlen_s(premium_free_str, 210); i++) {
175+
memset((char*)premium_free + i, premium_free_str[i], 1);
176+
}
177+
g_Logger.Log(L"premium patched!");
178+
}
179+
xpui_found = true;
153180
}
154181

155182
__declspec(naked) void hook_zip_buffer()

0 commit comments

Comments
 (0)