From def5f5e9ab48e4692f785ffc1523ed0967a507d7 Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Mon, 20 Oct 2025 09:40:10 +0200 Subject: [PATCH] Add some optimizations to the project --- LittleNightmareIII/dllmain.cpp | 20 ++++++++++---------- Metal Gear Solid Delta/MGSDelta.vcxproj | 6 ++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/LittleNightmareIII/dllmain.cpp b/LittleNightmareIII/dllmain.cpp index 018613d..33da678 100644 --- a/LittleNightmareIII/dllmain.cpp +++ b/LittleNightmareIII/dllmain.cpp @@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) logger->info("--------------- AOB scan started ---------------"); if (CameraComponentaddress == nullptr) { constexpr auto FOVStringObfuscated = make_obfuscated<0x4A>("EB ?? F3 0F ?? ?? ?? ?? ?? ?? F3 0F ?? ?? ?? 8B 87"); - CameraComponentaddress = Memory::AOBScan(gameExecutable, FOVStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + CameraComponentaddress = Memory::AOBScan("", FOVStringObfuscated.decrypt(), PAGE_EXECUTE_READ, logger); if (!CameraComponentaddress) logger->warn("Camera component signature not found. Maybe your game has been updated and is no more compatible with this plugin."); @@ -89,7 +89,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!AspectRatioAxisConstraintaddress) { constexpr auto AspectRatioAxisConstraintStringObfuscated = make_obfuscated<0x4A>("41 0F ?? ?? ?? ?? ?? ?? 48 8D ?? ?? ?? ?? ?? 4C ?? ?? 4D ?? ?? E8"); - AspectRatioAxisConstraintaddress = Memory::AOBScan(gameExecutable, AspectRatioAxisConstraintStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + AspectRatioAxisConstraintaddress = Memory::AOBScan("", AspectRatioAxisConstraintStringObfuscated.decrypt(), PAGE_EXECUTE_READ); if (!AspectRatioAxisConstraintaddress) logger->warn("HOR+ signature not found. Maybe your game has been updated and is no more compatible with this plugin."); @@ -114,7 +114,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!CAaddress) { constexpr auto CAStringObfuscated = make_obfuscated<0x4A>("7F ?? 89 BB ?? ?? ?? ?? 8B ?? ?? 39 05 ?? ?? ?? ?? 7E"); - CAaddress = Memory::AOBScan(gameExecutable, CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + CAaddress = Memory::AOBScan("", CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ); if (!CAaddress) logger->warn("Chromatic aberrations signature not found. Maybe your game has been updated and is no more compatible with this plugin."); @@ -124,7 +124,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!Vignettingaddress) { constexpr auto CAStringObfuscated = make_obfuscated<0x4A>("8B ?? 83 ?? ?? 7D ?? 89 BB ?? ?? ?? ?? 89 BB"); - Vignettingaddress = Memory::AOBScan(gameExecutable, CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + Vignettingaddress = Memory::AOBScan("", CAStringObfuscated.decrypt(), PAGE_EXECUTE_READ); //LittleNightmaresIII.exe + 39E9201 - 89 BB 8C 10 00 00 - mov[rbx + 0000108C], edi //LittleNightmaresIII.exe + 39E9207 - 48 8B 05 2A 6C A4 02 - mov rax, [LittleNightmaresIII.exe + 642FE38] //LittleNightmaresIII.exe + 39E920E - 8B 08 - mov ecx, [rax] @@ -139,7 +139,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!Fogaddress) { constexpr auto FogStringObfuscated = make_obfuscated<0x4A>("83 ?? ?? ?? 75 ?? B3 ?? EB ?? 32 ?? 48 8B"); - Fogaddress = Memory::AOBScan(gameExecutable, FogStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + Fogaddress = Memory::AOBScan("", FogStringObfuscated.decrypt(), PAGE_EXECUTE_READ); if (!Fogaddress) logger->warn("Fog signature not found. Maybe your game has been updated and is no more compatible with this plugin."); @@ -149,7 +149,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!VolumetricFogaddress){ constexpr auto VolumetricFogStringObfuscated = make_obfuscated<0x4A>("74 ?? F7 47 ?? ?? ?? ?? ?? 74 ?? 83 BB"); - VolumetricFogaddress = Memory::AOBScan(gameExecutable, VolumetricFogStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + VolumetricFogaddress = Memory::AOBScan("", VolumetricFogStringObfuscated.decrypt(), PAGE_EXECUTE_READ); if (!VolumetricFogaddress) logger->warn("Volumetric fog signature not found. Maybe your game has been updated and is no more compatible with this plugin."); @@ -168,11 +168,11 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) uint8_t* baseModule = reinterpret_cast(GetModuleHandleA(nullptr)); // Get game base address constexpr auto GObjetcsStringObfuscated = make_obfuscated<0x4A>("48 8B ?? ?? ?? ?? ?? 48 8B ?? ?? 48 8D ?? ?? EB ?? 33"); - GObjectsaddress = Memory::AOBScan(gameExecutable, GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + GObjectsaddress = Memory::AOBScan("", GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ); constexpr auto GNamesStringObfuscated = make_obfuscated<0x4A>("48 8D ?? ?? ?? ?? ?? EB ?? 48 8D ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? C6 05 ?? ?? ?? ?? ?? 0F ?? ?? 4C"); - GNamesaddress = Memory::AOBScan(gameExecutable, GNamesStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + GNamesaddress = Memory::AOBScan("", GNamesStringObfuscated.decrypt(), PAGE_EXECUTE_READ); constexpr auto ProcessEventStringObfuscated = make_obfuscated<0x4A>("40 ?? 56 57 41 ?? 41 ?? 41 ?? 41 ?? 48 81 ?? ?? ?? ?? ?? 48 8D ?? ?? ?? 48 89 ?? ?? ?? ?? ?? 48 8B ?? ?? ?? ?? ?? 48 33 ?? 48 89 ?? ?? ?? ?? ?? 8B 41"); - ProcessEventaddress = Memory::AOBScan(gameExecutable, ProcessEventStringObfuscated.decrypt(), PAGE_EXECUTE_READ); + ProcessEventaddress = Memory::AOBScan("", ProcessEventStringObfuscated.decrypt(), PAGE_EXECUTE_READ); if (!GObjectsaddress) logger->warn("GObjects signature not found. Maybe your game has been updated and is no more compatible with this plugin."); @@ -193,7 +193,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!ProcessEventaddress) logger->warn("Process Event signature not found. Maybe your game has been updated and is no more compatible with this plugin."); else { - std::optional gProcessEventOffsetOpt = UE::CalculateOffset(gameExecutable, ProcessEventaddress); + std::optional gProcessEventOffsetOpt = UE::CalculateOffset("", ProcessEventaddress); uint32_t gProcessEventOffset = *gProcessEventOffsetOpt; logger->info("Process Event offset is: 0x{:X}.", gProcessEventOffset); Offsets::ProcessEvent = static_cast(gProcessEventOffset);// Update ProcessEvent offset diff --git a/Metal Gear Solid Delta/MGSDelta.vcxproj b/Metal Gear Solid Delta/MGSDelta.vcxproj index e954021..b36427a 100644 --- a/Metal Gear Solid Delta/MGSDelta.vcxproj +++ b/Metal Gear Solid Delta/MGSDelta.vcxproj @@ -32,6 +32,7 @@ true v143 Unicode + true DynamicLibrary @@ -45,6 +46,7 @@ true v143 Unicode + true DynamicLibrary @@ -103,6 +105,7 @@ MultiThreadedDLL stdcpp23 true + MinSpace Windows @@ -130,6 +133,7 @@ MultiThreadedDLL stdcpp23 true + MinSpace Windows @@ -155,6 +159,7 @@ MultiThreadedDLL stdcpp23 true + MinSpace Windows @@ -183,6 +188,7 @@ stdcpplatest true true + MinSpace Windows