#include "common.hpp" #include "logger.hpp" #include "pointers.hpp" #include "memory/all.hpp" namespace big { pointers::pointers() { memory::pattern_batch main_batch; main_batch.add("Game state", "83 3D ? ? ? ? ? 75 17 8B 42 20 25", [this](memory::handle ptr) { m_game_state = ptr.add(2).rip().as(); }); main_batch.add("Is session started", "40 38 35 ? ? ? ? 75 0E 4C 8B C3 49 8B D7 49 8B CE", [this](memory::handle ptr) { m_is_session_started = ptr.add(3).rip().as(); }); main_batch.add("Ped factory", "48 8B 05 ? ? ? ? 48 8B 48 08 48 85 C9 74 52 8B 81", [this](memory::handle ptr) { m_ped_factory = ptr.add(3).rip().as(); }); main_batch.add("Network player manager", "48 8B 0D ? ? ? ? 8A D3 48 8B 01 FF 50 ? 4C 8B 07 48 8B CF", [this](memory::handle ptr) { m_network_player_mgr = ptr.add(3).rip().as(); }); main_batch.add("Native handlers", "48 8D 0D ? ? ? ? 48 8B 14 FA E8 ? ? ? ? 48 85 C0 75 0A", [this](memory::handle ptr) { m_native_registration_table = ptr.add(3).rip().as(); m_get_native_handler = ptr.add(12).rip().as(); }); main_batch.add("Fix vectors", "83 79 18 00 48 8B D1 74 4A FF 4A 18 48 63 4A 18 48 8D 41 04 48 8B 4C CA", [this](memory::handle ptr) { m_fix_vectors = ptr.as(); }); main_batch.add("Script threads", "45 33 F6 8B E9 85 C9 B8", [this](memory::handle ptr) { m_script_threads = ptr.sub(4).rip().sub(8).as(); m_run_script_threads = ptr.sub(0x1F).as(); }); main_batch.add("Script programs", "44 8B 0D ? ? ? ? 4C 8B 1D ? ? ? ? 48 8B 1D ? ? ? ? 41 83 F8 FF 74 3F 49 63 C0 42 0F B6 0C 18 81 E1", [this](memory::handle ptr) { m_script_program_table = ptr.add(17).rip().as(); }); main_batch.add("Script globals", "48 8D 15 ? ? ? ? 4C 8B C0 E8 ? ? ? ? 48 85 FF 48 89 1D", [this](memory::handle ptr) { m_script_globals = ptr.add(3).rip().as(); }); main_batch.add("CGameScriptHandlerMgr", "48 8B 0D ? ? ? ? 4C 8B CE E8 ? ? ? ? 48 85 C0 74 05 40 32 FF", [this](memory::handle ptr) { m_script_handler_mgr = ptr.add(3).rip().as(); }); main_batch.add("Swapchain", "48 8B 0D ? ? ? ? 48 8B 01 44 8D 43 01 33 D2 FF 50 40 8B C8", [this](memory::handle ptr) { m_swapchain = ptr.add(3).rip().as(); }); main_batch.add("Model Spawn Bypass", "48 8B C8 FF 52 30 84 C0 74 05 48", [this](memory::handle ptr) { m_model_spawn_bypass = ptr.add(8).as(); }); // new pointers main_batch.add("Native Return Spoofer", "FF E3", [this](memory::handle ptr) { m_native_return = ptr.add(0).as(); }); main_batch.add("Event Register", "48 83 EC 28 E8 ? ? ? ? 48 8B 0D ? ? ? ? 4C 8D 0D ? ? ? ? 4C 8D 05 ? ? ? ? BA 03", [this](memory::handle ptr) { m_event_register = ptr.as(); if (m_event_register) { const char* pattern = "\x4C\x8D\x05"; for (int i = 0, x = 0, found = 0, matches = 0; found < event_count; i++) { if (m_event_register[i] == pattern[x]) { if (++matches == 3) { m_event_ptr.push_back((void*)(reinterpret_cast(m_event_register + i - x) + *reinterpret_cast(m_event_register + i + 1) + 7)); found++; x = matches = 0; } x++; continue; } x = matches = 0; } } }); main_batch.run(memory::module(nullptr)); m_hwnd = FindWindowW(L"grcWindow", nullptr); if (!m_hwnd) throw std::runtime_error("Failed to find the game's window."); g_pointers = this; } pointers::~pointers() { g_pointers = nullptr; } }