From 47e4e9c491af1e0c22acccdff5b316b0ae73ed15 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sun, 10 Jan 2021 16:19:40 +0100 Subject: [PATCH 01/31] wip(Project): pushing project --- BigBaseV2/src/features.cpp | 3 + BigBaseV2/src/features.hpp | 3 +- .../src/features/looped/join_message.cpp | 48 +++---- .../src/features/looped/spectate_player.cpp | 10 +- .../src/features/looped/super_sprint.cpp | 117 ++++++++++-------- BigBaseV2/src/features/rid_joiner.cpp | 54 ++++++++ BigBaseV2/src/features/rid_joiner.hpp | 63 ++++++++++ BigBaseV2/src/function_types.hpp | 8 +- BigBaseV2/src/gui/tab_bar/tab_misc.cpp | 9 ++ BigBaseV2/src/hooking.cpp | 6 +- BigBaseV2/src/hooking.hpp | 4 +- BigBaseV2/src/hooks/censor_chat.cpp | 11 -- BigBaseV2/src/hooks/read_session_response.cpp | 59 +++++++++ BigBaseV2/src/pointers.cpp | 31 ++++- BigBaseV2/src/pointers.hpp | 8 +- 15 files changed, 334 insertions(+), 100 deletions(-) create mode 100644 BigBaseV2/src/features/rid_joiner.cpp create mode 100644 BigBaseV2/src/features/rid_joiner.hpp delete mode 100644 BigBaseV2/src/hooks/censor_chat.cpp create mode 100644 BigBaseV2/src/hooks/read_session_response.cpp diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index 551d3bfa..f77cc1f5 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -12,8 +12,11 @@ namespace big update_player_structs(); update_screen_sizes(); + g_rid_joiner.look_for_session(); + disable_phone(); god_mode(); + join_message(); never_wanted(); no_bike_fall(); no_idle_kick(); diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index 216278c4..971ecbde 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -6,6 +6,7 @@ #include "structs/temp.hpp" #include "features/functions.hpp" #include "features/notify.hpp" +#include "features/rid_joiner.hpp" #include "features/stats.hpp" #include "features/teleport.hpp" @@ -31,7 +32,7 @@ namespace big void disable_phone(); void god_mode(); - void join_message(Player player); + void join_message(); void never_wanted(); void no_bike_fall(); void no_idle_kick(); diff --git a/BigBaseV2/src/features/looped/join_message.cpp b/BigBaseV2/src/features/looped/join_message.cpp index da4a2ef0..eec249dc 100644 --- a/BigBaseV2/src/features/looped/join_message.cpp +++ b/BigBaseV2/src/features/looped/join_message.cpp @@ -1,22 +1,28 @@ -#include "features.hpp" -#include "pointers.hpp" - -namespace big -{ - void features::join_message(Player player) - { - if (player == g_playerId) return; - - bool bJoinMessage = g_settings.options["join_message"].get(); - - if (bJoinMessage) - { - char joinMsg[64]; - strcpy(joinMsg, ""); - strcat(joinMsg, g_pointers->m_get_player_name(player)); - strcat(joinMsg, " is joining."); - - features::notify::above_map(joinMsg); - } - } +#include "features.hpp" +#include "pointers.hpp" + +namespace big +{ + void features::join_message() + { + bool bJoinMessage = g_settings.options["join_message"].get(); + + if (bJoinMessage) + { + for (uint8_t i = 0; i < 32; i++) + { + if (i == g_playerId) continue; + + if (ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i)) && !NETWORK::NETWORK_IS_PLAYER_CONNECTED(i)) + { + char joinMsg[64]; + strcpy(joinMsg, ""); + strcat(joinMsg, g_pointers->m_get_player_name(i)); + strcat(joinMsg, " is joining."); + + features::notify::above_map(joinMsg); + } + } + } + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/spectate_player.cpp b/BigBaseV2/src/features/looped/spectate_player.cpp index a4520661..11c57342 100644 --- a/BigBaseV2/src/features/looped/spectate_player.cpp +++ b/BigBaseV2/src/features/looped/spectate_player.cpp @@ -3,17 +3,25 @@ namespace big { + static bool bReset = true; void features::spectate_player() { if (g_selectedPlayerId == -1 || !g_selectedPlayer.is_online || !g_temp.spectate_player) { if (g_temp.spectate_player) g_temp.spectate_player = false; - g_pointers->m_spectate_player(false, -1); + if (!bReset) + { + bReset = true; + + g_pointers->m_spectate_player(false, -1); + } return; } g_pointers->m_spectate_player(true, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayerId)); + + bReset = false; } } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/super_sprint.cpp b/BigBaseV2/src/features/looped/super_sprint.cpp index 3d198766..7de248ab 100644 --- a/BigBaseV2/src/features/looped/super_sprint.cpp +++ b/BigBaseV2/src/features/looped/super_sprint.cpp @@ -1,55 +1,64 @@ -#include "features.hpp" - -namespace big -{ - static bool bLastSuperSprint = false; - static bool bSkyDiving = false; - - void features::super_sprint() - { - bool bSuperSprint = g_settings.options["super_sprint"].get(); - - if (bSuperSprint) - { - QUEUE_JOB_BEGIN_CLAUSE(= ) - { - Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); - Vector3 location = ENTITY::GET_ENTITY_COORDS(player, true); - float ground; - MISC::GET_GROUND_Z_FOR_3D_COORD(location.x, location.y, location.z, &ground, 0, 0); - - bool flying = location.z - ground > 3; - if (flying && !bSkyDiving) - { - TASK::TASK_SKY_DIVE(player, true); - - bSkyDiving = true; - } - else if (!flying && bSkyDiving) - bSkyDiving = false; - - if (TASK::IS_PED_SPRINTING(player) || flying) - { - Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 0.6, 0); - ENTITY::APPLY_FORCE_TO_ENTITY(player, 1, 0.0f, 1.3, bSkyDiving ? 1.f : 0.f, 0.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1); - - PLAYER::SET_PLAYER_SPRINT(g_playerId, 1); - PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.49); - } - else - { - PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); - } - }QUEUE_JOB_END_CLAUSE - } - else if (!bSuperSprint && bSuperSprint != bLastSuperSprint) - { - QUEUE_JOB_BEGIN_CLAUSE(= ) - { - PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); - }QUEUE_JOB_END_CLAUSE - } - - bLastSuperSprint = bSuperSprint; - } +#include "features.hpp" + +namespace big +{ + static bool bLastSuperSprint = false; + static bool bSkyDiving = false; + + void features::super_sprint() + { + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + + if (PED::IS_PED_IN_ANY_VEHICLE(player, true)) return; + + bool bSuperSprint = g_settings.options["super_sprint"].get(); + + if (bSuperSprint) + { + Vector3 vel = ENTITY::GET_ENTITY_VELOCITY(player); + + LOG(INFO) << vel.x << " " << vel.y << ", " << vel.z; + + ENTITY::SET_ENTITY_VELOCITY(player, vel.x * 2, vel.y * 2, vel.z); + } + /* + if (bSuperSprint) + { + float height = ENTITY::GET_ENTITY_HEIGHT_ABOVE_GROUND(player); + + bool flying = height > 5; + if (flying && !bSkyDiving) + { + TASK::TASK_SKY_DIVE(player, true); + + bSkyDiving = true; + } + else if (!flying && bSkyDiving) + { + bSkyDiving = false; + flying = false; + + TASK::TASK_SKY_DIVE(player, false); + } + + if (TASK::IS_PED_SPRINTING(player) || flying) + { + Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 0.6, 0); + ENTITY::APPLY_FORCE_TO_ENTITY(player, 1, 0.0f, 1.3, bSkyDiving ? 1.f : 0.f, 0.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1); + + PLAYER::SET_PLAYER_SPRINT(g_playerId, 1); + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.49); + } + else + { + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); + } + } + else if (!bSuperSprint && bSuperSprint != bLastSuperSprint) + { + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); + }*/ + + bLastSuperSprint = bSuperSprint; + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/rid_joiner.cpp b/BigBaseV2/src/features/rid_joiner.cpp new file mode 100644 index 00000000..8be2bc14 --- /dev/null +++ b/BigBaseV2/src/features/rid_joiner.cpp @@ -0,0 +1,54 @@ +#include "features/notify.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "rid_joiner.hpp" +#include "script.hpp" +#include "fiber_pool.hpp" + +namespace big +{ + void rid_joiner::look_for_session() + { + if (this->awaiting_request) + { + features::notify::above_map("WAITING FOR GAME COORDINATOR"); + + if (this->type == 2 && !this->gs_info.empty()) + { + handle_info(); + } + } + } + + void rid_joiner::handle_info() + { + this->awaiting_request = false; + + join_rstar_id_request request; + memset(&request, 0, sizeof(request)); + request.identifier.rockstar_id = g_pointers->m_rs_info->rockstar_id; + request.identifier.type = 3; + + features::notify::above_map("ATTEMPTING TO JOIN"); + + g_pointers->m_get_session_info_from_gs(&request.session_info, this->gs_info.c_str(), 0, 0); + g_pointers->m_join_player_via_session_info(&request.identifier, &request.session_info, 0xA000); + } + + void rid_joiner::join_player(uint64_t rid) + { + this->awaiting_request = true; + this->gs_info.clear(); + this->type = 2; + this->rid = rid; + + rockstar_identifier* identifier = new rockstar_identifier(); + identifier->rockstar_id = rid; + identifier->type = 3; + NETWORK::NETWORK_CLEAR_GET_GAMER_STATUS(); + + g_pointers->m_send_session_info_request(identifier, 1); + + features::notify::above_map("Sent join request to join R* Id."); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/rid_joiner.hpp b/BigBaseV2/src/features/rid_joiner.hpp new file mode 100644 index 00000000..3b3d210e --- /dev/null +++ b/BigBaseV2/src/features/rid_joiner.hpp @@ -0,0 +1,63 @@ +#pragma once +#include "common.hpp" + +namespace big +{ + class rid_joiner + { + public: + std::string gs_info; + uint64_t rid; + + void look_for_session(); + void handle_info(); + void join_player(uint64_t rid); + private: + bool awaiting_request = false; + int type = 0; + }; + + inline rid_joiner g_rid_joiner{}; + + struct rockstar_identifier { + uint64_t rockstar_id; + uint32_t type; + uint32_t sub_type; + }; + + struct gs_session { + char _0x0000[0x8]; + uint64_t PeerToken; + char _0x0010[0x38]; + uint64_t RockstarID; + }; + + struct net_msg_identifier { + uint64_t rockstar_id; + uint8_t type; + char _0x0009[0xB]; + }; + + struct rs_info { + char scs_ticket[0x100]; + char _0x0100[0x190]; + uint64_t peer; + char _0x0298[0xA7]; + char email[0x50]; + char _0x038f[0x20]; + char name[0x20]; + char _0x03cf[0x29]; + uint32_t rockstar_id; + }; + + struct network_handle { + int Handle; + char _0x0[48]; + }; + + struct join_rstar_id_request { + char _0x0000[0x8]; + gs_session session_info; + net_msg_identifier identifier; + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index 058efbdc..b4156db4 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -2,6 +2,7 @@ #include "common.hpp" #include "gta/fwddec.hpp" #include "gta/natives.hpp" +#include "features/rid_joiner.hpp" namespace big::functions { @@ -9,7 +10,6 @@ namespace big::functions using get_native_handler_t = rage::scrNativeHandler(*)(rage::scrNativeRegistrationTable*, rage::scrNativeHash); using fix_vectors_t = void(*)(rage::scrNativeCallContext*); - using censor_chat = int(int64_t chat_menu, const char* user_text, const char** output_text); using error_screen = void(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background); using increment_stat_event = bool(uint64_t net_event_struct, int64_t sender, int64_t a3); using get_event_data = bool(int32_t eventGroup, int32_t eventIndex, int64_t* args, uint32_t argCount); @@ -20,4 +20,10 @@ namespace big::functions using spectate_player = bool(bool toggle, Ped player); using sync_local_time = void(int h, int m); using trigger_script_event = int(bool unk0, int64_t* args, int argCount, int bitFlags); + + // R* Joiner + using get_session_info_from_gs = bool(gs_session* session, const char* gs, int a3, int a4); + using join_player_via_session_info = void(net_msg_identifier* identifier, gs_session* session_info, int flag); + using read_session_response = bool(uint64_t rcx); + using send_session_info_request = void(rockstar_identifier* target, int count); } diff --git a/BigBaseV2/src/gui/tab_bar/tab_misc.cpp b/BigBaseV2/src/gui/tab_bar/tab_misc.cpp index d7e35a3f..d14d0eec 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_misc.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_misc.cpp @@ -1,4 +1,5 @@ #include "tab_bar.hpp" +#include "features/rid_joiner.hpp" namespace big { @@ -6,6 +7,14 @@ namespace big { if (ImGui::BeginTabItem("Misc")) { + if (ImGui::Button("Join R* Id")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + g_rid_joiner.join_player(143069134); + }QUEUE_JOB_END_CLAUSE + } + ImGui::Text("Set Current Character Level:"); ImGui::SliderInt("##input_levels_self", &g_temp.set_level, 0, 8000); if (ImGui::Button("Set Level")) diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 6088b26f..4752d9b1 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -39,10 +39,10 @@ namespace big m_run_script_threads_hook("Script hook", g_pointers->m_run_script_threads, &hooks::run_script_threads), m_convert_thread_to_fiber_hook("ConvertThreadToFiber", memory::module("kernel32.dll").get_export("ConvertThreadToFiber").as(), &hooks::convert_thread_to_fiber), - m_censor_chat("Censor Chat", g_pointers->m_censor_chat, &hooks::censor_chat), m_get_event_data("Get Event Data", g_pointers->m_get_event_data, &hooks::get_event_data), m_error_screen_hook("Disable Warning/Error Screen", g_pointers->m_error_screen, &hooks::error_screen), m_increment_stat_hook("Increment Stat Event", g_pointers->m_increment_stat_event, &hooks::increment_stat_event), + m_read_session_response("Read Session Response", g_pointers->m_read_session_response, &hooks::read_session_response), m_script_event_hook("Script Event Handler", g_pointers->m_script_event_handler, &hooks::script_event_handler) { m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present); @@ -69,10 +69,10 @@ namespace big m_convert_thread_to_fiber_hook.enable(); // New hooks enable - m_censor_chat.enable(); m_get_event_data.enable(); m_error_screen_hook.enable(); m_increment_stat_hook.enable(); + m_read_session_response.enable(); m_script_event_hook.enable(); m_enabled = true; @@ -90,10 +90,10 @@ namespace big m_swapchain_hook.disable(); // New hooks disable - m_censor_chat.disable(); m_get_event_data.disable(); m_error_screen_hook.disable(); m_increment_stat_hook.disable(); + m_read_session_response.disable(); m_script_event_hook.disable(); } diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index 93e26eb3..e3cefc07 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -22,10 +22,10 @@ namespace big static BOOL set_cursor_pos(int x, int y); // New Hook Definitions - static int censor_chat(int64_t chat_menu, const char* user_text, const char** output_text); static bool get_event_data(int32_t eventGroup, int32_t eventIndex, int64_t* args, uint32_t argCount); static void error_screen(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background); static bool increment_stat_event(uint64_t net_event_struct, int64_t sender, int64_t a3); + static bool read_session_response(uint64_t rcx); static bool script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer); }; @@ -57,10 +57,10 @@ namespace big detour_hook m_convert_thread_to_fiber_hook; // New Detour Hook Definitions - detour_hook m_censor_chat; detour_hook m_get_event_data; detour_hook m_error_screen_hook; detour_hook m_increment_stat_hook; + detour_hook m_read_session_response; detour_hook m_script_event_hook; }; diff --git a/BigBaseV2/src/hooks/censor_chat.cpp b/BigBaseV2/src/hooks/censor_chat.cpp deleted file mode 100644 index 4b0c1cec..00000000 --- a/BigBaseV2/src/hooks/censor_chat.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "hooking.hpp" - -namespace big -{ - int hooks::censor_chat(int64_t chat_menu, const char* user_text, const char** output_text) - { - if (g_settings.options["disable_chat_censoring"].get()) return -1; - - return g_hooking->m_censor_chat.get_original()(chat_menu, user_text, output_text); - } -} \ No newline at end of file diff --git a/BigBaseV2/src/hooks/read_session_response.cpp b/BigBaseV2/src/hooks/read_session_response.cpp new file mode 100644 index 00000000..9d5c0ec5 --- /dev/null +++ b/BigBaseV2/src/hooks/read_session_response.cpp @@ -0,0 +1,59 @@ +#include "hooking.hpp" +#include "features.hpp" + +namespace big +{ + bool hooks::read_session_response(uint64_t rcx) + { + bool bReturn = true; + + if (rcx && *(uint32_t*)(rcx + 0x23C4)) { + uint32_t i = 0; + do { + uint64_t address = rcx + 0x22C0 + (i * 8); + if (*(uint64_t*)(address)) { + const char* responseData = *(const char**)(address); + if (responseData) { + try { + nlohmann::json Json = nlohmann::json::parse(responseData); + if (Json.find("gsinfo") == Json.end()) { + return false; + } + + uint64_t rockstar_id = std::stoul(Json["_id"].get().substr(3)); + std::string gs_info_json = Json["gsinfo"].get(); + + features::notify::above_map("HOOK GOT DRIP."); + + LOG(INFO) << "Rockstar ID: " << rockstar_id; + LOG(INFO) << "Data: "; + LOG(INFO) << gs_info_json; + LOG(INFO) << rockstar_id << " == " << g_rid_joiner.rid; + + if (rockstar_id == g_rid_joiner.rid) { + if (gs_info_json.empty()) + { + // PendingTimeout = 0; + } + else + { + g_rid_joiner.gs_info = gs_info_json; + } + + bReturn = false; + } + } + catch (...) { + return false; + } + } + } + + i++; + } while (i < *(uint32_t*)(rcx + 0x23C4)); + } + + if (!bReturn) return false; + return g_hooking->m_read_session_response.get_original()(rcx); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index f0ccf0cb..bb779d94 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -113,11 +113,6 @@ namespace big m_spectate_player = ptr.as(); }); - main_batch.add("Censor Chat", "E8 ? ? ? ? 83 F8 FF 75 B9", [this](memory::handle ptr) - { - m_censor_chat = ptr.as(); - }); - main_batch.add("Get Net player", "48 83 EC 28 33 C0 38 05 ? ? ? ? 74 0A", [this](memory::handle ptr) { m_get_net_game_player = ptr.as(); @@ -127,6 +122,32 @@ namespace big { m_get_event_data = ptr.sub(28).as(); }); + + // R* Id + main_batch.add("Send Session Info Request", "48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 56 48 83 EC 30 48 83 3D ? ? ? ? ? 8B", [this](memory::handle ptr) + { + m_send_session_info_request = ptr.as(); + }); + + main_batch.add("Join Player Via Session Info", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 81 EC ? ? ? ? 4C 8B F9 B1 01 49 8B F1 49 8B E8 44 8B F2 E8", [this](memory::handle ptr) + { + m_join_player_via_session_info = ptr.as(); + }); + + main_batch.add("Rockstar Info", "48 8D 05 ? ? ? ? 4D 69 C0 ? ? ? ? 4C 03 C0 41 83 B8 ? ? ? ? ? 0F 86 ? ? ? ? 83 CD FF 48 8D 15", [this](memory::handle ptr) + { + m_rs_info = ptr.as(); + }); + + main_batch.add("Get Session Info From GS", "48 8B C4 48 89 58 08 48 89 68 10 56 57 41 56 48 81 EC ? ? ? ? 48 8B F2 33 D2 49 8B F8 4C 8B F1 44 8D 42", [this](memory::handle ptr) + { + m_get_session_info_from_gs = ptr.as(); + }); + + main_batch.add("Read Session Response Hook", "48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 55 41 54 41 56 48 8D 68 D8 48 81 EC ? ? ? ? 45 33 F6 48 8B F9 45", [this](memory::handle ptr) + { + m_read_session_response = ptr.as(); + }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 1c79e87e..3464c1f6 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -3,6 +3,7 @@ #include "gta/fwddec.hpp" #include "gta/enums.hpp" #include "function_types.hpp" +#include "features/rid_joiner.hpp" namespace big { @@ -35,7 +36,6 @@ namespace big PVOID m_model_spawn_bypass; - functions::censor_chat* m_censor_chat{}; functions::error_screen* m_error_screen{}; functions::get_event_data* m_get_event_data{}; functions::get_player_name* m_get_player_name{}; @@ -46,6 +46,12 @@ namespace big functions::spectate_player* m_spectate_player{}; functions::sync_local_time* m_sync_local_time{}; functions::trigger_script_event* m_trigger_script_event{}; + + rs_info *m_rs_info{}; + functions::get_session_info_from_gs* m_get_session_info_from_gs{}; + functions::join_player_via_session_info* m_join_player_via_session_info{}; + functions::read_session_response* m_read_session_response{}; + functions::send_session_info_request* m_send_session_info_request{}; }; inline pointers *g_pointers{}; From d0c3063148d86f910c65c24b8e4359c46d8b69f1 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 15:31:43 +0100 Subject: [PATCH 02/31] refactor(JoinMessage): Removed old join message feature --- .../src/features/looped/join_message.cpp | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 BigBaseV2/src/features/looped/join_message.cpp diff --git a/BigBaseV2/src/features/looped/join_message.cpp b/BigBaseV2/src/features/looped/join_message.cpp deleted file mode 100644 index eec249dc..00000000 --- a/BigBaseV2/src/features/looped/join_message.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "features.hpp" -#include "pointers.hpp" - -namespace big -{ - void features::join_message() - { - bool bJoinMessage = g_settings.options["join_message"].get(); - - if (bJoinMessage) - { - for (uint8_t i = 0; i < 32; i++) - { - if (i == g_playerId) continue; - - if (ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i)) && !NETWORK::NETWORK_IS_PLAYER_CONNECTED(i)) - { - char joinMsg[64]; - strcpy(joinMsg, ""); - strcat(joinMsg, g_pointers->m_get_player_name(i)); - strcat(joinMsg, " is joining."); - - features::notify::above_map(joinMsg); - } - } - } - } -} \ No newline at end of file From f9c3e718aefb40288a1bc4253c1bd86145a96eed Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 15:33:52 +0100 Subject: [PATCH 03/31] feat(NoClip): Added velocity based noclipping --- BigBaseV2/src/features.cpp | 3 +- BigBaseV2/src/features.hpp | 3 +- BigBaseV2/src/features/looped/noclip.cpp | 63 ++++++++++++++++++++++++ BigBaseV2/src/gui/tab_bar/tab_self.cpp | 15 ++++++ BigBaseV2/src/settings.h | 6 +++ 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 BigBaseV2/src/features/looped/noclip.cpp diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index f77cc1f5..aa35bf02 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -16,8 +16,9 @@ namespace big disable_phone(); god_mode(); - join_message(); + gravity_gun(); never_wanted(); + noclip(); no_bike_fall(); no_idle_kick(); no_ragdoll(); diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index 971ecbde..fc5e3a0f 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -32,8 +32,9 @@ namespace big void disable_phone(); void god_mode(); - void join_message(); + void gravity_gun(); void never_wanted(); + void noclip(); void no_bike_fall(); void no_idle_kick(); void no_ragdoll(); diff --git a/BigBaseV2/src/features/looped/noclip.cpp b/BigBaseV2/src/features/looped/noclip.cpp new file mode 100644 index 00000000..7bf00e39 --- /dev/null +++ b/BigBaseV2/src/features/looped/noclip.cpp @@ -0,0 +1,63 @@ +#include "features.hpp" + +namespace big +{ + static const int controls[] = { 21, 32, 33, 34, 35, 36 }; + static const float speed = 20.f; + static const float headingSpeed = 3.f; + + void features::noclip() + { + bool bNoclip = g_settings.options["noclip"]["enabled"]; + float fHorizontal = g_settings.options["noclip"]["horizontal"]; + float fVertical = g_settings.options["noclip"]["vertical"]; + + Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + bool inVehicle = PED::IS_PED_IN_ANY_VEHICLE(ent, true); + if (inVehicle) ent = PED::GET_VEHICLE_PED_IS_IN(ent, false); + + if (bNoclip) + { + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + Vector3 cur_pos = ENTITY::GET_ENTITY_COORDS(ent, true); + Vector3 vel = { 0.f, 0.f, 0.07f }; + float heading = 0.f; + + // Left Shift + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 21)) + vel.z += speed; + // Left Control + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 36)) + vel.z -= speed; + // Forward + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 32)) + vel.y += speed; + // Backward + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 33)) + vel.y -= speed; + // Left + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 34)) + { + if (inVehicle) heading += headingSpeed; + vel.x -= speed; + } + // Right + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 35)) + { + if (inVehicle) heading -= headingSpeed; + vel.x += speed; + } + + Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f); + vel.x = offset.x - cur_pos.x; + vel.y = offset.y - cur_pos.y; + + ENTITY::SET_ENTITY_ROTATION(ent, 0.f, 0.f, ENTITY::GET_ENTITY_HEADING(ent) + heading, 0, true); + + ENTITY::SET_ENTITY_VELOCITY(ent, vel.x * fHorizontal, vel.y * fHorizontal, vel.z * fVertical); + } + ENTITY::SET_ENTITY_COLLISION(ent, !bNoclip, !bNoclip); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/gui/tab_bar/tab_self.cpp b/BigBaseV2/src/gui/tab_bar/tab_self.cpp index 1f539328..6e46becb 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_self.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_self.cpp @@ -27,6 +27,21 @@ namespace big ImGui::Separator(); + if (ImGui::TreeNode("No Clip")) + { + if (ImGui::Checkbox("No Clip", g_settings.options["noclip"]["enabled"].get())) + g_settings.save(); + + const double min = 0.0, max = 10.0; + if (ImGui::SliderScalar("Horizontal Multiplier", ImGuiDataType_Double, g_settings.options["noclip"]["horizontal"].get(), &min, &max)) + g_settings.save(); + if (ImGui::SliderScalar("Vertical Multiplier", ImGuiDataType_Double, g_settings.options["noclip"]["vertical"].get(), &min, &max)) + g_settings.save(); + + ImGui::TreePop(); + } + ImGui::Separator(); + if (ImGui::Checkbox("God Mode", g_settings.options["god_mode"].get()) || ImGui::Checkbox("No Ragdoll", g_settings.options["ragdoll"].get())) g_settings.save(); diff --git a/BigBaseV2/src/settings.h b/BigBaseV2/src/settings.h index 3b0ca6c7..43e46fff 100644 --- a/BigBaseV2/src/settings.h +++ b/BigBaseV2/src/settings.h @@ -16,8 +16,14 @@ namespace big "disable_phone": false, "disable_chat_censoring": false, "god_mode": false, + "gravity_gun": true, "join_message": false, "never_wanted": false, + "noclip": { + "enabled": false, + "horizontal": 5.0, + "vertical": 1.0 + }, "no_bike_fall": false, "no_idle_kick": false, "off_radar": false, From 79a59603b5b4a59e47adf6c3ee51269c74e4f346 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 15:35:21 +0100 Subject: [PATCH 04/31] feat(ScriptEventHandler): Improved logging and added join msg --- BigBaseV2/src/gta/enums.hpp | 11 ++++++++ BigBaseV2/src/hooks/script_event_handler.cpp | 28 +++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/BigBaseV2/src/gta/enums.hpp b/BigBaseV2/src/gta/enums.hpp index c0c51477..4d9acc92 100644 --- a/BigBaseV2/src/gta/enums.hpp +++ b/BigBaseV2/src/gta/enums.hpp @@ -1687,6 +1687,17 @@ enum PedBones : std::uint32_t FB_Tongue_001 = 0xB987 }; +enum FreemodePlayerEvents : int64_t +{ + PlayerJoined = 1120313136, //args 2 JOINED = 1289518925 + PlayerPaused = 2383153667, + PlayerUnpaused = 3717680613, + ChatOpened = 2965958374, + ChatClosed = 1841943281, + LsCustomsEntered = 2098987581, + LsCustomsExit = 465570678, +}; + enum RemoteEvents : int64_t { Bounty = -116602735, diff --git a/BigBaseV2/src/hooks/script_event_handler.cpp b/BigBaseV2/src/hooks/script_event_handler.cpp index 68b7f548..0d004ecb 100644 --- a/BigBaseV2/src/hooks/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/script_event_handler.cpp @@ -1,17 +1,39 @@ #include "hooking.hpp" +#include "features.hpp" +#include "pointers.hpp" #include "natives.hpp" +#include "gta/enums.hpp" namespace big { bool hooks::script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer) { auto args = reinterpret_cast(NetEventStruct + 0x70); - Player SenderID = *reinterpret_cast(CNetGamePlayer + 0x2D); + Player player = *reinterpret_cast(CNetGamePlayer + 0x2D); - const auto ScriptEventHash = args[0]; + int64_t hash = args[0]; + + switch (hash) + { + case FreemodePlayerEvents::PlayerJoined: + if (g_settings.options["join_message"].get() && args[2] == 1289518925) + { + char join_msg[128]; + sprintf(join_msg, "%s is joining...", g_pointers->m_get_player_name((Player)args[1])); + + features::notify::above_map(join_msg); + } + } if (g_settings.options["settings"]["logging"]["script_events"]) - LOG(INFO) << "Received Script Event " << ScriptEventHash << " from Player " << PLAYER::GET_PLAYER_NAME(SenderID); + { + LOG(INFO) << "Received Script Event"; + LOG(INFO) << "Player: " << PLAYER::GET_PLAYER_NAME(player); + LOG(INFO) << "Hash: " << hash; + + for (int i = 1; i < sizeof(args); i++) + LOG(INFO) << "Arg #" << i << ": " << args[i]; + } return g_hooking->m_script_event_hook.get_original()(NetEventStruct, CNetGamePlayer); } From c4b6e7698de33d366f7406d3b948750caf1a7b25 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 15:35:46 +0100 Subject: [PATCH 05/31] fix(TabSpawn): Input enter returns true & improved code --- BigBaseV2/src/gui/tab_bar/tab_spawn.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp b/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp index 28974d36..b18940fa 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp @@ -9,9 +9,10 @@ namespace big { if (ImGui::BeginTabItem("Spawn")) { - ImGui::InputText("Model Name", model, sizeof(model)); - - if (ImGui::Button("Spawn")) + if ( + ImGui::InputText("Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue) || + ImGui::Button("Spawn") + ) { QUEUE_JOB_BEGIN_CLAUSE(= ) { @@ -19,17 +20,13 @@ namespace big if (hash) { - int tries = 0; - const int max = 100; - while (!STREAMING::HAS_MODEL_LOADED(hash) && tries < max) + for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) { STREAMING::REQUEST_MODEL(hash); - tries++; - script::get_current()->yield(); } - if (tries >= max) + if (!STREAMING::HAS_MODEL_LOADED(hash)) { features::notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); From d00094de96c46dbbfb96835c415ecf702cc12837 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 15:36:13 +0100 Subject: [PATCH 06/31] feat(GravityGun): Added velocity based gravity gun --- BigBaseV2/src/features/functions.cpp | 63 +++++++ BigBaseV2/src/features/functions.hpp | 7 + BigBaseV2/src/features/looped/gravity_gun.cpp | 172 ++++++++++++++++++ BigBaseV2/src/gta/vector.hpp | 36 ++++ 4 files changed, 278 insertions(+) create mode 100644 BigBaseV2/src/features/looped/gravity_gun.cpp diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index 1a7eb122..daa89b56 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -120,4 +120,67 @@ namespace big::features::functions g_settings.save(); } + + bool take_control_of_entity(Entity ent) + { + for (uint8_t i = 0; !NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent) && i < 3; i++) + { + NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ent); + + script::get_current()->yield(); + } + if (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return false; + + int netHandle = NETWORK::NETWORK_GET_NETWORK_ID_FROM_ENTITY(ent); + NETWORK::SET_NETWORK_ID_CAN_MIGRATE(netHandle, true); + + return true; + } + + BOOL raycast_entity(Entity* ent) + { + BOOL hit; + Vector3 endCoords; + Vector3 surfaceNormal; + + Vector3 camCoords = CAM::GET_GAMEPLAY_CAM_COORD(); + Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2); + Vector3 dir = rotation_to_direction(rot); + Vector3 farCoords; + + farCoords.x = camCoords.x + dir.x * 1000; + farCoords.y = camCoords.y + dir.y * 1000; + farCoords.z = camCoords.z + dir.z * 1000; + + int ray = SHAPETEST::_START_SHAPE_TEST_RAY(camCoords.x, camCoords.y, camCoords.z, farCoords.x, farCoords.y, farCoords.z, -1, 0, 7); + SHAPETEST::GET_SHAPE_TEST_RESULT(ray, &hit, &endCoords, &surfaceNormal, ent); + + return hit; + } + + float deg_to_rad(float deg) + { + double radian = (3.14159265359 / 180) * deg; + return (float)radian; + } + + Vector3 rotation_to_direction(Vector3 rotation) + { + float x = deg_to_rad(rotation.x); + float z = deg_to_rad(rotation.z); + + float num = abs(cos(x)); + + return Vector3 + { + -sin(z) * num, + cos(z) * num, + sin(x) + }; + } + + double distance_between_vectors(Vector3 a, Vector3 b) + { + return sqrt(pow((a.x - b.x), 2) + pow((a.y - b.y), 2) + pow((a.z - b.z), 2)); + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp index 3c34a8ba..67aaf485 100644 --- a/BigBaseV2/src/features/functions.hpp +++ b/BigBaseV2/src/features/functions.hpp @@ -12,4 +12,11 @@ namespace big::features::functions void set_player_level(int level); void spoof_rank(int rank); void toggle_protections(bool toggle); + + bool take_control_of_entity(Entity ent); + + BOOL raycast_entity(Entity* ent); + float deg_to_rad(float deg); + Vector3 rotation_to_direction(Vector3 rotation); + double distance_between_vectors(Vector3 a, Vector3 b); } \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/gravity_gun.cpp b/BigBaseV2/src/features/looped/gravity_gun.cpp new file mode 100644 index 00000000..8aac047a --- /dev/null +++ b/BigBaseV2/src/features/looped/gravity_gun.cpp @@ -0,0 +1,172 @@ +#include "features.hpp" + +namespace big +{ + static Entity entity = -1; + static Vector3 location; + static Vector3 other; + static double dist; + + static const float multiplier = 3; + static const int scroll = 2; + static const int controls[] = { 14, 15, 24 }; + + void features::gravity_gun() + { + bool bGravityGun = g_settings.options["gravity_gun"]; + + if (bGravityGun) + { + // ZOOMED IN + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) + { + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true); + + // Attack RELEASED + if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) + { + if (functions::raycast_entity(&entity)) + { + other = ENTITY::GET_ENTITY_COORDS(entity, true); + dist = functions::distance_between_vectors(location, other); + + if (dist > 50) + { + entity = -1; + + notify::above_map("Entity is too far."); + } + else + { + functions::take_control_of_entity(entity); + + features::notify::above_map("Selected entity at crosshair."); + } + } + else + { + entity = -1; + + features::notify::above_map("No entity found."); + } + } + + if (ENTITY::DOES_ENTITY_EXIST(entity)) + { + // Scroll Away + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 14)) + dist -= 5; + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 15)) + dist += 5; + + functions::take_control_of_entity(entity); + + ENTITY::SET_ENTITY_COLLISION(entity, false, false); + + other = ENTITY::GET_ENTITY_COORDS(entity, true); + + Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2); + float pitch = functions::deg_to_rad(rot.x - 0); // vertical + // float roll = rot.y; + float yaw = functions::deg_to_rad(rot.z + 90); // horizontal + + Vector3 zRot; + + zRot.x = location.x + (dist * cos(pitch) * cos(yaw)); + zRot.y = location.y + (dist * sin(yaw) * cos(pitch)); + zRot.z = location.z + (dist * sin(pitch)); + + ENTITY::SET_ENTITY_VELOCITY(entity, (zRot.x - other.x) * multiplier, (zRot.y - other.y) * multiplier, (zRot.z - other.z) * multiplier); + } + } + else if (entity != -1) + { + ENTITY::SET_ENTITY_COLLISION(entity, true, true); + + entity = -1; + + features::notify::above_map("Released entity."); + } + } + } + + float deg_to_rad(float deg) + { + double radian = (3.14159265359 / 180) * deg; + return (float)radian; + } + + Vector3 rotation_to_direction(Vector3 rotation) + { + float x = deg_to_rad(rotation.x); + float z = deg_to_rad(rotation.z); + + float num = abs(cos(x)); + + return Vector3 + { + -sin(z) * num, + cos(z) * num, + sin(x) + }; + } + + Vector3 screen_to_world(Vector3 position, Vector3 rotation, float mouseX, float mouseY, Vector3 &out) + { + Vector3 direction = rotation_to_direction(rotation); + + Vector3 rotUp = rotation; + Vector3 rotDown = rotation; + Vector3 rotLeft = rotation; + Vector3 rotRight = rotation; + + rotUp.x += 1; + rotDown.x -= 1; + rotLeft.z -= 1; + rotRight.z += 1; + + Vector3 camRight = rotation_to_direction(rotRight) - rotation_to_direction(rotLeft); + Vector3 camUp = rotation_to_direction(rotUp) - rotation_to_direction(rotDown); + + float rollRad = -deg_to_rad(rotation.y); + + Vector3 camRightRoll = camRight * cos(rollRad) - camUp * sin(rollRad); + Vector3 camUpRoll = camRight * sin(rollRad) + camUp * cos(rollRad); + + Vector3 point3d = position + direction * 1.f + camRightRoll + camUpRoll; + float x, y; + if (!GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD(point3d.x, point3d.y, point3d.z, &x, &y)) + { + out = direction; + + return position + direction * 1.f; + } + + Vector3 point3d_zero = position + direction * 1.f; + float x_zero, y_zero; + if (!GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD(point3d_zero.x, point3d_zero.y, point3d_zero.z, &x_zero, &y_zero)) + { + out = direction; + + return position + direction * 1.f; + } + + const double eps = .001; + if (abs(x - x_zero) < eps || abs(y - y_zero) < eps) + { + out = direction; + + return position + direction * 1.f; + } + + float scaleX = (mouseX - x_zero) / (x - x_zero); + float scaleY = (mouseY - y_zero) / (y - y_zero); + + Vector3 point3d_ret = position + direction * 1.f + camRightRoll * scaleX + camUpRoll * scaleY; + out = direction + camRightRoll * scaleX + camUpRoll * scaleY; + return point3d_ret; + } +} \ No newline at end of file diff --git a/BigBaseV2/src/gta/vector.hpp b/BigBaseV2/src/gta/vector.hpp index 9ec39766..523f7495 100644 --- a/BigBaseV2/src/gta/vector.hpp +++ b/BigBaseV2/src/gta/vector.hpp @@ -32,6 +32,42 @@ namespace rage scrVector(float x, float y, float z) : x(x), y(y), z(z) {} + + scrVector operator+(const scrVector& other) + { + scrVector vec; + vec.x = this->x + other.x; + vec.y = this->y + other.y; + vec.z = this->z + other.z; + return vec; + } + + scrVector operator-(const scrVector& other) + { + scrVector vec; + vec.x = this->x - other.x; + vec.y = this->y - other.y; + vec.z = this->z - other.z; + return vec; + } + + scrVector operator*(const scrVector& other) + { + scrVector vec; + vec.x = this->x * other.x; + vec.y = this->y * other.y; + vec.z = this->z * other.z; + return vec; + } + + scrVector operator*(const float& other) + { + scrVector vec; + vec.x = this->x * other; + vec.y = this->y * other; + vec.z = this->z * other; + return vec; + } public: float x{}; private: From c84c5ae428e46ab8ad4fd93dc3cb195318bbb5b1 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 16:54:49 +0100 Subject: [PATCH 07/31] refactor(TakeControlOfEnt): Return true if has control --- BigBaseV2/src/features/functions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index daa89b56..26531bd2 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -123,7 +123,8 @@ namespace big::features::functions bool take_control_of_entity(Entity ent) { - for (uint8_t i = 0; !NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent) && i < 3; i++) + if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return true; + for (uint8_t i = 0; !NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent) && i < 5; i++) { NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ent); From 9213324e9dddd22d87d47cf55b662bf0df1eb0b9 Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 13 Jan 2021 16:55:49 +0100 Subject: [PATCH 08/31] feat(GUI): Added Weapons tab --- BigBaseV2/src/features/looped/gravity_gun.cpp | 90 +++---------------- BigBaseV2/src/gui/main_window.cpp | 1 + BigBaseV2/src/gui/tab_bar/tab_bar.hpp | 1 + BigBaseV2/src/gui/tab_bar/tab_weapons.cpp | 25 ++++++ BigBaseV2/src/settings.h | 5 +- 5 files changed, 42 insertions(+), 80 deletions(-) create mode 100644 BigBaseV2/src/gui/tab_bar/tab_weapons.cpp diff --git a/BigBaseV2/src/features/looped/gravity_gun.cpp b/BigBaseV2/src/features/looped/gravity_gun.cpp index 8aac047a..fce57066 100644 --- a/BigBaseV2/src/features/looped/gravity_gun.cpp +++ b/BigBaseV2/src/features/looped/gravity_gun.cpp @@ -7,26 +7,30 @@ namespace big static Vector3 other; static double dist; - static const float multiplier = 3; static const int scroll = 2; static const int controls[] = { 14, 15, 24 }; void features::gravity_gun() { - bool bGravityGun = g_settings.options["gravity_gun"]; + bool bGravityGun = g_settings.options["gravity_gun"]["enabled"]; + double multiplier = g_settings.options["gravity_gun"]["multiplier"]; - if (bGravityGun) + Hash currWeapon; + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); + + if (bGravityGun && currWeapon == RAGE_JOAAT("weapon_pistol")) { // ZOOMED IN if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { + PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true); // Attack RELEASED - if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) + if (PAD::IS_DISABLED_CONTROL_JUST_PRESSED(0, 24)) { if (functions::raycast_entity(&entity)) { @@ -35,7 +39,7 @@ namespace big if (dist > 50) { - entity = -1; + entity = 0; notify::above_map("Entity is too far."); } @@ -48,7 +52,7 @@ namespace big } else { - entity = -1; + entity = 0; features::notify::above_map("No entity found."); } @@ -56,7 +60,6 @@ namespace big if (ENTITY::DOES_ENTITY_EXIST(entity)) { - // Scroll Away if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 14)) dist -= 5; if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 15)) @@ -69,7 +72,7 @@ namespace big other = ENTITY::GET_ENTITY_COORDS(entity, true); Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(2); - float pitch = functions::deg_to_rad(rot.x - 0); // vertical + float pitch = functions::deg_to_rad(rot.x); // vertical // float roll = rot.y; float yaw = functions::deg_to_rad(rot.z + 90); // horizontal @@ -98,75 +101,4 @@ namespace big double radian = (3.14159265359 / 180) * deg; return (float)radian; } - - Vector3 rotation_to_direction(Vector3 rotation) - { - float x = deg_to_rad(rotation.x); - float z = deg_to_rad(rotation.z); - - float num = abs(cos(x)); - - return Vector3 - { - -sin(z) * num, - cos(z) * num, - sin(x) - }; - } - - Vector3 screen_to_world(Vector3 position, Vector3 rotation, float mouseX, float mouseY, Vector3 &out) - { - Vector3 direction = rotation_to_direction(rotation); - - Vector3 rotUp = rotation; - Vector3 rotDown = rotation; - Vector3 rotLeft = rotation; - Vector3 rotRight = rotation; - - rotUp.x += 1; - rotDown.x -= 1; - rotLeft.z -= 1; - rotRight.z += 1; - - Vector3 camRight = rotation_to_direction(rotRight) - rotation_to_direction(rotLeft); - Vector3 camUp = rotation_to_direction(rotUp) - rotation_to_direction(rotDown); - - float rollRad = -deg_to_rad(rotation.y); - - Vector3 camRightRoll = camRight * cos(rollRad) - camUp * sin(rollRad); - Vector3 camUpRoll = camRight * sin(rollRad) + camUp * cos(rollRad); - - Vector3 point3d = position + direction * 1.f + camRightRoll + camUpRoll; - float x, y; - if (!GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD(point3d.x, point3d.y, point3d.z, &x, &y)) - { - out = direction; - - return position + direction * 1.f; - } - - Vector3 point3d_zero = position + direction * 1.f; - float x_zero, y_zero; - if (!GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD(point3d_zero.x, point3d_zero.y, point3d_zero.z, &x_zero, &y_zero)) - { - out = direction; - - return position + direction * 1.f; - } - - const double eps = .001; - if (abs(x - x_zero) < eps || abs(y - y_zero) < eps) - { - out = direction; - - return position + direction * 1.f; - } - - float scaleX = (mouseX - x_zero) / (x - x_zero); - float scaleY = (mouseY - y_zero) / (y - y_zero); - - Vector3 point3d_ret = position + direction * 1.f + camRightRoll * scaleX + camUpRoll * scaleY; - out = direction + camRightRoll * scaleX + camUpRoll * scaleY; - return point3d_ret; - } } \ No newline at end of file diff --git a/BigBaseV2/src/gui/main_window.cpp b/BigBaseV2/src/gui/main_window.cpp index 1b32eb9c..06f86a4f 100644 --- a/BigBaseV2/src/gui/main_window.cpp +++ b/BigBaseV2/src/gui/main_window.cpp @@ -11,6 +11,7 @@ namespace big { ImGui::BeginTabBar("tabbar"); tabbar::render_self(); + tabbar::render_weapons(); tabbar::render_tunables(); tabbar::render_teleport(); tabbar::render_vehicle(); diff --git a/BigBaseV2/src/gui/tab_bar/tab_bar.hpp b/BigBaseV2/src/gui/tab_bar/tab_bar.hpp index 998f1d56..c23a733a 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_bar.hpp +++ b/BigBaseV2/src/gui/tab_bar/tab_bar.hpp @@ -14,6 +14,7 @@ namespace big public: // Order in the order that they are rendered/sorted in the UI static void render_self(); + static void render_weapons(); static void render_tunables(); static void render_teleport(); static void render_vehicle(); diff --git a/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp b/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp new file mode 100644 index 00000000..a156a21b --- /dev/null +++ b/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp @@ -0,0 +1,25 @@ +#include "tab_bar.hpp" + +namespace big +{ + static const double min = 1, max = 5; + + void tabbar::render_weapons() + { + if (ImGui::BeginTabItem("Weapons")) + { + if (ImGui::TreeNode("Gravity Gun")) + { + if (ImGui::Checkbox("Gravity Gun", g_settings.options["gravity_gun"]["enabled"].get())) + g_settings.save(); + + if (ImGui::SliderScalar("Multiplier", ImGuiDataType_Double, g_settings.options["gravity_gun"]["multiplier"].get(), &min, &max)) + g_settings.save(); + + ImGui::TreePop(); + } + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/settings.h b/BigBaseV2/src/settings.h index 43e46fff..90c3d50d 100644 --- a/BigBaseV2/src/settings.h +++ b/BigBaseV2/src/settings.h @@ -16,7 +16,10 @@ namespace big "disable_phone": false, "disable_chat_censoring": false, "god_mode": false, - "gravity_gun": true, + "gravity_gun": { + "enabled": false, + "multiplier": 3.0 + }, "join_message": false, "never_wanted": false, "noclip": { From e2b49fd59fe11e4ba1294d4d2f821e16ee33b697 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 21:32:24 +0100 Subject: [PATCH 09/31] feat(Functions): Added spawn vehicle func --- BigBaseV2/src/features/functions.cpp | 43 ++++++++++++++++++++++++++++ BigBaseV2/src/features/functions.hpp | 2 ++ 2 files changed, 45 insertions(+) diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index 26531bd2..25df2dd0 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -184,4 +184,47 @@ namespace big::features::functions { return sqrt(pow((a.x - b.x), 2) + pow((a.y - b.y), 2) + pow((a.z - b.z), 2)); } + + Entity spawn_vehicle(const char* model, Vector3 location, float heading) + { + Hash hash = MISC::GET_HASH_KEY(model); + + if (hash) + { + for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) + { + STREAMING::REQUEST_MODEL(hash); + + script::get_current()->yield(); + } + if (!STREAMING::HAS_MODEL_LOADED(hash)) + { + notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); + + return -1; + } + + *(unsigned short*)g_pointers->m_model_spawn_bypass = 0x9090; + Vehicle veh = VEHICLE::CREATE_VEHICLE(hash, location.x, location.y, location.z, heading, true, false, false); + *(unsigned short*)g_pointers->m_model_spawn_bypass = 0x0574; + + script::get_current()->yield(); + + STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash); + + if (*g_pointers->m_is_session_started) + { + DECORATOR::DECOR_SET_INT(veh, "MPBitset", 0); + ENTITY::_SET_ENTITY_SOMETHING(veh, true); + int networkId = NETWORK::VEH_TO_NET(veh); + if (NETWORK::NETWORK_GET_ENTITY_IS_NETWORKED(veh)) + NETWORK::SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES(networkId, true); + VEHICLE::SET_VEHICLE_IS_STOLEN(veh, false); + } + + return veh; + } + + return -1; + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp index 67aaf485..cc54250f 100644 --- a/BigBaseV2/src/features/functions.hpp +++ b/BigBaseV2/src/features/functions.hpp @@ -13,6 +13,8 @@ namespace big::features::functions void spoof_rank(int rank); void toggle_protections(bool toggle); + Entity spawn_vehicle(const char* model, Vector3 location, float heading); + bool take_control_of_entity(Entity ent); BOOL raycast_entity(Entity* ent); From 4c0a94276acb2f8140063e8c986bb37f1f3a86d6 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 21:36:06 +0100 Subject: [PATCH 10/31] refactor(RIDJoiner): Cleaned up some old broken code --- BigBaseV2/src/function_types.hpp | 7 ------- BigBaseV2/src/hooking.cpp | 3 --- BigBaseV2/src/hooking.hpp | 2 -- BigBaseV2/src/pointers.cpp | 26 -------------------------- BigBaseV2/src/pointers.hpp | 7 ------- 5 files changed, 45 deletions(-) diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index b4156db4..bfc7c5d9 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -2,7 +2,6 @@ #include "common.hpp" #include "gta/fwddec.hpp" #include "gta/natives.hpp" -#include "features/rid_joiner.hpp" namespace big::functions { @@ -20,10 +19,4 @@ namespace big::functions using spectate_player = bool(bool toggle, Ped player); using sync_local_time = void(int h, int m); using trigger_script_event = int(bool unk0, int64_t* args, int argCount, int bitFlags); - - // R* Joiner - using get_session_info_from_gs = bool(gs_session* session, const char* gs, int a3, int a4); - using join_player_via_session_info = void(net_msg_identifier* identifier, gs_session* session_info, int flag); - using read_session_response = bool(uint64_t rcx); - using send_session_info_request = void(rockstar_identifier* target, int count); } diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 4752d9b1..54fff776 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -42,7 +42,6 @@ namespace big m_get_event_data("Get Event Data", g_pointers->m_get_event_data, &hooks::get_event_data), m_error_screen_hook("Disable Warning/Error Screen", g_pointers->m_error_screen, &hooks::error_screen), m_increment_stat_hook("Increment Stat Event", g_pointers->m_increment_stat_event, &hooks::increment_stat_event), - m_read_session_response("Read Session Response", g_pointers->m_read_session_response, &hooks::read_session_response), m_script_event_hook("Script Event Handler", g_pointers->m_script_event_handler, &hooks::script_event_handler) { m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present); @@ -72,7 +71,6 @@ namespace big m_get_event_data.enable(); m_error_screen_hook.enable(); m_increment_stat_hook.enable(); - m_read_session_response.enable(); m_script_event_hook.enable(); m_enabled = true; @@ -93,7 +91,6 @@ namespace big m_get_event_data.disable(); m_error_screen_hook.disable(); m_increment_stat_hook.disable(); - m_read_session_response.disable(); m_script_event_hook.disable(); } diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index e3cefc07..233c51d8 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -25,7 +25,6 @@ namespace big static bool get_event_data(int32_t eventGroup, int32_t eventIndex, int64_t* args, uint32_t argCount); static void error_screen(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background); static bool increment_stat_event(uint64_t net_event_struct, int64_t sender, int64_t a3); - static bool read_session_response(uint64_t rcx); static bool script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer); }; @@ -60,7 +59,6 @@ namespace big detour_hook m_get_event_data; detour_hook m_error_screen_hook; detour_hook m_increment_stat_hook; - detour_hook m_read_session_response; detour_hook m_script_event_hook; }; diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index bb779d94..75259b7c 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -122,32 +122,6 @@ namespace big { m_get_event_data = ptr.sub(28).as(); }); - - // R* Id - main_batch.add("Send Session Info Request", "48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 56 48 83 EC 30 48 83 3D ? ? ? ? ? 8B", [this](memory::handle ptr) - { - m_send_session_info_request = ptr.as(); - }); - - main_batch.add("Join Player Via Session Info", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 81 EC ? ? ? ? 4C 8B F9 B1 01 49 8B F1 49 8B E8 44 8B F2 E8", [this](memory::handle ptr) - { - m_join_player_via_session_info = ptr.as(); - }); - - main_batch.add("Rockstar Info", "48 8D 05 ? ? ? ? 4D 69 C0 ? ? ? ? 4C 03 C0 41 83 B8 ? ? ? ? ? 0F 86 ? ? ? ? 83 CD FF 48 8D 15", [this](memory::handle ptr) - { - m_rs_info = ptr.as(); - }); - - main_batch.add("Get Session Info From GS", "48 8B C4 48 89 58 08 48 89 68 10 56 57 41 56 48 81 EC ? ? ? ? 48 8B F2 33 D2 49 8B F8 4C 8B F1 44 8D 42", [this](memory::handle ptr) - { - m_get_session_info_from_gs = ptr.as(); - }); - - main_batch.add("Read Session Response Hook", "48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 55 41 54 41 56 48 8D 68 D8 48 81 EC ? ? ? ? 45 33 F6 48 8B F9 45", [this](memory::handle ptr) - { - m_read_session_response = ptr.as(); - }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 3464c1f6..3fbad155 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -3,7 +3,6 @@ #include "gta/fwddec.hpp" #include "gta/enums.hpp" #include "function_types.hpp" -#include "features/rid_joiner.hpp" namespace big { @@ -46,12 +45,6 @@ namespace big functions::spectate_player* m_spectate_player{}; functions::sync_local_time* m_sync_local_time{}; functions::trigger_script_event* m_trigger_script_event{}; - - rs_info *m_rs_info{}; - functions::get_session_info_from_gs* m_get_session_info_from_gs{}; - functions::join_player_via_session_info* m_join_player_via_session_info{}; - functions::read_session_response* m_read_session_response{}; - functions::send_session_info_request* m_send_session_info_request{}; }; inline pointers *g_pointers{}; From c569872bc37296e2fcb8251e2e1847c6463c59c0 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 21:56:30 +0100 Subject: [PATCH 11/31] refactor(TabMisc): Removed Join R* Id button --- BigBaseV2/src/gui/tab_bar/tab_misc.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/BigBaseV2/src/gui/tab_bar/tab_misc.cpp b/BigBaseV2/src/gui/tab_bar/tab_misc.cpp index d14d0eec..d7e35a3f 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_misc.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_misc.cpp @@ -1,5 +1,4 @@ #include "tab_bar.hpp" -#include "features/rid_joiner.hpp" namespace big { @@ -7,14 +6,6 @@ namespace big { if (ImGui::BeginTabItem("Misc")) { - if (ImGui::Button("Join R* Id")) - { - QUEUE_JOB_BEGIN_CLAUSE() - { - g_rid_joiner.join_player(143069134); - }QUEUE_JOB_END_CLAUSE - } - ImGui::Text("Set Current Character Level:"); ImGui::SliderInt("##input_levels_self", &g_temp.set_level, 0, 8000); if (ImGui::Button("Set Level")) From 4259fabe286cad5f169014737fa3c73e927816f6 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 21:58:29 +0100 Subject: [PATCH 12/31] refactor(TabOnline): Removed sell vehicle --- BigBaseV2/src/gui/tab_bar/tab_online.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/BigBaseV2/src/gui/tab_bar/tab_online.cpp b/BigBaseV2/src/gui/tab_bar/tab_online.cpp index a42aac80..6e1ec77b 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_online.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_online.cpp @@ -46,25 +46,7 @@ namespace big if (ImGui::TreeNode("Money")) { - ImGui::Text("Instructions:\n\nTake a vehicle from the street.\nGo in LSC and put a tracker on it.\nOpen the sell submenu but don't confirm it.\nOpen this menu and click one of the below buttons."); - - if (ImGui::Button("Set Car Sell Value at 25 million")) - { - features::functions::set_car_sell_value((int)25e6); - } - - if (ImGui::Button("Set Car Sell Value at INT_MAX (2.1 billion)")) - { - features::functions::set_car_sell_value(INT_MAX); - } - - if (ImGui::Button("Reset Vehicle Sell Stats")) - { - QUEUE_JOB_BEGIN_CLAUSE() - { - features::functions::reset_vehicle_sell_stats(); - }QUEUE_JOB_END_CLAUSE - } + ImGui::Text("Removed because is has been detected..."); ImGui::TreePop(); } From c76c4b17e927649f7472c71a3a5bb339f76b3900 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 21:59:44 +0100 Subject: [PATCH 13/31] refactor(TabSpawn): Changed spawn code to spawn function --- BigBaseV2/src/gui/tab_bar/tab_spawn.cpp | 40 ++----------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp b/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp index b18940fa..f9237efb 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_spawn.cpp @@ -16,44 +16,10 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE(= ) { - Hash hash = MISC::GET_HASH_KEY((const char*)model); + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, .0, 8.0, .5); - if (hash) - { - for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) - { - STREAMING::REQUEST_MODEL(hash); - - script::get_current()->yield(); - } - if (!STREAMING::HAS_MODEL_LOADED(hash)) - { - features::notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); - - return; - } - - Ped player = PLAYER::PLAYER_PED_ID(); - - Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, .0, 8.0, .5); - *(unsigned short*)g_pointers->m_model_spawn_bypass = 0x9090; - Vehicle veh = VEHICLE::CREATE_VEHICLE(hash, location.x, location.y, location.z, ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID()) + 90.f, true, false, false); - *(unsigned short*)g_pointers->m_model_spawn_bypass = 0x0574; - - script::get_current()->yield(); - - STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash); - - if (*g_pointers->m_is_session_started) - { - DECORATOR::DECOR_SET_INT(veh, "MPBitset", 0); - ENTITY::_SET_ENTITY_SOMETHING(veh, true); - int networkId = NETWORK::VEH_TO_NET(veh); - if (NETWORK::NETWORK_GET_ENTITY_IS_NETWORKED(veh)) - NETWORK::SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES(networkId, true); - VEHICLE::SET_VEHICLE_IS_STOLEN(veh, false); - } - } + features::functions::spawn_vehicle((const char*)model, location, ENTITY::GET_ENTITY_HEADING(player) + 90.f); }QUEUE_JOB_END_CLAUSE } From c52806d4bb0d06e58c1087c0e4c0be793632941e Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:11:30 +0100 Subject: [PATCH 14/31] feat(Struct/List): Added custom gun list --- BigBaseV2/src/structs/custom_gun.hpp | 8 ++++++++ BigBaseV2/src/structs/lists.hpp | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 BigBaseV2/src/structs/custom_gun.hpp diff --git a/BigBaseV2/src/structs/custom_gun.hpp b/BigBaseV2/src/structs/custom_gun.hpp new file mode 100644 index 00000000..2a7746a2 --- /dev/null +++ b/BigBaseV2/src/structs/custom_gun.hpp @@ -0,0 +1,8 @@ +#pragma once +namespace big +{ + struct custom_gun { + uint8_t id; + char name[64]; + }; +} \ No newline at end of file diff --git a/BigBaseV2/src/structs/lists.hpp b/BigBaseV2/src/structs/lists.hpp index c0598f34..ef99c207 100644 --- a/BigBaseV2/src/structs/lists.hpp +++ b/BigBaseV2/src/structs/lists.hpp @@ -1,9 +1,17 @@ #pragma once +#include "custom_gun.hpp" #include "location.hpp" #include "session_type.hpp" namespace big { + inline custom_gun custom_guns[] = { + 0, "None", + 1, "Delete Gun", + 2, "Gravity Gun", + 3, "Vehicle Gun" + }; + inline const int64_t kick_hashes[]{ 1317868303,-1243454584,-1212832151,-1252906024,-1890951223,-442306200,-966559987,1977655521,1998625272,1070934291,764638896,-345371965,-1559754940,1347850743,495824472,1240585650,1129105265,1192658057,3042061272,2735212356, 3852661096,123310597000,122994296644, -1549630786, -1990292823, 1352706024, 12442595688, 11325146948, 11631995864, 96893296585, 98341941608, 97224492868, 97540793224, 1317868303,-1243454584,-1212832151,-1252906024,-1890951223,-442306200,-966559987,1977655521,1998625272,1070934291,764638896,-345371965,-1559754940,1347850743,495824472,1240585650,1129105265,1192658057,3042061272,2735212356, 3852661096,123310597000,122994296644, -1549630786, -1990292823, 1352706024, -1549630786, -1990292823, -920663435, -891346918, -1729804184, -966559987, -1890951223, -1252906024, 665709549, -2065346036, 823645419, 1881968783, 2565163112, 2404016073, 3328407309, -977515445, 767605081, -1054826273, 1620254541, 1401831542, 1428412924, 10993950665, 11672069737, 12442595688, 11325146948, 11918341901, 10567590113, 11830075615, 9210190337, 97531341784, 96893296585, 98341941608, 97817687821, 96466936033, 97729421535, 95109536257, 97863584373, 96793954985, 97234617022, 96487905784, 95560214803, 97571415657, 97224492868, 95807148815, 97540793224 }; From 46cf3a87c21dcffb63e067bc4053254698bf6f23 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:14:29 +0100 Subject: [PATCH 15/31] refactor(SuperSprint): Reverted to old supersprint --- BigBaseV2/src/features/looped/super_sprint.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/BigBaseV2/src/features/looped/super_sprint.cpp b/BigBaseV2/src/features/looped/super_sprint.cpp index 7de248ab..0e3eea84 100644 --- a/BigBaseV2/src/features/looped/super_sprint.cpp +++ b/BigBaseV2/src/features/looped/super_sprint.cpp @@ -13,15 +13,6 @@ namespace big bool bSuperSprint = g_settings.options["super_sprint"].get(); - if (bSuperSprint) - { - Vector3 vel = ENTITY::GET_ENTITY_VELOCITY(player); - - LOG(INFO) << vel.x << " " << vel.y << ", " << vel.z; - - ENTITY::SET_ENTITY_VELOCITY(player, vel.x * 2, vel.y * 2, vel.z); - } - /* if (bSuperSprint) { float height = ENTITY::GET_ENTITY_HEIGHT_ABOVE_GROUND(player); @@ -57,7 +48,7 @@ namespace big else if (!bSuperSprint && bSuperSprint != bLastSuperSprint) { PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); - }*/ + } bLastSuperSprint = bSuperSprint; } From be93889ffaabc87be3b3bf49649cc0111e05abf8 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:14:48 +0100 Subject: [PATCH 16/31] refactor(RIDJoiner): Removed old class files --- BigBaseV2/src/features/rid_joiner.cpp | 54 ----------------------- BigBaseV2/src/features/rid_joiner.hpp | 63 --------------------------- 2 files changed, 117 deletions(-) delete mode 100644 BigBaseV2/src/features/rid_joiner.cpp delete mode 100644 BigBaseV2/src/features/rid_joiner.hpp diff --git a/BigBaseV2/src/features/rid_joiner.cpp b/BigBaseV2/src/features/rid_joiner.cpp deleted file mode 100644 index 8be2bc14..00000000 --- a/BigBaseV2/src/features/rid_joiner.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "features/notify.hpp" -#include "natives.hpp" -#include "pointers.hpp" -#include "rid_joiner.hpp" -#include "script.hpp" -#include "fiber_pool.hpp" - -namespace big -{ - void rid_joiner::look_for_session() - { - if (this->awaiting_request) - { - features::notify::above_map("WAITING FOR GAME COORDINATOR"); - - if (this->type == 2 && !this->gs_info.empty()) - { - handle_info(); - } - } - } - - void rid_joiner::handle_info() - { - this->awaiting_request = false; - - join_rstar_id_request request; - memset(&request, 0, sizeof(request)); - request.identifier.rockstar_id = g_pointers->m_rs_info->rockstar_id; - request.identifier.type = 3; - - features::notify::above_map("ATTEMPTING TO JOIN"); - - g_pointers->m_get_session_info_from_gs(&request.session_info, this->gs_info.c_str(), 0, 0); - g_pointers->m_join_player_via_session_info(&request.identifier, &request.session_info, 0xA000); - } - - void rid_joiner::join_player(uint64_t rid) - { - this->awaiting_request = true; - this->gs_info.clear(); - this->type = 2; - this->rid = rid; - - rockstar_identifier* identifier = new rockstar_identifier(); - identifier->rockstar_id = rid; - identifier->type = 3; - NETWORK::NETWORK_CLEAR_GET_GAMER_STATUS(); - - g_pointers->m_send_session_info_request(identifier, 1); - - features::notify::above_map("Sent join request to join R* Id."); - } -} \ No newline at end of file diff --git a/BigBaseV2/src/features/rid_joiner.hpp b/BigBaseV2/src/features/rid_joiner.hpp deleted file mode 100644 index 3b3d210e..00000000 --- a/BigBaseV2/src/features/rid_joiner.hpp +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once -#include "common.hpp" - -namespace big -{ - class rid_joiner - { - public: - std::string gs_info; - uint64_t rid; - - void look_for_session(); - void handle_info(); - void join_player(uint64_t rid); - private: - bool awaiting_request = false; - int type = 0; - }; - - inline rid_joiner g_rid_joiner{}; - - struct rockstar_identifier { - uint64_t rockstar_id; - uint32_t type; - uint32_t sub_type; - }; - - struct gs_session { - char _0x0000[0x8]; - uint64_t PeerToken; - char _0x0010[0x38]; - uint64_t RockstarID; - }; - - struct net_msg_identifier { - uint64_t rockstar_id; - uint8_t type; - char _0x0009[0xB]; - }; - - struct rs_info { - char scs_ticket[0x100]; - char _0x0100[0x190]; - uint64_t peer; - char _0x0298[0xA7]; - char email[0x50]; - char _0x038f[0x20]; - char name[0x20]; - char _0x03cf[0x29]; - uint32_t rockstar_id; - }; - - struct network_handle { - int Handle; - char _0x0[48]; - }; - - struct join_rstar_id_request { - char _0x0000[0x8]; - gs_session session_info; - net_msg_identifier identifier; - }; -} \ No newline at end of file From 7aec3ebb7cd534b177f4ba49aa871ddd76bd2d0e Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:15:14 +0100 Subject: [PATCH 17/31] fix(NoClip): Only take control of entity when needed --- BigBaseV2/src/features/looped/noclip.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/BigBaseV2/src/features/looped/noclip.cpp b/BigBaseV2/src/features/looped/noclip.cpp index 7bf00e39..649e54e3 100644 --- a/BigBaseV2/src/features/looped/noclip.cpp +++ b/BigBaseV2/src/features/looped/noclip.cpp @@ -6,6 +6,8 @@ namespace big static const float speed = 20.f; static const float headingSpeed = 3.f; + static bool bLastNoClip; + void features::noclip() { bool bNoclip = g_settings.options["noclip"]["enabled"]; @@ -18,6 +20,11 @@ namespace big if (bNoclip) { + functions::take_control_of_entity(ent); + + if (bNoclip != bLastNoClip) + ENTITY::SET_ENTITY_COLLISION(ent, false, false); + for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); @@ -58,6 +65,13 @@ namespace big ENTITY::SET_ENTITY_VELOCITY(ent, vel.x * fHorizontal, vel.y * fHorizontal, vel.z * fVertical); } - ENTITY::SET_ENTITY_COLLISION(ent, !bNoclip, !bNoclip); + else if (!bNoclip && bNoclip != bLastNoClip) + { + functions::take_control_of_entity(ent); + + ENTITY::SET_ENTITY_COLLISION(ent, true, true); + } + + bLastNoClip = bNoclip; } } \ No newline at end of file From d8e57aec836f2a8ea31ffd7ec71984ccdacf4589 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:18:49 +0100 Subject: [PATCH 18/31] feat(GravityGun): Made gravity gun a selectable --- BigBaseV2/src/features/looped/gravity_gun.cpp | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/BigBaseV2/src/features/looped/gravity_gun.cpp b/BigBaseV2/src/features/looped/gravity_gun.cpp index fce57066..e365d9b6 100644 --- a/BigBaseV2/src/features/looped/gravity_gun.cpp +++ b/BigBaseV2/src/features/looped/gravity_gun.cpp @@ -2,7 +2,7 @@ namespace big { - static Entity entity = -1; + static Entity entity = 0; static Vector3 location; static Vector3 other; static double dist; @@ -12,14 +12,16 @@ namespace big void features::gravity_gun() { - bool bGravityGun = g_settings.options["gravity_gun"]["enabled"]; - double multiplier = g_settings.options["gravity_gun"]["multiplier"]; + bool bGravityGun = g_settings.options["custom_gun"]["type"] == 2; + double multiplier = g_settings.options["custom_gun"]["gravity_velocity_multiplier"]; - Hash currWeapon; - WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); - - if (bGravityGun && currWeapon == RAGE_JOAAT("weapon_pistol")) + if (bGravityGun) { + Hash currWeapon; + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); + + if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; + // ZOOMED IN if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) { @@ -30,24 +32,33 @@ namespace big location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true); // Attack RELEASED - if (PAD::IS_DISABLED_CONTROL_JUST_PRESSED(0, 24)) + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 24) && entity == 0) { if (functions::raycast_entity(&entity)) { - other = ENTITY::GET_ENTITY_COORDS(entity, true); - dist = functions::distance_between_vectors(location, other); - - if (dist > 50) + if (ENTITY::IS_ENTITY_A_PED(entity) && PED::IS_PED_A_PLAYER(entity)) { entity = 0; - notify::above_map("Entity is too far."); + notify::above_map("You can't move player entities!"); } else { - functions::take_control_of_entity(entity); + other = ENTITY::GET_ENTITY_COORDS(entity, true); + dist = functions::distance_between_vectors(location, other); - features::notify::above_map("Selected entity at crosshair."); + if (dist > 50) + { + entity = 0; + + notify::above_map("Entity is too far."); + } + else + { + functions::take_control_of_entity(entity); + + features::notify::above_map("Selected entity at crosshair."); + } } } else @@ -85,11 +96,11 @@ namespace big ENTITY::SET_ENTITY_VELOCITY(entity, (zRot.x - other.x) * multiplier, (zRot.y - other.y) * multiplier, (zRot.z - other.z) * multiplier); } } - else if (entity != -1) + else if (entity != 0) { ENTITY::SET_ENTITY_COLLISION(entity, true, true); - entity = -1; + entity = 0; features::notify::above_map("Released entity."); } From b50a949c3936670938eadedfac6e639aa2b9d2d9 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:22:06 +0100 Subject: [PATCH 19/31] feat(VehicleGun): Added vehicle gun --- BigBaseV2/src/features/looped/vehicle_gun.cpp | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 BigBaseV2/src/features/looped/vehicle_gun.cpp diff --git a/BigBaseV2/src/features/looped/vehicle_gun.cpp b/BigBaseV2/src/features/looped/vehicle_gun.cpp new file mode 100644 index 00000000..28f5bfa2 --- /dev/null +++ b/BigBaseV2/src/features/looped/vehicle_gun.cpp @@ -0,0 +1,42 @@ +#include "features.hpp" + +namespace big +{ + static const int controls[] = { 14, 15, 24 }; + + void features::vehicle_gun() + { + bool bVehicleGun = g_settings.options["custom_gun"]["type"] == 3; + + if (bVehicleGun) + { + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + + Hash currWeapon; + WEAPON::GET_CURRENT_PED_WEAPON(player, &currWeapon, 1); + + if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) + { + PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) + { + Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.f, 10.f, 0.f); + Vehicle veh = functions::spawn_vehicle( + "bus", + location, + ENTITY::GET_ENTITY_HEADING(player) + ); + + script::get_current()->yield(); + + ENTITY::APPLY_FORCE_TO_ENTITY(veh, 1, 0.f, 150.f, 0.f, 0.f, 0.f, 0.f, 0, 1, 1, 1, 0, 1); + } + } + } + } +} \ No newline at end of file From 44a060c943289194c0fb8bfca52981b8c79f5eca Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:22:21 +0100 Subject: [PATCH 20/31] feat(DeleteGun): Added delete gun --- BigBaseV2/src/features/looped/delete_gun.cpp | 62 ++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 BigBaseV2/src/features/looped/delete_gun.cpp diff --git a/BigBaseV2/src/features/looped/delete_gun.cpp b/BigBaseV2/src/features/looped/delete_gun.cpp new file mode 100644 index 00000000..47f4756b --- /dev/null +++ b/BigBaseV2/src/features/looped/delete_gun.cpp @@ -0,0 +1,62 @@ +#include "features.hpp" + +namespace big +{ + static const int controls[] = { 14, 15, 24 }; + + void features::delete_gun() + { + bool bDeleteGun = g_settings.options["custom_gun"]["type"] == 1; + + if (bDeleteGun) + { + Hash currWeapon; + WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1); + + if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) + { + PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) + { + Entity entity; + + if (functions::raycast_entity(&entity)) + { + if (ENTITY::IS_ENTITY_A_PED(entity) && PED::IS_PED_A_PLAYER(entity)) + { + notify::above_map("You can't delete player entities!"); + } + else + { + Vector3 player = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true); + Vector3 entLoc = ENTITY::GET_ENTITY_COORDS(entity, true); + double dist = functions::distance_between_vectors(player, entLoc); + + if (dist > 50) + { + notify::above_map("Entity is too far."); + } + else + { + if (functions::take_control_of_entity(entity)) + { + ENTITY::DETACH_ENTITY(entity, 1, 1); + ENTITY::SET_ENTITY_COORDS_NO_OFFSET(entity, 0, 0, 0, 0, 0, 0); + ENTITY::SET_ENTITY_AS_MISSION_ENTITY(entity, 0, 1); + ENTITY::DELETE_ENTITY(&entity); + } + else notify::above_map("~r~Failed to take control of entity."); + } + } + } + else features::notify::above_map("No entity found."); + } + } + } + } +} \ No newline at end of file From 62bfe65dae36e114f9f6f5993a7a9e2d3beb7363 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:23:16 +0100 Subject: [PATCH 21/31] feat(TabWeapons): Added dropdown for different guns --- BigBaseV2/src/gui/tab_bar/tab_weapons.cpp | 44 ++++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp b/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp index a156a21b..a39552b1 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp @@ -8,13 +8,47 @@ namespace big { if (ImGui::BeginTabItem("Weapons")) { - if (ImGui::TreeNode("Gravity Gun")) + if (ImGui::TreeNode("Custom Weapons")) { - if (ImGui::Checkbox("Gravity Gun", g_settings.options["gravity_gun"]["enabled"].get())) - g_settings.save(); + uint8_t selected = g_settings.options["custom_gun"]["type"]; - if (ImGui::SliderScalar("Multiplier", ImGuiDataType_Double, g_settings.options["gravity_gun"]["multiplier"].get(), &min, &max)) - g_settings.save(); + if (ImGui::BeginCombo("Weapon", custom_guns[selected].name)) + { + for (custom_gun gun : custom_guns) + { + if (ImGui::Selectable(gun.name, gun.id == selected)) + { + g_settings.options["custom_gun"]["type"] = gun.id; + + g_settings.save(); + } + + if (gun.id == selected) + ImGui::SetItemDefaultFocus(); + } + + ImGui::EndCombo(); + } + + switch (selected) + { + case 0: + ImGui::Text("No custom weapon selected."); + + break; + + case 2: + if (ImGui::SliderScalar("Multiplier", ImGuiDataType_Double, g_settings.options["custom_gun"]["gravity_velocity_multiplier"].get(), &min, &max)) + g_settings.save(); + + break; + case 3: + ImGui::Text("Set the vehicle model to spawn."); + + + + break; + } ImGui::TreePop(); } From bce76308b40e567ba9f4dba5c77699b5c009eab7 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:23:38 +0100 Subject: [PATCH 22/31] fix(Settings): Added custom gun settings --- BigBaseV2/src/settings.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BigBaseV2/src/settings.h b/BigBaseV2/src/settings.h index 90c3d50d..3cc0befa 100644 --- a/BigBaseV2/src/settings.h +++ b/BigBaseV2/src/settings.h @@ -13,13 +13,14 @@ namespace big nlohmann::json options; nlohmann::json default_options = R"({ + "custom_gun": { + "gravity_velocity_multiplier": 3.0, + "type": 0, + "vehicle_spawn_model": "bus" + }, "disable_phone": false, "disable_chat_censoring": false, "god_mode": false, - "gravity_gun": { - "enabled": false, - "multiplier": 3.0 - }, "join_message": false, "never_wanted": false, "noclip": { From 24a89138d0114cea529dfb2111c53d135d4d06fd Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 14 Jan 2021 22:24:30 +0100 Subject: [PATCH 23/31] feat(Features): Call guns in loop --- BigBaseV2/src/features.cpp | 4 ++-- BigBaseV2/src/features.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index aa35bf02..5fa24cdf 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -12,8 +12,7 @@ namespace big update_player_structs(); update_screen_sizes(); - g_rid_joiner.look_for_session(); - + delete_gun(); disable_phone(); god_mode(); gravity_gun(); @@ -30,6 +29,7 @@ namespace big spoof_rank(); sticky_tyres(); super_sprint(); + vehicle_gun(); } void features::script_func() diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index fc5e3a0f..f3b12300 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -6,7 +6,6 @@ #include "structs/temp.hpp" #include "features/functions.hpp" #include "features/notify.hpp" -#include "features/rid_joiner.hpp" #include "features/stats.hpp" #include "features/teleport.hpp" @@ -30,6 +29,7 @@ namespace big void run_tick(); void script_func(); + void delete_gun(); void disable_phone(); void god_mode(); void gravity_gun(); @@ -46,6 +46,7 @@ namespace big void spoof_rank(); void sticky_tyres(); void super_sprint(); + void vehicle_gun(); void update_screen_sizes(); void update_player_structs(); From 3beb21b48bfa95990cd05549bac2e2972e2ddbb5 Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 01:23:17 +0100 Subject: [PATCH 24/31] refactor(Functions): Moved create ambient money to a function --- BigBaseV2/src/features/functions.cpp | 8 ++++++++ BigBaseV2/src/features/functions.hpp | 2 ++ BigBaseV2/src/gui/player_window.cpp | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index 25df2dd0..f39a447f 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -227,4 +227,12 @@ namespace big::features::functions return -1; } + + void create_ambient_money(Vector3 location, int amount) + { + Hash hash = RAGE_JOAAT("PICKUP_MONEY_PAPER_BAG"); + + OBJECT::CREATE_AMBIENT_PICKUP(hash, location.x, location.y, location.z + 0.5f, 0, amount, hash, false, true); + STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash); + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp index cc54250f..7ac8b9ba 100644 --- a/BigBaseV2/src/features/functions.hpp +++ b/BigBaseV2/src/features/functions.hpp @@ -15,6 +15,8 @@ namespace big::features::functions Entity spawn_vehicle(const char* model, Vector3 location, float heading); + void create_ambient_money(Vector3 location, int amount); + bool take_control_of_entity(Entity ent); BOOL raycast_entity(Entity* ent); diff --git a/BigBaseV2/src/gui/player_window.cpp b/BigBaseV2/src/gui/player_window.cpp index 24efecd5..67f6905c 100644 --- a/BigBaseV2/src/gui/player_window.cpp +++ b/BigBaseV2/src/gui/player_window.cpp @@ -155,8 +155,7 @@ namespace big { Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), true); - OBJECT::CREATE_AMBIENT_PICKUP(0x1E9A99F8, coords.x, coords.y, coords.z + 0.5f, 0, rand() % 500 + 2000, (Hash)-1666779307, false, true); - STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED((Hash)-1666779307); + features::functions::create_ambient_money(coords, rand() % 500 + 2000); }QUEUE_JOB_END_CLAUSE } From e389c3c21c527010a62cffc7b36d1badedde1273 Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 01:24:05 +0100 Subject: [PATCH 25/31] fix(NoClip): Enforce no collision & no physics --- BigBaseV2/src/features/looped/noclip.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BigBaseV2/src/features/looped/noclip.cpp b/BigBaseV2/src/features/looped/noclip.cpp index 649e54e3..3d63fa14 100644 --- a/BigBaseV2/src/features/looped/noclip.cpp +++ b/BigBaseV2/src/features/looped/noclip.cpp @@ -22,8 +22,7 @@ namespace big { functions::take_control_of_entity(ent); - if (bNoclip != bLastNoClip) - ENTITY::SET_ENTITY_COLLISION(ent, false, false); + ENTITY::SET_ENTITY_COLLISION(ent, false, false); for (int control : controls) PAD::DISABLE_CONTROL_ACTION(0, control, true); From 73d378a7e691bb3a64ae6841ec0e6670b3f82bfc Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 01:24:42 +0100 Subject: [PATCH 26/31] feat(Weapons): Added money gun --- BigBaseV2/src/features.cpp | 1 + BigBaseV2/src/features.hpp | 6 +- BigBaseV2/src/features/looped/money_gun.cpp | 57 +++++++++++++++++++ BigBaseV2/src/features/looped/vehicle_gun.cpp | 4 +- BigBaseV2/src/gui/tab_bar/tab_weapons.cpp | 2 +- BigBaseV2/src/structs/lists.hpp | 5 +- 6 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 BigBaseV2/src/features/looped/money_gun.cpp diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index 5fa24cdf..0b4d1d13 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -16,6 +16,7 @@ namespace big disable_phone(); god_mode(); gravity_gun(); + money_gun(); never_wanted(); noclip(); no_bike_fall(); diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index f3b12300..e3419fa7 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -30,9 +30,12 @@ namespace big void script_func(); void delete_gun(); + void gravity_gun(); + void money_gun(); + void vehicle_gun(); + void disable_phone(); void god_mode(); - void gravity_gun(); void never_wanted(); void noclip(); void no_bike_fall(); @@ -46,7 +49,6 @@ namespace big void spoof_rank(); void sticky_tyres(); void super_sprint(); - void vehicle_gun(); void update_screen_sizes(); void update_player_structs(); diff --git a/BigBaseV2/src/features/looped/money_gun.cpp b/BigBaseV2/src/features/looped/money_gun.cpp new file mode 100644 index 00000000..e0337480 --- /dev/null +++ b/BigBaseV2/src/features/looped/money_gun.cpp @@ -0,0 +1,57 @@ +#include "features.hpp" + +namespace big +{ + static const int controls[] = { 14, 15, 24 }; + + static bool busy = false; + static Entity entity = 0; + + void features::money_gun() + { + bool bMoneyGun = g_settings.options["custom_gun"]["type"] == 3; + + if (bMoneyGun) + { + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + + Hash currWeapon; + WEAPON::GET_CURRENT_PED_WEAPON(player, &currWeapon, 1); + + if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return; + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25)) + { + PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true); + for (int control : controls) + PAD::DISABLE_CONTROL_ACTION(0, control, true); + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 24) && !busy) + { + busy = true; + + QUEUE_JOB_BEGIN_CLAUSE(&) + { + if (functions::raycast_entity(&entity)) + { + if (!ENTITY::IS_ENTITY_A_PED(entity) || !PED::IS_PED_A_PLAYER(entity)) + { + busy = false; + + return; + } + + Vector3 location = ENTITY::GET_ENTITY_COORDS(entity, true); + + features::functions::create_ambient_money(location, rand() % 500 + 2000); + + script::get_current()->yield(33ms); + + busy = false; + } + }QUEUE_JOB_END_CLAUSE + } + } + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/looped/vehicle_gun.cpp b/BigBaseV2/src/features/looped/vehicle_gun.cpp index 28f5bfa2..829fe3c7 100644 --- a/BigBaseV2/src/features/looped/vehicle_gun.cpp +++ b/BigBaseV2/src/features/looped/vehicle_gun.cpp @@ -6,7 +6,7 @@ namespace big void features::vehicle_gun() { - bool bVehicleGun = g_settings.options["custom_gun"]["type"] == 3; + bool bVehicleGun = g_settings.options["custom_gun"]["type"] == 4; if (bVehicleGun) { @@ -25,7 +25,7 @@ namespace big if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24)) { - Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.f, 10.f, 0.f); + Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.f, 15.f, 0.f); Vehicle veh = functions::spawn_vehicle( "bus", location, diff --git a/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp b/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp index a39552b1..ea5da271 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_weapons.cpp @@ -42,7 +42,7 @@ namespace big g_settings.save(); break; - case 3: + case 4: ImGui::Text("Set the vehicle model to spawn."); diff --git a/BigBaseV2/src/structs/lists.hpp b/BigBaseV2/src/structs/lists.hpp index ef99c207..bb7cf438 100644 --- a/BigBaseV2/src/structs/lists.hpp +++ b/BigBaseV2/src/structs/lists.hpp @@ -7,9 +7,10 @@ namespace big { inline custom_gun custom_guns[] = { 0, "None", - 1, "Delete Gun", + 1, "Delete From Existence", 2, "Gravity Gun", - 3, "Vehicle Gun" + 3, "Money Printer", + 4, "Vehicle Yeeter" }; inline const int64_t kick_hashes[]{ 1317868303,-1243454584,-1212832151,-1252906024,-1890951223,-442306200,-966559987,1977655521,1998625272,1070934291,764638896,-345371965,-1559754940,1347850743,495824472,1240585650,1129105265,1192658057,3042061272,2735212356, 3852661096,123310597000,122994296644, -1549630786, -1990292823, 1352706024, 12442595688, 11325146948, 11631995864, 96893296585, 98341941608, 97224492868, 97540793224, 1317868303,-1243454584,-1212832151,-1252906024,-1890951223,-442306200,-966559987,1977655521,1998625272,1070934291,764638896,-345371965,-1559754940,1347850743,495824472,1240585650,1129105265,1192658057,3042061272,2735212356, 3852661096,123310597000,122994296644, -1549630786, -1990292823, 1352706024, From 3fe2e840adb429494629bd20d73c3305ebf10b5d Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 02:19:29 +0100 Subject: [PATCH 27/31] feat(Functions): Added cage ped --- BigBaseV2/src/features/functions.cpp | 8 ++++++++ BigBaseV2/src/features/functions.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index f39a447f..1bd534a1 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -235,4 +235,12 @@ namespace big::features::functions OBJECT::CREATE_AMBIENT_PICKUP(hash, location.x, location.y, location.z + 0.5f, 0, amount, hash, false, true); STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash); } + + void cage_ped(Ped ped) + { + Hash hash = RAGE_JOAAT("prop_gold_cont_01"); + + Vector3 location = ENTITY::GET_ENTITY_COORDS(ped, true); + OBJECT::CREATE_OBJECT(hash, location.x, location.y, location.z - 1.f, true, false, false); + } } \ No newline at end of file diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp index 7ac8b9ba..3934d7c8 100644 --- a/BigBaseV2/src/features/functions.hpp +++ b/BigBaseV2/src/features/functions.hpp @@ -16,6 +16,7 @@ namespace big::features::functions Entity spawn_vehicle(const char* model, Vector3 location, float heading); void create_ambient_money(Vector3 location, int amount); + void cage_ped(Ped ped); bool take_control_of_entity(Entity ent); From f8c1dc43299c07b2c004091cdcac2b2caeb1dc3f Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 02:20:46 +0100 Subject: [PATCH 28/31] feat(Players): Added cage button --- BigBaseV2/src/gui/player_window.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BigBaseV2/src/gui/player_window.cpp b/BigBaseV2/src/gui/player_window.cpp index 67f6905c..f9a605a4 100644 --- a/BigBaseV2/src/gui/player_window.cpp +++ b/BigBaseV2/src/gui/player_window.cpp @@ -159,6 +159,14 @@ namespace big }QUEUE_JOB_END_CLAUSE } + if (ImGui::Button("Cage")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + features::functions::cage_ped(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id)); + }QUEUE_JOB_END_CLAUSE + } + ImGui::End(); } } From 8752a9f93c1a0d391ffd26ea0eabe8848ee0484b Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 02:38:38 +0100 Subject: [PATCH 29/31] refactor(GravityGun): Changed variable names --- BigBaseV2/src/features/looped/gravity_gun.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BigBaseV2/src/features/looped/gravity_gun.cpp b/BigBaseV2/src/features/looped/gravity_gun.cpp index e365d9b6..b2ed9355 100644 --- a/BigBaseV2/src/features/looped/gravity_gun.cpp +++ b/BigBaseV2/src/features/looped/gravity_gun.cpp @@ -87,13 +87,13 @@ namespace big // float roll = rot.y; float yaw = functions::deg_to_rad(rot.z + 90); // horizontal - Vector3 zRot; + Vector3 velocity; - zRot.x = location.x + (dist * cos(pitch) * cos(yaw)); - zRot.y = location.y + (dist * sin(yaw) * cos(pitch)); - zRot.z = location.z + (dist * sin(pitch)); + velocity.x = location.x + (dist * cos(pitch) * cos(yaw)) - other.x; + velocity.y = location.y + (dist * sin(yaw) * cos(pitch)) - other.y; + velocity.z = location.z + (dist * sin(pitch)) - other.z; - ENTITY::SET_ENTITY_VELOCITY(entity, (zRot.x - other.x) * multiplier, (zRot.y - other.y) * multiplier, (zRot.z - other.z) * multiplier); + ENTITY::SET_ENTITY_VELOCITY(entity, velocity.x * multiplier, velocity.y * multiplier, velocity.z * multiplier); } } else if (entity != 0) From 04eb6617b190a66357bb7e5cd451ba0bea9a785a Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 16:48:30 +0100 Subject: [PATCH 30/31] feat(GTA): Added ref to class Replay, Object & Vehicle --- BigBaseV2/src/gta/fwddec.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BigBaseV2/src/gta/fwddec.hpp b/BigBaseV2/src/gta/fwddec.hpp index 3a6c1fba..7f6f7381 100644 --- a/BigBaseV2/src/gta/fwddec.hpp +++ b/BigBaseV2/src/gta/fwddec.hpp @@ -70,3 +70,7 @@ class CNetGamePlayer; class CNetworkPlayerMgr; class CPlayerInfo; class CNetworkObjectMgr; + +class CReplayInterface; +class CObjectInterface; +class CVehicleInterface; From 005ebb8ce7693efd19d206723af5ebf4fe6dfb8d Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 15 Jan 2021 16:48:47 +0100 Subject: [PATCH 31/31] feat(Pointers): Added ReplayInterface --- BigBaseV2/src/pointers.cpp | 5 +++++ BigBaseV2/src/pointers.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 75259b7c..4ed52a8b 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -122,6 +122,11 @@ namespace big { m_get_event_data = ptr.sub(28).as(); }); + + main_batch.add("Replay Interface", "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(); + }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 3fbad155..2a41b5f6 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -19,6 +19,7 @@ namespace big CPedFactory **m_ped_factory{}; CNetworkPlayerMgr **m_network_player_mgr{}; + CReplayInterface **m_replay_interface{}; rage::scrNativeRegistrationTable *m_native_registration_table{}; functions::get_native_handler_t m_get_native_handler{};