Skip to content

Commit

Permalink
Fixed issues with hptocss, sponsorship and premium_free signatures. (#…
Browse files Browse the repository at this point in the history
…539)

* Fixed issues with hptocss, sponsorship and premium_free signatures. and some edits to the code.

* added 'type' function
  • Loading branch information
Yolilad authored Jun 11, 2024
1 parent be4740f commit b1a59a0
Show file tree
Hide file tree
Showing 13 changed files with 393 additions and 315 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<h4 align="center">A multi-purpose adblocker and skip-bypass for the <strong>Spotify for Windows (64 bit)</strong> </h4>
<h5 align="center">Please support Spotify by purchasing premium</h5>
<p align="center">
<strong>Last updated:</strong> 29 March 2024<br>
<strong>Last tested version:</strong> Spotify for Windows (64 bit) 1.2.33.1039.g8ddb5918
<strong>Last updated:</strong> 24 May 2024<br>
<strong>Last tested version:</strong> Spotify for Windows (64 bit) 1.2.38.720.ga4a70a0e
</p>
</center>

Expand Down
180 changes: 90 additions & 90 deletions blockthespot_settings.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
{
"Cef Offsets": {
"x64": {
"cef_request_t_get_url": 48,
"cef_zip_reader_t_get_file_name": 72,
"cef_zip_reader_t_read_file": 112
},
"x32": {
"cef_request_t_get_url": 24,
"cef_zip_reader_t_get_file_name": 36,
"cef_zip_reader_t_read_file": 56
"Latest Release Date": "2024-05-24",
"Block List": [
"/ads/",
"/ad-logic/",
"/gabo-receiver-service/"
],
"Zip Reader": {
"home-hpto.css": {
"hptocss": {
"Signature": ".utUDWsORU96S7boXm2Aq{display:-webkit-box;display:-ms-flexbox;display:flex;",
"Value": "none",
"Offset": 70,
"Fill": 0,
"Address": -1
}
},
"Developer": {
"x64": {
"Signature": "80 E3 01 48 8B 95 ?? ?? ?? ?? 48 83 FA 10",
"Value": "B3 01 90",
"Offset": 0,
"Address": 0
},
"xpui.js": {
"adsEnabled": {
"Signature": "adsEnabled:!0",
"Value": "1",
"Offset": 12,
"Fill": 0,
"Address": -1
},
"x32": {
"Signature": "25 01 FF FF FF 89 ?? ?? ?? FF FF",
"Value": "B8 03 00",
"Offset": 0,
"Address": 0
}
},
"Zip Reader": {
"home-hpto.css": {
"hptocss": {
"Signature": ".WiPggcPDzbwGxoxwLWFf{display:-webkit-box;display:-ms-flexbox;display:flex;",
"Value": ".WiPggcPDzbwGxoxwLWFf{display:-webkit-box;display:-ms-flexbox;display:none;",
"Offset": 0,
"Fill": 0,
"Address": 0
}
"ishptohidden": {
"Signature": "isHptoHidden:!0",
"Value": "1",
"Offset": 14,
"Fill": 0,
"Address": -1
},
"xpui.js": {
"adsEnabled": {
"Signature": "adsEnabled:!0",
"Value": "1",
"Offset": 12,
"Fill": 0,
"Address": 0
},
"ishptohidden": {
"Signature": "isHptoHidden:!0",
"Value": "1",
"Offset": 14,
"Fill": 0,
"Address": 0
},
"sponsorship": {
"Signature": ".set(\"allSponsorships\",t.sponsorships)}}(e,t);",
"Value": "\"",
"Offset": 5,
"Fill": 15,
"Address": 0
},
"skipsentry": {
"Signature": "sentry.io",
"Value": "localhost",
"Offset": 0,
"Fill": 0,
"Address": 0
},
"hptoEnabled": {
"Signature": "hptoEnabled:!0",
"Value": "1",
"Offset": 13,
"Fill": 0,
"Address": 0
},
"sp_localhost": {
"Signature": "sp://ads/v1/ads/",
"Value": "sp://localhost//",
"Offset": 0,
"Fill": 0,
"Address": 0
},
"premium_free": {
"Signature": "e.session?.productState?.catalogue?.toLowerCase()",
"Value": "\"\"",
"Offset": -1,
"Fill": 48,
"Address": 0
}
"sponsorship": {
"Signature": ".set(\"allSponsorships\",t.sponsorships)})}(e,t);",
"Value": "\"",
"Offset": 5,
"Fill": 15,
"Address": -1
},
"skipsentry": {
"Signature": "sentry.io",
"Value": "localhost",
"Offset": 0,
"Fill": 0,
"Address": -1
},
"hptoEnabled": {
"Signature": "hptoEnabled:!0",
"Value": "1",
"Offset": 13,
"Fill": 0,
"Address": -1
},
"sp_localhost": {
"Signature": "sp://ads/v1/ads/",
"Value": "sp://localhost//",
"Offset": 0,
"Fill": 0,
"Address": -1
},
"premium_free": {
"Signature": "\"free\"===(null===(t=e.session)",
"Value": "\"\"",
"Offset": 0,
"Fill": 4,
"Address": -1
}
}
},
"Block List": [
"/ads/",
"/ad-logic/",
"/gabo-receiver-service/"
],
"Latest Release Date": ""
}
"Developer": {
"x64": {
"Signature": "80 E3 01 48 8B 95 ?? ?? ?? ?? 48 83 FA 10",
"Value": "B3 01 90",
"Offset": 0,
"Address": -1
},
"x32": {
"Signature": "25 01 FF FF FF 89 ?? ?? ?? FF FF",
"Value": "B8 03 00",
"Offset": 0,
"Address": -1
}
},
"Cef Offsets": {
"x64": {
"cef_request_t_get_url": 48,
"cef_zip_reader_t_get_file_name": 72,
"cef_zip_reader_t_read_file": 112
},
"x32": {
"cef_request_t_get_url": 24,
"cef_zip_reader_t_get_file_name": 36,
"cef_zip_reader_t_read_file": 56
}
}
}
94 changes: 60 additions & 34 deletions src/BasicUtils/Json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ bool Json::is_integer() const
return std::holds_alternative<int>(m_value);
}

bool Json::is_float() const
{
return std::holds_alternative<float>(m_value);
}

bool Json::is_double() const
{
return std::holds_alternative<double>(m_value);
Expand Down Expand Up @@ -157,64 +152,55 @@ bool Json::is_array() const

int Json::get_integer() const
{
if (std::holds_alternative<int>(m_value)) {
if (is_integer()) {
return std::get<int>(m_value);
}
Log(L"JSON value is not an integer", LogLevel::Error);
LogError(L"JSON value is not an integer");
return 0;
}

float Json::get_float() const
{
if (std::holds_alternative<float>(m_value)) {
return std::get<float>(m_value);
}
Log(L"JSON value is not an float", LogLevel::Error);
return 0.0f;
}

double Json::get_double() const
{
if (std::holds_alternative<double>(m_value)) {
if (is_double()) {
return std::get<double>(m_value);
}
Log(L"JSON value is not a double", LogLevel::Error);
LogError(L"JSON value is not a double");
return 0.0;
}

bool Json::get_boolean() const
{
if (std::holds_alternative<bool>(m_value)) {
if (is_boolean()) {
return std::get<bool>(m_value);
}
Log(L"JSON value is not a boolean", LogLevel::Error);
LogError(L"JSON value is not a boolean");
return false;
}

std::wstring Json::get_string() const
{
if (std::holds_alternative<std::wstring>(m_value)) {
if (is_string()) {
return std::get<std::wstring>(m_value);
}
Log(L"JSON value is not a string", LogLevel::Error);
LogError(L"JSON value is not a string");
return L"";
}

Json::Object Json::get_object() const
{
if (std::holds_alternative<Object>(m_value)) {
if (is_object()) {
return std::get<Object>(m_value);
}
Log(L"JSON value is not an object", LogLevel::Error);
LogError(L"JSON value is not an object");
return Object();
}

Json::Array Json::get_array() const
{
if (std::holds_alternative<Array>(m_value)) {
if (is_array()) {
return std::get<Array>(m_value);
}
Log(L"JSON value is not an array", LogLevel::Error);
LogError(L"JSON value is not an array");
return Array();
}

Expand Down Expand Up @@ -253,39 +239,64 @@ const Json& Json::at(std::size_t index) const

void Json::clear()
{
if (std::holds_alternative<Object>(m_value)) {
if (is_object()) {
std::get<Object>(m_value).clear();
}
else if (std::holds_alternative<Array>(m_value)) {
else if (is_array()) {
std::get<Array>(m_value).clear();
}
}

bool Json::empty() const
{
if (std::holds_alternative<Object>(m_value)) {
if (is_object()) {
return std::get<Object>(m_value).empty();
}
else if (std::holds_alternative<Array>(m_value)) {
else if (is_array()) {
return std::get<Array>(m_value).empty();
}
else if (std::holds_alternative<nullptr_t>(m_value)) {
else if (is_null()) {
return true;
}
return false;
}

std::size_t Json::size() const
{
if (std::holds_alternative<Object>(m_value)) {
if (is_object()) {
return std::get<Object>(m_value).size();
}
else if (std::holds_alternative<Array>(m_value)) {
else if (is_array()) {
return std::get<Array>(m_value).size();
}
return 0;
}

Json::ValueType Json::type() const
{
if (is_object()) {
return ValueType::Object;
}
else if (is_array()) {
return ValueType::Array;
}
else if (is_string()) {
return ValueType::String;
}
else if (is_boolean()) {
return ValueType::Boolean;
}
else if (is_integer()) {
return ValueType::Integer;
}
else if (is_double()) {
return ValueType::Double;
}
else {
return ValueType::Null;
}
}

bool Json::contains(const std::wstring& key) const
{
if (is_object()) {
Expand All @@ -295,6 +306,21 @@ bool Json::contains(const std::wstring& key) const
return false;
}

size_t Json::count(const std::wstring& key) const {
if (is_object()) {
const auto& object = std::get<Object>(m_value);
return object.count(key);
}
return 0;
}

void Json::erase(const std::wstring& key) {
if (is_object()) {
auto& object = std::get<Object>(m_value);
object.erase(key);
}
}

std::wstring Json::dump(int indent) const
{
std::wostringstream os;
Expand Down Expand Up @@ -381,7 +407,7 @@ Json Json::parse(std::wistream& is)
}
}
catch (const std::exception& e) {
Log(Utils::FormatString(L"{}", e.what()), LogLevel::Error);
LogError(L"{}", e.what());
return Json();
}
}
Expand Down
Loading

0 comments on commit b1a59a0

Please sign in to comment.