2019-03-21 20:18:31 +01:00
|
|
|
#include "common.hpp"
|
|
|
|
#include "pointers.hpp"
|
|
|
|
#include "memory/all.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
pointers::pointers()
|
|
|
|
{
|
|
|
|
memory::pattern_batch main_batch;
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Game State
|
|
|
|
main_batch.add("GS", "83 3D ? ? ? ? ? 75 17 8B 43 20 25", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_game_state = ptr.add(2).rip().as<eGameState*>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Is session active
|
|
|
|
main_batch.add("ISA", "40 38 35 ? ? ? ? 75 0E 4C 8B C3 49 8B D7 49 8B CE", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_is_session_started = ptr.add(3).rip().as<bool*>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Ped Factory
|
|
|
|
main_batch.add("PF", "48 8B 05 ? ? ? ? 48 8B 48 08 48 85 C9 74 52 8B 81", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_ped_factory = ptr.add(3).rip().as<CPedFactory**>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Network Player Manager
|
|
|
|
main_batch.add("NPM", "48 8B 0D ? ? ? ? 8A D3 48 8B 01 FF 50 ? 4C 8B 07 48 8B CF", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_network_player_mgr = ptr.add(3).rip().as<CNetworkPlayerMgr**>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Native Handlers
|
|
|
|
main_batch.add("NH", "48 8D 0D ? ? ? ? 48 8B 14 FA E8 ? ? ? ? 48 85 C0 75 0A", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_native_registration_table = ptr.add(3).rip().as<rage::scrNativeRegistrationTable*>();
|
|
|
|
m_get_native_handler = ptr.add(12).rip().as<functions::get_native_handler_t>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Fix Vectors
|
|
|
|
main_batch.add("FV", "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)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_fix_vectors = ptr.as<functions::fix_vectors_t>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Script Threads
|
|
|
|
main_batch.add("ST", "45 33 F6 8B E9 85 C9 B8", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_script_threads = ptr.sub(4).rip().sub(8).as<decltype(m_script_threads)>();
|
|
|
|
m_run_script_threads = ptr.sub(0x1F).as<functions::run_script_threads_t>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Script Programs
|
|
|
|
main_batch.add("SP", "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)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_script_program_table = ptr.add(17).rip().as<decltype(m_script_program_table)>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Script Global
|
|
|
|
main_batch.add("SG", "48 8D 15 ? ? ? ? 4C 8B C0 E8 ? ? ? ? 48 85 FF 48 89 1D", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_script_globals = ptr.add(3).rip().as<std::int64_t**>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Game Script Handle Manager
|
|
|
|
main_batch.add("CGSHM", "48 8B 0D ? ? ? ? 4C 8B CE E8 ? ? ? ? 48 85 C0 74 05 40 32 FF", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_script_handler_mgr = ptr.add(3).rip().as<CGameScriptHandlerMgr**>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Swapchain
|
|
|
|
main_batch.add("S", "48 8B 0D ? ? ? ? 48 8B 01 44 8D 43 01 33 D2 FF 50 40 8B C8", [this](memory::handle ptr)
|
2019-03-21 20:18:31 +01:00
|
|
|
{
|
|
|
|
m_swapchain = ptr.add(3).rip().as<IDXGISwapChain**>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Model Spawn Bypass
|
|
|
|
main_batch.add("MSB", "48 8B C8 FF 52 30 84 C0 74 05 48", [this](memory::handle ptr)
|
2020-02-22 18:37:42 -05:00
|
|
|
{
|
|
|
|
m_model_spawn_bypass = ptr.add(8).as<PVOID>();
|
|
|
|
});
|
|
|
|
|
2021-05-18 23:03:42 +02:00
|
|
|
// new pointers
|
2021-07-23 00:47:27 +02:00
|
|
|
// Native Return Spoofer
|
|
|
|
main_batch.add("NRF", "FF E3", [this](memory::handle ptr)
|
2020-12-26 17:35:05 +01:00
|
|
|
{
|
2021-05-18 23:03:42 +02:00
|
|
|
m_native_return = ptr.add(0).as<PVOID>();
|
2020-12-26 17:35:05 +01:00
|
|
|
});
|
2021-05-19 00:07:13 +02:00
|
|
|
|
2022-01-21 23:08:00 +01:00
|
|
|
// GTA Thread Start
|
2022-01-22 03:27:13 +01:00
|
|
|
main_batch.add("GTS", "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 8B FA 85 D2 75 2A 8B 15", [this](memory::handle ptr)
|
2022-01-21 23:08:00 +01:00
|
|
|
{
|
|
|
|
m_gta_thread_start = ptr.as<PVOID>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Thread Thick
|
|
|
|
main_batch.add("TT", "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 80 B9 ? ? ? ? ? 8B FA 48 8B D9 74 05", [this](memory::handle ptr)
|
2021-05-19 00:41:55 +02:00
|
|
|
{
|
2022-01-21 23:08:00 +01:00
|
|
|
m_gta_thread_tick = ptr.as<PVOID>();
|
2021-05-19 00:41:55 +02:00
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Thread Kill
|
|
|
|
main_batch.add("TK", "48 89 5C 24 ? 57 48 83 EC 20 48 83 B9 ? ? ? ? ? 48 8B D9 74 14", [this](memory::handle ptr)
|
2021-05-19 00:41:55 +02:00
|
|
|
{
|
2022-01-21 23:08:00 +01:00
|
|
|
m_gta_thread_kill = ptr.as<PVOID>();
|
2021-05-19 00:41:55 +02:00
|
|
|
});
|
2021-05-19 16:19:38 +02:00
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Increment Stat Event
|
|
|
|
main_batch.add("ISE", "48 89 5C 24 ? 48 89 74 24 ? 55 57 41 55 41 56 41 57 48 8B EC 48 83 EC 60 8B 79 30", [this](memory::handle ptr)
|
2021-05-25 14:44:35 +02:00
|
|
|
{
|
|
|
|
m_increment_stat_event = ptr.as<decltype(m_increment_stat_event)>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Error Screen Hook
|
|
|
|
main_batch.add("ESH", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 83 EC 60 4C 8B F2 48 8B 94 24 ? ? ? ? 33 DB", [this](memory::handle ptr)
|
2021-05-20 15:49:36 +02:00
|
|
|
{
|
|
|
|
m_error_screen = ptr.as<decltype(m_error_screen)>();
|
|
|
|
});
|
2021-05-21 00:59:09 +02:00
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Trigger Script Event
|
|
|
|
main_batch.add("TSE", "48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 56 48 81 EC ? ? ? ? 45 8B F0 41 8B F9", [this](memory::handle ptr)
|
2021-05-21 00:59:09 +02:00
|
|
|
{
|
|
|
|
m_trigger_script_event = ptr.as<decltype(m_trigger_script_event)>();
|
|
|
|
});
|
2021-05-25 12:58:33 +02:00
|
|
|
|
|
|
|
// Received Event Signatures START
|
2021-07-23 00:47:27 +02:00
|
|
|
// Received Event Hook
|
|
|
|
main_batch.add("REH", "66 41 83 F9 ? 0F 83 ? ? ? ?", [this](memory::handle ptr)
|
2021-05-25 12:58:33 +02:00
|
|
|
{
|
|
|
|
m_received_event = ptr.as<decltype(m_received_event)>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Read Bitbugger WORD/DWORD
|
|
|
|
main_batch.add("RBWD", "48 89 74 24 ? 57 48 83 EC 20 48 8B D9 33 C9 41 8B F0 8A", [this](memory::handle ptr)
|
2021-05-25 12:58:33 +02:00
|
|
|
{
|
|
|
|
m_read_bitbuf_dword = ptr.sub(5).as<decltype(m_read_bitbuf_dword)>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Read Bitbuffer Array
|
|
|
|
main_batch.add("RBA", "48 89 5C 24 ? 57 48 83 EC 30 41 8B F8 4C", [this](memory::handle ptr)
|
2021-05-25 12:58:33 +02:00
|
|
|
{
|
|
|
|
m_read_bitbuf_array = ptr.as<decltype(m_read_bitbuf_array)>();
|
|
|
|
});
|
|
|
|
|
2021-07-23 23:03:47 +02:00
|
|
|
// Send Event Acknowledge
|
2021-07-23 00:47:27 +02:00
|
|
|
main_batch.add("SEA", "48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 80 7A", [this](memory::handle ptr)
|
2021-05-25 12:58:33 +02:00
|
|
|
{
|
|
|
|
m_send_event_ack = ptr.sub(5).as<decltype(m_send_event_ack)>();
|
|
|
|
});
|
|
|
|
// Received Event Signatures END
|
2021-05-26 00:14:28 +02:00
|
|
|
|
2021-07-23 00:47:27 +02:00
|
|
|
// Request Control of Entity PATCH
|
|
|
|
main_batch.add("RCOE-Patch", "48 89 5C 24 ? 57 48 83 EC 20 8B D9 E8 ? ? ? ? ? ? ? ? 8B CB", [this](memory::handle ptr)
|
2021-05-26 00:14:28 +02:00
|
|
|
{
|
|
|
|
PVOID spectator_check = ptr.add(0x11).as<PVOID>();
|
|
|
|
|
|
|
|
memset(spectator_check, 0x90, 0x4);
|
|
|
|
});
|
2021-05-26 13:33:26 +02:00
|
|
|
|
2021-07-26 00:38:03 +02:00
|
|
|
// Scripted Game Event Handler
|
|
|
|
main_batch.add("SGEH", "40 53 48 81 EC ? ? ? ? 44 8B 81 ? ? ? ? 4C 8B CA 41 8D 40 FF 3D ? ? ? ? 77 42", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_scripted_game_event = ptr.as<decltype(m_scripted_game_event)>();
|
|
|
|
});
|
2021-07-26 13:38:28 +02:00
|
|
|
|
|
|
|
// GET CNetGamePlayer
|
|
|
|
main_batch.add("GCNGP", "48 83 EC ? 33 C0 38 05 ? ? ? ? 74 ? 83 F9", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_get_net_game_player = ptr.as<decltype(m_get_net_game_player)>();
|
|
|
|
});
|
2021-08-05 23:06:47 +02:00
|
|
|
|
|
|
|
// Replay Interface
|
|
|
|
main_batch.add("RI", "48 8D 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 48 8D 0D ? ? ? ? 8A D8 E8 ? ? ? ? 84 DB 75 13 48 8D 0D", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_replay_interface = ptr.add(3).rip().as<decltype(m_replay_interface)>();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Pointer to Handle
|
|
|
|
main_batch.add("PTH", "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 8B 15 ? ? ? ? 48 8B F9 48 83 C1 10 33 DB", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_ptr_to_handle = ptr.as<decltype(m_ptr_to_handle)>();
|
|
|
|
});
|
2021-08-08 10:19:04 +02:00
|
|
|
|
2021-10-15 11:26:52 +02:00
|
|
|
// Blame Explode
|
|
|
|
main_batch.add("BE", "0F 85 ? ? ? ? 48 8B 05 ? ? ? ? 48 8B 48 08 E8", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_blame_explode = ptr.as<decltype(m_blame_explode)>();
|
|
|
|
});
|
2021-12-06 16:39:46 +01:00
|
|
|
|
|
|
|
// Is DLC Present
|
|
|
|
main_batch.add("IDP", "48 89 5C 24 ? 57 48 83 EC ? 81 F9", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_is_dlc_present = ptr.as<decltype(m_is_dlc_present)>();
|
|
|
|
});
|
2021-12-18 19:24:30 +01:00
|
|
|
|
|
|
|
// Send NET Info to Lobby
|
|
|
|
main_batch.add("SNITL", "44 8B 6C 24 ? 45 8B C6 48 8D 4E 70 41 8B D5 45 2B C5 4C 8D 4C 24 ? 03 D5 44 2B C5 49 03 D4 E8 ? ? ? ? 84 C0 74 69", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_send_net_info_to_lobby = ptr.sub(0x64).as<decltype(m_send_net_info_to_lobby)>();
|
|
|
|
});
|
2022-01-25 02:55:35 +01:00
|
|
|
|
|
|
|
// CNetworkObjectMgr
|
|
|
|
main_batch.add("CNOM", "48 8B 0D ? ? ? ? 45 33 C0 E8 ? ? ? ? 33 FF 4C 8B F0", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_network_object_mgr = ptr.add(3).rip().as<CNetworkObjectMgr**>();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Player Has Joined
|
|
|
|
main_batch.add("PHJ", "48 8B CA 48 8B F2 FF 50 18 4C 8D 05", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_player_has_joined = ptr.sub(0x26).as<PVOID>();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Player Has Left
|
|
|
|
main_batch.add("PHL", "4C 8B F1 48 8B CA 48 8B EA FF 50 18 4C 8D 05", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_player_has_left = ptr.sub(0x26).as<PVOID>();
|
|
|
|
});
|
2022-01-31 18:27:35 +01:00
|
|
|
|
|
|
|
// Network Player Mgr Shutdown
|
|
|
|
main_batch.add("NPMS", "41 57 48 81 EC ? ? ? ? 8A 81 ? ? ? ? 48", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_network_player_mgr_shutdown = ptr.sub(0x17).as<PVOID>();
|
|
|
|
});
|
2022-02-18 17:44:32 +01:00
|
|
|
|
2022-03-16 15:55:27 +01:00
|
|
|
// FriendRegistry
|
2022-02-18 17:44:32 +01:00
|
|
|
main_batch.add("FR", "3B 0D ? ? ? ? 73 13 48 63 C9", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_friend_registry = ptr.add(2).rip().as<FriendRegistry*>();
|
|
|
|
});
|
2022-03-09 00:03:14 +01:00
|
|
|
|
2022-03-16 15:55:27 +01:00
|
|
|
// GET_SCREEN_COORDS_FROM_WORLD_COORDS
|
|
|
|
main_batch.add("GSCFWC", "E8 ? ? ? ? 84 C0 74 19 F3 0F 10 44 24", [this](memory::handle ptr)
|
2022-03-16 00:04:09 +01:00
|
|
|
{
|
|
|
|
m_get_screen_coords_for_world_coords = ptr.add(1).rip().as<functions::get_screen_coords_for_world_coords*>();
|
|
|
|
});
|
2022-03-09 00:03:14 +01:00
|
|
|
|
|
|
|
// Get Gameplay Cam Coords
|
|
|
|
main_batch.add("GGCC", "40 53 48 83 EC 20 48 8B D9 E8 ? ? ? ? 8B 90 ? ? ? ? 89 13 8B 90 ? ? ? ? 8B 80 ? ? ? ? 89 43 10 89 53 08 48 8B C3 48 83 C4 20 5B C3", [this](memory::handle ptr)
|
2022-03-16 00:04:09 +01:00
|
|
|
{
|
|
|
|
m_get_gamplay_cam_coords = ptr.as<functions::get_gameplay_cam_coords*>();
|
|
|
|
});
|
2022-03-09 00:03:14 +01:00
|
|
|
|
2022-03-16 15:55:27 +01:00
|
|
|
// net array handler - version mismatch patch
|
|
|
|
main_batch.add("NAH", "44 8B E0 89 45 F4 48 8B 03 48 8B CB FF 90", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_net_array_handler = ptr.sub(0x3C).as<PVOID>();
|
|
|
|
});
|
2022-03-17 12:08:03 +01:00
|
|
|
|
|
|
|
main_batch.add("SCREEN_RESOLUTION", "66 0F 6E 0D ? ? ? ? 0F B7 3D", [this](memory::handle ptr)
|
|
|
|
{
|
|
|
|
m_resolution_x = ptr.sub(4).rip().as<int*>();
|
|
|
|
m_resolution_y = ptr.add(4).rip().as<int*>();
|
|
|
|
});
|
2021-05-18 23:03:42 +02:00
|
|
|
|
2019-03-21 20:18:31 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|