Skip to content

Commit 93dcfee

Browse files
iostreamiostream
authored andcommitted
vs2019 - 16.9.2, Update dns checking. including some readme.md
1 parent fe0edab commit 93dcfee

File tree

6 files changed

+33
-44
lines changed

6 files changed

+33
-44
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,21 @@ assignees: ''
77

88
---
99

10-
**Important**
11-
- Make sure you use [latest spotify](https://www.spotify.com) before reporting a bug.
12-
- Make sure you use the [latest blockthespot](https://www.github.com/mrpond/BlockTheSpot/releases) before reporting a bug.
13-
- Make sure if blockthespot DLL got replaced after Spotify update (important).
14-
1510

1611
**Describe the bug**
1712
A clear and concise description of what the bug is.
1813

19-
**Desktop:**
14+
**Important:**
2015
<!--(please complete the following information)-->
2116
- OS: [e.g. Windows 10]
22-
- Spotify Version: [e.g. 1.1.47.684.g136419d9]
23-
- BlockTheSpot Product Version: [e.g. 0.51.0.0] <!--[right click chrome_elf.dll -> Details -> Product Version]-->
17+
- Confirm that you currently using latest version of
18+
1. [latest spotify](https://www.spotify.com)
19+
2. [latest blockthespot](https://www.github.com/mrpond/BlockTheSpot/releases) from github.
20+
3. Blockthespot are not working with Spotify from Microsoft Store or alpha version of Spotify.
2421

2522
**Additional context**
2623
Add any other context about the problem here.
2724
If ad blocking is not working, please include a debug log by
2825
1. edit config.ini and set Log = 1
2926
2. after ads song play close Spotify
30-
3. zip the main_log.txt, utility_log.txt
27+
3. zip the blockthespot_log.txt

JUNTA.jpg

-545 KB
Binary file not shown.

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
[![Build status](https://ci.appveyor.com/api/projects/status/31l6ynm0a1fhr2vs/branch/master?svg=true)](https://ci.appveyor.com/project/mrpond/blockthespot/branch/master) [![Discord](https://discord.com/api/guilds/807273906872123412/widget.png)](https://discord.gg/p43cusgUPm)
22

33
<center>
4-
<h3 align="center"><a href="https://en.wikipedia.org/wiki/2020_Thai_protests">Support the 2020 Thai protests</a></h3>
5-
<h3 align="center">#WhatsHappeningInThailand</h3>
6-
<h3 align="center"><a href="https://twitter.com/search?q=%23ม็อบ13กุมภา">#ม็อบ13กุมภา</a></h3>
4+
<h3 align="center"><a href="https://en.wikipedia.org/wiki/2020_Thai_protests">Support the 2020 Thailand & 2021 Myanmar protests</a></h3>
75
<h3 align="center">Help me stop the dictatorship in Thailand and Myanmar!</h3>
8-
<h3 align="center">#CivilDisobedienceMovement</h3>
9-
<h3 align="center">#JusticeForMyanmar</h3>
10-
<h3 align="center">#Save_Myanmar</h3>
11-
<h3 align="center">Today 13 February 2021 police attack pro-democracy demonstrator in Thailand!</h3>
126
<h3 align="center">Southeast Asia strong together!</h3>
137
</center>
148

@@ -17,7 +11,7 @@
1711
<h4 align="center">A multi-purpose adblocker and skip-bypass for the <strong>Windows</strong> Spotify desktop application.</h4>
1812
<h5 align="center">Please support Spotify by purchasing premium</h5>
1913
<p align="center">
20-
<strong>Last updated:</strong> 10 December 2020<br>
14+
<strong>Last updated:</strong> 24 March 2020<br>
2115
<strong>Last tested version:</strong> 1.1.55.498.gf9a83c60
2216
</p>
2317
</center>

src/Logger.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,31 @@ class Logger {
99
public:
1010
Logger (Config* config) {
1111

12-
m_isEnable = config->getConfig ("Log");
13-
if (m_isEnable) {
12+
m_active = config->getConfig ("Log");
13+
if (m_active) {
1414
m_log.open ("blockthespot_log.txt", std::ios::out | std::ios::app);
1515
m_log << "BlockTheSpot - Build date: " << __TIMESTAMP__ << std::endl;
1616
}
1717
}
1818

1919
~Logger () {
20-
if (m_isEnable) {
20+
if (m_active) {
2121
m_log.flush ();
2222
m_log.close ();
2323
}
2424
}
2525

26+
bool is_active () {
27+
return m_active;
28+
}
29+
2630
void Log (std::string_view log) {
27-
if (m_isEnable)
31+
if (m_active)
2832
m_log << log << std::endl;
2933
}
3034

3135
private:
32-
bool m_isEnable = false;
36+
bool m_active = false;
3337
std::ofstream m_log;
3438

3539
};

src/Modify.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,11 @@ DWORD WINAPI KillBanner (LPVOID conf)
5151
VirtualProtect ((char*)skipPod + 6, 1, PAGE_EXECUTE_READWRITE, &oldProtect);
5252
memset ((char*)skipPod + 6, 0xE9, 1);
5353
VirtualProtect ((char*)skipPod + 6, 1, oldProtect, &oldProtect);
54-
logger->Log ("main process - #1patch success!");
54+
logger->Log ("main process - patch success!");
5555
}
5656
else {
57-
logger->Log ("main process - #1patch failed!");
57+
logger->Log ("main process - patch failed!");
5858
}
59-
60-
skipPod = FindPattern ((uint8_t*)hModule, mInfo.SizeOfImage, (BYTE*)"\x00\x61\x64\x70\x6F\x64\x00", "xxxxxxx");
61-
if (skipPod)
62-
{
63-
DWORD oldProtect;
64-
VirtualProtect ((char*)skipPod + 5, 1, PAGE_EXECUTE_READWRITE, &oldProtect);
65-
memset ((char*)skipPod + 5, 0x90, 1);
66-
VirtualProtect ((char*)skipPod + 5, 1, oldProtect, &oldProtect);
67-
68-
logger->Log ("main process - #2patch success!");
69-
}
70-
else {
71-
logger->Log ("main process - #2patch failed!");
72-
}
73-
7459
}
7560
else {
7661
logger->Log ("GetModuleInformation failed!");

src/hosts.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77

88
_getaddrinfo getaddrinfo_orig;
99

10-
const std::vector<std::string_view> blockList = { "google", "doubleclick", "qualaroo.com", "fbsbx.com", "adeventtracker" };
11-
1210
// check if ads hostname
1311
bool is_blockhost (std::string_view nodename, Config* config) {
14-
15-
1612
static bool wpad = config->getConfig ("Skip_wpad");
13+
static const std::vector<std::string_view> blockList = { "google", "doubleclick", "qualaroo.com", "fbsbx.com", /*"cloudflare"*/ };
14+
1715
if (0 == nodename.compare ("wpad"))
1816
return wpad ? true : false;
19-
for (auto i : blockList) {
17+
for (auto &i : blockList) {
2018
if (std::string_view::npos != nodename.find (i))
2119
return true;
2220
}
@@ -31,6 +29,8 @@ int WSAAPI getaddrinfo_hook (
3129
{
3230
static auto* config = new Config ();
3331
static auto* logger = new Logger (config);
32+
static const std::vector<std::string_view> dnscheck = { "dns.google", "cloudflare" };
33+
3434
if (nodename == nullptr)
3535
return getaddrinfo_orig (nodename, servname, hints, res);
3636

@@ -50,6 +50,15 @@ int WSAAPI getaddrinfo_hook (
5050
logger->Log ("allowed - " + nnodename);
5151
}
5252
}
53+
if (true == logger->is_active() &&
54+
true == config->getConfig ("Skip_wpad"))
55+
{
56+
for (auto& i : dnscheck) {
57+
if (std::string_view::npos != nnodename.find (i))
58+
logger->Log ("custom dns currently in use - " + nnodename +
59+
" turn on Skip_wpad in config.ini or switch to adguard dns");
60+
}
61+
}
5362
return result;
5463
}
5564

0 commit comments

Comments
 (0)