├── .gitignore
├── CSGOSimple.DotSettings
├── CSGOSimple.sln
├── CSGOSimple.sln.DotSettings
├── CSGOSimple
├── CSGOSimple.vcxproj
├── CSGOSimple.vcxproj.filters
├── UI.cpp
├── config.hpp
├── features
│ ├── bhop.cpp
│ ├── bhop.hpp
│ ├── chams.cpp
│ ├── chams.hpp
│ ├── glow.cpp
│ ├── glow.hpp
│ ├── visuals.cpp
│ └── visuals.hpp
├── fonts
│ ├── cousine.hpp
│ ├── droid.hpp
│ └── fonts.hpp
├── helpers
│ ├── input.cpp
│ ├── input.hpp
│ ├── math.cpp
│ ├── math.hpp
│ ├── utils.cpp
│ ├── utils.hpp
│ ├── vfunc_hook.cpp
│ └── vfunc_hook.hpp
├── hooks.cpp
├── hooks.hpp
├── imgui
│ ├── LICENSE.txt
│ ├── imconfig.h
│ ├── imgui.cpp
│ ├── imgui.h
│ ├── imgui_draw.cpp
│ ├── imgui_internal.h
│ ├── imgui_widgets.cpp
│ ├── impl
│ │ ├── imgui_impl_dx9.cpp
│ │ ├── imgui_impl_dx9.h
│ │ ├── imgui_impl_win32.cpp
│ │ └── imgui_impl_win32.h
│ ├── imstb_rectpack.h
│ ├── imstb_textedit.h
│ └── imstb_truetype.h
├── main.cpp
├── menu.cpp
├── menu.hpp
├── options.cpp
├── options.hpp
├── render.cpp
├── render.hpp
├── singleton.hpp
├── ui.hpp
└── valve_sdk
│ ├── csgostructs.cpp
│ ├── csgostructs.hpp
│ ├── interfaces
│ ├── CClientState.hpp
│ ├── CInput.hpp
│ ├── IAppSystem.hpp
│ ├── IBaseClientDll.hpp
│ ├── IClientEntity.hpp
│ ├── IClientEntityList.hpp
│ ├── IClientMode.hpp
│ ├── IClientNetworkable.hpp
│ ├── IClientRenderable.hpp
│ ├── IClientThinkable.hpp
│ ├── IClientUnknown.hpp
│ ├── ICollideable.hpp
│ ├── IConVar.hpp
│ ├── ICvar.hpp
│ ├── IEngineSound.hpp
│ ├── IEngineTrace.hpp
│ ├── IGameEventmanager.hpp
│ ├── IInputSystem.hpp
│ ├── IMDLCache.hpp
│ ├── IMaterialSystem.hpp
│ ├── IMoveHelper.hpp
│ ├── IPanel.hpp
│ ├── IPhysics.hpp
│ ├── IPrediction.hpp
│ ├── IRefCounted.hpp
│ ├── IRenderView.hpp
│ ├── ISurface.hpp
│ ├── IVDebugOverlay.hpp
│ ├── IVEngineClient.hpp
│ ├── IVModelInfoClient.hpp
│ ├── IVModelRender.hpp
│ └── IViewRender.hpp
│ ├── math
│ ├── QAngle.hpp
│ ├── VMatrix.cpp
│ ├── VMatrix.hpp
│ ├── Vector.hpp
│ ├── Vector2D.cpp
│ ├── Vector2D.hpp
│ ├── Vector4D.cpp
│ └── Vector4D.hpp
│ ├── misc
│ ├── BaseHandle.hpp
│ ├── CUserCmd.hpp
│ ├── ClientClass.hpp
│ ├── Color.cpp
│ ├── Color.hpp
│ ├── Convar.cpp
│ ├── Convar.hpp
│ ├── EHandle.hpp
│ ├── Enums.hpp
│ ├── GlobalVars.hpp
│ ├── IHandleEntity.hpp
│ ├── Recv.hpp
│ ├── Studio.hpp
│ ├── UtlBuffer.cpp
│ ├── UtlBuffer.hpp
│ ├── UtlMemory.hpp
│ ├── UtlString.cpp
│ ├── UtlString.hpp
│ ├── UtlVector.hpp
│ ├── characterset.cpp
│ ├── characterset.hpp
│ ├── checksum_crc.cpp
│ ├── checksum_crc.hpp
│ ├── checksum_md5.cpp
│ ├── checksum_md5.hpp
│ ├── datamap.hpp
│ ├── glow_outline_effect.hpp
│ ├── platform.hpp
│ └── vfunc.hpp
│ ├── netvars.cpp
│ ├── netvars.hpp
│ ├── sdk.cpp
│ └── sdk.hpp
├── LICENSE
├── README.md
└── SimpleInjector
├── README.md
├── SimpleInjector.vcxproj
├── SimpleInjector.vcxproj.filters
└── main.cpp
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]elease(debug)/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # MSTest test Results
34 | [Tt]est[Rr]esult*/
35 | [Bb]uild[Ll]og.*
36 |
37 | # NUNIT
38 | *.VisualState.xml
39 | TestResult.xml
40 |
41 | # Build Results of an ATL Project
42 | [Dd]ebugPS/
43 | [Rr]eleasePS/
44 | dlldata.c
45 |
46 | # Benchmark Results
47 | BenchmarkDotNet.Artifacts/
48 |
49 | # .NET Core
50 | project.lock.json
51 | project.fragment.lock.json
52 | artifacts/
53 | **/Properties/launchSettings.json
54 |
55 | *_i.c
56 | *_p.c
57 | *_i.h
58 | *.ilk
59 | *.meta
60 | *.obj
61 | *.pch
62 | *.pdb
63 | *.pgc
64 | *.pgd
65 | *.rsp
66 | *.sbr
67 | *.tlb
68 | *.tli
69 | *.tlh
70 | *.tmp
71 | *.tmp_proj
72 | *.log
73 | *.vspscc
74 | *.vssscc
75 | .builds
76 | *.pidb
77 | *.svclog
78 | *.scc
79 |
80 | # Chutzpah Test files
81 | _Chutzpah*
82 |
83 | # Visual C++ cache files
84 | ipch/
85 | *.aps
86 | *.ncb
87 | *.opendb
88 | *.opensdf
89 | *.sdf
90 | *.cachefile
91 | *.VC.db
92 | *.VC.VC.opendb
93 |
94 | # Visual Studio profiler
95 | *.psess
96 | *.vsp
97 | *.vspx
98 | *.sap
99 |
100 | # TFS 2012 Local Workspace
101 | $tf/
102 |
103 | # Guidance Automation Toolkit
104 | *.gpState
105 |
106 | # ReSharper is a .NET coding add-in
107 | _ReSharper*/
108 | *.[Rr]e[Ss]harper
109 | *.DotSettings.user
110 |
111 | # JustCode is a .NET coding add-in
112 | .JustCode
113 |
114 | # TeamCity is a build add-in
115 | _TeamCity*
116 |
117 | # DotCover is a Code Coverage Tool
118 | *.dotCover
119 |
120 | # Visual Studio code coverage results
121 | *.coverage
122 | *.coveragexml
123 |
124 | # NCrunch
125 | _NCrunch_*
126 | .*crunch*.local.xml
127 | nCrunchTemp_*
128 |
129 | # MightyMoose
130 | *.mm.*
131 | AutoTest.Net/
132 |
133 | # Web workbench (sass)
134 | .sass-cache/
135 |
136 | # Installshield output folder
137 | [Ee]xpress/
138 |
139 | # DocProject is a documentation generator add-in
140 | DocProject/buildhelp/
141 | DocProject/Help/*.HxT
142 | DocProject/Help/*.HxC
143 | DocProject/Help/*.hhc
144 | DocProject/Help/*.hhk
145 | DocProject/Help/*.hhp
146 | DocProject/Help/Html2
147 | DocProject/Help/html
148 |
149 | # Click-Once directory
150 | publish/
151 |
152 | # Publish Web Output
153 | *.[Pp]ublish.xml
154 | *.azurePubxml
155 | # TODO: Comment the next line if you want to checkin your web deploy settings
156 | # but database connection strings (with potential passwords) will be unencrypted
157 | *.pubxml
158 | *.publishproj
159 |
160 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
161 | # checkin your Azure Web App publish settings, but sensitive information contained
162 | # in these scripts will be unencrypted
163 | PublishScripts/
164 |
165 | # NuGet Packages
166 | *.nupkg
167 | # The packages folder can be ignored because of Package Restore
168 | **/packages/*
169 | # except build/, which is used as an MSBuild target.
170 | !**/packages/build/
171 | # Uncomment if necessary however generally it will be regenerated when needed
172 | #!**/packages/repositories.config
173 | # NuGet v3's project.json files produces more ignorable files
174 | *.nuget.props
175 | *.nuget.targets
176 |
177 | # Microsoft Azure Build Output
178 | csx/
179 | *.build.csdef
180 |
181 | # Microsoft Azure Emulator
182 | ecf/
183 | rcf/
184 |
185 | # Windows Store app package directories and files
186 | AppPackages/
187 | BundleArtifacts/
188 | Package.StoreAssociation.xml
189 | _pkginfo.txt
190 | *.appx
191 |
192 | # Visual Studio cache files
193 | # files ending in .cache can be ignored
194 | *.[Cc]ache
195 | # but keep track of directories ending in .cache
196 | !*.[Cc]ache/
197 |
198 | # Others
199 | ClientBin/
200 | ~$*
201 | *~
202 | *.dbmdl
203 | *.dbproj.schemaview
204 | *.jfm
205 | *.pfx
206 | *.publishsettings
207 | orleans.codegen.cs
208 |
209 | # Since there are multiple workflows, uncomment next line to ignore bower_components
210 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
211 | #bower_components/
212 |
213 | # RIA/Silverlight projects
214 | Generated_Code/
215 |
216 | # Backup & report files from converting an old project file
217 | # to a newer Visual Studio version. Backup files are not needed,
218 | # because we have git ;-)
219 | _UpgradeReport_Files/
220 | Backup*/
221 | UpgradeLog*.XML
222 | UpgradeLog*.htm
223 |
224 | # SQL Server files
225 | *.mdf
226 | *.ldf
227 | *.ndf
228 |
229 | # Business Intelligence projects
230 | *.rdl.data
231 | *.bim.layout
232 | *.bim_*.settings
233 |
234 | # Microsoft Fakes
235 | FakesAssemblies/
236 |
237 | # GhostDoc plugin setting file
238 | *.GhostDoc.xml
239 |
240 | # Node.js Tools for Visual Studio
241 | .ntvs_analysis.dat
242 | node_modules/
243 |
244 | # Typescript v1 declaration files
245 | typings/
246 |
247 | # Visual Studio 6 build log
248 | *.plg
249 |
250 | # Visual Studio 6 workspace options file
251 | *.opt
252 |
253 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
254 | *.vbw
255 |
256 | # Visual Studio LightSwitch build output
257 | **/*.HTMLClient/GeneratedArtifacts
258 | **/*.DesktopClient/GeneratedArtifacts
259 | **/*.DesktopClient/ModelManifest.xml
260 | **/*.Server/GeneratedArtifacts
261 | **/*.Server/ModelManifest.xml
262 | _Pvt_Extensions
263 |
264 | # Paket dependency manager
265 | .paket/paket.exe
266 | paket-files/
267 |
268 | # FAKE - F# Make
269 | .fake/
270 |
271 | # JetBrains Rider
272 | .idea/
273 | *.sln.iml
274 |
275 | # CodeRush
276 | .cr/
277 |
278 | # Python Tools for Visual Studio (PTVS)
279 | __pycache__/
280 | *.pyc
281 |
282 | # Cake - Uncomment if you are using it
283 | # tools/**
284 | # !tools/packages.config
285 |
286 | # Tabs Studio
287 | *.tss
288 |
289 | # Telerik's JustMock configuration file
290 | *.jmconfig
291 |
292 | # BizTalk build output
293 | *.btp.cs
294 | *.btm.cs
295 | *.odx.cs
296 | *.xsd.cs
--------------------------------------------------------------------------------
/CSGOSimple.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | NEXT_LINE
3 | True
4 | END_OF_LINE
5 | False
6 | False
7 | False
8 | False
9 | True
--------------------------------------------------------------------------------
/CSGOSimple.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CSGOSimple", "CSGOSimple\CSGOSimple.vcxproj", "{F3E42845-8D56-4BB3-821D-8163AB1337F0}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleInjector", "SimpleInjector\SimpleInjector.vcxproj", "{D6A5475A-A3D9-4971-B971-A94520CB0354}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|x64 = Debug|x64
13 | Debug|x86 = Debug|x86
14 | Release|x64 = Release|x64
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {F3E42845-8D56-4BB3-821D-8163AB1337F0}.Debug|x64.ActiveCfg = Debug|Win32
19 | {F3E42845-8D56-4BB3-821D-8163AB1337F0}.Debug|x86.ActiveCfg = Debug|Win32
20 | {F3E42845-8D56-4BB3-821D-8163AB1337F0}.Debug|x86.Build.0 = Debug|Win32
21 | {F3E42845-8D56-4BB3-821D-8163AB1337F0}.Release|x64.ActiveCfg = Release|Win32
22 | {F3E42845-8D56-4BB3-821D-8163AB1337F0}.Release|x86.ActiveCfg = Release|Win32
23 | {F3E42845-8D56-4BB3-821D-8163AB1337F0}.Release|x86.Build.0 = Release|Win32
24 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Debug|x64.ActiveCfg = Debug|x64
25 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Debug|x64.Build.0 = Debug|x64
26 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Debug|x86.ActiveCfg = Debug|Win32
27 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Debug|x86.Build.0 = Debug|Win32
28 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Release|x64.ActiveCfg = Release|x64
29 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Release|x64.Build.0 = Release|x64
30 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Release|x86.ActiveCfg = Release|Win32
31 | {D6A5475A-A3D9-4971-B971-A94520CB0354}.Release|x86.Build.0 = Release|Win32
32 | EndGlobalSection
33 | GlobalSection(SolutionProperties) = preSolution
34 | HideSolutionNode = FALSE
35 | EndGlobalSection
36 | EndGlobal
37 |
--------------------------------------------------------------------------------
/CSGOSimple.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | C:\Users\Marcelo\Documents\Development\Sources\CSGOSimple\CSGOSimple.DotSettings
3 | ..\CSGOSimple.DotSettings
4 | True
5 | True
6 | 1
--------------------------------------------------------------------------------
/CSGOSimple/config.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "options.hpp"
3 | #include "singleton.hpp"
4 |
5 | #include
6 |
7 |
8 |
9 |
10 | class Config : public Singleton {
11 | public:
12 | void Save() {
13 | std::ofstream fout("csgosimple.cfg", std::ios::binary);
14 | const auto sz = sizeof(Options);
15 | const auto var_sz = sizeof(Var);
16 | const auto cnt = sz / var_sz;
17 | for (auto i = 0; i < cnt; i++) {
18 | const auto el = &(*(Var*)(&g_Options)) + i;
19 | auto name = el->name;
20 | auto val = el->value;
21 | auto sizeof_val = el->size;
22 | fout << name << "\t" << Utils::BytesToString((unsigned char*)*(int*)&val, sizeof_val) << std::endl;
23 | }
24 | fout.close();
25 | }
26 |
27 |
28 | void Load() {
29 | std::ifstream fin("csgosimple.cfg", std::ios::binary);
30 | std::stringstream ss;
31 | ss << fin.rdbuf();
32 |
33 |
34 | auto lines = Utils::Split(ss.str(), "\n");
35 |
36 | for (auto line : lines) {
37 | auto data = Utils::Split(line, "\t");
38 | const auto sz = sizeof(Options);
39 | const auto var_sz = sizeof(Var);
40 | const auto cnt = sz / var_sz;
41 | for (auto i = 0; i < cnt; i++) {
42 | const auto &el = &(*(Var*)(&g_Options)) + i;
43 | if (data[0] == el->name) {
44 | auto bytes = Utils::HexToBytes(data[1]);
45 | memcpy(*(void**)&el->value, bytes.data(), el->size);
46 | }
47 | }
48 | }
49 | fin.close();
50 | }
51 | };
--------------------------------------------------------------------------------
/CSGOSimple/features/bhop.cpp:
--------------------------------------------------------------------------------
1 | #include "bhop.hpp"
2 |
3 | #include "../valve_sdk/csgostructs.hpp"
4 |
5 | void BunnyHop::OnCreateMove(CUserCmd* cmd)
6 | {
7 | static bool jumped_last_tick = false;
8 | static bool should_fake_jump = false;
9 |
10 | if (!g_LocalPlayer)
11 | return;
12 |
13 | if (!g_LocalPlayer->IsAlive())
14 | return;
15 |
16 | if (g_LocalPlayer->m_nMoveType() == MOVETYPE_LADDER || g_LocalPlayer->m_nMoveType() == MOVETYPE_NOCLIP)
17 | return;
18 |
19 | if (g_LocalPlayer->m_fFlags() & FL_INWATER)
20 | return;
21 |
22 | if(!jumped_last_tick && should_fake_jump) {
23 | should_fake_jump = false;
24 | cmd->buttons |= IN_JUMP;
25 | } else if(cmd->buttons & IN_JUMP) {
26 | if(g_LocalPlayer->m_fFlags() & FL_ONGROUND) {
27 | jumped_last_tick = true;
28 | should_fake_jump = true;
29 | } else {
30 | cmd->buttons &= ~IN_JUMP;
31 | jumped_last_tick = false;
32 | }
33 | } else {
34 | jumped_last_tick = false;
35 | should_fake_jump = false;
36 | }
37 | }
--------------------------------------------------------------------------------
/CSGOSimple/features/bhop.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class C_BasePlayer;
4 | class CUserCmd;
5 |
6 | namespace BunnyHop
7 | {
8 | void OnCreateMove(CUserCmd* cmd);
9 | }
--------------------------------------------------------------------------------
/CSGOSimple/features/chams.cpp:
--------------------------------------------------------------------------------
1 | #include "chams.hpp"
2 | #include
3 |
4 | #include "../valve_sdk/csgostructs.hpp"
5 | #include "../options.hpp"
6 | #include "../hooks.hpp"
7 | #include "../helpers/input.hpp"
8 |
9 |
10 | Chams::Chams() {
11 | materialRegular = g_MatSystem->FindMaterial("debug/debugambientcube");
12 | materialFlat = g_MatSystem->FindMaterial("debug/debugdrawflat");
13 | }
14 |
15 | Chams::~Chams() {
16 | }
17 |
18 |
19 | void Chams::OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba) {
20 | IMaterial* material = nullptr;
21 |
22 | if (flat) {
23 | material = materialFlat;
24 | }
25 | else {
26 | material = materialRegular;
27 | }
28 |
29 | material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, ignoreZ);
30 |
31 |
32 | if (glass) {
33 | material = materialFlat;
34 | material->AlphaModulate(0.45f);
35 | }
36 | else {
37 | material->AlphaModulate(
38 | rgba.a() / 255.0f);
39 | }
40 |
41 | material->SetMaterialVarFlag(MATERIAL_VAR_WIREFRAME, wireframe);
42 | material->ColorModulate(
43 | rgba.r() / 255.0f,
44 | rgba.g() / 255.0f,
45 | rgba.b() / 255.0f);
46 |
47 | g_MdlRender->ForcedMaterialOverride(material);
48 | }
49 |
50 |
51 | void Chams::OnDrawModelExecute(
52 | IMatRenderContext* ctx,
53 | const DrawModelState_t& state,
54 | const ModelRenderInfo_t& info,
55 | matrix3x4_t* matrix)
56 | {
57 | static auto fnDME = Hooks::mdlrender_hook.get_original(index::DrawModelExecute);
58 |
59 | const auto mdl = info.pModel;
60 |
61 | bool is_arm = strstr(mdl->szName, "arms") != nullptr;
62 | bool is_player = strstr(mdl->szName, "models/player") != nullptr;
63 | bool is_sleeve = strstr(mdl->szName, "sleeve") != nullptr;
64 | //bool is_weapon = strstr(mdl->szName, "weapons/v_") != nullptr;
65 |
66 | if (is_player && g_Options.chams_player_enabled) {
67 | //
68 | // Draw player Chams.
69 | //
70 | auto ent = C_BasePlayer::GetPlayerByIndex(info.entity_index);
71 |
72 | if (ent && g_LocalPlayer && ent->IsAlive()) {
73 | const auto enemy = ent->m_iTeamNum() != g_LocalPlayer->m_iTeamNum();
74 | if (!enemy && g_Options.chams_player_enemies_only)
75 | return;
76 |
77 | const auto clr_front = enemy ? g_Options.color_chams_player_enemy_visible : g_Options.color_chams_player_ally_visible;
78 | const auto clr_back = enemy ? g_Options.color_chams_player_enemy_occluded : g_Options.color_chams_player_ally_occluded;
79 |
80 | if (g_Options.chams_player_ignorez) {
81 | OverrideMaterial(
82 | true,
83 | g_Options.chams_player_flat,
84 | g_Options.chams_player_wireframe,
85 | false,
86 | clr_back);
87 | fnDME(g_MdlRender, 0, ctx, state, info, matrix);
88 | OverrideMaterial(
89 | false,
90 | g_Options.chams_player_flat,
91 | g_Options.chams_player_wireframe,
92 | false,
93 | clr_front);
94 | }
95 | else {
96 | OverrideMaterial(
97 | false,
98 | g_Options.chams_player_flat,
99 | g_Options.chams_player_wireframe,
100 | g_Options.chams_player_glass,
101 | clr_front);
102 | }
103 | }
104 | }
105 | else if (is_sleeve && g_Options.chams_arms_enabled) {
106 | auto material = g_MatSystem->FindMaterial(mdl->szName, TEXTURE_GROUP_MODEL);
107 | if (!material)
108 | return;
109 | //
110 | // Remove sleeves when drawing Chams.
111 | //
112 | material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
113 | g_MdlRender->ForcedMaterialOverride(material);
114 | }
115 | else if (is_arm) {
116 | auto material = g_MatSystem->FindMaterial(mdl->szName, TEXTURE_GROUP_MODEL);
117 | if (!material)
118 | return;
119 | if (g_Options.misc_no_hands) {
120 | //
121 | // No hands.
122 | //
123 | material->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
124 | g_MdlRender->ForcedMaterialOverride(material);
125 | }
126 | else if (g_Options.chams_arms_enabled) {
127 | if (g_Options.chams_arms_ignorez) {
128 | OverrideMaterial(
129 | true,
130 | g_Options.chams_arms_flat,
131 | g_Options.chams_arms_wireframe,
132 | false,
133 | g_Options.color_chams_arms_occluded);
134 | fnDME(g_MdlRender, 0, ctx, state, info, matrix);
135 | OverrideMaterial(
136 | false,
137 | g_Options.chams_arms_flat,
138 | g_Options.chams_arms_wireframe,
139 | false,
140 | g_Options.color_chams_arms_visible);
141 | }
142 | else {
143 | OverrideMaterial(
144 | false,
145 | g_Options.chams_arms_flat,
146 | g_Options.chams_arms_wireframe,
147 | g_Options.chams_arms_glass,
148 | g_Options.color_chams_arms_visible);
149 | }
150 | }
151 | }
152 | }
--------------------------------------------------------------------------------
/CSGOSimple/features/chams.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "../singleton.hpp"
4 |
5 | class IMatRenderContext;
6 | struct DrawModelState_t;
7 | struct ModelRenderInfo_t;
8 | class matrix3x4_t;
9 | class IMaterial;
10 | class Color;
11 |
12 | class Chams
13 | : public Singleton
14 | {
15 | friend class Singleton;
16 |
17 | Chams();
18 | ~Chams();
19 |
20 | public:
21 | void OnDrawModelExecute(
22 | IMatRenderContext* ctx,
23 | const DrawModelState_t &state,
24 | const ModelRenderInfo_t &pInfo,
25 | matrix3x4_t *pCustomBoneToWorld);
26 |
27 | private:
28 | void OverrideMaterial(bool ignoreZ, bool flat, bool wireframe, bool glass, const Color& rgba);
29 |
30 | IMaterial* materialRegular = nullptr;
31 | IMaterial* materialFlat = nullptr;
32 | };
--------------------------------------------------------------------------------
/CSGOSimple/features/glow.cpp:
--------------------------------------------------------------------------------
1 | #include "glow.hpp"
2 |
3 | #include "../valve_sdk/csgostructs.hpp"
4 | #include "../options.hpp"
5 |
6 | Glow::Glow()
7 | {
8 | }
9 |
10 | Glow::~Glow()
11 | {
12 | // We cannot call shutdown here unfortunately.
13 | // Reason is not very straightforward but anyways:
14 | // - This destructor will be called when the dll unloads
15 | // but it cannot distinguish between manual unload
16 | // (pressing the Unload button or calling FreeLibrary)
17 | // or unload due to game exit.
18 | // What that means is that this destructor will be called
19 | // when the game exits.
20 | // - When the game is exiting, other dlls might already
21 | // have been unloaded before us, so it is not safe to
22 | // access intermodular variables or functions.
23 | //
24 | // Trying to call Shutdown here will crash CSGO when it is
25 | // exiting (because we try to access g_GlowObjManager).
26 | //
27 | }
28 |
29 | void Glow::Shutdown()
30 | {
31 | // Remove glow from all entities
32 | for(auto i = 0; i < g_GlowObjManager->m_GlowObjectDefinitions.Count(); i++) {
33 | auto& glowObject = g_GlowObjManager->m_GlowObjectDefinitions[i];
34 | auto entity = reinterpret_cast(glowObject.m_pEntity);
35 |
36 | if(glowObject.IsUnused())
37 | continue;
38 |
39 | if(!entity || entity->IsDormant())
40 | continue;
41 |
42 | glowObject.m_flAlpha = 0.0f;
43 | }
44 | }
45 |
46 | void Glow::Run()
47 | {
48 | for(auto i = 0; i < g_GlowObjManager->m_GlowObjectDefinitions.Count(); i++) {
49 | auto& glowObject = g_GlowObjManager->m_GlowObjectDefinitions[i];
50 | auto entity = reinterpret_cast(glowObject.m_pEntity);
51 |
52 | if(glowObject.IsUnused())
53 | continue;
54 |
55 | if(!entity || entity->IsDormant())
56 | continue;
57 |
58 | auto class_id = entity->GetClientClass()->m_ClassID;
59 | auto color = Color{};
60 |
61 | switch(class_id) {
62 | case ClassId_CCSPlayer:
63 | {
64 | auto is_enemy = entity->m_iTeamNum() != g_LocalPlayer->m_iTeamNum();
65 |
66 | if(entity->HasC4() && is_enemy && g_Options.glow_c4_carrier) {
67 | color = g_Options.color_glow_c4_carrier;
68 | break;
69 | }
70 |
71 | if(!g_Options.glow_players || !entity->IsAlive())
72 | continue;
73 |
74 | if(!is_enemy && g_Options.glow_enemies_only)
75 | continue;
76 |
77 | color = is_enemy ? g_Options.color_glow_enemy : g_Options.color_glow_ally;
78 |
79 | break;
80 | }
81 | case ClassId_CChicken:
82 | if(!g_Options.glow_chickens)
83 | continue;
84 | entity->m_bShouldGlow() = true;
85 | color = g_Options.color_glow_chickens;
86 | break;
87 | case ClassId_CBaseAnimating:
88 | if(!g_Options.glow_defuse_kits)
89 | continue;
90 | color = g_Options.color_glow_defuse;
91 | break;
92 | case ClassId_CPlantedC4:
93 | if(!g_Options.glow_planted_c4)
94 | continue;
95 | color = g_Options.color_glow_planted_c4;
96 | break;
97 | default:
98 | {
99 | if(entity->IsWeapon()) {
100 | if(!g_Options.glow_weapons)
101 | continue;
102 | color = g_Options.color_glow_weapons;
103 | }
104 | }
105 | }
106 |
107 | glowObject.m_flRed = color.r() / 255.0f;
108 | glowObject.m_flGreen = color.g() / 255.0f;
109 | glowObject.m_flBlue = color.b() / 255.0f;
110 | glowObject.m_flAlpha = color.a() / 255.0f;
111 | glowObject.m_bRenderWhenOccluded = true;
112 | glowObject.m_bRenderWhenUnoccluded = false;
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/CSGOSimple/features/glow.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../Singleton.hpp"
3 |
4 | class Glow
5 | : public Singleton
6 | {
7 | friend class Singleton;
8 |
9 | Glow();
10 | ~Glow();
11 |
12 | public:
13 | void Run();
14 | void Shutdown();
15 | };
--------------------------------------------------------------------------------
/CSGOSimple/features/visuals.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "../singleton.hpp"
4 |
5 | #include "../render.hpp"
6 | #include "../helpers/math.hpp"
7 | #include "../valve_sdk/csgostructs.hpp"
8 |
9 |
10 |
11 |
12 | class Visuals : public Singleton
13 | {
14 | friend class Singleton;
15 |
16 | CRITICAL_SECTION cs;
17 |
18 | Visuals();
19 | ~Visuals();
20 | public:
21 | class Player
22 | {
23 | public:
24 | struct
25 | {
26 | C_BasePlayer* pl;
27 | bool is_enemy;
28 | bool is_visible;
29 | Color clr;
30 | Vector head_pos;
31 | Vector feet_pos;
32 | RECT bbox;
33 | } ctx;
34 |
35 | bool Begin(C_BasePlayer * pl);
36 | void RenderBox();
37 | void RenderName();
38 | void RenderWeaponName();
39 | void RenderHealth();
40 | void RenderArmour();
41 | void RenderSnapline();
42 | };
43 | void RenderCrosshair();
44 | void RenderWeapon(C_BaseCombatWeapon* ent);
45 | void RenderDefuseKit(C_BaseEntity* ent);
46 | void RenderPlantedC4(C_BaseEntity* ent);
47 | void RenderItemEsp(C_BaseEntity* ent);
48 | void ThirdPerson();
49 | public:
50 | void AddToDrawList();
51 | void Render();
52 | };
53 |
--------------------------------------------------------------------------------
/CSGOSimple/fonts/fonts.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | namespace Fonts {
3 | #include "droid.hpp"
4 | #include "cousine.hpp"
5 | }
--------------------------------------------------------------------------------
/CSGOSimple/helpers/input.cpp:
--------------------------------------------------------------------------------
1 | #include "input.hpp"
2 |
3 | #include "../valve_sdk/sdk.hpp"
4 | #include "../imgui/imgui.h"
5 | #include "../imgui/impl/imgui_impl_win32.h"
6 | #include "../menu.hpp"
7 |
8 | InputSys::InputSys()
9 | : m_hTargetWindow(nullptr), m_ulOldWndProc(0)
10 | {
11 | }
12 |
13 | InputSys::~InputSys()
14 | {
15 | if (m_ulOldWndProc)
16 | SetWindowLongPtr(m_hTargetWindow, GWLP_WNDPROC, m_ulOldWndProc);
17 | m_ulOldWndProc = 0;
18 | }
19 | void InputSys::Initialize()
20 | {
21 | D3DDEVICE_CREATION_PARAMETERS params;
22 |
23 | if (FAILED(g_D3DDevice9->GetCreationParameters(¶ms)))
24 | throw std::runtime_error("[InputSys] GetCreationParameters failed.");
25 |
26 | m_hTargetWindow = params.hFocusWindow;
27 | m_ulOldWndProc = SetWindowLongPtr(m_hTargetWindow, GWLP_WNDPROC, (LONG_PTR)WndProc);
28 |
29 | if (!m_ulOldWndProc)
30 | throw std::runtime_error("[InputSys] SetWindowLongPtr failed.");
31 | }
32 |
33 | LRESULT __stdcall InputSys::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
34 | {
35 | Get().ProcessMessage(msg, wParam, lParam);
36 |
37 | if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam) && Menu::Get().IsVisible())
38 | return true;
39 |
40 | return CallWindowProc((WNDPROC)Get().m_ulOldWndProc, hWnd, msg, wParam, lParam);
41 | }
42 |
43 | bool InputSys::ProcessMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
44 | {
45 | switch (uMsg) {
46 | case WM_MBUTTONDBLCLK:
47 | case WM_RBUTTONDBLCLK:
48 | case WM_LBUTTONDBLCLK:
49 | case WM_XBUTTONDBLCLK:
50 | case WM_MBUTTONDOWN:
51 | case WM_RBUTTONDOWN:
52 | case WM_LBUTTONDOWN:
53 | case WM_XBUTTONDOWN:
54 | case WM_MBUTTONUP:
55 | case WM_RBUTTONUP:
56 | case WM_LBUTTONUP:
57 | case WM_XBUTTONUP:
58 | return ProcessMouseMessage(uMsg, wParam, lParam);
59 | case WM_KEYDOWN:
60 | case WM_KEYUP:
61 | case WM_SYSKEYDOWN:
62 | case WM_SYSKEYUP:
63 | return ProcessKeybdMessage(uMsg, wParam, lParam);
64 | default:
65 | return false;
66 | }
67 | }
68 |
69 | bool InputSys::ProcessMouseMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
70 | {
71 | auto key = VK_LBUTTON;
72 | auto state = KeyState::None;
73 | switch (uMsg) {
74 | case WM_MBUTTONDOWN:
75 | case WM_MBUTTONUP:
76 | case WM_MBUTTONDBLCLK:
77 | state = uMsg == WM_MBUTTONUP ? KeyState::Up : KeyState::Down;
78 | key = VK_MBUTTON;
79 | break;
80 | case WM_RBUTTONDOWN:
81 | case WM_RBUTTONUP:
82 | case WM_RBUTTONDBLCLK:
83 | state = uMsg == WM_RBUTTONUP ? KeyState::Up : KeyState::Down;
84 | key = VK_RBUTTON;
85 | break;
86 | case WM_LBUTTONDOWN:
87 | case WM_LBUTTONUP:
88 | case WM_LBUTTONDBLCLK:
89 | state = uMsg == WM_LBUTTONUP ? KeyState::Up : KeyState::Down;
90 | key = VK_LBUTTON;
91 | break;
92 | case WM_XBUTTONDOWN:
93 | case WM_XBUTTONUP:
94 | case WM_XBUTTONDBLCLK:
95 | state = uMsg == WM_XBUTTONUP ? KeyState::Up : KeyState::Down;
96 | key = (HIWORD(wParam) == XBUTTON1 ? VK_XBUTTON1 : VK_XBUTTON2);
97 | break;
98 | default:
99 | return false;
100 | }
101 |
102 | if (state == KeyState::Up && m_iKeyMap[key] == KeyState::Down)
103 | m_iKeyMap[key] = KeyState::Pressed;
104 | else
105 | m_iKeyMap[key] = state;
106 | return true;
107 | }
108 |
109 | bool InputSys::ProcessKeybdMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
110 | {
111 | auto key = wParam;
112 | auto state = KeyState::None;
113 |
114 | switch (uMsg) {
115 | case WM_KEYDOWN:
116 | case WM_SYSKEYDOWN:
117 | state = KeyState::Down;
118 | break;
119 | case WM_KEYUP:
120 | case WM_SYSKEYUP:
121 | state = KeyState::Up;
122 | break;
123 | default:
124 | return false;
125 | }
126 |
127 | if (state == KeyState::Up && m_iKeyMap[int(key)] == KeyState::Down) {
128 | m_iKeyMap[int(key)] = KeyState::Pressed;
129 |
130 | auto& hotkey_callback = m_Hotkeys[key];
131 |
132 | if (hotkey_callback)
133 | hotkey_callback();
134 |
135 | }
136 | else {
137 | m_iKeyMap[int(key)] = state;
138 | }
139 |
140 | return true;
141 | }
142 | KeyState InputSys::GetKeyState(std::uint32_t vk)
143 | {
144 | return m_iKeyMap[vk];
145 | }
146 | bool InputSys::IsKeyDown(std::uint32_t vk)
147 | {
148 | return m_iKeyMap[vk] == KeyState::Down;
149 | }
150 | bool InputSys::WasKeyPressed(std::uint32_t vk)
151 | {
152 | if (m_iKeyMap[vk] == KeyState::Pressed) {
153 | m_iKeyMap[vk] = KeyState::Up;
154 | return true;
155 | }
156 | return false;
157 | }
158 |
159 | void InputSys::RegisterHotkey(std::uint32_t vk, std::function f)
160 | {
161 | m_Hotkeys[vk] = f;
162 | }
163 | void InputSys::RemoveHotkey(std::uint32_t vk)
164 | {
165 | m_Hotkeys[vk] = nullptr;
166 | }
167 |
--------------------------------------------------------------------------------
/CSGOSimple/helpers/input.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define NOMINMAX
4 | #include
5 | #include
6 | #include
7 | #include