Skip to content

Commit

Permalink
Neat update
Browse files Browse the repository at this point in the history
Added /  Improved:
No recoil,
Draw crosshair,
New GUI,
Draw esp lines,
Radar now looks a bit better,
Blacklist looks better,
Unlock all,
No hardcore restrictions

Something else too but I forgot
  • Loading branch information
womblee committed Jun 14, 2024
1 parent 9a64d4c commit de19407
Show file tree
Hide file tree
Showing 24 changed files with 512 additions and 85 deletions.
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Created by https://www.toptal.com/developers/gitignore/api/c++
# Edit at https://www.toptal.com/developers/gitignore?templates=c++

### C++ ###
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj
*.tlog
*.log
*.ipdb

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll
*.pdb

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Packages
/packages/
!packages/repositories.config

# .vs
/.vs/

# End of https://www.toptal.com/developers/gitignore/api/c++
Binary file modified .vs/spankerfield/v17/.suo
Binary file not shown.
Binary file modified .vs/spankerfield/v17/Browse.VC.db
Binary file not shown.
4 changes: 2 additions & 2 deletions spankerfield/Features/Blacklist/blacklist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using namespace big;
namespace plugins
{
int exclusive = 123456789; // Random persona ID which won't occur in a game by random.
int exclusive = 193738923; // Random persona ID which won't occur in a game by random chance.

std::filesystem::path get_path()
{
Expand Down Expand Up @@ -196,7 +196,7 @@ namespace plugins
if (nickname != bl.name)
request_name_change(bl.name);

m_drawing->AddText(g_globals.g_width / 2.f, 95.f + offset, g_settings.blacklist_color, 28.f, FL_CENTER_X, bl.name.c_str());
m_drawing->AddText(g_globals.g_width / 2.f, 75.f + offset, g_settings.blacklist_color, 26.f, FL_CENTER_X, bl.name.c_str());
offset += 20.f;
}
}
Expand Down
49 changes: 49 additions & 0 deletions spankerfield/Features/Crosshair/crosshair.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "crosshair.h"
#include "../../settings.h"
#include "../../Rendering/draw-list.h"

using namespace big;
namespace plugins
{
void draw_crosshair()
{
if (!g_settings.draw_crosshair) return;

const auto game_context = ClientGameContext::GetInstance();
if (!game_context) return;

const auto player_manager = game_context->m_pPlayerManager;
if (!player_manager) return;

const auto local_player = player_manager->m_pLocalPlayer;
if (!local_player) return;

const auto local_soldier = local_player->GetSoldier();
if (!local_soldier) return;

if (!local_soldier->IsAlive()) return;

// Positions
ImVec2 screen_center = ImVec2(ImGui::GetIO().DisplaySize.x / 2.0f, ImGui::GetIO().DisplaySize.y / 2.0f);
ImVec2 horizontal_start = ImVec2(screen_center.x - g_settings.crosshair_size / 2.0f, screen_center.y);
ImVec2 horizontal_end = ImVec2(screen_center.x + g_settings.crosshair_size / 2.0f, screen_center.y);
ImVec2 vertical_start = ImVec2(screen_center.x, screen_center.y - g_settings.crosshair_size / 2.0f);
ImVec2 vertical_end = ImVec2(screen_center.x, screen_center.y + g_settings.crosshair_size / 2.0f);

// Draw the shadow lines
if (g_settings.crosshair_shadow)
{
ImVec2 horizontal_start_shadow = ImVec2(horizontal_start.x + 1.35f, horizontal_start.y + 1.35f);
ImVec2 horizontal_end_shadow = ImVec2(horizontal_end.x + 1.35f, horizontal_end.y + 1.35f);
ImVec2 vertical_start_shadow = ImVec2(vertical_start.x + 1.35f, vertical_start.y + 1.35f);
ImVec2 vertical_end_shadow = ImVec2(vertical_end.x + 1.35f, vertical_end.y + 1.35f);

m_drawing->AddLine(horizontal_start_shadow, horizontal_end_shadow, ImColor(0.0f, 0.0f, 0.0f, 0.7f), g_settings.crosshair_thickness);
m_drawing->AddLine(vertical_start_shadow, vertical_end_shadow, ImColor(0.0f, 0.0f, 0.0f, 0.7f), g_settings.crosshair_thickness);
}

// Drawing colored crosshair
m_drawing->AddLine(horizontal_start, horizontal_end, g_settings.crosshair_color, g_settings.crosshair_thickness);
m_drawing->AddLine(vertical_start, vertical_end, g_settings.crosshair_color, g_settings.crosshair_thickness);
}
}
7 changes: 7 additions & 0 deletions spankerfield/Features/Crosshair/crosshair.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once
#include "../../SDK/sdk.h"

namespace plugins
{
void draw_crosshair();
}
43 changes: 43 additions & 0 deletions spankerfield/Features/ESP/esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ namespace plugins

if (get_box_coords(transform, &box_coords[0]) && distance <= g_settings.esp_distance)
{
float box_x = box_coords[0].x;
float box_y = box_coords[0].y;
float box_width = box_coords[1].x - box_coords[0].x;
float box_height = box_coords[1].y - box_coords[0].y;
float health = vehicle ? health_vehicle : health_player;
Expand All @@ -129,6 +131,47 @@ namespace plugins
m_drawing->DrawEspBox(g_settings.esp_box_style, box_coords[0].x, box_coords[0].y, box_coords[1].x - box_coords[0].x, box_coords[1].y - box_coords[0].y, box_color.Value.x, box_color.Value.y, box_color.Value.z, box_color.Value.w);
}

if (g_settings.esp_draw_line)
{
ImColor line_color = soldier->m_Occluded ? g_settings.esp_line_color_occluded : g_settings.esp_line_color;
ImVec2 box_center = ImVec2(box_coords[0].x + box_width / 2.0f, box_coords[0].y + box_height / 2.0f);
ImVec2 drawing_from;

switch (g_settings.esp_draw_line_from) {
case 0:
drawing_from = ImVec2(ImGui::GetIO().DisplaySize.x / 2.0f, ImGui::GetIO().DisplaySize.y / 2.0f);
break;
case 1:
drawing_from = ImVec2(ImGui::GetIO().DisplaySize.x / 2.0f, ImGui::GetIO().DisplaySize.y);
break;
case 2:
drawing_from = ImVec2(ImGui::GetIO().DisplaySize.x / 2.0f, 0);
break;
case 3:
drawing_from = ImVec2(0, ImGui::GetIO().DisplaySize.y / 2.0f);
break;
case 4:
drawing_from = ImVec2(ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y / 2.0f);
break;
case 5:
drawing_from = ImVec2(0, 0);
break;
case 6:
drawing_from = ImVec2(ImGui::GetIO().DisplaySize.x, 0);
break;
case 7:
drawing_from = ImVec2(0, ImGui::GetIO().DisplaySize.y);
break;
case 8:
drawing_from = ImVec2(ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y);
break;
default:
return; // Invalid position, do nothing
}

m_drawing->AddLine(drawing_from, box_center, line_color, g_settings.esp_line_thickness);
}

if (g_settings.esp_draw_health)
{
ImColor hb_color(BYTE(255 - max(health - max_health / 2, 0) * (255 / (max_health / 2))), BYTE(255 - max(max_health / 2 - health, 0) * (255 / (max_health / 2))), 0, 255);
Expand Down
5 changes: 2 additions & 3 deletions spankerfield/Features/Minimap/minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ namespace plugins
{
g_thread_pool->push([&]
{
g_globals.g_obs = is_process_running(xorstr_(L"obs64.exe"));
// There is no way the executable is in any other name, you must be running 64-bit...
g_globals.g_obs = is_process_running(xorstr_(L"obs64.exe"));
});

g_globals.g_obscheck = GetTickCount64();
}

if (g_globals.g_obs) return;
}

const auto game_context = ClientGameContext::GetInstance();
Expand Down
7 changes: 5 additions & 2 deletions spankerfield/Features/Radar/radar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ namespace plugins

const bool valid = IsValidPtr(local_soldier->m_pWeaponComponent) && IsValidPtr(local_soldier->m_pWeaponComponent->GetActiveSoldierWeapon()) && IsValidPtr(local_soldier->m_pWeaponComponent->GetActiveSoldierWeapon()->m_pAuthoritativeAiming) && local_soldier->m_pWeaponComponent->GetActiveSoldierWeapon()->m_pAuthoritativeAiming->m_Yaw;
if (!valid) return;

m_drawing->DrawFillArea(g_settings.radar_x, g_settings.radar_y, g_settings.radar_width, g_settings.radar_height, ImColor(0, 0, 0, 160));

// Radar itself
m_drawing->DrawFillArea(g_settings.radar_x, g_settings.radar_y, g_settings.radar_width, g_settings.radar_height, ImColor(0, 0, 0, 160));
m_drawing->AddCircleFilled(ImVec2(g_settings.radar_x + g_settings.radar_width / 2.0f, g_settings.radar_y + g_settings.radar_height / 2.0f), 3.5f, ImColor(255, 255, 255, 175));

// Dots
for (int i = 0; i < MAX_PLAYERS; i++)
{
const auto player = player_manager->m_ppPlayers[i];
Expand Down
93 changes: 93 additions & 0 deletions spankerfield/Features/Risky/risky.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#include "risky.h"
#include "../../settings.h"

using namespace big;
namespace plugins
{
void no_recoil()
{
if (!g_settings.no_recoil) return;

const auto game_context = ClientGameContext::GetInstance();
if (!game_context) return;

const auto player_manager = game_context->m_pPlayerManager;
if (!player_manager) return;

const auto local_player = player_manager->m_pLocalPlayer;
if (!local_player) return;

const auto local_soldier = local_player->GetSoldier();
if (!local_soldier) return;

if (local_soldier->IsAlive())
{
const auto weapon = WeaponFiring::GetInstance();
if (!weapon) return;

const auto is_hit_type = [weapon]() -> bool
{
switch (weapon->GetWeaponClass())
{
case WeaponClass::_12gauge:
case WeaponClass::_338Magnum:
case WeaponClass::_357Magnum:
case WeaponClass::_44Magnum:
case WeaponClass::_45cal:
case WeaponClass::_46x30mm:
case WeaponClass::_50cal:
case WeaponClass::_545x45mmWP:
case WeaponClass::_556x45mmNATO:
case WeaponClass::_57x28mm:
case WeaponClass::_58x42mm:
case WeaponClass::_762x39mmWP:
case WeaponClass::_762x51mmNATO:
case WeaponClass::_762x54mmR:
case WeaponClass::_9x19mm:
case WeaponClass::_9x39mm:
case WeaponClass::Assault:
case WeaponClass::Shotgun:
case WeaponClass::Smg:
case WeaponClass::Lmg:
case WeaponClass::Sniper:
return true;
default:
return false;
}
};

const auto sway = weapon->m_Sway;
if (!sway) return;

const auto data = sway->m_Data;
if (!data) return;

if (is_hit_type())
{
data->m_ShootingRecoilDecreaseScale = 100.0f;
data->m_FirstShotRecoilMultiplier = 0.0f;
}
}
}

void unlock_all()
{
if (!g_settings.unlock_all) return;

const auto settings = SyncedBFSettings::GetInstance();
if (!settings) return;

settings->m_AllUnlocksUnlocked = true;
}

void no_hc_restrictions()
{
if (!g_settings.no_hc_restrictions) return;

const auto settings = SyncedBFSettings::GetInstance();
if (!settings) return;

settings->m_DisableHitIndicators = false;
settings->m_NoMinimap = false;
}
}
9 changes: 9 additions & 0 deletions spankerfield/Features/Risky/risky.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once
#include "../../SDK/sdk.h"

namespace plugins
{
void no_recoil();
void unlock_all();
void no_hc_restrictions();
}
4 changes: 1 addition & 3 deletions spankerfield/Features/Spectator List/spectators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@ namespace plugins
if (!set)
{
ImGui::SetNextWindowSize(ImVec2(250, 125.f), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowPos(ImVec2(ImGui::GetIO().DisplaySize.x - 260.f, 8.f), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowPos(ImVec2(ImGui::GetIO().DisplaySize.x - 258.f, 8.f), ImGuiCond_FirstUseEver);
set = true;
}

if (ImGui::Begin(xorstr_("Spectator list"), nullptr, flags))
{
for (const auto& rs : spectators)
{
ImGui::Text(rs.c_str());
}
}
ImGui::End();
}
Expand Down
4 changes: 4 additions & 0 deletions spankerfield/Features/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace big
{
void features::draw()
{
plugins::draw_crosshair();
plugins::draw_spectators();
plugins::draw_esp();

Expand All @@ -27,6 +28,9 @@ namespace big
plugins::aimbot(delta_time);
}

plugins::unlock_all();
plugins::no_hc_restrictions();
plugins::no_recoil();
plugins::overheat_control();

plugins::spot_minimap();
Expand Down
2 changes: 2 additions & 0 deletions spankerfield/Features/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
#include "Blacklist/blacklist.h"
#include "Spectator List/spectators.h"
#include "ESP/esp.h"
#include "Crosshair/crosshair.h"
#include "Radar/radar.h"
#include "Explosives/explosives.h"
#include "Missiles/missiles.h"
#include "Jet Speed/jetspeed.h"
#include "Aimbot/aimbot.h"
#include "Risky/risky.h"
#include "Overheat/overheat.h"
#include "Infantry Alert/infantry_alert.h"

Expand Down
2 changes: 2 additions & 0 deletions spankerfield/Hooks/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace big
Sleep(15);
bool result = oBitBlt(hdcDst, x, y, cx, cy, hdcSrc, x1, y1, rop);
g_globals.g_fairfight = false;
LOG(INFO) << xorstr_("FairFight initiated a screenshot.");
return result;
}

Expand All @@ -41,6 +42,7 @@ namespace big
oTakeScreenshot(pThis);

g_globals.g_punkbuster = false;
LOG(INFO) << xorstr_("PunkBuster initiated a screenshot.");
}
}

Expand Down
Loading

0 comments on commit de19407

Please sign in to comment.