diff options
Diffstat (limited to 'NorthstarDLL/exploitfixes_utf8parser.cpp')
-rw-r--r-- | NorthstarDLL/exploitfixes_utf8parser.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/NorthstarDLL/exploitfixes_utf8parser.cpp b/NorthstarDLL/exploitfixes_utf8parser.cpp index 5627c3e3..8d6399fb 100644 --- a/NorthstarDLL/exploitfixes_utf8parser.cpp +++ b/NorthstarDLL/exploitfixes_utf8parser.cpp @@ -3,10 +3,12 @@ AUTOHOOK_INIT()
+INT64(__fastcall* sub_F1320)(DWORD a1, char* a2);
+
// Reimplementation of an exploitable UTF decoding function in titanfall
bool __fastcall CheckUTF8Valid(INT64* a1, DWORD* a2, char* strData)
{
- static auto sub_F1320 = (INT64(__fastcall*)(DWORD a1, char* a2))NSMem::PatternScan("engine.dll", "83 F9 7F 77 08 88 0A");
+ static auto = ()NSMem::PatternScan("engine.dll", );
DWORD v3; // eax
char* v4; // rbx
@@ -69,8 +71,7 @@ bool __fastcall CheckUTF8Valid(INT64* a1, DWORD* a2, char* strData) {
while (1)
{
-
- if (!NSMem::IsMemoryReadable(v4, 1))
+ if (!MemoryAddress(v4).IsMemoryReadable(1))
return false; // INVALID
v11 = *v4++; // crash potential
@@ -184,7 +185,9 @@ bool, __fastcall, (INT64 * a1, DWORD* a2, char* strData)) // 48 89 5C 24 ? 48 89 return Rson_ParseUTF8(a1, a2, strData);
}
-ON_DLL_LOAD("engine.dll", EngineExploitFixes_UTF8Parser, (HMODULE baseAddress))
+ON_DLL_LOAD("engine.dll", EngineExploitFixes_UTF8Parser, (CModule module))
{
AUTOHOOK_DISPATCH()
+
+ sub_F1320 = module.FindPattern("83 F9 7F 77 08 88 0A").As<INT64(__fastcall*)(DWORD, char*)>();
}
\ No newline at end of file |