Addressed an issue where wrong offsets would be returned making game to crash
This commit is contained in:
@@ -138,6 +138,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
|
||||
|
||||
if (!GObjectsaddress || !GNamesaddress || !AppendStringaddress || !ProcessEventaddress) {
|
||||
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");
|
||||
GObjectsaddress = Memory::AOBScan(gameExecutable, GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
|
||||
@@ -149,8 +150,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
|
||||
if (!GObjectsaddress)
|
||||
logger->warn("GObjects signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||
else {
|
||||
uint32_t gObjectsOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GObjectsaddress + 0x3) -
|
||||
reinterpret_cast<uint8_t*>(GetModuleHandleA(gameExecutable.c_str())));
|
||||
uint32_t gObjectsOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GObjectsaddress + 0x3) - baseModule);
|
||||
logger->info("GObjects offset is: 0x{:X}.", gObjectsOffset);
|
||||
Offsets::GObjects = static_cast<UC::uint32>(gObjectsOffset); // Update GObjects offset
|
||||
}
|
||||
@@ -158,8 +158,7 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
|
||||
if (!GNamesaddress)
|
||||
logger->warn("GNames signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
|
||||
else {
|
||||
uint32_t gNamesOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GNamesaddress + 0x3) -
|
||||
reinterpret_cast<uint8_t*>(GetModuleHandleA(gameExecutable.c_str())));
|
||||
uint32_t gNamesOffset = static_cast<uint32_t>(Memory::GetOffsetFromOpcode(GNamesaddress + 0x3) - baseModule);
|
||||
logger->info("GNames offset is: 0x{:X}.", gNamesOffset);
|
||||
Offsets::GNames = static_cast<UC::uint32>(gNamesOffset); // Update GNames offset
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user