Compare commits
2 Commits
384379ead4
...
5b974969d1
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b974969d1 | |||
| cf03aab0bc |
@@ -138,6 +138,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
|
|||||||
|
|
||||||
if (!GObjectsaddress || !GNamesaddress || !AppendStringaddress || !ProcessEventaddress) {
|
if (!GObjectsaddress || !GNamesaddress || !AppendStringaddress || !ProcessEventaddress) {
|
||||||
logger->info("------------ UEngine offsets search ------------");
|
logger->info("------------ UEngine offsets search ------------");
|
||||||
|
uint8_t* baseModule = reinterpret_cast<uint8_t*>(GetModuleHandleA(nullptr)); // Get game base address
|
||||||
|
|
||||||
constexpr auto GObjetcsStringObfuscated = make_obfuscated<0x4A>("48 8B ?? ?? ?? ?? ?? 48 8B ?? ?? 48 8D ?? ?? EB ?? 33");
|
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(gameExecutable, GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||||
@@ -149,8 +150,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
|
|||||||
if (!GObjectsaddress)
|
if (!GObjectsaddress)
|
||||||
logger->warn("GObjects signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("GObjects signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
else {
|
else {
|
||||||
uint32_t gObjectsOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GObjectsaddress + 0x3) -
|
uint32_t gObjectsOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GObjectsaddress + 0x3) - baseModule);
|
||||||
reinterpret_cast<uint8_t*>(GetModuleHandleA(gameExecutable.c_str())));
|
|
||||||
logger->info("GObjects offset is: 0x{:X}.", gObjectsOffset);
|
logger->info("GObjects offset is: 0x{:X}.", gObjectsOffset);
|
||||||
Offsets::GObjects = static_cast<UC::uint32>(gObjectsOffset); // Update GObjects offset
|
Offsets::GObjects = static_cast<UC::uint32>(gObjectsOffset); // Update GObjects offset
|
||||||
}
|
}
|
||||||
@@ -158,8 +158,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
|
|||||||
if (!GNamesaddress)
|
if (!GNamesaddress)
|
||||||
logger->warn("GNames signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
logger->warn("GNames signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||||
else {
|
else {
|
||||||
uint32_t gNamesOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GNamesaddress + 0x3) -
|
uint32_t gNamesOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GNamesaddress + 0x3) - baseModule);
|
||||||
reinterpret_cast<uint8_t*>(GetModuleHandleA(gameExecutable.c_str())));
|
|
||||||
logger->info("GNames offset is: 0x{:X}.", gNamesOffset);
|
logger->info("GNames offset is: 0x{:X}.", gNamesOffset);
|
||||||
Offsets::GNames = static_cast<UC::uint32>(gNamesOffset); // Update GNames offset
|
Offsets::GNames = static_cast<UC::uint32>(gNamesOffset); // Update GNames offset
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,20 @@
|
|||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
#include "UEngine.hpp"
|
#include "UEngine.hpp"
|
||||||
|
|
||||||
std::optional<uint32_t> UE::CalculateOffset(const std::string& exeName, uint8_t* AOBResult)
|
std::optional<uint32_t> UE::CalculateOffset(const std::string& exeName, uint8_t* AOBResult)
|
||||||
{
|
{
|
||||||
// Récupère la base du module via GetModuleHandleA
|
// Récupère la base du module via GetModuleHandleA
|
||||||
HMODULE hModule = GetModuleHandleA(exeName.c_str());
|
HMODULE hModule = GetModuleHandleA(exeName.c_str());
|
||||||
if (!hModule || !AOBResult)
|
if (!AOBResult)
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|
||||||
|
if (!hModule)
|
||||||
|
hModule = GetModuleHandleA(nullptr);
|
||||||
|
|
||||||
uintptr_t baseModule = reinterpret_cast<uintptr_t>(hModule);
|
uintptr_t baseModule = reinterpret_cast<uintptr_t>(hModule);
|
||||||
uintptr_t AOBAbsoluteAdress = reinterpret_cast<uintptr_t>(AOBResult);
|
uintptr_t AOBAbsoluteAdress = reinterpret_cast<uintptr_t>(AOBResult);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user