diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-09-15 00:20:56 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-09-15 00:20:56 +0100 |
commit | ba26be9bea801f219fa6340178fd6b13f02d574e (patch) | |
tree | f50e67e06f7174daca0c97cf95659c7cbcef8151 /NorthstarDLL/exploitfixes_utf8parser.cpp | |
parent | d2907aa522d56a4baacec1c17426f7d6f1fae3a2 (diff) | |
download | NorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.tar.gz NorthstarLauncher-ba26be9bea801f219fa6340178fd6b13f02d574e.zip |
clang format, fix issues with server registration and rpak loading
Diffstat (limited to 'NorthstarDLL/exploitfixes_utf8parser.cpp')
-rw-r--r-- | NorthstarDLL/exploitfixes_utf8parser.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/NorthstarDLL/exploitfixes_utf8parser.cpp b/NorthstarDLL/exploitfixes_utf8parser.cpp index 581596a7..e2510765 100644 --- a/NorthstarDLL/exploitfixes_utf8parser.cpp +++ b/NorthstarDLL/exploitfixes_utf8parser.cpp @@ -169,20 +169,24 @@ LABEL_48: return true; } -// prevent utf8 parser from crashing when provided bad data, which can be sent through user-controlled openinvites +// prevent utf8 parser from crashing when provided bad data, which can be sent through user-controlled openinvites +// clang-format off AUTOHOOK(Rson_ParseUTF8, engine.dll + 0xEF670, bool, __fastcall, (INT64* a1, DWORD* a2, char* strData)) // 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 20 8B 1A +// clang-format on { static void* targetRetAddr = CModule("engine.dll").FindPattern("84 C0 75 2C 49 8B 16"); // only call if we're parsing utf8 data from the network (i.e. communities), otherwise we get perf issues - if ( + void* pReturnAddress = #ifdef _MSC_VER _ReturnAddress() #else __builtin_return_address(0) #endif - == targetRetAddr && !CheckUTF8Valid(a1, a2, strData)) + ; + + if (pReturnAddress == targetRetAddr && !CheckUTF8Valid(a1, a2, strData)) return false; return Rson_ParseUTF8(a1, a2, strData); |