@@ -90,28 +90,32 @@ __forceinline I v(void* iface, unsigned int index) { return (I)((*(unsigned int*
90
90
using matrix_t = float [3 ][4 ];
91
91
using matrix4x4_t = float [4 ][4 ];
92
92
// config system
93
- unsigned long long config;
94
93
bool menu_open = true ;
95
- enum {
96
- BHOP = 1 ,
97
- AUTOPISTOL = 2 ,
98
- HITSOUND = 4 ,
99
- BOX_ESP = 8 ,
100
- NAME_ESP = 16 ,
101
- HEALTH_BAR = 32 ,
102
- ESP_TEAM = 64 ,
103
- SPECTATOR_LIST = 128 ,
104
- DISABLE_POSTPROCESS = 256 ,
105
- ESP_DORMANT = 512 ,
106
- NOSCOPE_CROSSHAIR = 1024 ,
107
- RECOIL_CROSSHAIR = 2048 ,
108
- DEAD_ESP = 4096 ,
109
- AUTO_ACCEPT = 8192 ,
110
- TRIGGERBOT = 16384 ,
111
- GAMEKEYBOARD = 32768 ,
112
- RADAR = 65536 ,
113
- BROKEN = 131702 , // do not assign this to anything
114
- };
94
+ struct sconfig {
95
+ struct saim {
96
+ bool m_bTriggerbot;
97
+ bool m_bAutoPistol;
98
+ }aimbot;
99
+ struct svisuals {
100
+ bool m_bBoxESP;
101
+ bool m_bNameESP;
102
+ bool m_bHealthBar;
103
+ bool m_bTargetTeam;
104
+ bool m_bDormanyCheck;
105
+ bool m_bOnlyOnDead;
106
+ bool m_bRadar;
107
+ bool m_bDisablePostProcess;
108
+ }visuals;
109
+ struct smisc {
110
+ bool m_bBhop;
111
+ bool m_bHitSound;
112
+ bool m_bNoScopeCrosshair;
113
+ bool m_bRecoilCrosshair;
114
+ bool m_bAutoAccept;
115
+ bool m_bGameKeyboard;
116
+ bool m_bSpectatorList;
117
+ }misc;
118
+ }config;
115
119
class vec3 {
116
120
public:
117
121
float x, y, z;
@@ -422,16 +426,14 @@ bool IsMouseInRegion(int x, int y, int w, int h) {
422
426
#include < iostream>
423
427
#include < fstream>
424
428
void load () { // not proud of using cpp here, but line count matters...
425
- std::ifstream ss;
426
- ss.open (" singlefile.cfg" );
427
- if (!ss.good ())
428
- return ;
429
- ss >> config;
429
+ FILE* cfg = fopen (" singlefile.cfg" , " r" );
430
+ fread (&config, sizeof (config), 1 , cfg);
431
+ fclose (cfg);
430
432
}
431
433
void save () {
432
- std::ofstream ss ;
433
- ss. open ( " singlefile. cfg" );
434
- ss << config ;
434
+ FILE* cfg = fopen ( " singlefile.cfg " , " w " ) ;
435
+ fwrite (&config, sizeof (config), 1 , cfg);
436
+ fclose (cfg) ;
435
437
}
436
438
namespace menu {
437
439
unsigned long font, esp;
@@ -468,12 +470,12 @@ namespace menu {
468
470
interfaces.surface ->DrawFilledRect (x_pos - 5 , rpos + 26 , 1 , vheight - 60 + 24 );
469
471
y_pos = rpos + 25 ;
470
472
}
471
- void checkbox (const wchar_t * name, unsigned long long * config, unsigned long long option) {
473
+ void checkbox (const wchar_t * name, bool * option) {
472
474
interfaces.surface ->SetColor (27 , 27 , 27 , 255 );
473
475
interfaces.surface ->DrawRectOutline (x_pos, y_pos, 12 , 12 );
474
476
interfaces.surface ->SetColor (37 , 37 , 38 , 255 );
475
477
interfaces.surface ->DrawFilledRect (x_pos + 1 , y_pos + 1 , 10 , 10 );
476
- if (*config & option) {
478
+ if (*option) {
477
479
interfaces.surface ->SetColor (25 , 100 , 255 , 255 );
478
480
interfaces.surface ->DrawFilledRect (x_pos + 1 , y_pos + 1 , 10 , 10 );
479
481
}
@@ -482,7 +484,7 @@ namespace menu {
482
484
interfaces.surface ->SetTextFont (menu::font);
483
485
interfaces.surface ->DrawText (name, wcslen (name));
484
486
if (IsMouseInRegion (x_pos, y_pos, 12 , 12 ) && GetAsyncKeyState (VK_LBUTTON) & 1 && GetAsyncKeyState (VK_LBUTTON))
485
- *config ^= option;
487
+ *option = !(* option) ;
486
488
y_pos += 15 ;
487
489
}
488
490
bool button (const wchar_t * name, vec2 pos, vec2 size) {
@@ -511,25 +513,25 @@ void SetupFonts() {
511
513
}
512
514
void RenderMenu () {
513
515
menu::window (L" singlefile csgo internal" , { 50 , 50 }, { 420 , 260 });
514
- menu::checkbox (L" bhop" , &config, BHOP );
515
- menu::checkbox (L" auto pistol" , &config, AUTOPISTOL );
516
- menu::checkbox (L" hitsound" , &config, HITSOUND );
517
- menu::checkbox (L" box esp" , &config, BOX_ESP );
518
- menu::checkbox (L" name esp" , &config, NAME_ESP );
519
- menu::checkbox (L" health bar" , &config, HEALTH_BAR );
520
- menu::checkbox (L" dormant esp" , &config, ESP_DORMANT );
521
- menu::checkbox (L" team esp" , &config, ESP_TEAM );
522
- menu::checkbox (L" spectator list" , &config, SPECTATOR_LIST );
523
- menu::checkbox (L" disable post process" , &config, DISABLE_POSTPROCESS );
524
- menu::checkbox (L" noscope crosshair" , &config, NOSCOPE_CROSSHAIR );
525
- menu::checkbox (L" recoil crosshair" , &config, RECOIL_CROSSHAIR );
526
- menu::checkbox (L" auto accept" , &config, AUTO_ACCEPT );
516
+ menu::checkbox (L" bhop" , &config. misc . m_bBhop );
517
+ menu::checkbox (L" auto pistol" , &config. aimbot . m_bAutoPistol );
518
+ menu::checkbox (L" hitsound" , &config. misc . m_bHitSound );
519
+ menu::checkbox (L" box esp" , &config. visuals . m_bBoxESP );
520
+ menu::checkbox (L" name esp" , &config. visuals . m_bNameESP );
521
+ menu::checkbox (L" health bar" , &config. visuals . m_bHealthBar );
522
+ menu::checkbox (L" dormant esp" , &config. visuals . m_bDormanyCheck );
523
+ menu::checkbox (L" team esp" , &config. visuals . m_bTargetTeam );
524
+ menu::checkbox (L" spectator list" , &config. misc . m_bSpectatorList );
525
+ menu::checkbox (L" disable post process" , &config. visuals . m_bDisablePostProcess );
526
+ menu::checkbox (L" noscope crosshair" , &config. misc . m_bNoScopeCrosshair );
527
+ menu::checkbox (L" recoil crosshair" , &config. misc . m_bRecoilCrosshair );
528
+ menu::checkbox (L" auto accept" , &config. misc . m_bAutoAccept );
527
529
528
530
menu::column (184 );
529
531
530
- menu::checkbox (L" triggerbot" , &config, TRIGGERBOT );
531
- menu::checkbox (L" radar" , &config, RADAR );
532
- menu::checkbox (L" disable keyboard in menu" , &config, GAMEKEYBOARD );
532
+ menu::checkbox (L" triggerbot" , &config. aimbot . m_bTriggerbot );
533
+ menu::checkbox (L" radar" , &config. visuals . m_bRadar );
534
+ menu::checkbox (L" disable keyboard in menu" , &config. misc . m_bGameKeyboard );
533
535
534
536
if (menu::button (L" load" , {60 , 270 }, {195 , 30 }))
535
537
load ();
@@ -581,7 +583,7 @@ enum {
581
583
IN_COUNT = 1 << 26 ,
582
584
};
583
585
void bhop (CUserCmd* cmd) {
584
- if (config & BHOP ) {
586
+ if (config. misc . m_bBhop ) {
585
587
CBaseEntity* localplayer = interfaces.entitylist ->GetEntity (interfaces.engine ->GetLocalPlayer ());
586
588
if (localplayer->GetHealth () == 0 )
587
589
return ;
@@ -593,7 +595,7 @@ void bhop(CUserCmd* cmd) {
593
595
}
594
596
}
595
597
void autopistol (CUserCmd* cmd) {
596
- if (config & AUTOPISTOL ) {
598
+ if (config. aimbot . m_bAutoPistol ) {
597
599
CBaseEntity* localplayer = interfaces.entitylist ->GetEntity (interfaces.engine ->GetLocalPlayer ());
598
600
if (localplayer->GetHealth () == 0 )
599
601
return ;
@@ -607,7 +609,8 @@ void autopistol(CUserCmd* cmd) {
607
609
void autoaccept (const char * sound) {
608
610
if (strstr (sound, " UIPanorama.popup_accept_match_beep" )) {
609
611
static bool (__stdcall * SetLPReady)(const char *) = (decltype (SetLPReady))PatternScan (client_dll, " 55 8B EC 83 E4 F8 8B 4D 08 BA ? ? ? ? E8 ? ? ? ? 85 C0 75 12" );
610
- SetLPReady (" " );
612
+ if (config.misc .m_bAutoAccept )
613
+ SetLPReady (" " );
611
614
}
612
615
}
613
616
template <typename T>
@@ -699,27 +702,27 @@ void players() {
699
702
if (!interfaces.engine ->IsInGame ())
700
703
return ;
701
704
CBaseEntity* localplayer = interfaces.entitylist ->GetEntity (interfaces.engine ->GetLocalPlayer ());
702
- if (localplayer->GetHealth () > 0 && (config & DEAD_ESP ))
705
+ if (localplayer->GetHealth () > 0 && (config. visuals . m_bOnlyOnDead ))
703
706
return ;
704
707
for (int i = 1 ; i <= interfaces.engine ->GetMaxClients (); i++) {
705
708
CBaseEntity* entity = interfaces.entitylist ->GetEntity (i);
706
709
if (!entity || entity->GetHealth () == 0 || entity->GetClientClass ()->m_nClassID != CCSPlayer)
707
710
continue ;
708
- if (!(config & ESP_TEAM ) && entity->GetTeamNumber () == localplayer->GetTeamNumber ())
711
+ if (!(config. visuals . m_bTargetTeam ) && entity->GetTeamNumber () == localplayer->GetTeamNumber ())
709
712
continue ;
710
- if (!(config & ESP_DORMANT ) && entity->IsDormant ())
713
+ if (!(config. visuals . m_bDormanyCheck ) && entity->IsDormant ())
711
714
continue ;
712
715
bbox box;
713
716
if (!getbbot (entity, box))
714
717
continue ;
715
- if (config & BOX_ESP ) {
718
+ if (config. visuals . m_bBoxESP ) {
716
719
interfaces.surface ->SetColor (255 , 255 , 255 , 255 );
717
720
interfaces.surface ->DrawRectOutline (box.x , box.y , box.w , box.h );
718
721
interfaces.surface ->SetColor (0 , 0 , 0 , 255 );
719
722
interfaces.surface ->DrawRectOutline (box.x + 1 , box.y + 1 , box.w - 2 , box.h - 2 );
720
723
interfaces.surface ->DrawRectOutline (box.x - 1 , box.y - 1 , box.w + 2 , box.h + 2 );
721
724
}
722
- if (config & NAME_ESP ) {
725
+ if (config. visuals . m_bNameESP ) {
723
726
interfaces.surface ->SetTextColor (255 , 255 , 255 , 255 );
724
727
interfaces.surface ->SetTextFont (menu::font);
725
728
unsigned int o, p;
@@ -732,7 +735,7 @@ void players() {
732
735
interfaces.surface ->DrawText (wname, wcslen (wname));
733
736
}
734
737
}
735
- if (config & HEALTH_BAR ) {
738
+ if (config. visuals . m_bHealthBar ) {
736
739
rgba healthclr;
737
740
if (entity->GetHealth () > 100 )
738
741
healthclr = rgba (0 , 255 , 0 , 255 );
@@ -743,15 +746,15 @@ void players() {
743
746
interfaces.surface ->SetColor (healthclr.r , healthclr.g , healthclr.b , healthclr.a );
744
747
interfaces.surface ->DrawFilledRect (box.x - 9 , box.y + box.h - ((box.h * (entity->GetHealth () / 100 .f ))), 3 , (box.h * entity->GetHealth () / 100 .f ) + (entity->GetHealth () == 100 ? 0 : 1 ));
745
748
}
746
- if (config & RADAR )
749
+ if (config. visuals . m_bRadar )
747
750
entity->Spotted () = true ;
748
751
}
749
752
}
750
753
void cvars () {
751
754
CBaseEntity* localplayer = interfaces.entitylist ->GetEntity (interfaces.engine ->GetLocalPlayer ());
752
- interfaces.cvar ->FindVar (" mat_postprocess_enable" )->SetValue (config & DISABLE_POSTPROCESS ? 0 : 1 );
753
- interfaces.cvar ->FindVar (" cl_crosshair_recoil" )->SetValue (config & RECOIL_CROSSHAIR ? 1 : 0 ); // i'm sure the ? 1 : 0 doesn't matter but this feels better. /shrug
754
- interfaces.cvar ->FindVar (" weapon_debug_spread_show" )->SetValue (((config & NOSCOPE_CROSSHAIR ) && !localplayer->IsScoped ()) ? 2 : 0 );
755
+ interfaces.cvar ->FindVar (" mat_postprocess_enable" )->SetValue (config. visuals . m_bDisablePostProcess ? 0 : 1 );
756
+ interfaces.cvar ->FindVar (" cl_crosshair_recoil" )->SetValue (config. misc . m_bRecoilCrosshair ? 1 : 0 ); // i'm sure the ? 1 : 0 doesn't matter but this feels better. /shrug
757
+ interfaces.cvar ->FindVar (" weapon_debug_spread_show" )->SetValue (((config. misc . m_bNoScopeCrosshair ) && !localplayer->IsScoped ()) ? 2 : 0 );
755
758
if (localplayer->GetHealth () < 0 && localplayer->GetObserverTarget ())
756
759
localplayer->ObserverMode () = 5 ;
757
760
else
@@ -764,7 +767,7 @@ void speclist() {
764
767
CBaseEntity* localplayer = interfaces.entitylist ->GetEntity (interfaces.engine ->GetLocalPlayer ());
765
768
if (!localplayer)
766
769
return ;
767
- if (config & SPECTATOR_LIST ) {
770
+ if (config. misc . m_bSpectatorList ) {
768
771
for (int i = 1 ; i <= interfaces.engine ->GetMaxClients (); i++) {
769
772
CBaseEntity* entity = interfaces.entitylist ->GetEntity (i);
770
773
if (!entity || entity->GetHealth () > 0 || !entity->GetObserverTarget ())
@@ -788,7 +791,7 @@ void speclist() {
788
791
b = 0 ;
789
792
}
790
793
void triggerbot (CUserCmd* cmd) {
791
- if (!(config & TRIGGERBOT ))
794
+ if (!(config. aimbot . m_bTriggerbot ))
792
795
return ;
793
796
CBaseEntity* lp = interfaces.entitylist ->GetEntity (interfaces.engine ->GetLocalPlayer ());
794
797
if (!lp || (lp->GetHealth () < 1 ) || !lp->CrosshairTarget ())
@@ -816,7 +819,7 @@ void __stdcall _EmitSound(void* filter, int entityIndex, int channel, const char
816
819
return EmitSoundOriginal (filter, entityIndex, channel, soundEntry, soundEntryHash, sample, volume, seed, soundLevel, flags, pitch, origin, direction, utlVecOrigins, updatePositions, soundtime, speakerentity, soundParams);
817
820
}
818
821
bool __stdcall _GameEvents (IGameEvent* event) {
819
- if (config & HITSOUND ) {
822
+ if (config. misc . m_bHitSound ) {
820
823
if (strstr (event->GetName (), " player_hurt" )) {
821
824
SPlayerInfo player;
822
825
interfaces.engine ->GetPlayerInfo (interfaces.engine ->GetLocalPlayer (), &player);
@@ -836,7 +839,7 @@ void __stdcall _PaintTraverse(unsigned int panel, bool m_bForceRepaint, bool m_b
836
839
}
837
840
if (drawing == fnv::hash (" FocusOverlayPanel" )) {
838
841
interfaces.panel ->SetInputMouseState (panel, menu_open);
839
- interfaces.panel ->SetInputKeyboardState (panel, menu_open && (config & GAMEKEYBOARD ));
842
+ interfaces.panel ->SetInputKeyboardState (panel, menu_open && (config. misc . m_bGameKeyboard ));
840
843
}
841
844
return PaintTraverseOriginal (interfaces.panel , panel, m_bForceRepaint, m_bAllowRepaint);
842
845
}
@@ -863,7 +866,7 @@ void __stdcall Init (HMODULE mod) {
863
866
AllocConsole ();
864
867
SetConsoleTitleA (" singlefile: console" );
865
868
freopen_s ((FILE**)stdout, " CONOUT$" , " w" , stdout);
866
- printf (" singlefile v1.1: loading... (compiled with %d lines of code)\n " , GetLineCount ());
869
+ printf (" singlefile v1.1.1 : loading... (compiled with %d lines of code)\n " , GetLineCount ());
867
870
csgo_window = FindWindowA (" Valve001" , nullptr );
868
871
orig_proc = (WNDPROC)SetWindowLongA (csgo_window, GWLP_WNDPROC, (LONG)Wndproc);
869
872
client_dll = GetModuleHandleA (" client.dll" );
@@ -872,7 +875,7 @@ void __stdcall Init (HMODULE mod) {
872
875
void * vgui2_dll = GetModuleHandleA (" vgui2.dll" );
873
876
void * vstdlib_dll = GetModuleHandleA (" vstdlib.dll" );
874
877
interfaces.engine = CreateInterface<IVEngineClient*>(engine_dll, " VEngineClient014" );
875
- if (!strstr (interfaces.engine ->GetVersionString (), " 1.37.8.5 " ))
878
+ if (!strstr (interfaces.engine ->GetVersionString (), " 1.37.8.6 " ))
876
879
printf (" note: you are using an unknown cs:go client version (%s). if you are expierencing crashes, you may need to update offsets. each offset in the source code has it's netvar name, or you can find it on hazedumper.\n " , interfaces.engine ->GetVersionString ());
877
880
interfaces.entitylist = CreateInterface<CBaseEntityList*>(client_dll, " VClientEntityList003" );
878
881
interfaces.surface = CreateInterface<CMatSystemSurface*>(surface_dll, " VGUI_Surface031" );
0 commit comments