From dc852acc302678e22f994275419aaf8a1feffc7a Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sat, 28 May 2022 20:36:43 +0200 Subject: [PATCH] Redirect component --- src/client/component/redirect.cpp | 6 ++++-- src/client/main.cpp | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/component/redirect.cpp b/src/client/component/redirect.cpp index 9d3cc65f..e44be742 100644 --- a/src/client/component/redirect.cpp +++ b/src/client/component/redirect.cpp @@ -1,8 +1,10 @@ #include #include "loader/component_loader.hpp" + +#include "game_module.hpp" + #include #include -#include "game_module.hpp" namespace redirect { @@ -80,4 +82,4 @@ namespace redirect }; } -//REGISTER_COMPONENT(redirect::component) +REGISTER_COMPONENT(redirect::component) diff --git a/src/client/main.cpp b/src/client/main.cpp index 9abef939..156ffd47 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -44,14 +44,18 @@ bool apply_aslr_patch(std::string* data) { // mp binary, sp binary if (data->size() != 0x1B97788 && data->size() != 0x1346D88) + { return false; + } auto* dos_header = reinterpret_cast(&data->at(0)); auto* nt_headers = reinterpret_cast(&data->at(dos_header->e_lfanew)); auto* optional_header = &nt_headers->OptionalHeader; - if(optional_header->DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) + if (optional_header->DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) + { optional_header->DllCharacteristics &= ~(IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE); + } return true; }