diff --git a/README.md b/README.md
index 85b1a6a..505a0cc 100644
--- a/README.md
+++ b/README.md
@@ -3,8 +3,8 @@
A multi-purpose adblocker and skip bypass for the Windows Spotify Desktop Application.
Please support Spotify by purchasing premium
- Current Version: 0.49
- Last updated: 3 March 2020
+ Current Version: 0.50
+ Last updated: 5 March 2020
Last tested version: 1.1.27.472.gf6574b97
Important Notice(s)
diff --git a/chrome_elf.zip b/chrome_elf.zip
index 020490e..b48cb2b 100644
Binary files a/chrome_elf.zip and b/chrome_elf.zip differ
diff --git a/src/Resource.rc b/src/Resource.rc
index fbef867..a095ad2 100644
--- a/src/Resource.rc
+++ b/src/Resource.rc
@@ -79,7 +79,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
- PRODUCTVERSION 0,49,0,0
+ PRODUCTVERSION 0,50,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -100,7 +100,7 @@ BEGIN
VALUE "LegalCopyright", "Copyright (C) 2019"
VALUE "OriginalFilename", "BlockTheSpot.dll"
VALUE "ProductName", "BlockTheSpot"
- VALUE "ProductVersion", "0.49.0.0"
+ VALUE "ProductVersion", "0.50.0.0"
END
END
BLOCK "VarFileInfo"
diff --git a/src/hosts.cpp b/src/hosts.cpp
index ac0b114..e60b5c7 100644
--- a/src/hosts.cpp
+++ b/src/hosts.cpp
@@ -9,10 +9,10 @@ std::wofstream Log;
bool is_blockhost (const char* nodename) {
std::string nnodename (nodename);
-
- if (0 == nnodename.compare("wpad"))
+
+ if (0 == nnodename.compare ("wpad"))
return g_Skip_wpad ? true : false;
-
+
if (std::string::npos != nnodename.find ("google"))
return true;
if (std::string::npos != nnodename.find ("doubleclick"))
@@ -36,27 +36,31 @@ int WINAPI getaddrinfohook (DWORD RetAddr,
hints,
res);
- if (0 == result && isblock.get ()) {
+ if (0 == result && isblock.get ()) {
for (auto ptr = *res; nullptr != ptr; ptr = ptr->ai_next) {
auto ipv4 = (struct sockaddr_in*)ptr->ai_addr;
//memset (&ipv4->sin_addr.S_un.S_addr, 0x0, sizeof ULONG);
ipv4->sin_addr.S_un.S_addr = INADDR_ANY;
}
if (Log.is_open ())
- Log << "blocked - getaddrinfo " << nodename << '\n';
+ Log << "blocked - " << nodename << std::endl;
}
return result;
}
// block http request base on URI
-bool is_blockrequest (LPCWSTR pwszObjectName) {
- std::wstring npwszObjectName (pwszObjectName);
- if (std::wstring::npos != npwszObjectName.compare (L"/ad-logic/"))
- return true;
- if (std::wstring::npos != npwszObjectName.compare (L"/ads/"))
- return true;
-
+bool is_blockrequest (const std::wstring& npwszVerb,const std::wstring& npwszObjectName) {
+ if (0 == npwszVerb.compare (L"POST")) {
+ if (0 == npwszObjectName.compare (L"/ad-logic/state/config")) {
+ return true;
+ }
+ }
+ if (0 == npwszVerb.compare (L"GET")) {
+ if (0 == npwszObjectName.compare (0, 5, L"/ads/", 5)) {
+ return true;
+ }
+ }
return false;
}
@@ -71,11 +75,21 @@ int WINAPI winhttpopenrequesthook (DWORD RetAddr,
LPCWSTR* ppwszAcceptTypes,
DWORD dwFlags)
{
- if (is_blockrequest (pwszObjectName)) {
- if (Log.is_open ())
- Log << "blocked - WinHttpOpenRequest " << pwszVerb << " " << pwszObjectName << '\n';
+ std::wstring npwszVerb (pwszVerb);
+ std::wstring npwszObjectName (pwszObjectName);
+
+ if (is_blockrequest (npwszVerb, npwszObjectName)) {
+ if (Log.is_open ()) {
+ auto pos = npwszObjectName.find_first_of (L"="); // check if had ?payload=
+ if (pos != std::string::npos) {
+ npwszObjectName.erase (pos + 1); // trim original base64 payload out
+ npwszObjectName.append (L"c2VjcmV0"); // append "secret"
+ }
+ Log << "blocked - " << npwszVerb << " " << npwszObjectName << std::endl;
+ }
return 0;
}
+
return fnwinhttpopenrequest (hConnect,
pwszVerb,
pwszObjectName,