feat(Spoofing): Added spoofing with SendNetInfoToLobby hook

This commit is contained in:
Yimura 2021-12-18 19:24:30 +01:00
parent 69bf73a1dd
commit 136cb01164
9 changed files with 142 additions and 2 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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();
}
}
}

View File

@ -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();

View File

@ -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();

View File

@ -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{};

View File

@ -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<decltype(&hooks::send_net_info_to_lobby)>()(player, a2, a3, a4);
}
}

View File

@ -203,6 +203,12 @@ namespace big
{
m_is_dlc_present = ptr.as<decltype(m_is_dlc_present)>();
});
// Send NET Info to Lobby
main_batch.add("SNITL", "44 8B 6C 24 ? 45 8B C6 48 8D 4E 70 41 8B D5 45 2B C5 4C 8D 4C 24 ? 03 D5 44 2B C5 49 03 D4 E8 ? ? ? ? 84 C0 74 69", [this](memory::handle ptr)
{
m_send_net_info_to_lobby = ptr.sub(0x64).as<decltype(m_send_net_info_to_lobby)>();
});
main_batch.run(memory::module(nullptr));

View File

@ -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{};
};