Update offset for console enabling

This commit is contained in:
2025-11-03 21:28:11 +01:00
parent 8ad9f5e4e4
commit f486d84c5b

View File

@@ -48,7 +48,6 @@ static bool g_Console_Enabled = false;
// AOB Unreal Engine offsets addresses
static uint8_t* GObjectsaddress = nullptr;
static uint8_t* GNamesaddress = nullptr;
static uint8_t* AppendStringaddress = nullptr;
static uint8_t* ProcessEventaddress = nullptr;
@@ -197,14 +196,14 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
AOBScanDone = true;
}
if (!GObjectsaddress || !GNamesaddress || !AppendStringaddress || !ProcessEventaddress) {
if (!GObjectsaddress || !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("", GObjetcsStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
constexpr auto GNamesStringObfuscated = make_obfuscated<0x4A>("48 8D ?? ?? ?? ?? ?? EB ?? 48 8D ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? C6 05 ?? ?? ?? ?? ?? 0F ?? ?? 4C");
GNamesaddress = Memory::AOBScan("", GNamesStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
constexpr auto AppendStringStringObfuscated = make_obfuscated<0x4A>("48 89 ?? ?? ?? 48 89 ?? ?? ?? 57 48 83 ?? ?? 80 3D ?? ?? ?? ?? ?? 48 ?? F2 8B ?? 48 ?? ?? 74 ?? 4C 8D ?? ?? ?? ?? ?? EB ?? 48 8D ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? 4C");
AppendStringaddress = Memory::AOBScan("", AppendStringStringObfuscated.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 ?? ?? 48 89 ?? ?? ?? ?? ?? 4D 8B");
ProcessEventaddress = Memory::AOBScan("", ProcessEventStringObfuscated.decrypt(), PAGE_EXECUTE_READ);
@@ -216,12 +215,13 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
Offsets::GObjects = static_cast<UC::uint32>(gObjectsOffset); // Update GObjects offset
}
if (!GNamesaddress)
logger->warn("GNames signature not found. Maybe your game has been updated and is no more compatible with this plugin.");
if (!AppendStringaddress)
logger->warn("AppendString 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) - baseModule);
logger->info("GNames offset is: 0x{:X}.", gNamesOffset);
Offsets::GNames = static_cast<UC::uint32>(gNamesOffset); // Update GNames offset
std::optional<uint32_t> gAppendStringOffsetOpt = UE::CalculateOffset("", AppendStringaddress);
uint32_t gAppendStringOffset = *gAppendStringOffsetOpt;
logger->info("AppendString offset is: 0x{:X}.", gAppendStringOffset);
Offsets::AppendString = static_cast<UC::uint32>(gAppendStringOffset);// Update ProcessEvent offset
}
if (!ProcessEventaddress)
@@ -458,7 +458,8 @@ static void VolumetricFogFixEnabled() {
static void EnableConsole()
{
logger->info("-------------- Console re-enabling --------------");
if (!GObjectsaddress || !GNamesaddress || !ProcessEventaddress) {
if (!GObjectsaddress || !AppendStringaddress || !ProcessEventaddress) {
//if (!GObjectsaddress || !GNamesaddress || !ProcessEventaddress) {
logger->warn("Could not re-enable console");
logger->info("------------------ User inputs ------------------");
return;