Followup to fix: check if it's actually a pointer by checking if it's ASCII
This commit is contained in:
parent
3d68312d63
commit
53be4250a4
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -53,4 +53,12 @@ std::map<std::string, std::string> 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<unsigned char>(c) > 127;
|
||||
});
|
||||
}
|
||||
|
|
@ -10,4 +10,5 @@ public:
|
|||
static const std::vector<std::string> allowedEmbeddedSchemes;
|
||||
static std::vector<std::string> split(std::string s, std::string delimiter);
|
||||
static std::map<std::string, std::string> parseArgs(std::string args);
|
||||
static bool isASCII(const std::string& s);
|
||||
};
|
||||
|
|
@ -8,4 +8,5 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
Loading…
Reference in New Issue