aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/exploitfixes_utf8parser.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-24 20:55:34 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-24 20:55:34 +0100
commit52dc6d143fec8eabb9958bacbdbf6f1b4b4af592 (patch)
tree61473cc529921fa622d7815b06c8530234248034 /NorthstarDLL/exploitfixes_utf8parser.cpp
parentb0bef05111a95a4cce6250d2b79e2aa5baa6dd98 (diff)
downloadNorthstarLauncher-52dc6d143fec8eabb9958bacbdbf6f1b4b4af592.tar.gz
NorthstarLauncher-52dc6d143fec8eabb9958bacbdbf6f1b4b4af592.zip
add new memory lib
Diffstat (limited to 'NorthstarDLL/exploitfixes_utf8parser.cpp')
-rw-r--r--NorthstarDLL/exploitfixes_utf8parser.cpp11
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