diff options
-rw-r--r-- | NorthstarDLL/clientauthhooks.cpp | 18 | ||||
-rw-r--r-- | NorthstarDLL/exploitfixes.cpp | 2 | ||||
-rw-r--r-- | NorthstarDLL/hooks.cpp | 38 |
3 files changed, 52 insertions, 6 deletions
diff --git a/NorthstarDLL/clientauthhooks.cpp b/NorthstarDLL/clientauthhooks.cpp index ccd7432e..ef61741e 100644 --- a/NorthstarDLL/clientauthhooks.cpp +++ b/NorthstarDLL/clientauthhooks.cpp @@ -33,10 +33,28 @@ void, __fastcall, (void* a1)) AuthWithStryder(a1); } +char* p3PToken; + +// clang-format off +AUTOHOOK(Auth3PToken, engine.dll + 183760, +char*, __fastcall, ()) +// clang-format on +{ + if (g_pMasterServerManager->m_sOwnClientAuthToken[0]) + { + memset(p3PToken, 0x0, 1024); + strcpy(p3PToken, "Protocol 3: Protect the Pilot"); + } + + return Auth3PToken(); +} + ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientAuthHooks, ConVar, (CModule module)) { AUTOHOOK_DISPATCH() + p3PToken = module.Offset(0x13979D80).As<char*>(); + // this cvar will save to cfg once initially agreed with Cvar_ns_has_agreed_to_send_token = new ConVar( "ns_has_agreed_to_send_token", diff --git a/NorthstarDLL/exploitfixes.cpp b/NorthstarDLL/exploitfixes.cpp index 240c352c..2a5f02f3 100644 --- a/NorthstarDLL/exploitfixes.cpp +++ b/NorthstarDLL/exploitfixes.cpp @@ -126,7 +126,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 int iFlags = bIsServerFrame ? FCVAR_USERINFO : FCVAR_REPLICATED; if (!pVar->IsFlagSet(iFlags)) return BLOCKED_INFO( - "Invalid flags (" << std::hex << "0x" << pVar->m_ConCommandBase.m_nFlags << "), var is " << entry->name); + "Invalid flags (" << std::hex << "0x" << pVar->m_ConCommandBase.m_nFlags << "), var is " << entry->name); } } else diff --git a/NorthstarDLL/hooks.cpp b/NorthstarDLL/hooks.cpp index 4c068fe8..cca1d986 100644 --- a/NorthstarDLL/hooks.cpp +++ b/NorthstarDLL/hooks.cpp @@ -349,9 +349,28 @@ void CallAllPendingDLLLoadCallbacks() } } -AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExA, LoadLibraryExA, HMODULE, WINAPI, (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)) +// clang-format off +AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExA, LoadLibraryExA, +HMODULE, WINAPI, (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)) +// clang-format on { - HMODULE moduleAddress = _LoadLibraryExA(lpLibFileName, hFile, dwFlags); + HMODULE moduleAddress; + + // replace xinput dll with one that has ASLR + if (!strncmp(lpLibFileName, "XInput1_3.dll", 14)) + { + moduleAddress = _LoadLibraryExA("XInput9_1_0.dll", hFile, dwFlags); + + if (!moduleAddress) + { + MessageBoxA(0, "Could not find XInput9_1_0.dll", "Northstar", MB_ICONERROR); + exit(-1); + + return nullptr; + } + } + else + moduleAddress = _LoadLibraryExA(lpLibFileName, hFile, dwFlags); if (moduleAddress) CallLoadLibraryACallbacks(lpLibFileName, moduleAddress); @@ -359,7 +378,10 @@ AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExA, LoadLibraryExA, HMODULE, WINAPI, (LPCSTR return moduleAddress; } -AUTOHOOK_ABSOLUTEADDR(_LoadLibraryA, LoadLibraryA, HMODULE, WINAPI, (LPCSTR lpLibFileName)) +// clang-format off +AUTOHOOK_ABSOLUTEADDR(_LoadLibraryA, LoadLibraryA, +HMODULE, WINAPI, (LPCSTR lpLibFileName)) +// clang-format on { HMODULE moduleAddress = _LoadLibraryA(lpLibFileName); @@ -369,7 +391,10 @@ AUTOHOOK_ABSOLUTEADDR(_LoadLibraryA, LoadLibraryA, HMODULE, WINAPI, (LPCSTR lpLi return moduleAddress; } -AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExW, LoadLibraryExW, HMODULE, WINAPI, (LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)) +// clang-format off +AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExW, LoadLibraryExW, +HMODULE, WINAPI, (LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)) +// clang-format on { HMODULE moduleAddress = _LoadLibraryExW(lpLibFileName, hFile, dwFlags); @@ -379,7 +404,10 @@ AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExW, LoadLibraryExW, HMODULE, WINAPI, (LPCWSTR return moduleAddress; } -AUTOHOOK_ABSOLUTEADDR(_LoadLibraryW, LoadLibraryW, HMODULE, WINAPI, (LPCWSTR lpLibFileName)) +// clang-format off +AUTOHOOK_ABSOLUTEADDR(_LoadLibraryW, LoadLibraryW, +HMODULE, WINAPI, (LPCWSTR lpLibFileName)) +// clang-format on { HMODULE moduleAddress = _LoadLibraryW(lpLibFileName); |