From 136cb01164ee8ce3dbf42bed796c496849b5b955 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 18 Dec 2021 19:24:30 +0100 Subject: [PATCH] feat(Spoofing): Added spoofing with SendNetInfoToLobby hook --- BigBaseV2/src/core/globals.hpp | 41 ++++++++++++++- BigBaseV2/src/gui/window/main/main_tabs.hpp | 1 + .../src/gui/window/main/tab_spoofing.cpp | 52 +++++++++++++++++++ BigBaseV2/src/gui/window/window_main.cpp | 1 + BigBaseV2/src/hooking.cpp | 7 +++ BigBaseV2/src/hooking.hpp | 2 + .../src/hooks/send_net_info_to_lobby.cpp | 32 ++++++++++++ BigBaseV2/src/pointers.cpp | 6 +++ BigBaseV2/src/pointers.hpp | 2 + 9 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 BigBaseV2/src/gui/window/main/tab_spoofing.cpp create mode 100644 BigBaseV2/src/hooks/send_net_info_to_lobby.cpp diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index a16b479b..6b35c17d 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -70,6 +70,18 @@ struct globals { frame_flags frame_flags{}; }; + struct spoofing + { + bool spoof_username = false; + std::string username = ""; + + bool spoof_ip = true; + int ip_address[4] = { 42, 42, 42, 42}; + + bool spoof_rockstar_id = false; + uint64_t rockstar_id = 0; + }; + struct vehicle { struct speedo_meter { SpeedoMeter type = SpeedoMeter::DISABLED; @@ -110,6 +122,7 @@ struct globals { player player{}; protections protections{}; self self{}; + spoofing spoofing{}; vehicle vehicle{}; weapons weapons{}; window window{}; @@ -147,6 +160,15 @@ struct globals { this->self.frame_flags.fire_ammo = j["self"]["frame_flags"]["fire_ammo"]; this->self.frame_flags.super_jump = j["self"]["frame_flags"]["super_jump"]; + this->spoofing.spoof_ip = j["spoofing"]["spoof_ip"]; + this->spoofing.spoof_rockstar_id = j["spoofing"]["spoof_rockstar_id"]; + this->spoofing.spoof_username = j["spoofing"]["spoof_username"]; + + for (int i = 0; i < 4; i++) + this->spoofing.ip_address[i] = j["spoofing"]["ip_address"].at(i); + this->spoofing.rockstar_id = j["spoofing"]["rockstar_id"]; + this->spoofing.username = j["spoofing"]["username"]; + this->vehicle.god_mode = j["vehicle"]["god_mode"]; this->vehicle.horn_boost = j["vehicle"]["horn_boost"]; @@ -221,6 +243,21 @@ struct globals { } } }, + { + "spoofing", { + { "spoof_ip", this->spoofing.spoof_ip }, + { "spoof_rockstar_id", this->spoofing.spoof_rockstar_id }, + { "spoof_username", this->spoofing.spoof_username }, + { "ip_address", nlohmann::json::array({ + this->spoofing.ip_address[0], + this->spoofing.ip_address[1], + this->spoofing.ip_address[2], + this->spoofing.ip_address[3] }) + }, + { "rockstar_id", this->spoofing.rockstar_id }, + { "username", this->spoofing.username } + } + }, { "vehicle", { { "god_mode", this->vehicle.god_mode }, @@ -318,12 +355,12 @@ private: should_save = true; } - else if (current_settings[key].is_structured() && e.value().is_structured()) + else if (current_settings[key].is_object() && e.value().is_object()) { if (deep_compare(current_settings[key], e.value(), compare_value)) should_save = true; } - else if (!current_settings[key].is_structured() && e.value().is_structured()) { + else if (!current_settings[key].is_object() && e.value().is_object()) { current_settings[key] = e.value(); should_save = true; diff --git a/BigBaseV2/src/gui/window/main/main_tabs.hpp b/BigBaseV2/src/gui/window/main/main_tabs.hpp index f28bcd0a..e8a938f7 100644 --- a/BigBaseV2/src/gui/window/main/main_tabs.hpp +++ b/BigBaseV2/src/gui/window/main/main_tabs.hpp @@ -11,6 +11,7 @@ namespace big static void tab_recovery(); static void tab_settings(); static void tab_spawn(); + static void tab_spoofing(); static void tab_vehicle(); static void tab_weapons(); static void tab_teleport(); diff --git a/BigBaseV2/src/gui/window/main/tab_spoofing.cpp b/BigBaseV2/src/gui/window/main/tab_spoofing.cpp new file mode 100644 index 00000000..a26d5779 --- /dev/null +++ b/BigBaseV2/src/gui/window/main/tab_spoofing.cpp @@ -0,0 +1,52 @@ +#include "main_tabs.hpp" +#include "fiber_pool.hpp" +#include "util/teleport.hpp" + +namespace big +{ + void tab_main::tab_spoofing() + { + if (ImGui::BeginTabItem("Spoofing")) + { + ImGui::Text("To spoof any of the below credentials you need to reconnect with the lobby."); + + if (ImGui::TreeNode("Username")) + { + ImGui::Checkbox("Spoof Username", &g.spoofing.spoof_username); + + static char name[20]; + strcpy_s(name, sizeof(name), g.spoofing.username.c_str()); + + ImGui::Text("Username:"); + ImGui::InputText("##username_input", name, sizeof(name)); + + if (name != g.spoofing.username) + g.spoofing.username = std::string(name); + + ImGui::TreePop(); + } + + if (ImGui::TreeNode("IP Address")) + { + ImGui::Checkbox("Spoof IP", &g.spoofing.spoof_ip); + + ImGui::Text("IP Address:"); + ImGui::DragInt4("##ip_fields", g.spoofing.ip_address, 0, 255); + + ImGui::TreePop(); + } + + if (ImGui::TreeNode("Rockstar ID")) + { + ImGui::Checkbox("Spoof Rockstar ID", &g.spoofing.spoof_rockstar_id); + + ImGui::Text("Rockstar ID:"); + ImGui::InputScalar("##rockstar_id_input", ImGuiDataType_U64, &g.spoofing.rockstar_id); + + ImGui::TreePop(); + } + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/gui/window/window_main.cpp b/BigBaseV2/src/gui/window/window_main.cpp index faca9464..bcf3b8ad 100644 --- a/BigBaseV2/src/gui/window/window_main.cpp +++ b/BigBaseV2/src/gui/window/window_main.cpp @@ -17,6 +17,7 @@ namespace big tab_main::tab_vehicle(); tab_main::tab_weapons(); tab_main::tab_recovery(); + tab_main::tab_spoofing(); tab_main::tab_settings(); ImGui::EndTabBar(); diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index cc029c5c..971ac475 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -61,6 +61,9 @@ namespace big // Scripted Game Event Hook m_scripted_game_event_hook("SGEH", g_pointers->m_scripted_game_event, &hooks::scripted_game_event), + + // Send NET Info to Lobby + m_send_net_info_to_lobby("SNITL", g_pointers->m_send_net_info_to_lobby, &hooks::send_net_info_to_lobby) { m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present); m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers); @@ -96,6 +99,8 @@ namespace big m_scripted_game_event_hook.enable(); + m_send_net_info_to_lobby.enable(); + m_enabled = true; } @@ -103,6 +108,8 @@ namespace big { m_enabled = false; + m_send_net_info_to_lobby.disable(); + m_scripted_game_event_hook.disable(); m_received_event_hook.disable(); diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index 0fbc2ac3..8406c34b 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -43,6 +43,7 @@ namespace big ); static bool scripted_game_event(CScriptedGameEvent* scripted_game_event, CNetGamePlayer* player); + static bool send_net_info_to_lobby(netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4); }; struct minhook_keepalive @@ -85,6 +86,7 @@ namespace big detour_hook m_received_event_hook; detour_hook m_scripted_game_event_hook; + detour_hook m_send_net_info_to_lobby; }; inline hooking *g_hooking{}; diff --git a/BigBaseV2/src/hooks/send_net_info_to_lobby.cpp b/BigBaseV2/src/hooks/send_net_info_to_lobby.cpp new file mode 100644 index 00000000..2f8693d7 --- /dev/null +++ b/BigBaseV2/src/hooks/send_net_info_to_lobby.cpp @@ -0,0 +1,32 @@ +#include "hooking.hpp" + +namespace big +{ + bool hooks::send_net_info_to_lobby(netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4) + { + // check so we're 100% sure we modify data only for ourselves + if (g_local_player->m_player_info->m_net_player_data.m_rockstar_id == player->m_rockstar_id) + { + LOG(INFO) << "HOOKS | Sending spoofed values to lobby."; + + if (g.spoofing.spoof_username) + memcpy(player->m_name, g.spoofing.username.c_str(), sizeof(player->m_name)); + + if (g.spoofing.spoof_ip) + { + player->m_external_ip.m_field1 = g.spoofing.ip_address[0]; + player->m_external_ip.m_field2 = g.spoofing.ip_address[1]; + player->m_external_ip.m_field3 = g.spoofing.ip_address[2]; + player->m_external_ip.m_field4 = g.spoofing.ip_address[3]; + } + + if (g.spoofing.spoof_rockstar_id) + { + player->m_rockstar_id = g.spoofing.rockstar_id; + player->m_rockstar_id2 = g.spoofing.rockstar_id; + } + } + + return g_hooking->m_send_net_info_to_lobby.get_original()(player, a2, a3, a4); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 62bf0c5d..daea36a0 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -203,6 +203,12 @@ namespace big { m_is_dlc_present = ptr.as(); }); + + // Send NET Info to Lobby + main_batch.add("SNITL", "44 8B 6C 24 ? 45 8B C6 48 8D 4E 70 41 8B D5 45 2B C5 4C 8D 4C 24 ? 03 D5 44 2B C5 49 03 D4 E8 ? ? ? ? 84 C0 74 69", [this](memory::handle ptr) + { + m_send_net_info_to_lobby = ptr.sub(0x64).as(); + }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 14613bec..2573d400 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -62,6 +62,8 @@ namespace big functions::send_event_ack* m_send_event_ack{}; // Received Event Signatures END + PVOID m_send_net_info_to_lobby{}; + functions::spectate_player* m_spectate_player{}; };