Add more spoofing options and added clang-format (#1020)

* feat(Spoofing): add spoofing
* feat(Spoofing): prepare code for player attach
* remove(PlayerAttach): isn't going to work due to netsync architecture
* fix(GUI): fix scaling
* feat(Project): add clang-format file
* feat(Classes): update classes
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(clang-format): Set tab width and 1 space before comment

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
maybegreat48
2023-03-01 21:27:15 +00:00
committed by GitHub
parent 92aea20cd6
commit 97a8c5d60b
466 changed files with 55224 additions and 35596 deletions

View File

@ -1,11 +1,12 @@
#include "views/view.hpp"
#include "services/player_database/player_database_service.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/scr_globals.hpp"
#include "core/data/language_codes.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include "core/scr_globals.hpp"
#include "services/player_database/player_database_service.hpp"
#include "views/view.hpp"
#include <script/globals/GPBD_FM.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -13,10 +14,10 @@ namespace big
{
if (ImGui::TreeNode("INFO"_T.data()))
{
ImGui::Text("PLAYER_INFO_ID"_T.data(), g_player_service->get_selected()->id());
ImGui::Text("PLAYER_INFO_SESSION_HOST"_T.data(), g_player_service->get_selected()->is_host() ? "YES"_T.data() : "NO"_T.data());
ImGui::Text("PLAYER_INFO_SESSION_HOST"_T.data(),
g_player_service->get_selected()->is_host() ? "YES"_T.data() : "NO"_T.data());
ImGui::Separator();
@ -26,18 +27,18 @@ namespace big
}
uint32_t ped_damage_bits = 0;
uint32_t ped_task_flag = 0;
uint32_t ped_health = 0;
uint32_t ped_maxhealth = 0;
uint32_t ped_task_flag = 0;
uint32_t ped_health = 0;
uint32_t ped_maxhealth = 0;
uint32_t veh_damage_bits = 0;
std::string mode_str = "";
std::string mode_str = "";
if (CPed* ped = g_player_service->get_selected()->get_ped(); ped != nullptr)
{
ped_damage_bits = ped->m_damage_bits;
ped_task_flag = ped->m_ped_task_flag;
ped_health = ped->m_health;
ped_maxhealth = ped->m_maxhealth;
ped_task_flag = ped->m_ped_task_flag;
ped_health = ped->m_health;
ped_maxhealth = ped->m_maxhealth;
}
if (ped_damage_bits & (uint32_t)eEntityProofs::GOD)
@ -113,29 +114,21 @@ namespace big
ImGui::SameLine();
ImGui::PushID("##rid");
if (ImGui::Button("COPY"_T.data())) ImGui::SetClipboardText(std::to_string(net_player_data->m_gamer_handle.m_rockstar_id).data());
if (ImGui::Button("COPY"_T.data()))
ImGui::SetClipboardText(std::to_string(net_player_data->m_gamer_handle.m_rockstar_id).data());
ImGui::PopID();
auto ip = g_player_service->get_selected()->get_ip_address();
auto ip = g_player_service->get_selected()->get_ip_address();
auto port = g_player_service->get_selected()->get_port();
ImGui::Text(
"PLAYER_INFO_IP"_T.data(),
ip.m_field1,
ip.m_field2,
ip.m_field3,
ip.m_field4,
port
);
ImGui::Text("PLAYER_INFO_IP"_T.data(), ip.m_field1, ip.m_field2, ip.m_field3, ip.m_field4, port);
ImGui::SameLine();
ImGui::PushID("##ip");
if (ImGui::Button("COPY"_T.data())) ImGui::SetClipboardText(std::format("{}.{}.{}.{}:{}", ip.m_field1,
ip.m_field2,
ip.m_field3,
ip.m_field4,
port).data());
if (ImGui::Button("COPY"_T.data()))
ImGui::SetClipboardText(
std::format("{}.{}.{}.{}:{}", ip.m_field1, ip.m_field2, ip.m_field3, ip.m_field4, port).data());
ImGui::PopID();
}
@ -145,7 +138,7 @@ namespace big
if (id != -1)
{
auto& stats = scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PlayerStats;
auto& stats = scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PlayerStats;
auto& boss_goon = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[id].BossGoon;
if (boss_goon.Language >= 0 && boss_goon.Language < 13)
@ -157,24 +150,27 @@ namespace big
ImGui::Text("PLAYER_INFO_BANK"_T.data(), stats.Money - stats.WalletBalance);
ImGui::Text("PLAYER_INFO_TOTAL_MONEY"_T.data(), stats.Money);
ImGui::Text("PLAYER_INFO_RANK"_T.data(), stats.Rank, stats.RP);
ImGui::Text("Health: %d (MaxHealth: %d)", ped_health, ped_maxhealth); // TODO: translate
ImGui::Text("Health: %d (MaxHealth: %d)", ped_health, ped_maxhealth);// TODO: translate
ImGui::Text("PLAYER_INFO_KD"_T.data(), stats.KdRatio);
ImGui::Text("PLAYER_INFO_KILLS"_T.data(), stats.KillsOnPlayers);
ImGui::Text("PLAYER_INFO_DEATHS"_T.data(), stats.DeathsByPlayers);
ImGui::Text("PLAYER_INFO_PROSTITUTES"_T.data(), stats.ProstitutesFrequented);
ImGui::Text("PLAYER_INFO_LAP_DANCES"_T.data(), stats.LapDancesBought);
ImGui::Text("PLAYER_INFO_MISSIONS_CREATED"_T.data(), stats.MissionsCreated);
ImGui::Text("PLAYER_INFO_METLDOWN_COMPLETE"_T.data(), scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "YES"_T.data() : "NO"_T.data()); // curious to see if anyone has actually played singleplayer
ImGui::Text("PLAYER_INFO_METLDOWN_COMPLETE"_T.data(),
scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "YES"_T.data() : "NO"_T.data());// curious to see if anyone has actually played singleplayer
ImGui::Separator();
}
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(), COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(),
COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
if (ImGui::Selectable(name, type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
if (ImGui::Selectable(name,
type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
{
g.session.chat_command_default_access_level = type;
g_player_database_service->get_or_create_player(g_player_service->get_selected())->command_access_level = type;

View File

@ -1,6 +1,6 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
namespace big
{
@ -8,13 +8,14 @@ namespace big
{
if (ImGui::TreeNode("KICK"_T.data()))
{
auto const is_session_host = [] { return gta_util::get_network()->m_game_session_ptr->is_host(); };
auto const is_session_host = [] {
return gta_util::get_network()->m_game_session_ptr->is_host();
};
components::player_command_button<"breakup">(g_player_service->get_selected());
ImGui::SameLine();
components::command_checkbox<"breakupcheating">();
components::disable_unless(std::not_fn(is_session_host), []
{
components::disable_unless(std::not_fn(is_session_host), [] {
components::player_command_button<"lckick">(g_player_service->get_selected());
});

View File

@ -1,6 +1,6 @@
#include "views/view.hpp"
#include "util/scripts.hpp"
#include "script/globals/GPBD_FM_3.hpp"
#include "util/scripts.hpp"
#include "views/view.hpp"
namespace big
{
@ -25,8 +25,7 @@ namespace big
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g_player_service->get_selected()->never_wanted);
ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g_player_service->get_selected()->semi_godmode);
components::button("Gooch Test", []
{
components::button("Gooch Test", [] {
*script_global(1890140).at(244).at(1).as<Player*>() = g_player_service->get_selected()->id();
scripts::start_launcher_script(171);
});

View File

@ -1,8 +1,8 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "util/toxic.hpp"
#include "core/data/apartment_names.hpp"
#include "core/data/warehouse_names.hpp"
#include "util/teleport.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
namespace big
{
@ -30,9 +30,13 @@ namespace big
components::player_command_button<"ceoraid">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::button("Trigger MC Raid", [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::BikerDefend); });
components::button("Trigger MC Raid", [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::BikerDefend);
});
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::GunrunningDefend); });
components::button("Trigger Bunker Raid", [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::GunrunningDefend);
});
components::player_command_button<"sext">(g_player_service->get_selected(), {});
ImGui::SameLine();
@ -41,7 +45,7 @@ namespace big
static int wanted_level;
ImGui::SliderInt("WANTED_LVL"_T.data(), &wanted_level, 0, 5);
ImGui::SameLine();
components::player_command_button<"wanted">(g_player_service->get_selected(), { (uint64_t)wanted_level }, "Set");
components::player_command_button<"wanted">(g_player_service->get_selected(), {(uint64_t)wanted_level}, "Set");
components::small_text("TELEPORTS"_T);
@ -65,7 +69,7 @@ namespace big
ImGui::SameLine();
components::player_command_button<"apartmenttp">(g_player_service->get_selected(), { (uint64_t)g.session.send_to_apartment_idx });
components::player_command_button<"apartmenttp">(g_player_service->get_selected(), {(uint64_t)g.session.send_to_apartment_idx});
if (ImGui::BeginCombo("##warehouse", warehouse_names[g.session.send_to_warehouse_idx]))
{
@ -87,74 +91,94 @@ namespace big
ImGui::SameLine();
components::player_command_button<"warehousetp">(g_player_service->get_selected(), { (uint64_t)g.session.send_to_warehouse_idx });
components::player_command_button<"warehousetp">(g_player_service->get_selected(), {(uint64_t)g.session.send_to_warehouse_idx});
components::button("TP_TO_DARTS"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::Darts); });
components::button("TP_TO_DARTS"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::Darts);
});
ImGui::SameLine();
components::button("TP_TO_FLIGHT_SCHOOL"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::PilotSchool); });
components::button("TP_TO_FLIGHT_SCHOOL"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::PilotSchool);
});
ImGui::SameLine();
components::button("TP_TO_MAP_CENTER"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::ArmWresling); });
components::button("TP_TO_MAP_CENTER"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::ArmWresling);
});
components::button("TP_TO_SKYDIVE"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::Skydive); });
components::button("TP_TO_SKYDIVE"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::Skydive);
});
ImGui::SameLine();
components::player_command_button<"cayotp">(g_player_service->get_selected(), { });
components::player_command_button<"cayotp">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 81 }, "TP To MOC");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {81}, "TP To MOC");
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 123 }, "TP To Casino");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {123}, "TP To Casino");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 124 }, "TP To Penthouse");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {124}, "TP To Penthouse");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 128 }, "TP To Arcade");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {128}, "TP To Arcade");
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 146 }, "TP To Music Locker");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {146}, "TP To Music Locker");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 148 }, "TP To Record A Studios");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {148}, "TP To Record A Studios");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 149 }, "TP To Custom Auto Shop");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {149}, "TP To Custom Auto Shop");
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 155 }, "TP To Agency");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {155}, "TP To Agency");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 160 }, "TP To Freakshop");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {160}, "TP To Freakshop");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 161 }, "TP To Multi Floor Garage");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {161}, "TP To Multi Floor Garage");
ImGui::SameLine();
components::player_command_button<"giveweaps">(g_player_service->get_selected(), { });
ImGui::SameLine();
components::player_command_button<"remweaps">(g_player_service->get_selected(), { });
components::player_command_button<"tutorial">(g_player_service->get_selected(), { });
components::player_command_button<"giveweaps">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"golf">(g_player_service->get_selected(), { });
ImGui::SameLine();
components::player_command_button<"flightschool">(g_player_service->get_selected(), { });
ImGui::SameLine();
components::player_command_button<"darts">(g_player_service->get_selected(), { });
components::player_command_button<"remweaps">(g_player_service->get_selected(), {});
components::player_command_button<"badlands">(g_player_service->get_selected(), { });
components::player_command_button<"tutorial">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"spacemonkey">(g_player_service->get_selected(), { });
components::player_command_button<"golf">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"wizard">(g_player_service->get_selected(), { });
components::player_command_button<"flightschool">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"darts">(g_player_service->get_selected(), {});
components::player_command_button<"qub3d">(g_player_service->get_selected(), { });
components::player_command_button<"badlands">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"camhedz">(g_player_service->get_selected(), { });
components::player_command_button<"spacemonkey">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"wizard">(g_player_service->get_selected(), {});
components::player_command_button<"qub3d">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"camhedz">(g_player_service->get_selected(), {});
components::small_text("WARP_TIME"_T);
components::button("PLUS_1_MINUTE"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 60 * 1000); });
components::button("PLUS_1_MINUTE"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_5_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 5 * 60 * 1000); });
components::button("PLUS_5_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 5 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_48_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 48 * 60 * 1000); });
components::button("PLUS_48_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 48 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_96_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 96 * 60 * 1000); });
components::button("PLUS_96_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 96 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_200_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 200 * 60 * 1000); });
components::button("PLUS_200_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 200 * 60 * 1000);
});
ImGui::SameLine();
components::button("STOP_TIME"_T, [] { toxic::set_time(g_player_service->get_selected(), INT_MAX - 3000); });
components::button("STOP_TIME"_T, [] {
toxic::set_time(g_player_service->get_selected(), INT_MAX - 3000);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("PLAYER_TOXIC_NO_WAY_BACK"_T.data());

View File

@ -1,7 +1,7 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "util/vehicle.hpp"
#include "util/troll.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
namespace big
{
@ -17,12 +17,14 @@ namespace big
components::player_command_button<"rcplayer">(g_player_service->get_selected());
static int bounty_value = 0;
ImGui::SliderInt("BOUNTY"_T.data(), &bounty_value, 0, 10000);
ImGui::SameLine();
components::command_checkbox<"anonbounty">();
ImGui::SameLine();
components::button("SET"_T, [] { troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value, g.session.anonymous_bounty);});
components::button("SET"_T, [] {
troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value, g.session.anonymous_bounty);
});
ImGui::TreePop();
}