diff --git a/PolygonClientUtilities/RobloxMFCHooks.cpp b/PolygonClientUtilities/RobloxMFCHooks.cpp index e2ae5a2..1d79a43 100644 --- a/PolygonClientUtilities/RobloxMFCHooks.cpp +++ b/PolygonClientUtilities/RobloxMFCHooks.cpp @@ -39,11 +39,11 @@ CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam = (CRobl BOOL __fastcall Http__trustCheck_hook(const char* url) { - if (strlen(url) == 7) + if (strlen(url) == 7 && !Util::isASCII(url)) { // so the client does this really fucking stupid thing where if it opens an ie window, // it passes a char**, and not a char* - // no idea if thats a detours quirk or if thats how its just actually handled + // no idea if thats a detours quirk (i doubt it) or if thats how its just actually handled // practically no url is ever going to be seven characters long so it doesn't really matter url = *(char**)url; diff --git a/PolygonClientUtilities/Util.cpp b/PolygonClientUtilities/Util.cpp index fd38915..15bdba3 100644 --- a/PolygonClientUtilities/Util.cpp +++ b/PolygonClientUtilities/Util.cpp @@ -53,4 +53,12 @@ std::map Util::parseArgs(std::string args) } return map; +} + +// https://stackoverflow.com/questions/48212992/how-to-find-out-if-there-is-any-non-ascii-character-in-a-string-with-a-file-path +bool Util::isASCII(const std::string& s) +{ + return !std::any_of(s.begin(), s.end(), [](char c) { + return static_cast(c) > 127; + }); } \ No newline at end of file diff --git a/PolygonClientUtilities/Util.h b/PolygonClientUtilities/Util.h index 6db06c3..6211ecb 100644 --- a/PolygonClientUtilities/Util.h +++ b/PolygonClientUtilities/Util.h @@ -10,4 +10,5 @@ public: static const std::vector allowedEmbeddedSchemes; static std::vector split(std::string s, std::string delimiter); static std::map parseArgs(std::string args); + static bool isASCII(const std::string& s); }; \ No newline at end of file diff --git a/PolygonClientUtilities/pch.h b/PolygonClientUtilities/pch.h index e3540a6..d270fa4 100644 --- a/PolygonClientUtilities/pch.h +++ b/PolygonClientUtilities/pch.h @@ -8,4 +8,5 @@ #include #include #include +#include #include \ No newline at end of file