diff --git a/src/backend/script_patches.hpp b/src/backend/script_patches.hpp index cb3dea17..a13f1beb 100644 --- a/src/backend/script_patches.hpp +++ b/src/backend/script_patches.hpp @@ -9,51 +9,71 @@ namespace big void register_script_patches() { g_script_patcher_service->add_patch( - {RAGE_JOAAT("freemode"), "2D 01 08 00 ? 38 00 5D ? ? ? 2A 06", 5, {0x71, 0x2E, 0x01, 0x01}, &g.session.decloak_players}); - g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 01 04 00 ? 2C ? ? ? 5D ? ? ? 71 57 ? ? 2C", 5, {0x2E, 0x01, 0x00}, nullptr}); // script host kick - g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "5D ? ? ? 76 57 ? ? 5D ? ? ? 76", 0, {0x2E, 0x00, 0x00}, nullptr}); // end session kick protection - g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 01 09 00 00 5D ? ? ? 56 ? ? 2E", 5, {0x2E, 0x01, 0x00}, nullptr}); // disable death when undermap/spectating - g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "71 2E ? ? 55 ? ? 61 ? ? ? 47 ? ? 63", 0, {0x72}, nullptr}); // load island even if stranded animal IPL choice is not set - g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 00 07 00 00 7B", 5, {0x2E, 0x00, 0x00}, nullptr}); // disable population load balancing + {RAGE_JOAAT("freemode"), "freemode1", "2D 01 08 00 ? 38 00 5D ? ? ? 2A 06", 5, {0x71, 0x2E, 0x01, 0x01}, &g.session.decloak_players}); + g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "script host kick", "2D 01 04 00 ? 2C ? ? ? 5D ? ? ? 71 57 ? ? 2C", 5, {0x2E, 0x01, 0x00}, nullptr}); // script host kick + g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "end session kick protection", "5D ? ? ? 76 57 ? ? 5D ? ? ? 76", 0, {0x2E, 0x00, 0x00}, nullptr}); // end session kick protection + g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "disable death when undermap/spectating", "2D 01 09 00 00 5D ? ? ? 56 ? ? 3A", 5, {0x2E, 0x01, 0x00}, nullptr}); // disable death when undermap/spectating + g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "load island even if stranded animal IPL choice is not set", "71 2E ? ? 55 ? ? 61 ? ? ? 47 ? ? 63", 0, {0x72}, nullptr}); // load island even if stranded animal IPL choice is not set + g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "disable population load balancing", "2D 00 07 00 00 7B", 5, {0x2E, 0x00, 0x00}, nullptr}); // disable population load balancing g_script_patcher_service->add_patch( - {RAGE_JOAAT("freemode"), "2D 02 08 00 00 38 01 56", 5, {0x2E, 0x02, 0x00}, &g.session.block_muggers}); - g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 00 CF 00 00", 5, {0x2E, 0x00, 0x00}, &g.session.block_ceo_raids}); + {RAGE_JOAAT("freemode"), "freemode7", "2D 02 08 00 00 38 01 56", 5, {0x2E, 0x02, 0x00}, &g.session.block_muggers}); g_script_patcher_service->add_patch( - {RAGE_JOAAT("freemode"), "06 56 ? ? 38 02 2C ? ? ? 71 71", 0, {0x2B, 0x55}, &g.spoofing.spoof_blip}); // prevent normal blip update + {RAGE_JOAAT("freemode"), "freemode8", "2D 00 CF 00 00", 5, {0x2E, 0x00, 0x00}, &g.session.block_ceo_raids}); g_script_patcher_service->add_patch( - {RAGE_JOAAT("freemode"), "2C ? ? ? 55 ? ? 71 2C ? ? ? 61", 7, std::vector(16, 0x0), &g.spoofing.spoof_blip}); // prevent normal blip update 2 - g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "2D 01 04 00 00 2C ? ? ? 56 ? ? 71", 5, {0x71, 0x2E, 0x01, 0x01}, nullptr}); // despawn bypass - g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "2D 01 03 00 00 5D ? ? ? 06 56 ? ? 2E ? ? 2C", 5, {0x2E, 0x01, 0x00}, nullptr}); // godmode/invisibility detection bypass + {RAGE_JOAAT("freemode"), "prevent normal blip update", "06 56 ? ? 38 02 2C ? ? ? 71 71", 0, {0x2B, 0x55}, &g.spoofing.spoof_blip}); // prevent normal blip update + g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), + "prevent normal blip update 2", + "2C ? ? ? 55 ? ? 71 2C ? ? ? 61", + 7, + std::vector(16, 0x0), + &g.spoofing.spoof_blip}); // prevent normal blip update 2 + g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "despawn bypass", "2D 01 04 00 00 2C ? ? ? 56 ? ? 71", 5, {0x71, 0x2E, 0x01, 0x01}, nullptr}); // despawn bypass + g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "godmode/invisibility detection bypass", "2D 01 03 00 00 5D ? ? ? 06 56 ? ? 2E ? ? 2C", 5, {0x2E, 0x01, 0x00}, nullptr}); // godmode/invisibility detection bypass g_script_patcher_service->add_patch({RAGE_JOAAT("am_mp_nightclub"), + "am_mp_nightclub1", "2D 01 03 00 00 2C ? ? ? 56 ? ? 72 2E ? ? 38 00", 5, {0x72, 0x2E, 0x01, 0x01}, &g.self.dance_mode}); - g_script_patcher_service->add_patch( - {RAGE_JOAAT("am_mp_nightclub"), "20 56 ? ? 4F ? ? 46 ? ? 41 ? 71", 0, {0x2B, 0x55}, &g.self.dance_mode}); + g_script_patcher_service->add_patch({RAGE_JOAAT("am_mp_nightclub"), + "am_mp_nightclub2", + "20 56 ? ? 4F ? ? 46 ? ? 41 ? 71", + 0, + {0x2B, 0x55}, + &g.self.dance_mode}); g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), + "freemode9", "5D ? ? ? 56 ? ? 72 39 05 38 04 2C ? ? ? 58", 0, {0x2B, 0x2B, 0x2B, 0x00, 0x55}, &g.self.invisibility}); g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), + "freemode10", "2D 01 03 00 00 38 00 71 72 5D ? ? ? 06 56 ? ? 71 2E ? ? 2C ? ? ? 71", 5, {0x72, 0x2E, 0x01, 0x01}, &g.session.unhide_players_from_player_list}); + g_script_patcher_service->add_patch({RAGE_JOAAT("carmod_shop"), + "disable camera", + "2D 01 0A 00 00 4F ? ? 40 ? 41 ? 39 03", + 5, + {0x2E, 0x01, 0x00}, + &g.vehicle.ls_customs}); // disable camera g_script_patcher_service->add_patch( - {RAGE_JOAAT("carmod_shop"), "2D 01 0A 00 00 4F ? ? 40 ? 41 ? 39 03", 5, {0x2E, 0x01, 0x00}, &g.vehicle.ls_customs}); // disable camera + {RAGE_JOAAT("carmod_shop"), "carmod_shop1", "2D 02 10 00 00 2C", 5, {0x71, 0x2E, 0x02, 0x01}, &g.vehicle.ls_customs}); g_script_patcher_service->add_patch( - {RAGE_JOAAT("carmod_shop"), "2D 02 10 00 00 2C", 5, {0x71, 0x2E, 0x02, 0x01}, &g.vehicle.ls_customs}); + {RAGE_JOAAT("carmod_shop"), "carmod_shop2", "2D 00 B8 00 00", 5, {0x2E, 0x00, 0x00}, &g.vehicle.ls_customs}); g_script_patcher_service->add_patch( - {RAGE_JOAAT("carmod_shop"), "2D 00 B8 00 00", 5, {0x2E, 0x00, 0x00}, &g.vehicle.ls_customs}); + {RAGE_JOAAT("carmod_shop"), "buy mods for free in SP", "06 1F 56 ? ? 62 ? ? ? 56", 0, {0x2B, 0x2B, 0x55}, &g.vehicle.ls_customs}); // buy mods for free in SP g_script_patcher_service->add_patch( - {RAGE_JOAAT("carmod_shop"), "06 1F 56 ? ? 62 ? ? ? 56", 0, {0x2B, 0x2B, 0x55}, &g.vehicle.ls_customs}); // buy mods for free in SP - g_script_patcher_service->add_patch( - {RAGE_JOAAT("carmod_shop"), "2D 03 16 00 00 5D", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs}); // allow all vehicles - g_script_patcher_service->add_patch( - {RAGE_JOAAT("carmod_shop"), "2D 03 07 00 00 71 38 02", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs}); // allow all vehicles 2 + {RAGE_JOAAT("carmod_shop"), "allow all vehicles", "2D 03 16 00 00 5D", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs}); // allow all vehicles + g_script_patcher_service->add_patch({RAGE_JOAAT("carmod_shop"), + "allow all vehicles 2", + "2D 03 07 00 00 71 38 02", + 5, + {0x72, 0x2E, 0x03, 0x01}, + &g.vehicle.ls_customs}); // allow all vehicles 2 for (auto& entry : *g_pointers->m_gta.m_script_program_table) { diff --git a/src/services/script_patcher/script_patch.cpp b/src/services/script_patcher/script_patch.cpp index dfbc0817..6d494f22 100644 --- a/src/services/script_patcher/script_patch.cpp +++ b/src/services/script_patcher/script_patch.cpp @@ -4,8 +4,9 @@ namespace big { - script_patch::script_patch(rage::joaat_t script, const memory::pattern pattern, int32_t offset, std::vector patch, bool* enable_bool) : + script_patch::script_patch(rage::joaat_t script, std::string name, const memory::pattern pattern, int32_t offset, std::vector patch, bool* enable_bool) : m_script(script), + m_name(name), m_pattern(pattern), m_offset(offset), m_patch(std::move(patch)), @@ -53,7 +54,7 @@ namespace big { auto result = get_code_location_by_pattern(data, m_pattern); if (!result.has_value()) - LOG(FATAL) << "Failed to find pattern"; + LOG(FATAL) << "Failed to find pattern: " << m_name; m_ip = result.value() + m_offset; diff --git a/src/services/script_patcher/script_patch.hpp b/src/services/script_patcher/script_patch.hpp index 53f7fc5d..e53ff2d2 100644 --- a/src/services/script_patcher/script_patch.hpp +++ b/src/services/script_patcher/script_patch.hpp @@ -9,6 +9,7 @@ namespace big { rage::joaat_t m_script; const memory::pattern m_pattern; + std::string m_name; int32_t m_offset; std::vector m_patch; std::vector m_original; @@ -26,7 +27,7 @@ namespace big return m_script; } - script_patch(rage::joaat_t script, const memory::pattern pattern, int32_t offset, std::vector patch, bool* enable_bool); + script_patch(rage::joaat_t script, std::string name, const memory::pattern pattern, int32_t offset, std::vector patch, bool* enable_bool); void update(script_data* data); }; } \ No newline at end of file diff --git a/src/services/tunables/tunables_service.cpp b/src/services/tunables/tunables_service.cpp index a06e090e..ac2c2010 100644 --- a/src/services/tunables/tunables_service.cpp +++ b/src/services/tunables/tunables_service.cpp @@ -64,7 +64,7 @@ namespace big SCRIPT::SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED(RAGE_JOAAT("tuneables_processing")); m_script_started = true; - g_script_patcher_service->add_patch({RAGE_JOAAT("tuneables_processing"), "2E ? ? 55 ? ? 38 06", 0, std::vector(17, 0x0), &m_script_started}); // bool tunables registration hack + g_script_patcher_service->add_patch({RAGE_JOAAT("tuneables_processing"), "tuneables_processing1", "2E ? ? 55 ? ? 38 06", 0, std::vector(17, 0x0), &m_script_started}); // bool tunables registration hack if (auto program = gta_util::find_script_program(RAGE_JOAAT("tuneables_processing"))) g_script_patcher_service->on_script_load(program); }