├── .gitignore
├── .idea
├── .gitignore
├── OverflowTF2.iml
├── misc.xml
├── modules.xml
└── vcs.xml
├── .vs
└── OverflowTF2
│ └── v16
│ └── Preview
│ └── Browse.VC.db
├── OverflowTF2.sln
├── OverflowTF2.vcxproj
├── OverflowTF2.vcxproj.filters
├── OverflowTF2.vcxproj.user
├── README.md
└── core
├── dllmain.cpp
├── features
├── aimbot
│ ├── aimbot.cpp
│ └── aimbot.hpp
├── backtrack
│ ├── backtrack.cpp
│ └── backtrack.hpp
├── misc
│ ├── misc.cpp
│ └── misc.hpp
├── other
│ ├── others.cpp
│ └── others.hpp
├── triggerbot
│ ├── triggerbot.cpp
│ └── triggerbot.hpp
└── visuals
│ ├── chams
│ ├── chams.cpp
│ └── chams.hpp
│ ├── esp
│ ├── esp.cpp
│ └── esp.hpp
│ └── walkbot
│ ├── visualize_walkbot.cpp
│ └── visualize_walkbot.hpp
├── hooks
├── hook.cpp
├── hook.hpp
└── vtables
│ ├── create_move.cpp
│ ├── dme.cpp
│ ├── paint.cpp
│ ├── paint_traverse.cpp
│ └── present.cpp
├── interfaces
├── interfaces.cpp
└── interfaces.hpp
├── menu
├── imgui
│ ├── dx9
│ │ ├── imgui_impl_dx9.cpp
│ │ └── imgui_impl_dx9.h
│ ├── imconfig.h
│ ├── imgui.cpp
│ ├── imgui.h
│ ├── imgui_draw.cpp
│ ├── imgui_internal.h
│ ├── stb_rect_pack.h
│ ├── stb_textedit.h
│ └── stb_truetype.h
├── menu.cpp
└── menu.hpp
├── source-sdk
├── interfaces
│ ├── c_base_combat_weapon.cpp
│ ├── c_base_combat_weapon.hpp
│ ├── c_convar.cpp
│ ├── c_convar.hpp
│ ├── c_game_movement.hpp
│ ├── c_glow_manager.hpp
│ ├── c_handle.hpp
│ ├── c_key_values.cpp
│ ├── c_key_values.hpp
│ ├── c_material_system.hpp
│ ├── c_model_info.hpp
│ ├── c_model_render.hpp
│ ├── c_net_channel.hpp
│ ├── i_base_client_dll.hpp
│ ├── i_client_networkable.hpp
│ ├── i_engine_vgui.hpp
│ ├── i_entity.cpp
│ ├── i_entity.hpp
│ ├── i_entity_list.hpp
│ ├── i_panels.hpp
│ ├── i_player_info_manager.hpp
│ ├── i_surface.hpp
│ ├── iv_debug_overlay.hpp
│ ├── iv_engine_client.hpp
│ └── iv_render_view.hpp
└── structs
│ ├── enums.hpp
│ └── structs.hpp
└── utils
├── color.hpp
├── draw
├── draw.cpp
└── draw.hpp
├── game
├── helpers.cpp
└── helpers.hpp
├── math
├── math.cpp
├── math.hpp
├── vector.hpp
└── vmatrix.hpp
├── memory
└── memory.hpp
├── netvars
├── dt_common.hpp
├── dt_recv.hpp
├── netvars.cpp
└── netvars.hpp
├── settings
├── settings.cpp
└── settings.hpp
└── utils.hpp
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.toptal.com/developers/gitignore/api/visualstudio,c++
3 | # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,c++
4 |
5 | ### C++ ###
6 | # Prerequisites
7 | *.d
8 |
9 | # Compiled Object files
10 | *.slo
11 | *.lo
12 | *.o
13 | *.obj
14 |
15 | # Precompiled Headers
16 | *.gch
17 | *.pch
18 |
19 | # Linker files
20 | *.ilk
21 |
22 | # Debugger Files
23 | *.pdb
24 |
25 | # Compiled Dynamic libraries
26 | *.so
27 | *.dylib
28 | *.dll
29 |
30 | # Fortran module files
31 | *.mod
32 | *.smod
33 |
34 | # Compiled Static libraries
35 | *.lai
36 | *.la
37 | *.a
38 | *.lib
39 |
40 | # Executables
41 | *.exe
42 | *.out
43 | *.app
44 |
45 | ### VisualStudio ###
46 | ## Ignore Visual Studio temporary files, build results, and
47 | ## files generated by popular Visual Studio add-ons.
48 | ##
49 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
50 |
51 | # User-specific files
52 | *.rsuser
53 | *.suo
54 | *.user
55 | *.userosscache
56 | *.sln.docstates
57 | *.vs
58 |
59 |
60 | # User-specific files (MonoDevelop/Xamarin Studio)
61 | *.userprefs
62 |
63 | # Mono auto generated files
64 | mono_crash.*
65 |
66 | # Build results
67 | [Dd]ebug/
68 | [Dd]ebugPublic/
69 | [Rr]elease/
70 | [Rr]eleases/
71 | x64/
72 | x86/
73 | [Aa][Rr][Mm]/
74 | [Aa][Rr][Mm]64/
75 | bld/
76 | [Bb]in/
77 | [Oo]bj/
78 | [Ll]og/
79 | [Ll]ogs/
80 |
81 | # Visual Studio 2015/2017 cache/options directory
82 | .vs/
83 | # Uncomment if you have tasks that create the project's static files in wwwroot
84 | #wwwroot/
85 |
86 | # Visual Studio 2017 auto generated files
87 | Generated\ Files/
88 |
89 | # MSTest test Results
90 | [Tt]est[Rr]esult*/
91 | [Bb]uild[Ll]og.*
92 |
93 | # NUnit
94 | *.VisualState.xml
95 | TestResult.xml
96 | nunit-*.xml
97 |
98 | # Build Results of an ATL Project
99 | [Dd]ebugPS/
100 | [Rr]eleasePS/
101 | dlldata.c
102 |
103 | # Benchmark Results
104 | BenchmarkDotNet.Artifacts/
105 |
106 | # .NET Core
107 | project.lock.json
108 | project.fragment.lock.json
109 | artifacts/
110 |
111 | # StyleCop
112 | StyleCopReport.xml
113 |
114 | # Files built by Visual Studio
115 | *_i.c
116 | *_p.c
117 | *_h.h
118 | *.meta
119 | *.iobj
120 | *.ipdb
121 | *.pgc
122 | *.pgd
123 | *.rsp
124 | *.sbr
125 | *.tlb
126 | *.tli
127 | *.tlh
128 | *.tmp
129 | *.tmp_proj
130 | *_wpftmp.csproj
131 | *.log
132 | *.vspscc
133 | *.vssscc
134 | .builds
135 | *.pidb
136 | *.svclog
137 | *.scc
138 |
139 | # Chutzpah Test files
140 | _Chutzpah*
141 |
142 | # Visual C++ cache files
143 | ipch/
144 | *.aps
145 | *.ncb
146 | *.opendb
147 | *.opensdf
148 | *.sdf
149 | *.cachefile
150 | *.VC.db
151 | *.VC.VC.opendb
152 |
153 | # Visual Studio profiler
154 | *.psess
155 | *.vsp
156 | *.vspx
157 | *.sap
158 |
159 | # Visual Studio Trace Files
160 | *.e2e
161 |
162 | # TFS 2012 Local Workspace
163 | $tf/
164 |
165 | # Guidance Automation Toolkit
166 | *.gpState
167 |
168 | # ReSharper is a .NET coding add-in
169 | _ReSharper*/
170 | *.[Rr]e[Ss]harper
171 | *.DotSettings.user
172 |
173 | # TeamCity is a build add-in
174 | _TeamCity*
175 |
176 | # DotCover is a Code Coverage Tool
177 | *.dotCover
178 |
179 | # AxoCover is a Code Coverage Tool
180 | .axoCover/*
181 | !.axoCover/settings.json
182 |
183 | # Coverlet is a free, cross platform Code Coverage Tool
184 | coverage*[.json, .xml, .info]
185 |
186 | # Visual Studio code coverage results
187 | *.coverage
188 | *.coveragexml
189 |
190 | # NCrunch
191 | _NCrunch_*
192 | .*crunch*.local.xml
193 | nCrunchTemp_*
194 |
195 | # MightyMoose
196 | *.mm.*
197 | AutoTest.Net/
198 |
199 | # Web workbench (sass)
200 | .sass-cache/
201 |
202 | # Installshield output folder
203 | [Ee]xpress/
204 |
205 | # DocProject is a documentation generator add-in
206 | DocProject/buildhelp/
207 | DocProject/Help/*.HxT
208 | DocProject/Help/*.HxC
209 | DocProject/Help/*.hhc
210 | DocProject/Help/*.hhk
211 | DocProject/Help/*.hhp
212 | DocProject/Help/Html2
213 | DocProject/Help/html
214 |
215 | # Click-Once directory
216 | publish/
217 |
218 | # Publish Web Output
219 | *.[Pp]ublish.xml
220 | *.azurePubxml
221 | # Note: Comment the next line if you want to checkin your web deploy settings,
222 | # but database connection strings (with potential passwords) will be unencrypted
223 | *.pubxml
224 | *.publishproj
225 |
226 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
227 | # checkin your Azure Web App publish settings, but sensitive information contained
228 | # in these scripts will be unencrypted
229 | PublishScripts/
230 |
231 | # NuGet Packages
232 | *.nupkg
233 | # NuGet Symbol Packages
234 | *.snupkg
235 | # The packages folder can be ignored because of Package Restore
236 | **/[Pp]ackages/*
237 | # except build/, which is used as an MSBuild target.
238 | !**/[Pp]ackages/build/
239 | # Uncomment if necessary however generally it will be regenerated when needed
240 | #!**/[Pp]ackages/repositories.config
241 | # NuGet v3's project.json files produces more ignorable files
242 | *.nuget.props
243 | *.nuget.targets
244 |
245 | # Microsoft Azure Build Output
246 | csx/
247 | *.build.csdef
248 |
249 | # Microsoft Azure Emulator
250 | ecf/
251 | rcf/
252 |
253 | # Windows Store app package directories and files
254 | AppPackages/
255 | BundleArtifacts/
256 | Package.StoreAssociation.xml
257 | _pkginfo.txt
258 | *.appx
259 | *.appxbundle
260 | *.appxupload
261 |
262 | # Visual Studio cache files
263 | # files ending in .cache can be ignored
264 | *.[Cc]ache
265 | # but keep track of directories ending in .cache
266 | !?*.[Cc]ache/
267 |
268 | # Others
269 | ClientBin/
270 | ~$*
271 | *~
272 | *.dbmdl
273 | *.dbproj.schemaview
274 | *.jfm
275 | *.pfx
276 | *.publishsettings
277 | orleans.codegen.cs
278 |
279 | # Including strong name files can present a security risk
280 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
281 | #*.snk
282 |
283 | # Since there are multiple workflows, uncomment next line to ignore bower_components
284 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
285 | #bower_components/
286 |
287 | # RIA/Silverlight projects
288 | Generated_Code/
289 |
290 | # Backup & report files from converting an old project file
291 | # to a newer Visual Studio version. Backup files are not needed,
292 | # because we have git ;-)
293 | _UpgradeReport_Files/
294 | Backup*/
295 | UpgradeLog*.XML
296 | UpgradeLog*.htm
297 | ServiceFabricBackup/
298 | *.rptproj.bak
299 |
300 | # SQL Server files
301 | *.mdf
302 | *.ldf
303 | *.ndf
304 |
305 | # Business Intelligence projects
306 | *.rdl.data
307 | *.bim.layout
308 | *.bim_*.settings
309 | *.rptproj.rsuser
310 | *- [Bb]ackup.rdl
311 | *- [Bb]ackup ([0-9]).rdl
312 | *- [Bb]ackup ([0-9][0-9]).rdl
313 |
314 | # Microsoft Fakes
315 | FakesAssemblies/
316 |
317 | # GhostDoc plugin setting file
318 | *.GhostDoc.xml
319 |
320 | # Node.js Tools for Visual Studio
321 | .ntvs_analysis.dat
322 | node_modules/
323 |
324 | # Visual Studio 6 build log
325 | *.plg
326 |
327 | # Visual Studio 6 workspace options file
328 | *.opt
329 |
330 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
331 | *.vbw
332 |
333 | # Visual Studio LightSwitch build output
334 | **/*.HTMLClient/GeneratedArtifacts
335 | **/*.DesktopClient/GeneratedArtifacts
336 | **/*.DesktopClient/ModelManifest.xml
337 | **/*.Server/GeneratedArtifacts
338 | **/*.Server/ModelManifest.xml
339 | _Pvt_Extensions
340 |
341 | # Paket dependency manager
342 | .paket/paket.exe
343 | paket-files/
344 |
345 | # FAKE - F# Make
346 | .fake/
347 |
348 | # CodeRush personal settings
349 | .cr/personal
350 |
351 | # Python Tools for Visual Studio (PTVS)
352 | __pycache__/
353 | *.pyc
354 |
355 | # Cake - Uncomment if you are using it
356 | # tools/**
357 | # !tools/packages.config
358 |
359 | # Tabs Studio
360 | *.tss
361 |
362 | # Telerik's JustMock configuration file
363 | *.jmconfig
364 |
365 | # BizTalk build output
366 | *.btp.cs
367 | *.btm.cs
368 | *.odx.cs
369 | *.xsd.cs
370 |
371 | # OpenCover UI analysis results
372 | OpenCover/
373 |
374 | # Azure Stream Analytics local run output
375 | ASALocalRun/
376 |
377 | # MSBuild Binary and Structured Log
378 | *.binlog
379 |
380 | # NVidia Nsight GPU debugger configuration file
381 | *.nvuser
382 |
383 | # MFractors (Xamarin productivity tool) working folder
384 | .mfractor/
385 |
386 | # Local History for Visual Studio
387 | .localhistory/
388 |
389 | # BeatPulse healthcheck temp database
390 | healthchecksdb
391 |
392 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
393 | MigrationBackup/
394 |
395 | # Ionide (cross platform F# VS Code tools) working folder
396 | .ionide/
397 |
398 | # End of https://www.toptal.com/developers/gitignore/api/visualstudio,c++
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/OverflowTF2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.vs/OverflowTF2/v16/Preview/Browse.VC.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NMan1/OverflowTF2/ffdbcc69510782e52abd1351f880bf26babee0f4/.vs/OverflowTF2/v16/Preview/Browse.VC.db
--------------------------------------------------------------------------------
/OverflowTF2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30709.64
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OverflowTF2", "OverflowTF2.vcxproj", "{DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Debug|x64.ActiveCfg = Debug|x64
17 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Debug|x64.Build.0 = Debug|x64
18 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Debug|x86.ActiveCfg = Debug|Win32
19 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Debug|x86.Build.0 = Debug|Win32
20 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Release|x64.ActiveCfg = Release|x64
21 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Release|x64.Build.0 = Release|x64
22 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Release|x86.ActiveCfg = Release|Win32
23 | {DCA8CAB2-0BDA-4CE6-B910-D91F05D320D3}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {FFEA15EE-E77C-4608-9B97-35B35CEFCB28}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/OverflowTF2.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 16.0
23 | Win32Proj
24 | {dca8cab2-0bda-4ce6-b910-d91f05d320d3}
25 | OverflowTF2
26 | 10.0
27 |
28 |
29 |
30 | DynamicLibrary
31 | true
32 | v142
33 | Unicode
34 |
35 |
36 | DynamicLibrary
37 | false
38 | v142
39 | true
40 | Unicode
41 |
42 |
43 | DynamicLibrary
44 | true
45 | v142
46 | Unicode
47 |
48 |
49 | DynamicLibrary
50 | false
51 | v142
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 | "$(DXSDK_DIR)include";$(LibraryPath)
76 | $(VC_IncludePath);$(WindowsSDK_IncludePath);;$(DXSDK_DIR)Include
77 |
78 |
79 | false
80 | "$(DXSDK_DIR)include";$(LibraryPath)
81 | $(VC_IncludePath);$(WindowsSDK_IncludePath);;$(DXSDK_DIR)Include
82 |
83 |
84 | true
85 | $(DXSDK_DIR)LIB\x86;$(IncludePath);$(DXSDK_DIR)Include
86 | "$(DXSDK_DIR)include";$(LibraryPath)
87 |
88 |
89 | false
90 | $(DXSDK_DIR)LIB\x86;$(IncludePath);$(DXSDK_DIR)Include
91 | "$(DXSDK_DIR)include";$(LibraryPath)
92 |
93 |
94 |
95 | Level3
96 | true
97 |
98 |
99 | true
100 | NotUsing
101 | pch.h
102 | 4244;26495;4305;4099;
103 | stdcpp17
104 |
105 |
106 | Windows
107 | true
108 | false
109 |
110 |
111 |
112 |
113 | Level3
114 | true
115 | true
116 | true
117 |
118 |
119 | true
120 | NotUsing
121 | pch.h
122 | 4244;26495;4305;4099;
123 | stdcpp17
124 |
125 |
126 | Windows
127 | true
128 | true
129 | true
130 | false
131 |
132 |
133 |
134 |
135 | Level3
136 | true
137 |
138 |
139 | true
140 | NotUsing
141 |
142 |
143 | stdcpp17
144 | $(IncludePath);$(DXSDK_DIR)Include
145 | 4244;26495;4305;4099;
146 |
147 |
148 | Windows
149 | true
150 | false
151 | d3d9.lib;d3dx9.lib;%(AdditionalDependencies)
152 |
153 |
154 |
155 |
156 | Level3
157 | true
158 | true
159 | true
160 |
161 |
162 | true
163 | NotUsing
164 |
165 |
166 | stdcpp17
167 | $(IncludePath);$(DXSDK_DIR)Include
168 | 4244;26495;4305;4099;
169 |
170 |
171 | Windows
172 | true
173 | true
174 | true
175 | false
176 | d3d9.lib;d3dx9.lib;%(AdditionalDependencies)
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
--------------------------------------------------------------------------------
/OverflowTF2.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 | Source Files
38 |
39 |
40 | Source Files
41 |
42 |
43 | Source Files
44 |
45 |
46 | Source Files
47 |
48 |
49 | Source Files
50 |
51 |
52 | Source Files
53 |
54 |
55 | Source Files
56 |
57 |
58 | Source Files
59 |
60 |
61 | Source Files
62 |
63 |
64 | Source Files
65 |
66 |
67 | Source Files
68 |
69 |
70 | Source Files
71 |
72 |
73 | Source Files
74 |
75 |
76 | Source Files
77 |
78 |
79 | Source Files
80 |
81 |
82 | Source Files
83 |
84 |
85 | Source Files
86 |
87 |
88 | Source Files
89 |
90 |
91 | Source Files
92 |
93 |
94 | Source Files
95 |
96 |
97 | Source Files
98 |
99 |
100 | Source Files
101 |
102 |
103 | Source Files
104 |
105 |
106 |
107 |
108 | Header Files
109 |
110 |
111 | Header Files
112 |
113 |
114 | Header Files
115 |
116 |
117 | Header Files
118 |
119 |
120 | Header Files
121 |
122 |
123 | Header Files
124 |
125 |
126 | Header Files
127 |
128 |
129 | Header Files
130 |
131 |
132 | Header Files
133 |
134 |
135 | Header Files
136 |
137 |
138 | Header Files
139 |
140 |
141 | Header Files
142 |
143 |
144 | Header Files
145 |
146 |
147 | Header Files
148 |
149 |
150 | Header Files
151 |
152 |
153 | Header Files
154 |
155 |
156 | Header Files
157 |
158 |
159 | Header Files
160 |
161 |
162 | Header Files
163 |
164 |
165 | Header Files
166 |
167 |
168 | Header Files
169 |
170 |
171 | Header Files
172 |
173 |
174 | Header Files
175 |
176 |
177 | Header Files
178 |
179 |
180 | Header Files
181 |
182 |
183 | Header Files
184 |
185 |
186 | Header Files
187 |
188 |
189 | Header Files
190 |
191 |
192 | Header Files
193 |
194 |
195 | Header Files
196 |
197 |
198 | Header Files
199 |
200 |
201 | Header Files
202 |
203 |
204 | Header Files
205 |
206 |
207 | Header Files
208 |
209 |
210 | Header Files
211 |
212 |
213 | Header Files
214 |
215 |
216 | Header Files
217 |
218 |
219 | Header Files
220 |
221 |
222 | Header Files
223 |
224 |
225 | Header Files
226 |
227 |
228 | Header Files
229 |
230 |
231 | Header Files
232 |
233 |
234 | Header Files
235 |
236 |
237 | Header Files
238 |
239 |
240 | Header Files
241 |
242 |
243 | Header Files
244 |
245 |
246 | Header Files
247 |
248 |
249 | Header Files
250 |
251 |
252 | Header Files
253 |
254 |
255 | Header Files
256 |
257 |
258 | Header Files
259 |
260 |
261 | Header Files
262 |
263 |
264 | Header Files
265 |
266 |
267 | Header Files
268 |
269 |
270 |
271 |
272 |
273 |
--------------------------------------------------------------------------------
/OverflowTF2.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OverflowTF2
2 | ### Internal TF2 cheat, esp, basic aimbot, misc stuff, imgui
3 |
4 | Code is relatively clean, written in snake_case
5 |
6 | ### Features:
7 | - Esp
8 | - box
9 | - health bar
10 | - health text
11 | - skeleton
12 | - snap lines
13 | - eye direction lines
14 | - class name
15 | - object eso (dispenser, turrets, telporters)
16 | - heatlh and ammo pack esp
17 | - Glow players and objects
18 | - Projectile esp
19 | - Chams
20 | - Basic player and weapon chams
21 | - Aimbot
22 | - fov
23 | - smoothing
24 | - projectile aimbot
25 | - legit backtrack
26 | - Trigger bot
27 | - bone
28 | - always on
29 | - scoped only
30 | - ignore cloaked
31 | - Misc
32 | - bunny hop
33 | - auto backstab
34 | - Player list & Spectator list
35 |
36 | ### Menu
37 |
38 |
39 |
40 |
41 | ### In game:
42 |
43 |
44 | ### Todo/Bugs:
45 | 1. ~~color picker for menu is fucked, cant be bothered to fix it.~~
46 | 2. ~~aimbot will sometimes lock onto legs when you respawn (rare-ish)~~
47 | 3. optimize esp more
48 | 4. ~~fix health abr from overflowing wehn someone is overhelaed (ez)~~
49 | 5. ~~hook dme for those sexy mateirals u have~~
50 |
51 | ### To comppile:
52 | 1. git clone
53 | 2. open sln
54 | 3. make sure direcxt sdk indatlled
55 | 4. Build x86 relaese or deubg
56 | 5. injdect load libary with ur so favorite undetcted best pastedm injector
57 |
58 | undetetced? yes, but isnt everything undetcted with vakve? yes. thank u gaben
59 |
--------------------------------------------------------------------------------
/core/dllmain.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include "hooks/hook.hpp"
5 | #include "interfaces/interfaces.hpp"
6 |
7 | DWORD WINAPI init(void* dll_instance) {
8 | #ifdef _DEBUG
9 | AllocConsole();
10 | freopen_s((FILE**)stdin, "CONIN$", "r", stdin);
11 | freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
12 |
13 | SetConsoleTitleA("Debug console");
14 | #endif
15 |
16 | while (!(utils::tf2_window = FindWindowA("Valve001", nullptr))) {
17 | std::this_thread::sleep_for(std::chrono::milliseconds(200));
18 | }
19 |
20 | interfaces::init_interfaces();
21 | if (!hooks::hook()) {
22 | FreeLibraryAndExitThread(reinterpret_cast(dll_instance), 0);
23 | return NULL;
24 | }
25 |
26 | while (!GetAsyncKeyState(VK_END)) {
27 | std::this_thread::sleep_for(std::chrono::milliseconds(200));
28 | }
29 |
30 | FreeLibraryAndExitThread(reinterpret_cast(dll_instance), 0);
31 | }
32 |
33 | VOID WINAPI detach()
34 | {
35 | #ifdef _DEBUG
36 | fclose((FILE*)stdin);
37 | fclose((FILE*)stdout);
38 |
39 | HWND hwnd = GetConsoleWindow();
40 | FreeConsole();
41 | PostMessageW(hwnd, WM_CLOSE, 0, 0);
42 | #endif
43 | }
44 |
45 | BOOL APIENTRY DllMain(HMODULE dll_instance, unsigned long reason_to_call, void* reserved)
46 | {
47 | if (reason_to_call == DLL_PROCESS_ATTACH) {
48 | DisableThreadLibraryCalls(dll_instance);
49 | if (!CreateThread(nullptr, NULL, init, dll_instance, NULL, nullptr))
50 | throw std::exception("Error while creating thread.");
51 | }
52 | else if (reason_to_call == DLL_PROCESS_DETACH) {
53 | if (!reserved) {
54 | hooks::unhook();
55 |
56 | using namespace std::literals::chrono_literals;
57 | std::this_thread::sleep_for(1s);
58 |
59 | detach();
60 | }
61 | }
62 | return TRUE;
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/core/features/aimbot/aimbot.cpp:
--------------------------------------------------------------------------------
1 | #define NOMINMAX
2 | #include "aimbot.hpp"
3 | #include "..\..\interfaces\interfaces.hpp"
4 | #include "..\..\utils\math\math.hpp"
5 | #include "..\..\utils\game\helpers.hpp"
6 | #include "../../utils/settings/settings.hpp"
7 | #include "..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
8 |
9 | namespace aimbot {
10 | c_base_entity* get_closest_to_crosshair(c_base_entity* local_player, const vector view_angles, int settings_fov) {
11 | c_base_entity* best_entity = nullptr;
12 | float max_delta = FLT_MAX;
13 |
14 | for (int i = 1; i <= interfaces::engine->get_max_clients(); i++) {
15 | auto entity = interfaces::entity_list->get_client_entity(i);
16 |
17 | if (!entity || entity == local_player || !entity->is_alive() || entity->is_dormant()) {
18 | continue;
19 | }
20 |
21 | if (entity->get_team_num() == local_player->get_team_num()) {
22 | continue;
23 | }
24 |
25 | if (!entity->is_visible(local_player)) {
26 | continue;
27 | }
28 |
29 | float delta = math::calc_angle(local_player->get_eye_position(), entity->get_eye_position(), view_angles).length();
30 | if (delta < max_delta && delta < settings_fov) {
31 | max_delta = delta;
32 | best_entity = entity;
33 | }
34 | }
35 | return best_entity;
36 | }
37 |
38 | c_base_entity* get_closest_distance(c_base_entity* local_player) {
39 | return nullptr;
40 | }
41 |
42 | int get_closest_hibox(c_base_entity* local_player, c_base_entity* target, const vector view_angles) {
43 | float max_delta = FLT_MAX;
44 | int best_hitbox = NULL;
45 |
46 | for (int i = hitboxes::HEAD; i != hitboxes::RIGHT_FOREARM; i++) {
47 | float delta = math::calc_angle(local_player->get_shoot_pos(), target->get_hitbox_pos(i), view_angles).length();
48 | if (delta < max_delta) {
49 | max_delta = delta;
50 | best_hitbox = i;
51 | }
52 | }
53 | return best_hitbox;
54 | }
55 |
56 | bool is_position_visible(c_base_entity* local_player ,const vector& source) {
57 | trace_t trace;
58 | ray_t ray; // the future of variable naming
59 | c_trace_filter filter;
60 |
61 | filter.skip = local_player;
62 |
63 | auto local_eye = local_player->get_eye_position();
64 | ray.init(local_eye, source);
65 |
66 | interfaces::trace->trace_ray(ray, MASK_SOLID, &filter, &trace);
67 |
68 | return !trace.did_hit();
69 | }
70 |
71 | vector predict_position(const vector& source, const vector& destination, const vector& target_velocity, const float projectile_speed, const float projectile_gravity) {
72 | const auto distance = source.dist_to(destination);
73 | const auto travel_time = distance / projectile_speed;
74 | auto pred_destination = destination + (target_velocity)*travel_time;
75 |
76 | pred_destination.y += 0.5f * std::fabsf(projectile_gravity) * travel_time * travel_time;
77 |
78 | return pred_destination;
79 | }
80 |
81 | void run(c_base_entity* local_player, c_user_cmd* cmd) {
82 | if (local_player->is_bonked() || local_player->is_taunting()) {
83 | return;
84 | }
85 |
86 | float projectile_speed = 0.0f, projectile_gravity = 0.0f;
87 | auto is_projectile_weapon = get_projectile_info(local_player, projectile_speed, projectile_gravity);
88 |
89 | auto target = get_closest_to_crosshair(local_player, cmd->viewangles, is_projectile_weapon ? settings::aimbot_proj_fov : settings::aimbot_fov);
90 | if (!target) {
91 | return;
92 | }
93 |
94 | const auto hitbox_id = settings::aimbot_bone == 0 ? get_closest_hibox(local_player, target, cmd->viewangles) : hitboxes::HEAD;
95 |
96 | if (settings::aimbot_proj && is_projectile_weapon) {
97 | // projectile
98 |
99 | auto target_position = target->get_hitbox_pos(hitbox_id);
100 | if (local_player->get_class_number() == tf_classes::CLASS_SOLDIER) {
101 | target_position = settings::aimbot_proj_launcher_bone == 1 ? target->get_abs_origin() + vector(0, 0, 15.0f) : target->get_abs_origin();
102 | }
103 |
104 | auto predicited_position = predict_position(local_player->get_eye_position(), target_position, target->get_velocity(), projectile_speed, projectile_gravity);
105 | if (!is_position_visible(local_player, predicited_position)) {
106 | return;
107 | }
108 |
109 | auto angle = math::calc_angle_projectile(local_player->get_eye_position(), predicited_position);
110 | math::clamp_angles(angle);
111 |
112 | if (settings::aimbot_proj_smoothness > 0) {
113 | angle /= (settings::aimbot_proj_smoothness * 5);
114 | }
115 |
116 | cmd->viewangles = angle;
117 | }
118 | else {
119 | // normal
120 |
121 | auto angle = math::calc_angle(local_player->get_eye_position(), target->get_hitbox_pos(hitbox_id), cmd->viewangles);
122 | math::clamp_angles(angle);
123 |
124 | if (settings::aimbot_smoothness > 0) {
125 | angle /= (settings::aimbot_smoothness * 5);
126 | }
127 |
128 | cmd->viewangles += angle;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/core/features/aimbot/aimbot.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class c_base_entity;
4 | class c_user_cmd;
5 | class vector;
6 |
7 | namespace aimbot {
8 | void run(c_base_entity* local_player, c_user_cmd* cmd);
9 |
10 | c_base_entity* get_closest_to_crosshair(c_base_entity* local_player, const vector view_angles, int settings_fov);
11 | }
--------------------------------------------------------------------------------
/core/features/backtrack/backtrack.cpp:
--------------------------------------------------------------------------------
1 | #define NOMINMAX
2 | #include "backtrack.hpp"
3 | #include "..\aimbot\aimbot.hpp"
4 | #include "..\..\interfaces\interfaces.hpp"
5 | #include "..\..\utils\math\math.hpp"
6 | #include "..\..\utils\game\helpers.hpp"
7 | #include "../../utils/settings/settings.hpp"
8 |
9 | namespace backtrack {
10 | std::vector player_ticks[64];
11 |
12 | void save_ticks(c_base_entity* local_player, c_user_cmd* cmd) {
13 | for (int i = 1; i <= interfaces::engine->get_max_clients(); i++) {
14 | auto entity = interfaces::entity_list->get_client_entity(i);
15 | if (!entity || !entity->get_health() || entity->get_team_num() == local_player->get_team_num()) {
16 | continue;
17 | }
18 |
19 | player_ticks[i].insert(player_ticks[i].begin(), { cmd->tick_count, entity->get_hitbox_pos(hitboxes::HEAD) });
20 | if (player_ticks[i].size() > 12) {
21 | player_ticks[i].pop_back();
22 | }
23 | }
24 | }
25 |
26 | void set_backtrack_tick(c_base_entity* local_player, c_user_cmd* cmd) {
27 | auto max_delta = FLT_MAX;
28 | auto best_index = -1;
29 | for (int i = 1; i <= interfaces::engine->get_max_clients(); i++) {
30 | auto entity = interfaces::entity_list->get_client_entity(i);
31 | if (!entity || !entity->get_health() || entity->get_team_num() == local_player->get_team_num()) {
32 | continue;
33 | }
34 |
35 | float delta = (math::calc_angle_projectile(local_player->get_eye_position(), entity->get_eye_position()) - cmd->viewangles).length();
36 | if (delta < max_delta) {
37 | best_index = i;
38 | max_delta = delta;
39 | }
40 | }
41 |
42 | if (best_index == -1) {
43 | return;
44 | }
45 |
46 | int best_tick = -1;
47 | max_delta = FLT_MAX;
48 | for (int i = 0; i < player_ticks[best_index].size(); i++) {
49 | float delta = (math::calc_angle_projectile(local_player->get_eye_position(), player_ticks[best_index].at(i).head_position) - cmd->viewangles).length();
50 | if (delta < max_delta) {
51 | max_delta = delta;
52 | best_tick = i;
53 | }
54 | }
55 |
56 | if (best_tick != -1 && cmd->buttons & IN_ATTACK) {
57 | cmd->tick_count = player_ticks[best_index].at(best_tick).tick_number;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/core/features/backtrack/backtrack.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "..\..\utils\math\vector.hpp"
4 |
5 | class c_base_entity;
6 | class c_user_cmd;
7 |
8 | struct saved_ticks {
9 | saved_ticks(int tick_number, vector head_positon) {
10 | this->tick_number = tick_number;
11 | this->head_position = head_positon;
12 | }
13 |
14 | int tick_number = -1;
15 | vector head_position = { 0, 0, 0 };
16 | };
17 |
18 | namespace backtrack {
19 | void save_ticks(c_base_entity* local_player, c_user_cmd* cmd);
20 |
21 | void set_backtrack_tick(c_base_entity* local_player, c_user_cmd* cmd);
22 |
23 | extern std::vector player_ticks[64];
24 | }
--------------------------------------------------------------------------------
/core/features/misc/misc.cpp:
--------------------------------------------------------------------------------
1 | #include "misc.hpp"
2 | #include "..\..\interfaces\interfaces.hpp"
3 | #include "..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
4 | #include "..\..\utils\memory\memory.hpp"
5 |
6 | namespace misc {
7 | void bunny_hop(c_base_entity* local_player, c_user_cmd* cmd) {
8 | static bool released = true;
9 |
10 | if (cmd->buttons & IN_JUMP) {
11 | if (!released) {
12 | if (!(local_player->get_flags() & entity_flags::GROUND))
13 | cmd->buttons &= ~(1 << 1);
14 | }
15 | else {
16 | released = false;
17 | }
18 | }
19 | else if (!released) {
20 | released = true;
21 | }
22 | }
23 |
24 | void auto_backstab(c_base_entity* local_player, c_user_cmd* cmd) {
25 | auto weapon = local_player->get_active_weapon();
26 |
27 | if (weapon && weapon->get_item_definition_index() == weapon_type::Spy_t_Knife) {
28 | if (local_player->get_active_weapon()->can_backstab()) {
29 | cmd->buttons |= IN_ATTACK;
30 | }
31 | }
32 | }
33 |
34 | void change_name(const char* name) {
35 | auto name_var = interfaces::convar->find_var("name");
36 | name_var->set_value(name);
37 |
38 | //interfaces::engine->get_net_channel_info()->send_net_msg(msg_SetConVar);
39 | }
40 | }
--------------------------------------------------------------------------------
/core/features/misc/misc.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class c_base_entity;
4 | class c_user_cmd;
5 |
6 | namespace misc {
7 | void bunny_hop(c_base_entity* local_player, c_user_cmd* cmd);
8 |
9 | void auto_backstab(c_base_entity* local_player, c_user_cmd* cmd);
10 |
11 | void change_name(const char* name);
12 | }
--------------------------------------------------------------------------------
/core/features/other/others.cpp:
--------------------------------------------------------------------------------
1 | #include "others.hpp"
2 | #include "..\..\interfaces\interfaces.hpp"
3 | #include "..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
4 | #include "..\..\utils\memory\memory.hpp"
5 |
6 | namespace others {
7 | std::vector get_spectators() {
8 | auto local_player = interfaces::entity_list->get_client_entity(interfaces::engine->get_local_player());
9 | if (!local_player || !local_player->is_alive()) {
10 | return {};
11 | }
12 |
13 | std::vector list = {};
14 | for (int i = 1; i <= interfaces::engine->get_max_clients(); i++) {
15 | auto entity = interfaces::entity_list->get_client_entity(i);
16 | if (!entity || entity == local_player || entity->is_alive()) {
17 | continue;
18 | }
19 |
20 | auto handle = entity->get_observer_target();
21 | if (!handle) {
22 | continue;
23 | }
24 |
25 | if (local_player == reinterpret_cast(interfaces::entity_list->get_client_entity_from_handle(handle))) {
26 | player_info info;
27 | if (interfaces::engine->get_player_info(entity, &info)) {
28 | auto mode = entity->get_observer_mode();
29 | auto type = mode == observer_modes::OBS_MODE_FIRSTPERSON ?
30 | "(1st) " : mode == observer_modes::OBS_MODE_THIRDPERSON ?
31 | "(3rd) " : mode == observer_modes::OBS_MODE_DEATHCAM ?
32 | "(death) " : mode == observer_modes::OBS_MODE_FREEZECAM ?
33 | "(freeze) " : mode == observer_modes::OBS_MODE_FIXED ?
34 | "(fixed) " : mode == observer_modes::OBS_MODE_ROAMING ?
35 | "(roaming) " : "";
36 |
37 | list.push_back(std::string(type) + info.name);
38 | }
39 | }
40 | }
41 | return list;
42 | }
43 | }
--------------------------------------------------------------------------------
/core/features/other/others.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | namespace others {
6 | std::vector get_spectators();
7 | }
--------------------------------------------------------------------------------
/core/features/triggerbot/triggerbot.cpp:
--------------------------------------------------------------------------------
1 | #include "triggerbot.hpp"
2 | #include "..\..\utils\math\math.hpp"
3 | #include "..\..\utils\settings\settings.hpp"
4 | #include "..\..\interfaces\interfaces.hpp"
5 | #include "..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
6 |
7 | namespace triggerbot {
8 | void run(c_base_entity* local_player, c_user_cmd* cmd) {
9 | if (settings::triggerbot_scoped_only && !local_player->is_scoped()) {
10 | return;
11 | }
12 |
13 | trace_t trace;
14 | ray_t ray;
15 |
16 | c_trace_filter filter;
17 | filter.skip = local_player;
18 |
19 | vector view_angles = {}, forward = {};
20 | interfaces::engine->get_view_angles(view_angles);
21 | math::angle_vectors(view_angles, &forward);
22 |
23 | vector start = local_player->get_eye_position();
24 | vector end = forward * 8192 + start; // normally i'd multiply by acitve weapon range but every weapon range in tf2 is 8192 for some reason
25 |
26 | ray.init(start, end);
27 |
28 | interfaces::trace->trace_ray(ray, (MASK_SHOT | CONTENTS_GRATE), &filter, &trace);
29 |
30 | if (trace.entity && trace.entity->is_player()) {
31 | if (trace.entity->get_team_num() == local_player->get_team_num() || (trace.entity->is_cloaked() && settings::triggerbot_ignore_cloaked)) {
32 | return;
33 | }
34 |
35 | if (settings::triggerbot_bone == 0 ? true : trace.hitbox == hitboxes::HEAD) {
36 | cmd->buttons |= IN_ATTACK;
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/core/features/triggerbot/triggerbot.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class c_base_entity;
4 | class c_user_cmd;
5 |
6 | namespace triggerbot {
7 | void run(c_base_entity* local_player, c_user_cmd* cmd);
8 | }
--------------------------------------------------------------------------------
/core/features/visuals/chams/chams.cpp:
--------------------------------------------------------------------------------
1 | #include "chams.hpp"
2 | #include "..\..\..\source-sdk\interfaces\c_key_values.hpp"
3 | #include "../../../utils/settings/settings.hpp"
4 |
5 | namespace chams {
6 |
7 | i_material* create_material(std::string type, std::string texture, std::string name, bool ignorez, bool nofog, bool model, bool nocull, bool halflambert);
8 |
9 | i_material* gold;
10 |
11 | i_material* normal;
12 |
13 | void run(model_render_info& info, const char* model_name) {
14 | if (!info.m_pModel) {
15 | return;
16 | }
17 |
18 | auto entity = interfaces::entity_list->get_client_entity(info.m_nEntIndex);
19 | if (!entity) {
20 | return;
21 | }
22 |
23 | auto local_player = interfaces::entity_list->get_client_entity(interfaces::engine->get_local_player());
24 | if (!local_player) {
25 | return;
26 | }
27 |
28 | auto class_id = entity->get_client_class()->class_id;
29 |
30 | if (class_id == class_ids::CTFPlayer) {
31 | if (entity->is_player() && entity->is_alive()) {
32 | if (settings::enemy_chams && entity->get_team_num() != local_player->get_team_num()) {
33 | interfaces::render_view->set_color_modulation(settings::enemy_chams_color.base());
34 | interfaces::model_render->forced_material_override(normal);
35 | }
36 | else {
37 | // team
38 | }
39 | }
40 | }
41 | else if (class_id == class_ids::CTFViewModel) {
42 | if (settings::gold_arm) {
43 | interfaces::model_render->forced_material_override(gold);
44 | }
45 | }
46 | }
47 |
48 | void init_materials() {
49 | gold = interfaces::material_system->find("models/player/shared/gold_player", "Model textures");
50 | gold->increment_reference_count();
51 |
52 | normal = create_material("VertexLitGeneric", "VGUI/white_additive", "0verflow_normal", false, true, true, true, true);
53 | normal->increment_reference_count();
54 | }
55 |
56 | i_material* create_material(std::string type, std::string texture, std::string name, bool ignorez, bool nofog, bool model, bool nocull, bool halflambert) {
57 | std::stringstream material_data;
58 | material_data << "\"" + type + "\"\n"
59 | "{\n"
60 | "\t\"$basetexture\" \"" + texture + "\"\n"
61 | "\t\"$ignorez\" \"" + std::to_string(ignorez) + "\"\n"
62 | "\t\"$nofog\" \"" + std::to_string(nofog) + "\"\n"
63 | "\t\"$model\" \"" + std::to_string(model) + "\"\n"
64 | "\t\"$nocull\" \"" + std::to_string(nocull) + "\"\n"
65 | "\t\"$halflambert\" \"" + std::to_string(halflambert) + "\"\n"
66 | "}\n" << std::flush;
67 |
68 | key_values* keys = (key_values*)malloc(sizeof(key_values));
69 | key_values::init(keys, type.c_str());
70 | key_values::load_from_buffer(keys, name.c_str(), material_data.str().c_str());
71 | return interfaces::material_system->create(name.c_str(), keys);
72 | }
73 | }
--------------------------------------------------------------------------------
/core/features/visuals/chams/chams.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\..\interfaces\interfaces.hpp"
3 |
4 | namespace chams {
5 | void run(model_render_info& info, const char* model_name);
6 |
7 | void init_materials();
8 | }
9 |
--------------------------------------------------------------------------------
/core/features/visuals/esp/esp.cpp:
--------------------------------------------------------------------------------
1 | #define NOMINMAX
2 | #include "esp.hpp"
3 | #include "..\..\..\utils\draw\draw.hpp"
4 | #include "..\..\..\utils\game\helpers.hpp"
5 | #include "..\..\..\utils\math\math.hpp"
6 | #include "..\..\..\utils\settings\settings.hpp"
7 | #include "..\..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
8 | #include "../../backtrack/backtrack.hpp"
9 |
10 | namespace esp {
11 | void box(c_base_entity* entity, int x, int y, int w, int h);
12 |
13 | void health_bar(c_base_entity* entity, int x, int y, int w, int h);
14 |
15 | void class_name(c_base_entity* entity, int x, int y, int w, int h);
16 |
17 | void glow(c_base_entity* entity, bool toggle);
18 |
19 | void snap_lines(c_base_entity* entity, int x, int y, int w, int h);
20 |
21 | void skeleton(c_base_entity* entity);
22 |
23 | void direction_line(c_base_entity* entity);
24 |
25 | void backtrack_point(c_base_entity* entity);
26 |
27 | void fov_circle(c_base_entity* local_player);
28 |
29 | void buildings(c_base_entity* entity, c_base_entity* local_player);
30 |
31 | void pickups(c_base_entity* entity);
32 |
33 | void projectiles(c_base_entity* entity, c_base_entity* local_player);
34 |
35 | bool get_item_bounds(c_base_entity* entity, int& x, int& y, int& w, int& h);
36 |
37 | void run() {
38 | auto local_player = interfaces::entity_list->get_client_entity(interfaces::engine->get_local_player());
39 |
40 | if (!local_player) {
41 | return;
42 | }
43 |
44 | if (!local_player->is_in_valid_team()) {
45 | return;
46 | }
47 |
48 | for (int i = 1; i <= interfaces::engine->get_max_clients(); i++) {
49 | auto entity = interfaces::entity_list->get_client_entity(i);
50 |
51 | if (!entity || entity == local_player || entity->is_dormant() || !entity->is_alive() || !entity->get_health()) {
52 | continue;
53 | }
54 |
55 | if (!settings::team_visuals && entity->get_team_num() == local_player->get_team_num()) {
56 | continue;
57 | }
58 |
59 | int x, y, w, h;
60 | if (!get_item_bounds(entity, x, y, w, h)) {
61 | continue;
62 | }
63 |
64 | if (settings::box) {
65 | box(entity, x, y, w, h);
66 | }
67 |
68 | if (settings::health_bar) {
69 | health_bar(entity, x, y, w, h);
70 | }
71 |
72 | if (settings::class_name) {
73 | class_name(entity, x, y, w, h);
74 | }
75 |
76 | glow(entity, settings::glow_players);
77 |
78 | if (settings::snap_lines) {
79 | snap_lines(entity, x, y, w, h);
80 | }
81 |
82 | if (settings::skeleton) {
83 | skeleton(entity);
84 | }
85 |
86 | if (settings::direction_line) {
87 | direction_line(entity);
88 | }
89 |
90 | if (settings::visualize_backtrack && settings::legit_backtrack && !local_player->is_scoped()) {
91 | backtrack_point(entity);
92 | }
93 | }
94 |
95 | for (int i = 1; i <= interfaces::entity_list->get_max_entitys(); i++) {
96 | auto entity = interfaces::entity_list->get_client_entity(i);
97 | if (!entity || entity->is_player() || entity->is_dormant()) {
98 | continue;
99 | }
100 |
101 | if (settings::buildings) {
102 | buildings(entity, local_player);
103 | }
104 |
105 | if (settings::pickups) {
106 | pickups(entity);
107 | }
108 |
109 | if (settings::projectile_esp) {
110 | projectiles(entity, local_player);
111 | }
112 | }
113 | }
114 |
115 | void box(c_base_entity* entity, int x, int y, int w, int h) {
116 | draw::rect(x, y, w, h, settings::box_color);
117 | draw::rect(x - 1, y - 1, w + 2, h + 2, color(0, 0, 0));
118 | }
119 |
120 | void health_bar(c_base_entity* entity, int x, int y, int w, int h) {
121 | float current_health = entity->get_health();
122 | float max_health = entity->get_max_health();
123 | auto health_height = current_health <= max_health ? h * (current_health / max_health) : h;
124 |
125 | draw::filled_rect(x - 6 - 1, y + (h - health_height), 2, health_height, current_health <= max_health ? color(0, 255, 0) : color(255, 215, 0));
126 |
127 | if (settings::health_text && current_health != max_health) {
128 | auto health_str = std::to_string((int)current_health);
129 | draw::text(draw::health_font, health_str, x - 6 - 1 - 2 - draw::get_text_size_width(draw::health_font, health_str), y + (h - health_height) - 2,
130 | current_health <= max_health ? color(255, 255, 255) : color(255, 215, 0));
131 | }
132 | }
133 |
134 | void class_name(c_base_entity* entity, int x, int y, int w, int h) {
135 | auto class_name = get_class_name_string(entity->get_class_number());
136 | draw::text(draw::class_name_font, class_name, x + (w / 2), y - 15, settings::class_name_color, true);
137 | }
138 |
139 | void glow(c_base_entity* entity, bool toggle) {
140 | entity->update_glow_effect();
141 | entity->glow_enabled() = toggle;
142 | }
143 |
144 | void snap_lines(c_base_entity* entity, int x, int y, int w, int h) {
145 | draw::line(utils::screen_x / 2, utils::screen_y, x + (w / 2), y + h, settings::snap_lines_color);
146 | }
147 |
148 | void skeleton(c_base_entity* entity) {
149 | auto studio_hdr = interfaces::model_info->get_studio_model(entity->get_model());
150 | if (studio_hdr) {
151 | for (int i = 0; i < studio_hdr->numbones; i++) {
152 | auto bone = studio_hdr->get_bone(i);
153 | if (bone && (bone->flags & BONE_USED_BY_HITBOX) && (bone->parent != -1)) {
154 | auto bone_pos = entity->get_bone_pos(i);
155 | auto parent_pos = entity->get_bone_pos(bone->parent);
156 |
157 | vector screen_bone, screen_parent;
158 | if (draw::w2s(bone_pos, screen_bone) && draw::w2s(parent_pos, screen_parent)) {
159 | draw::line(screen_parent.x, screen_parent.y, screen_bone.x, screen_bone.y, settings::skeleton_color);
160 | }
161 | }
162 | }
163 | }
164 | }
165 |
166 | void direction_line(c_base_entity* entity) {
167 | vector start = entity->get_hitbox_pos(hitboxes::HEAD);
168 | vector angles = entity->get_view_angles();
169 | vector forward_vector;
170 |
171 | math::angle_vectors(angles, &forward_vector);
172 |
173 | vector screen_start, screen_end;
174 | if (draw::w2s(start, screen_start) && draw::w2s(forward_vector * 50 + start, screen_end)) {
175 | draw::line(screen_start, screen_end, settings::direction_line_color);
176 | }
177 | }
178 |
179 | void backtrack_point(c_base_entity* entity) {
180 | auto &ticks = backtrack::player_ticks[entity->get_entity_index()];
181 | if (ticks.size() < 1) {
182 | return;
183 | }
184 |
185 | auto point = ticks.at(ticks.size() - 1).head_position;
186 |
187 | vector screen;
188 | if (draw::w2s(point, screen)) {
189 | draw::circle(screen, 4, settings::visualize_backtrack_color);
190 | }
191 | }
192 |
193 | void fov_circle(c_base_entity* local_player) {
194 | //auto fuck_me = ((tanf((settings::aimbot_fov / 2) * M_PI / 180)) / tanf((90 / 2) * M_PI / 180) * 800 / 2); //+10 because that fine tunes the circle to where we need it
195 | //draw::circle(vector_2d(utils::screen_x / 2, utils::screen_y / 2), fuck_me, color(255, 0, 0));
196 | }
197 |
198 | void buildings(c_base_entity* entity, c_base_entity* local_player) {
199 | if (!settings::team_buildings && entity->get_team_num() == local_player->get_team_num()) {
200 | return;
201 | }
202 |
203 | auto model_name = entity->get_model_name();
204 | if (model_name[7] == 'b' && model_name[11] == 'd' && model_name[16] == 's') {
205 | // models/buildables/
206 |
207 | const char* display_name = "";
208 | if (entity->is_dispenser()) {
209 | display_name = "dispenser";
210 | }
211 | else if (entity->is_sentry()) {
212 | display_name = "sentry";
213 | }
214 | else if (entity->is_teleporter()) {
215 | display_name = "teleporter";
216 | }
217 | else {
218 | return;
219 | }
220 |
221 | int x, y, w, h;
222 | if (get_item_bounds(entity, x, y, w, h)) {
223 | color color = (settings::team_buildings && entity->get_team_num() == local_player->get_team_num()) ?
224 | settings::team_buildings_color : settings::buildings_color;
225 |
226 | draw::rect(x, y, w, h, color);
227 | draw::text(draw::pickup_font, display_name, x + (w / 2), y - 15, { 255, 255, 255 }, true);
228 |
229 | if (settings::health_bar_buildings) {
230 | float current_health = entity->get_object_health();
231 | float max_health = entity->get_object_max_health();
232 | auto health_height = current_health <= max_health ? h * (current_health / max_health) : h;
233 |
234 | draw::filled_rect(x - 6 - 1, y + (h - health_height), 2, health_height, { 0, 255, 0 });
235 | }
236 | }
237 | glow(entity, settings::glow_buildings);
238 | }
239 | }
240 |
241 | void pickups(c_base_entity* entity) {
242 | if (settings::health_pack_esp && entity->is_health_pack()) {
243 | int x, y, w, h;
244 | if (get_item_bounds(entity, x, y, w, h)) {
245 | draw::rect(x, y, w, h, settings::health_pack_esp_color);
246 | draw::text(draw::pickup_font, L"Health", x + (w / 2), y, settings::health_pack_esp_color, true);
247 | }
248 | }
249 | else if (settings::ammo_box_esp && entity->is_ammo_pack()) {
250 | int x, y, w, h;
251 | if (get_item_bounds(entity, x, y, w, h)) {
252 | draw::rect(x, y, w, h, settings::ammo_box_esp_color);
253 | draw::text(draw::pickup_font, L"Ammo", x + (w / 2), y, settings::ammo_box_esp_color, true);
254 | }
255 | }
256 | }
257 |
258 | void projectiles(c_base_entity* entity, c_base_entity* local_player) {
259 | if (!settings::projectile_esp || entity->get_team_num() == local_player->get_team_num()) {
260 | return;
261 | }
262 |
263 | auto class_id = entity->get_class_id();
264 | if (class_id == CTFProjectile_Rocket ||
265 | class_id == CTFProjectile_Arrow ||
266 | class_id == CTFProjectile_Flare ||
267 | class_id == CTFGrenadePipebombProjectile) {
268 |
269 | const char* display_name = "";
270 | if (class_id == CTFProjectile_Rocket) {
271 | display_name = "rocket";
272 | }
273 | else if (class_id == CTFProjectile_Arrow) {
274 | display_name = "arrow";
275 | }
276 | else if (class_id == CTFProjectile_Flare) {
277 | display_name = "flare";
278 | }
279 | else if (class_id == CTFGrenadePipebombProjectile) {
280 | display_name = "pipe";
281 | }
282 |
283 | int x, y, w, h;
284 | if (get_item_bounds(entity, x, y, w, h)) {
285 | draw::rect(x, y, w, h, settings::projectile_esp_color);
286 | draw::text(draw::object_font, display_name, x + (w / 2), y - 15, { 255, 255, 255 }, true);
287 | }
288 | }
289 | }
290 |
291 | bool get_item_bounds(c_base_entity* entity, int& x, int& y, int& w, int& h) {
292 | if (!interfaces::game_movement || !entity) {
293 | return false;
294 | }
295 |
296 | const matrix3x4& transform = entity->get_rgfl_coordinate_frame();
297 |
298 | vector mins = {};
299 | vector maxs = {};
300 |
301 | if (entity->is_player()) {
302 | mins = interfaces::game_movement->get_player_mins(entity->is_ducking());
303 | maxs = interfaces::game_movement->get_player_maxs(entity->is_ducking());
304 | }
305 | else {
306 | mins = entity->get_collideable_mins();
307 | maxs = entity->get_collideable_max();
308 | }
309 |
310 | vector points[] = {
311 | vector(mins.x, mins.y, mins.z),
312 | vector(mins.x, maxs.y, mins.z),
313 | vector(maxs.x, maxs.y, mins.z),
314 | vector(maxs.x, mins.y, mins.z),
315 | vector(maxs.x, maxs.y, maxs.z),
316 | vector(mins.x, maxs.y, maxs.z),
317 | vector(mins.x, mins.y, maxs.z),
318 | vector(maxs.x, mins.y, maxs.z)
319 | };
320 |
321 | vector transformed_points[8];
322 |
323 | for (int i = 0; i < 8; i++)
324 | math::vector_transform(points[i], transform, transformed_points[i]);
325 |
326 | vector flb, brt, blb, frt, frb, brb, blt, flt;
327 |
328 | if (draw::w2s(transformed_points[3], flb) && draw::w2s(transformed_points[5], brt)
329 | && draw::w2s(transformed_points[0], blb) && draw::w2s(transformed_points[4], frt)
330 | && draw::w2s(transformed_points[2], frb) && draw::w2s(transformed_points[1], brb)
331 | && draw::w2s(transformed_points[6], blt) && draw::w2s(transformed_points[7], flt)
332 | && draw::w2s(transformed_points[6], blt) && draw::w2s(transformed_points[7], flt))
333 | {
334 | vector arr[] = { flb, brt, blb, frt, frb, brb, blt, flt };
335 |
336 | float left = flb.x;
337 | float top = flb.y;
338 | float righ = flb.x;
339 | float bottom = flb.y;
340 |
341 | for (int n = 1; n < 8; n++) {
342 | if (left > arr[n].x)
343 | left = arr[n].x;
344 |
345 | if (top < arr[n].y)
346 | top = arr[n].y;
347 |
348 | if (righ < arr[n].x)
349 | righ = arr[n].x;
350 |
351 | if (bottom > arr[n].y)
352 | bottom = arr[n].y;
353 | }
354 |
355 | float x_ = left;
356 | float y_ = bottom;
357 | float w_ = (righ - left);
358 | float h_ = (top - bottom);
359 |
360 | if (entity->is_player()) {
361 | x_ += ((righ - left) / 8.0f);
362 | w_ -= (((righ - left) / 8.0f) * 2.0f);
363 | }
364 |
365 | x = static_cast(x_);
366 | y = static_cast(y_);
367 | w = static_cast(w_);
368 | h = static_cast(h_);
369 |
370 | if (x > utils::screen_x || (x + w) < 0 || y > utils::screen_y || (y + h) < 0)
371 | return false;
372 |
373 | return true;
374 | }
375 |
376 | return false;
377 | }
378 | }
--------------------------------------------------------------------------------
/core/features/visuals/esp/esp.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace esp {
4 | void run();
5 | }
--------------------------------------------------------------------------------
/core/features/visuals/walkbot/visualize_walkbot.cpp:
--------------------------------------------------------------------------------
1 | #include "visualize_walkbot.hpp"
2 | #include "..\..\..\utils\draw\draw.hpp"
3 | #include "..\..\..\utils\game\helpers.hpp"
4 | #include "..\..\..\utils\math\math.hpp"
5 | #include "..\..\..\utils\settings\settings.hpp"
6 | #include "..\..\..\utils\math\math.hpp"
7 |
8 | namespace visualize_walkbot {
9 |
10 | void move(c_base_entity* local_player, c_user_cmd* cmd) {
11 | if (GetAsyncKeyState(VK_UP) & 0x8000) {
12 | cmd->forwardmove = 450;
13 | }
14 |
15 | static vector start = local_player->get_origin();
16 | vector current = local_player->get_origin();
17 | std::cout << current.dist_to(start) << std::endl;
18 | }
19 |
20 | void visualize_path() {
21 | auto local_player = interfaces::entity_list->get_client_entity(interfaces::engine->get_local_player());
22 | if (!local_player) {
23 | return;
24 | }
25 |
26 | vector view_angles = {}, forward = {};
27 | interfaces::engine->get_view_angles(view_angles);
28 | math::angle_vectors(view_angles, &forward);
29 |
30 | vector start = local_player->get_origin();
31 | static vector end = forward * 1000 + start;
32 |
33 | vector screen_start, screen_end;
34 | if (draw::w2s(start, screen_start) && draw::w2s(end, screen_end)) {
35 | draw::line(screen_start, screen_end, color(255, 0, 0));
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/core/features/visuals/walkbot/visualize_walkbot.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class c_base_entity;
4 | class c_user_cmd;
5 |
6 | namespace visualize_walkbot {
7 |
8 | void move(c_base_entity* local_player, c_user_cmd* cmd);
9 |
10 | void visualize_path();
11 |
12 | }
--------------------------------------------------------------------------------
/core/hooks/hook.cpp:
--------------------------------------------------------------------------------
1 | #include "hook.hpp"
2 | #include "..\interfaces\interfaces.hpp"
3 | #include "../utils/netvars/netvars.hpp"
4 | #include "../menu/menu.hpp"
5 | #include
6 |
7 | namespace hooks {
8 | std::unique_ptr m_client_mode = nullptr;
9 | std::unique_ptr m_paint_traverse = nullptr;
10 | std::unique_ptr m_paint = nullptr;
11 | std::unique_ptr m_dme = nullptr;
12 | std::unique_ptr m_present = nullptr;
13 | std::unique_ptr m_reset = nullptr;
14 | std::unique_ptr m_lock_cursor = nullptr;
15 | WNDPROC d3d::wnd_proc::old_wnd_proc = nullptr;
16 |
17 | bool hook() {
18 | auto present = memory::find_pattern("gameoverlayrenderer.dll", "FF 15 ? ? ? ? 8B F0 EB 1B");
19 | auto reset = memory::find_pattern("gameoverlayrenderer.dll", "FF 15 ? ? ? ? 8B D8 85 DB 78 18");
20 | if (!present || !reset) {
21 | utils::log("[-] Present or Reset Nullptr");
22 | std::this_thread::sleep_for(std::chrono::milliseconds(3000));
23 | return false;
24 | }
25 | else {
26 | present += 0x2;
27 | reset += 0x2;
28 | }
29 |
30 | // Create netvar manager
31 | g_netvar = std::make_unique();
32 |
33 | // Client mode hooks
34 | m_client_mode = std::make_unique(interfaces::client_mode);
35 | m_client_mode->hook(client_mode::create_move::index, client_mode::create_move::fn);
36 |
37 | // Panel hooks
38 | //m_paint_traverse = std::make_unique(interfaces::panels);
39 | //m_paint_traverse->hook(panel::paint_traverse::index, panel::paint_traverse::fn);
40 |
41 | // EngineVGui hooks
42 | m_paint = std::make_unique(interfaces::engine_vgui);
43 | m_paint->hook(engine_vgui::paint::index, engine_vgui::paint::fn);
44 |
45 | // Model render hooks
46 | //m_dme = std::make_unique(interfaces::model_render);
47 | //m_dme->hook(model_render::dme::index, model_render::dme::fn);
48 |
49 | // D3D hooks
50 | m_present = std::make_unique(present);
51 | m_present->hook(d3d::present::index, d3d::present::fn);
52 |
53 | m_reset = std::make_unique(reset);
54 | m_reset->hook(d3d::reset::index, d3d::reset::fn);
55 |
56 | m_lock_cursor = std::make_unique(interfaces::surface);
57 | m_lock_cursor->hook(d3d::lock_cursor::index, d3d::lock_cursor::fn);
58 |
59 | d3d::wnd_proc::old_wnd_proc = reinterpret_cast(
60 | SetWindowLongPtr((HWND)utils::tf2_window, GWLP_WNDPROC, reinterpret_cast(d3d::wnd_proc::wnd_proc)));
61 |
62 | utils::log("[-] Hooks Applied");
63 |
64 | return true;
65 | }
66 |
67 | void unhook() {
68 | menu::open = false;
69 |
70 | std::this_thread::sleep_for(std::chrono::milliseconds(800));
71 |
72 | m_client_mode->unhook();
73 | //m_paint_traverse->unhook();
74 | m_paint->unhook();
75 | //m_dme->unhook();
76 | m_present->unhook();
77 | m_reset->unhook();
78 | m_lock_cursor->unhook();
79 |
80 | SetWindowLongPtr((HWND)utils::tf2_window, GWLP_WNDPROC, reinterpret_cast(d3d::wnd_proc::old_wnd_proc));
81 |
82 | g_netvar.reset();
83 | utils::log("[-] Hooks unapplied");
84 | }
85 | }
--------------------------------------------------------------------------------
/core/hooks/hook.hpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "..\source-sdk\structs\structs.hpp"
3 | #include "..\utils\memory\memory.hpp"
4 | #include "..\source-sdk\interfaces\i_engine_vgui.hpp"
5 |
6 | class i_surface;
7 | class draw_model_state;
8 | class model_render_info;
9 | class c_model_render;
10 |
11 | namespace hooks {
12 | bool hook();
13 | void unhook();
14 |
15 | namespace client_mode {
16 | namespace create_move {
17 | constexpr int index = 21u;
18 | using t = bool(__stdcall*)(float, c_user_cmd*);
19 | bool __stdcall fn(float flInputSampleTime, c_user_cmd* cmd);
20 | }
21 | }
22 |
23 | namespace panel {
24 | namespace paint_traverse {
25 | constexpr int index = 41u;
26 | using t = void(__thiscall*)(void* panels, unsigned int, bool, bool);
27 | void __fastcall fn(void* panels, int edx, unsigned int vgui_panel, bool force_repaint, bool allow_force);
28 | }
29 | }
30 |
31 | namespace engine_vgui {
32 | namespace paint {
33 | constexpr int index = 13;
34 | using t = void(__thiscall*)(i_engine_vgui*, int);
35 | void __stdcall fn(int mode);
36 | }
37 | }
38 |
39 | namespace model_render {
40 | namespace dme {
41 | constexpr int index = 19u;
42 | using t = void(__thiscall*)(c_model_render*, draw_model_state&, model_render_info&, matrix3x4*);
43 | void __stdcall fn(draw_model_state& state, model_render_info& info, matrix3x4* bone_to_world);
44 | }
45 | }
46 |
47 | namespace d3d {
48 | namespace present {
49 | constexpr int index = 0u;
50 | using t = long(__stdcall*)(IDirect3DDevice9*, const RECT*, const RECT*, HWND, const RGNDATA*);
51 | long __stdcall fn(IDirect3DDevice9* device, const RECT* source_rect, const RECT* dest_rect, HWND dest_window_override, const RGNDATA* dirty_region);
52 | }
53 |
54 | namespace reset {
55 | constexpr int index = 0u;
56 | using t = long(__stdcall*)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
57 | long __stdcall fn(IDirect3DDevice9* device, D3DPRESENT_PARAMETERS* present_parameters);
58 | }
59 |
60 | namespace lock_cursor {
61 | constexpr int index = 62u;
62 | using t = void(__thiscall*)(i_surface*);
63 | void __stdcall fn();
64 | }
65 |
66 | namespace wnd_proc {
67 | LRESULT __stdcall wnd_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
68 | extern WNDPROC old_wnd_proc;
69 | }
70 | }
71 |
72 | extern std::unique_ptr m_client_mode;
73 | extern std::unique_ptr m_paint_traverse;
74 | extern std::unique_ptr m_paint;
75 | extern std::unique_ptr m_dme;
76 | extern std::unique_ptr m_present;
77 | extern std::unique_ptr m_reset;
78 | extern std::unique_ptr m_lock_cursor;
79 | }
--------------------------------------------------------------------------------
/core/hooks/vtables/create_move.cpp:
--------------------------------------------------------------------------------
1 | #include "..\hook.hpp"
2 | #include "..\..\utils\settings\settings.hpp"
3 | #include "..\..\interfaces\interfaces.hpp"
4 | #include "..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
5 |
6 | #include "../../features/misc/misc.hpp"
7 | #include "../../features/aimbot/aimbot.hpp"
8 | #include "../../features/triggerbot/triggerbot.hpp"
9 | #include "../../features/visuals/walkbot/visualize_walkbot.hpp"
10 | #include "../../menu/menu.hpp"
11 | #include "../../features/backtrack/backtrack.hpp"
12 |
13 | bool __stdcall hooks::client_mode::create_move::fn(float input_sample_time, c_user_cmd* cmd)
14 | {
15 | static const auto original_return_value = m_client_mode->get_original(index)(input_sample_time, cmd);
16 |
17 | if (!cmd || !cmd->command_number) {
18 | return original_return_value;
19 | }
20 |
21 | auto local_player = interfaces::entity_list->get_client_entity(interfaces::engine->get_local_player());
22 | if (local_player && local_player->is_alive() && settings::misc) {
23 | if (settings::bunny_hop) {
24 | misc::bunny_hop(local_player, cmd);
25 | }
26 |
27 | if (settings::auto_backstab) {
28 | misc::auto_backstab(local_player, cmd);
29 | }
30 |
31 | if (settings::legit_backtrack) {
32 | backtrack::save_ticks(local_player, cmd);
33 | backtrack::set_backtrack_tick(local_player, cmd);
34 | }
35 |
36 | if (!menu::open && settings::aimbot && GetAsyncKeyState(settings::aimbot_key) & 0x8000) {
37 | aimbot::run(local_player, cmd);
38 | }
39 |
40 | if (settings::triggerbot && (GetAsyncKeyState(settings::triggerbot_key) & 0x8000 || settings::triggerbot_always_on)) {
41 | triggerbot::run(local_player, cmd);
42 | }
43 |
44 | //visualize_walkbot::move();
45 | }
46 |
47 | return original_return_value;
48 | }
--------------------------------------------------------------------------------
/core/hooks/vtables/dme.cpp:
--------------------------------------------------------------------------------
1 | #include "..\hook.hpp"
2 | #include "..\..\interfaces\interfaces.hpp"
3 | #include "../../features/visuals/chams/chams.hpp"
4 | #include "../../utils/settings/settings.hpp"
5 |
6 | constexpr float default_color[3] = { 1, 1, 1 };
7 |
8 | void __stdcall hooks::model_render::dme::fn(draw_model_state& state, model_render_info& info, matrix3x4* bone_to_world) {
9 | static auto init = false;
10 | if (!init) {
11 | chams::init_materials();
12 | init = true;
13 | }
14 |
15 | const char* model_name = interfaces::model_info->get_model_name(info.m_pModel);
16 | if (!model_name) {
17 | return;
18 | }
19 |
20 | if (settings::chams) {
21 | chams::run(info, model_name);
22 | }
23 |
24 | m_dme->get_original(index)(interfaces::model_render, state, info, bone_to_world);
25 |
26 | interfaces::render_view->set_blend(1);
27 | interfaces::render_view->set_color_modulation(default_color);
28 | interfaces::model_render->forced_material_override(nullptr);
29 | }
--------------------------------------------------------------------------------
/core/hooks/vtables/paint.cpp:
--------------------------------------------------------------------------------
1 | #include "..\hook.hpp"
2 | #include "..\..\interfaces\interfaces.hpp"
3 | #include "..\..\utils\draw\draw.hpp"
4 | #include "..\..\features\visuals\esp\esp.hpp"
5 | #include "../../utils/settings/settings.hpp"
6 | #include "../../features/visuals/walkbot/visualize_walkbot.hpp"
7 |
8 | void __stdcall hooks::engine_vgui::paint::fn(int mode) {
9 | static auto start_drawing = reinterpret_cast(memory::find_pattern("vguimatsurface.dll", "55 8B EC 64 A1 ? ? ? ? 6A FF 68 ? ? ? ? 50 64 89 25 ? ? ? ? 83 EC 14"));
10 | static auto finish_drawing = reinterpret_cast(memory::find_pattern("vguimatsurface.dll", "55 8B EC 6A FF 68 ? ? ? ? 64 A1 ? ? ? ? 50 64 89 25 ? ? ? ? 51 56 6A 00"));
11 |
12 | static auto init = false;
13 | if (!init) {
14 | draw::init();
15 | init = true;
16 | }
17 |
18 | m_paint->get_original(index)(interfaces::engine_vgui, mode);
19 |
20 | if (mode & paint_mode::UIPANELS) {
21 | start_drawing(interfaces::surface);
22 | {
23 | draw::text(draw::watermark_font, L"Overflow", { 10, 10 }, { 255, 0, 0 });
24 |
25 | if (interfaces::engine->is_in_game() && interfaces::engine->is_connected() &&
26 | !interfaces::engine->con_is_visible() && !interfaces::engine_vgui->is_game_ui_visible()) {
27 | if (settings::visuals) {
28 | esp::run();
29 | }
30 |
31 | //visualize_walkbot::visualize_path();
32 | }
33 | }
34 | finish_drawing(interfaces::surface);
35 | }
36 | }
--------------------------------------------------------------------------------
/core/hooks/vtables/paint_traverse.cpp:
--------------------------------------------------------------------------------
1 | #include "..\hook.hpp"
2 | #include "..\..\interfaces\interfaces.hpp"
3 | #include "../../utils/draw/draw.hpp"
4 | #include "../../utils/settings/settings.hpp"
5 | #include "../../features/visuals/esp/esp.hpp"
6 |
7 | void __fastcall hooks::panel::paint_traverse::fn(void* panels, int edx, unsigned int vgui_panel, bool force_repaint, bool allow_force) {
8 |
9 | m_paint_traverse->get_original(index)(panels, vgui_panel, force_repaint, allow_force);
10 |
11 | static auto focus_overlay_panel_index = NULL;
12 | if (!focus_overlay_panel_index) {
13 | if (!strcmp(interfaces::panels->get_name(vgui_panel), "FocusOverlayPanel")) {
14 | focus_overlay_panel_index = vgui_panel;
15 | utils::log((std::string("[-] Found Panel: ") + interfaces::panels->get_name(vgui_panel)).c_str());
16 | }
17 | }
18 | else if (focus_overlay_panel_index == vgui_panel) {
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/core/hooks/vtables/present.cpp:
--------------------------------------------------------------------------------
1 | #include "..\hook.hpp"
2 | #include "../../interfaces/interfaces.hpp"
3 | #include "../../menu/menu.hpp"
4 | #include "../../utils/settings/settings.hpp"
5 |
6 | extern LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
7 |
8 | long __stdcall hooks::d3d::present::fn(IDirect3DDevice9* device, const RECT* source_rect, const RECT* dest_rect, HWND dest_window_override, const RGNDATA* dirty_region) {
9 | static auto init = false;
10 | if (!init) {
11 | menu::setup_fonts();
12 | menu::setup_present(device);
13 | init = true;
14 | }
15 |
16 | menu::pre_render(device);
17 | menu::post_render();
18 |
19 | if (GetAsyncKeyState(VK_INSERT) & 1) {
20 | menu::open = !menu::open;
21 | interfaces::surface->set_cursor_always_visible(menu::open);
22 | }
23 |
24 | if (menu::open) {
25 | menu::render();
26 | }
27 |
28 | if (settings::spectator_list) {
29 | menu::spectator_window();
30 | }
31 |
32 | menu::end_present(device);
33 |
34 | return m_present->get_original(index)(device, source_rect, dest_rect, dest_window_override, dirty_region);
35 | }
36 |
37 | long __stdcall hooks::d3d::reset::fn(IDirect3DDevice9* device, D3DPRESENT_PARAMETERS* present_parameters) {
38 | menu::invalidate_objects();
39 | const auto hr = m_reset->get_original(index)(device, present_parameters);
40 | menu::create_objects(device);
41 | return hr;
42 | }
43 |
44 | void __stdcall hooks::d3d::lock_cursor::fn() {
45 | menu::open ? interfaces::surface->unlock_cursor() : m_lock_cursor->get_original(index)(interfaces::surface);
46 | }
47 |
48 | LRESULT __stdcall hooks::d3d::wnd_proc::wnd_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
49 | if (menu::open && ImGui_ImplDX9_WndProcHandler(hwnd, message, wparam, lparam))
50 | return true;
51 |
52 | return CallWindowProcA(old_wnd_proc, hwnd, message, wparam, lparam);
53 | }
--------------------------------------------------------------------------------
/core/interfaces/interfaces.cpp:
--------------------------------------------------------------------------------
1 | #include "interfaces.hpp"
2 | #include "..\utils\memory\memory.hpp"
3 |
4 | namespace interfaces {
5 | i_base_client_dll* client_dll = nullptr;
6 | iv_engine_client* engine = nullptr;
7 | i_client_entity_list* entity_list = nullptr;
8 | i_global_vars* globals = nullptr;
9 | i_client_mode_shared* client_mode = nullptr;
10 | i_panel* panels = nullptr;
11 | i_surface* surface = nullptr;
12 | i_engine_vgui* engine_vgui = nullptr;
13 | iv_debug_overlay* debug_overlay = nullptr;
14 | i_player_info_manager* player_info = nullptr;
15 | c_model_info_client* model_info = nullptr;
16 | i_engine_trace* trace = nullptr;
17 | iv_render_view* render_view = nullptr;
18 | c_game_movement* game_movement = nullptr;
19 | c_model_render* model_render = nullptr;
20 | c_material_system* material_system = nullptr;
21 | glow_manager_t* glow_manager = nullptr;
22 | i_cvar* convar = nullptr;
23 |
24 | template
25 | t get_interface(const char* module_name, const char* interface_name) {
26 | using fn = void* (*)(const char*, int*);
27 | void* (*create_interface)(const char*, int*) = reinterpret_cast(GetProcAddress(GetModuleHandleA(module_name), "CreateInterface"));
28 | return reinterpret_cast(create_interface(interface_name, nullptr));
29 | }
30 |
31 | void init_interfaces() {
32 | client_dll = get_interface("client.dll", "VClient017");
33 | engine = get_interface("engine.dll", "VEngineClient013");
34 | entity_list = get_interface("client.dll", "VClientEntityList003");
35 | panels = get_interface("vgui2.dll", "VGUI_Panel009");
36 | surface = get_interface("vguimatsurface.dll", "VGUI_Surface030");
37 | engine_vgui = get_interface("engine.dll", "VEngineVGui001");
38 | debug_overlay = get_interface("engine.dll", "VDebugOverlay003");
39 | player_info = get_interface("server.dll", "PlayerInfoManager002");
40 | model_info = get_interface("engine.dll", "VModelInfoClient006");
41 | trace = get_interface("engine.dll", "EngineTraceClient003");
42 | render_view = get_interface("engine.dll", "VEngineRenderView014");
43 | game_movement = get_interface("client.dll", "GameMovement001");
44 | model_render = get_interface("engine.dll", "VEngineModel016");
45 | material_system = get_interface("MaterialSystem.dll", "VMaterialSystem081");
46 | convar = get_interface("vstdlib.dll", "VEngineCvar004");
47 | //glow_manager = *reinterpret_cast(memory::find_pattern("client.dll", "C1 E0 05 03 05") + 5);
48 |
49 | const auto dw_chl_client_table = reinterpret_cast(*reinterpret_cast(client_dll));
50 | client_mode = **reinterpret_cast(static_cast(dw_chl_client_table[10]) + 0x05);
51 | globals = player_info->get_global_vars();
52 |
53 | utils::log("[-] Grabbed Interfaces");
54 | }
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/core/interfaces/interfaces.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "..\source-sdk\interfaces\c_handle.hpp"
4 | #include "..\source-sdk\interfaces\i_client_networkable.hpp"
5 | #include "..\source-sdk\interfaces\i_base_client_dll.hpp"
6 | #include "..\source-sdk\interfaces\iv_engine_client.hpp"
7 | #include "..\source-sdk\interfaces\i_panels.hpp"
8 | #include "..\source-sdk\interfaces\i_surface.hpp"
9 | #include "..\source-sdk\interfaces\iv_debug_overlay.hpp"
10 | #include "..\source-sdk\interfaces\i_player_info_manager.hpp"
11 | #include "..\source-sdk\interfaces\i_engine_vgui.hpp"
12 | #include "..\source-sdk\interfaces\c_model_info.hpp"
13 | #include "../source-sdk/interfaces/iv_render_view.hpp"
14 | #include "../source-sdk/interfaces/c_game_movement.hpp"
15 | #include "../source-sdk/interfaces/i_entity_list.hpp"
16 | #include "../source-sdk/interfaces/c_model_render.hpp"
17 | #include "../source-sdk/interfaces/c_material_system.hpp"
18 | #include "../source-sdk/interfaces/c_glow_manager.hpp"
19 | #include "../source-sdk/interfaces/c_convar.hpp"
20 |
21 | namespace interfaces {
22 | extern i_base_client_dll* client_dll;
23 | extern iv_engine_client* engine;
24 | extern i_client_entity_list* entity_list;
25 | extern i_global_vars* globals;
26 | extern i_client_mode_shared* client_mode;
27 | extern i_panel* panels;
28 | extern i_surface* surface;
29 | extern i_engine_vgui* engine_vgui;
30 | extern iv_debug_overlay* debug_overlay;
31 | extern i_player_info_manager* player_info;
32 | extern c_model_info_client* model_info;
33 | extern i_engine_trace* trace;
34 | extern iv_render_view* render_view;
35 | extern c_game_movement* game_movement;
36 | extern c_model_render* model_render;
37 | extern c_material_system* material_system;
38 | extern glow_manager_t* glow_manager;
39 | extern i_cvar* convar;
40 |
41 | void init_interfaces();
42 | }
--------------------------------------------------------------------------------
/core/menu/imgui/dx9/imgui_impl_dx9.h:
--------------------------------------------------------------------------------
1 | // ImGui Win32 + DirectX9 binding
2 | // In this binding, ImTextureID is used to store a 'LPDIRECT3DTEXTURE9' texture identifier. Read the FAQ about ImTextureID in imgui.cpp.
3 |
4 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
5 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
6 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
7 | // https://github.com/ocornut/imgui
8 |
9 | struct IDirect3DDevice9;
10 |
11 | IMGUI_API bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device);
12 | IMGUI_API void ImGui_ImplDX9_Shutdown();
13 | IMGUI_API void ImGui_ImplDX9_NewFrame();
14 |
15 | // Use if you want to reset your rendering device without losing ImGui state.
16 | IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects();
17 | IMGUI_API bool ImGui_ImplDX9_CreateDeviceObjects();
18 | IMGUI_API void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data);
19 |
20 | // Handler for Win32 messages, update mouse/keyboard data.
21 | // You may or not need this for your implementation, but it can serve as reference for handling inputs.
22 | // Commented out to avoid dragging dependencies on types. You can copy the extern declaration in your code.
23 | /*
24 | IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
25 | */
26 |
--------------------------------------------------------------------------------
/core/menu/imgui/imconfig.h:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------------
2 | // USER IMPLEMENTATION
3 | // This file contains compile-time options for ImGui.
4 | // Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO().
5 | //-----------------------------------------------------------------------------
6 |
7 | #pragma once
8 |
9 | //---- Define assertion handler. Defaults to calling assert().
10 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
11 |
12 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows.
13 | //#define IMGUI_API __declspec( dllexport )
14 | //#define IMGUI_API __declspec( dllimport )
15 |
16 | //---- Include imgui_user.h at the end of imgui.h
17 | //#define IMGUI_INCLUDE_IMGUI_USER_H
18 |
19 | //---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
20 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
21 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
22 |
23 | //---- Don't implement test window functionality (ShowTestWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
24 | //---- It is very strongly recommended to NOT disable the test windows. Please read the comment at the top of imgui_demo.cpp to learn why.
25 | //#define IMGUI_DISABLE_TEST_WINDOWS
26 |
27 | //---- Don't define obsolete functions names. Consider enabling from time to time or when updating to reduce like hood of using already obsolete function/names
28 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
29 |
30 | //---- Pack colors to BGRA instead of RGBA (remove need to post process vertex buffer in back ends)
31 | //#define IMGUI_USE_BGRA_PACKED_COLOR
32 |
33 | //---- Implement STB libraries in a namespace to avoid conflicts
34 | //#define IMGUI_STB_NAMESPACE ImGuiStb
35 |
36 | //---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
37 | /*
38 | #define IM_VEC2_CLASS_EXTRA \
39 | ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
40 | operator MyVec2() const { return MyVec2(x,y); }
41 |
42 | #define IM_VEC4_CLASS_EXTRA \
43 | ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \
44 | operator MyVec4() const { return MyVec4(x,y,z,w); }
45 | */
46 |
47 | //---- Use 32-bit vertex indices (instead of default: 16-bit) to allow meshes with more than 64K vertices
48 | //#define ImDrawIdx unsigned int
49 |
50 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
51 | //---- e.g. create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers.
52 | /*
53 | namespace ImGui
54 | {
55 | void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL);
56 | }
57 | */
58 |
--------------------------------------------------------------------------------
/core/menu/menu.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | struct ImFont;
5 |
6 | namespace menu {
7 | extern bool open;
8 |
9 | void __stdcall create_objects(IDirect3DDevice9* device);
10 |
11 | void __stdcall invalidate_objects();
12 |
13 | void __stdcall setup_present(IDirect3DDevice9* device);
14 |
15 | void setup_fonts();
16 |
17 | void __stdcall end_present(IDirect3DDevice9* device);
18 |
19 | void __stdcall pre_render(IDirect3DDevice9* device);
20 |
21 | void __stdcall post_render();
22 |
23 | void render();
24 |
25 | void spectator_window();
26 | }
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_base_combat_weapon.cpp:
--------------------------------------------------------------------------------
1 | #include "c_base_combat_weapon.hpp"
2 | #include "..\..\utils\memory\memory.hpp"
3 | #include "../structs/structs.hpp"
4 | #include "..\..\utils\netvars\netvars.hpp"
5 | #include "../../interfaces/interfaces.hpp"
6 |
7 | template
8 | t c_base_combat_weapon::get_value(const int offset) {
9 | return *reinterpret_cast(reinterpret_cast(this) + offset);
10 | }
11 |
12 | int c_base_combat_weapon::get_weapon_id()
13 | {
14 | typedef int(__thiscall* fn)(void*);
15 | return utils::get_vfunc(this, 377)(this);
16 | }
17 |
18 | weapon_data c_base_combat_weapon::get_weapon_data() {
19 | using Data = weapon_info * (__cdecl*)(int);
20 | static int offset = memory::find_pattern("client.dll", "55 8B EC 66 8B ? ? 66 3B 05 ? ? ? ? 73");
21 | static auto get_tf_weapon_data_fn = reinterpret_cast(offset);
22 | return get_tf_weapon_data_fn(get_weapon_id())->m_WeaponData[0];
23 | }
24 |
25 | int c_base_combat_weapon::get_clip_1()
26 | {
27 | static int team_num = g_netvar->get_offset("DT_BaseCombatWeapon", "LocalWeaponData", "m_iClip1");
28 | return get_value(team_num);
29 | }
30 |
31 | int c_base_combat_weapon::get_clip_2()
32 | {
33 | static int team_num = g_netvar->get_offset("DT_BaseCombatWeapon", "LocalWeaponData", "m_iClip2");
34 | return get_value(team_num);
35 | }
36 |
37 | int c_base_combat_weapon::get_slot()
38 | {
39 | typedef int(__thiscall* fn)(PVOID);
40 | return utils::get_vfunc(this, 327)(this);
41 | }
42 |
43 | float c_base_combat_weapon::get_charge_time()
44 | {
45 | static int team_num = g_netvar->get_offset("DT_WeaponPipebombLauncher", "PipebombLauncherLocalData", "m_flChargeBeginTime");
46 | return get_value(team_num);
47 | }
48 |
49 | float c_base_combat_weapon::get_charge_damage()
50 | {
51 | static int team_num = g_netvar->get_offset("DT_TFSniperRifle", "SniperRifleLocalData", "m_flChargedDamage");
52 | return get_value(team_num);
53 | }
54 |
55 | short c_base_combat_weapon::get_item_definition_index()
56 | {
57 | static int team_num = g_netvar->get_offset("DT_EconEntity", "m_AttributeManager", "m_Item", "m_iItemDefinitionIndex");
58 | return get_value(team_num);
59 | }
60 |
61 | float c_base_combat_weapon::get_last_fire_time()
62 | {
63 | static int team_num = g_netvar->get_offset("DT_TFWeaponBase", "LocalActiveTFWeaponData", "m_flLastFireTime");
64 | return get_value(team_num);
65 | }
66 |
67 | float c_base_combat_weapon::get_swing_range(c_base_entity* pLocal)
68 | {
69 | typedef int(__thiscall* fn)(c_base_entity*);
70 | return (static_cast(utils::get_vfunc(this, 451)(pLocal)));
71 | }
72 |
73 | bool c_base_combat_weapon::do_swing_trace(c_game_trace& Trace)
74 | {
75 | typedef int(__thiscall* fn)(c_game_trace&);
76 | return utils::get_vfunc(this, 453)(Trace);
77 | }
78 |
79 | bool c_base_combat_weapon::will_crit()
80 | {
81 | typedef bool(__thiscall* FN)(c_base_combat_weapon*);
82 | static DWORD dwFN = memory::find_pattern("client.dll", "55 8B EC 83 EC 18 56 57 6A 00 68 ? ? ? ? 68 ? ? ? ? 6A 00 8B F9 E8 ? ? ? ? 50 E8 ? ? ? ? 8B F0 83 C4 14 89 75 EC");
83 | return ((FN)dwFN)(this);
84 | }
85 |
86 | vector& c_base_combat_weapon::get_bullet_spread()
87 | {
88 | typedef vector& (__thiscall* fn)(PVOID);
89 | return utils::get_vfunc(this, 286)(this);
90 | }
91 |
92 | int c_base_combat_weapon::get_damage_type()
93 | {
94 | typedef int(__thiscall* fn)(void*);
95 | return utils::get_vfunc(this, 378)(this);
96 | }
97 |
98 | bool c_base_combat_weapon::can_fire_critical_shot(bool bHeadShot)
99 | {
100 | typedef bool(__thiscall* fn)(void*, bool, c_base_entity*);
101 | return utils::get_vfunc(this, 421)(this, bHeadShot, nullptr);
102 | }
103 |
104 | float c_base_combat_weapon::get_next_secondary_attack()
105 | {
106 | static int team_num = g_netvar->get_offset("DT_BaseCombatWeapon", "LocalActiveWeaponData", "m_flNextSecondaryAttack");
107 | return get_value(team_num);
108 | }
109 |
110 | float c_base_combat_weapon::get_next_primary_attack()
111 | {
112 | static int team_num = g_netvar->get_offset("DT_BaseCombatWeapon", "LocalActiveWeaponData", "m_flNextPrimaryAttack");
113 | return get_value(team_num);
114 | }
115 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_base_combat_weapon.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\utils\utils.hpp"
3 | #include "i_entity.hpp"
4 | #include "c_base_combat_weapon.hpp"
5 |
6 | struct weapon_data;
7 | class c_game_trace;
8 | class vector;
9 | class c_base_entity;
10 |
11 | class c_base_combat_weapon : public c_base_entity
12 | {
13 | private:
14 | template
15 | t get_value(const int offset);
16 |
17 | public:
18 |
19 | int get_weapon_id();
20 |
21 | weapon_data get_weapon_data();
22 |
23 | int get_clip_1();
24 |
25 | int get_clip_2();
26 |
27 | int get_slot();
28 |
29 | float get_charge_time();
30 |
31 | float get_charge_damage();
32 |
33 | short get_item_definition_index();
34 |
35 | float get_last_fire_time();
36 |
37 | float get_swing_range(c_base_entity* pLocal);
38 |
39 | bool do_swing_trace(c_game_trace& Trace);
40 |
41 | bool will_crit();
42 |
43 | vector& get_bullet_spread();
44 |
45 | int get_damage_type();
46 |
47 | bool can_fire_critical_shot(bool bHeadShot);
48 |
49 | float get_next_secondary_attack();
50 |
51 | float get_next_primary_attack();
52 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_convar.cpp:
--------------------------------------------------------------------------------
1 | #include "c_convar.hpp"
2 | #include
3 | #include "../structs/enums.hpp"
4 | #include
5 | #include
6 |
7 | ConCommandBase* ConCommandBase::s_pConCommandBases = nullptr;
8 | static int s_nCVarFlag = 0;
9 | static int s_nDLLIdentifier = -1;
10 | static bool s_bRegistered = false;
11 |
12 | class CDefaultAccessor : public IConCommandBaseAccessor
13 | {
14 | public:
15 | virtual bool RegisterConCommandBase(ConCommandBase* pVar)
16 | {
17 | /*gInts.cvar->RegisterConCommand(pVar);
18 | return true;*/
19 | return false;
20 | }
21 | };
22 |
23 | static CDefaultAccessor s_DefaultAccessor;
24 | IConCommandBaseAccessor* ConCommandBase::s_pAccessor = &s_DefaultAccessor;
25 |
26 | void ConVar_Register(int nCVarFlag, IConCommandBaseAccessor* pAccessor)
27 | {
28 | /*if (s_bRegistered)
29 | return;
30 | s_bRegistered = true;
31 | s_nCVarFlag = nCVarFlag;
32 | s_nDLLIdentifier = gInts.cvar->AllocateDLLIdentifier();
33 | ConCommandBase *pCur, *pNext;
34 | ConCommandBase::s_pAccessor = pAccessor ? pAccessor : &s_DefaultAccessor;
35 | pCur = ConCommandBase::s_pConCommandBases;
36 | while (pCur)
37 | {
38 | pNext = pCur->m_pNext;
39 | pCur->AddFlags(s_nCVarFlag);
40 | pCur->Init();
41 | pCur = pNext;
42 | }
43 | ConCommandBase::s_pConCommandBases = NULL;*/
44 | }
45 |
46 | convar::convar(const char* pName, const char* pDefaultValue, int flags)
47 | {
48 | Create(pName, pDefaultValue, flags);
49 | }
50 |
51 | convar::convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString)
52 | {
53 | Create(pName, pDefaultValue, flags, pHelpString);
54 | }
55 |
56 | convar::convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, bool bMin, float fMin, bool bMax, float fMax)
57 | {
58 | Create(pName, pDefaultValue, flags, pHelpString, bMin, fMin, bMax, fMax);
59 | }
60 |
61 | convar::convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, FnChangeCallback_t callback)
62 | {
63 | Create(pName, pDefaultValue, flags, pHelpString, false, 0.0, false, 0.0, callback);
64 | }
65 |
66 | convar::convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, bool bMin, float fMin, bool bMax, float fMax, FnChangeCallback_t callback)
67 | {
68 | Create(pName, pDefaultValue, flags, pHelpString, bMin, fMin, bMax, fMax, callback);
69 | }
70 |
71 | convar::~convar(void)
72 | {
73 | if (m_Value.m_pszString)
74 | {
75 | delete[] m_Value.m_pszString;
76 | m_Value.m_pszString = NULL;
77 | }
78 | }
79 |
80 | bool convar::IsFlagSet(int flag) const
81 | {
82 | return (flag & m_pParent->m_nFlags) ? true : false;
83 | }
84 |
85 | const char* convar::GetHelpText(void) const
86 | {
87 | return m_pParent->m_pszHelpString;
88 | }
89 |
90 | void convar::AddFlags(int flags)
91 | {
92 | m_pParent->m_nFlags |= flags;
93 | }
94 |
95 | int convar::GetFlags(void) const
96 | {
97 | return m_pParent->m_nFlags;
98 | }
99 |
100 | bool convar::IsRegistered(void) const
101 | {
102 | return m_pParent->m_bRegistered;
103 | }
104 |
105 | bool convar::IsCommand(void) const
106 | {
107 | return false;
108 | }
109 |
110 | const char* convar::GetName(void) const
111 | {
112 | return m_pParent->m_pszName;
113 | }
114 |
115 | const char* convar::GetBaseName(void) const
116 | {
117 | return m_pParent->m_pszName;
118 | }
119 |
120 | float convar::get_float(void) const
121 | {
122 | return m_pParent->m_Value.m_fValue;
123 | }
124 |
125 | int convar::GetInt(void) const
126 | {
127 | return m_pParent->m_Value.m_nValue;
128 | }
129 |
130 | const char* convar::GetString(void) const
131 | {
132 | return m_pParent->m_Value.m_pszString;
133 | }
134 |
135 | int convar::GetSplitScreenPlayerSlot(void) const
136 | {
137 | return 0;
138 | }
139 |
140 | void convar::InternalSetValue(const char* value)
141 | {
142 | float fNewValue;
143 | char tempVal[32];
144 | char* val;
145 |
146 | float flOldValue = m_Value.m_fValue;
147 |
148 | val = (char*)value;
149 | fNewValue = (float)atof(value);
150 |
151 | if (ClampValue(fNewValue))
152 | {
153 | val = tempVal;
154 | }
155 |
156 | // Redetermine value
157 | m_Value.m_fValue = fNewValue;
158 | m_Value.m_nValue = (int)(fNewValue);
159 |
160 | if (!(m_nFlags & (int)ConVarFlags_t::FCVAR_NEVER_AS_STRING))
161 | {
162 | ChangeStringValue(val, flOldValue);
163 | }
164 | }
165 |
166 | void convar::ChangeStringValue(const char* tempVal, float flOldValue)
167 | {
168 | UNREFERENCED_PARAMETER(flOldValue);
169 | int len = strlen(tempVal) + 1;
170 |
171 | if (len > m_Value.m_StringLength)
172 | {
173 | if (m_Value.m_pszString)
174 | {
175 | delete[] m_Value.m_pszString;
176 | }
177 |
178 | m_Value.m_pszString = new char[len];
179 | m_Value.m_StringLength = len;
180 | }
181 |
182 | memcpy(m_Value.m_pszString, tempVal, len);
183 |
184 | }
185 |
186 | bool convar::ClampValue(float& value)
187 | {
188 | if (m_bHasMin && (value < m_fMinVal))
189 | {
190 | value = m_fMinVal;
191 | return true;
192 | }
193 |
194 | if (m_bHasMax && (value > m_fMaxVal))
195 | {
196 | value = m_fMaxVal;
197 | return true;
198 | }
199 |
200 | return false;
201 | }
202 |
203 | void convar::InternalSetFloatValue(float fNewValue)
204 | {
205 | if (fNewValue == m_Value.m_fValue)
206 | return;
207 | // Check bounds
208 | ClampValue(fNewValue);
209 |
210 | // Redetermine value
211 | float flOldValue = m_Value.m_fValue;
212 | m_Value.m_fValue = fNewValue;
213 | m_Value.m_nValue = (int)fNewValue;
214 |
215 | if (!(m_nFlags & (int)ConVarFlags_t::FCVAR_NEVER_AS_STRING))
216 | {
217 | char tempVal[32];
218 | ChangeStringValue(tempVal, flOldValue);
219 | }
220 | }
221 |
222 | void convar::InternalSetIntValue(int nValue)
223 | {
224 | if (nValue == m_Value.m_nValue)
225 | return;
226 |
227 | float fValue = (float)nValue;
228 | if (ClampValue(fValue))
229 | {
230 | nValue = (int)(fValue);
231 | }
232 |
233 | float flOldValue = m_Value.m_fValue;
234 | m_Value.m_fValue = fValue;
235 | m_Value.m_nValue = nValue;
236 |
237 | if (!(m_nFlags & (int)ConVarFlags_t::FCVAR_NEVER_AS_STRING))
238 | {
239 | char tempVal[32];
240 | ChangeStringValue(tempVal, flOldValue);
241 | }
242 | }
243 |
244 | void convar::InternalSetColorValue(DWORD cValue)
245 | {
246 | int color = (int)cValue;
247 | InternalSetIntValue(color);
248 | }
249 |
250 | void convar::Create(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, bool bMin, float fMin, bool bMax, float fMax, FnChangeCallback_t callback)
251 | {
252 | static const char* empty_string = "";
253 |
254 | m_pParent = this;
255 |
256 | // Name should be static data
257 | m_pszDefaultValue = pDefaultValue ? pDefaultValue : empty_string;
258 |
259 | m_Value.m_StringLength = strlen(m_pszDefaultValue) + 1;
260 | m_Value.m_pszString = new char[m_Value.m_StringLength];
261 | memcpy(m_Value.m_pszString, m_pszDefaultValue, m_Value.m_StringLength);
262 |
263 | m_bHasMin = bMin;
264 | m_fMinVal = fMin;
265 | m_bHasMax = bMax;
266 | m_fMaxVal = fMax;
267 |
268 | m_fnChangeCallback = callback;
269 | m_Value.m_fValue = (float)atof(m_Value.m_pszString);
270 | m_Value.m_nValue = (int)m_Value.m_fValue;
271 |
272 | BaseClass::Create(pName, pHelpString, flags);
273 | }
274 |
275 | void convar::set_value(const char* value)
276 | {
277 | m_pParent->InternalSetValue(value);
278 | }
279 |
280 | void convar::set_value(float value)
281 | {
282 | m_pParent->InternalSetFloatValue(value);
283 | }
284 |
285 | void convar::set_value(int value)
286 | {
287 | m_pParent->InternalSetIntValue(value);
288 | }
289 |
290 | void convar::set_value(DWORD value)
291 | {
292 | m_pParent->InternalSetColorValue(value);
293 | }
294 |
295 | const char* convar::GetDefault(void) const
296 | {
297 | return m_pParent->m_pszDefaultValue;
298 | }
299 |
300 | ConCommandBase::ConCommandBase(void)
301 | {
302 | m_bRegistered = false;
303 | m_pszName = NULL;
304 | m_pszHelpString = NULL;
305 |
306 | m_nFlags = 0;
307 | m_pNext = NULL;
308 | }
309 |
310 | ConCommandBase::ConCommandBase(const char* pName, const char* pHelpString, int flags)
311 | {
312 | Create(pName, pHelpString, flags);
313 | }
314 |
315 | ConCommandBase::~ConCommandBase(void)
316 | {
317 | }
318 |
319 | bool ConCommandBase::IsCommand(void) const
320 | {
321 | return true;
322 | }
323 |
324 | int ConCommandBase::GetDLLIdentifier() const
325 | {
326 | return s_nDLLIdentifier;
327 | }
328 |
329 | void ConCommandBase::Create(const char* pName, const char* pHelpString, int flags)
330 | {
331 | static const char* empty_string = "";
332 |
333 | m_bRegistered = false;
334 |
335 | m_pszName = pName;
336 | m_pszHelpString = pHelpString ? pHelpString : empty_string;
337 |
338 | m_nFlags = flags;
339 |
340 | if (!(m_nFlags & (int)ConVarFlags_t::FCVAR_UNREGISTERED))
341 | {
342 | m_pNext = s_pConCommandBases;
343 | s_pConCommandBases = this;
344 | }
345 |
346 | else
347 | {
348 | m_pNext = NULL;
349 | }
350 |
351 | Init();
352 | }
353 |
354 | void ConCommandBase::Init()
355 | {
356 | if (s_pAccessor)
357 | {
358 | s_pAccessor->RegisterConCommandBase(this);
359 | }
360 | }
361 |
362 | const char* ConCommandBase::GetName(void) const
363 | {
364 | return m_pszName;
365 | }
366 |
367 | void convar::InstallChangeCallback(FnChangeCallback_t callback)
368 | {
369 | m_pParent->m_fnChangeCallback = callback;
370 |
371 | if (m_pParent->m_fnChangeCallback)
372 | {
373 | m_pParent->m_fnChangeCallback(this, m_Value.m_pszString, m_Value.m_fValue);
374 | }
375 | }
376 |
377 | bool ConCommandBase::IsFlagSet(int flag) const
378 | {
379 | return (flag & m_nFlags) ? true : false;
380 | }
381 |
382 | void ConCommandBase::AddFlags(int flags)
383 | {
384 | m_nFlags |= flags;
385 | }
386 |
387 | void ConCommandBase::RemoveFlags(int flags)
388 | {
389 | m_nFlags &= ~flags;
390 | }
391 |
392 | int ConCommandBase::GetFlags(void) const
393 | {
394 | return m_nFlags;
395 | }
396 |
397 | const char* ConCommandBase::GetHelpText(void) const
398 | {
399 | return m_pszHelpString;
400 | }
401 |
402 | bool ConCommandBase::IsRegistered(void) const
403 | {
404 | return m_bRegistered;
405 | }
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_convar.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | //big mess
4 |
5 | class convar;
6 | class i_convar;
7 | class CCommand;
8 | class ConCommand;
9 | class ConCommandBase;
10 | class color;
11 |
12 | class i_convar {
13 | public:
14 | virtual void SetValue(const char* pValue) = 0;
15 | virtual void SetValue(float flValue) = 0;
16 | virtual void SetValue(int nValue) = 0;
17 | virtual const char* GetName(void)const = 0;
18 | virtual bool IsFlagSet(int nFlag) const = 0;
19 | };
20 |
21 | typedef void(*FnChangeCallback_t)(i_convar* var, const char* pOldValue, float flOldValue);
22 |
23 | class IConCommandBaseAccessor {
24 | public:
25 | virtual bool RegisterConCommandBase(ConCommandBase* pVar) = 0;
26 | };
27 |
28 | void ConVar_Register(int nCVarFlag, IConCommandBaseAccessor* pAccessor = nullptr);
29 |
30 | class ConCommandBase {
31 | public:
32 | ConCommandBase(void);
33 | ConCommandBase(const char* pName, const char* pHelpString = 0, int flags = 0);
34 |
35 | virtual ~ConCommandBase(void);
36 | virtual bool IsCommand(void) const;
37 | virtual bool IsFlagSet(int flag) const;
38 | virtual void AddFlags(int flags);
39 | virtual void RemoveFlags(int flags);
40 | virtual int GetFlags() const;
41 | virtual const char* GetName(void) const;
42 | virtual const char* GetHelpText(void) const;
43 | virtual bool IsRegistered(void) const;
44 | virtual int GetDLLIdentifier() const;
45 | virtual void Create(const char* pName, const char* pHelpString = 0, int flags = 0);
46 | virtual void Init();
47 |
48 | public:
49 | ConCommandBase* m_pNext;
50 | bool m_bRegistered;
51 | const char* m_pszName;
52 | const char* m_pszHelpString;
53 | int m_nFlags;
54 |
55 | public:
56 | static ConCommandBase* s_pConCommandBases;
57 | static IConCommandBaseAccessor* s_pAccessor;
58 | };
59 |
60 | class convar : public ConCommandBase, public i_convar {
61 | public:
62 |
63 | typedef ConCommandBase BaseClass;
64 |
65 | convar(const char* pName, const char* pDefaultValue, int flags = 0);
66 |
67 | convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString);
68 | convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, bool bMin, float fMin, bool bMax, float fMax);
69 | convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, FnChangeCallback_t callback);
70 | convar(const char* pName, const char* pDefaultValue, int flags, const char* pHelpString, bool bMin, float fMin, bool bMax, float fMax, FnChangeCallback_t callback);
71 |
72 | virtual ~convar(void);
73 |
74 | virtual bool IsFlagSet(int flag) const;
75 | virtual const char* GetHelpText(void) const;
76 | virtual bool IsRegistered(void) const;
77 | virtual const char* GetName(void) const;
78 | virtual const char* GetBaseName(void) const;
79 | virtual int GetSplitScreenPlayerSlot() const;
80 | DWORD GetColor(void) const;
81 | virtual void AddFlags(int flags);
82 | virtual int GetFlags() const;
83 | virtual bool IsCommand(void) const;
84 | virtual void set_value(const char* value);
85 | virtual void set_value(float value);
86 | virtual void set_value(int value);
87 | virtual void set_value(DWORD value);
88 | virtual void InternalSetValue(const char* value);
89 | virtual void InternalSetFloatValue(float fNewValue);
90 | virtual void InternalSetIntValue(int nValue);
91 | virtual void InternalSetColorValue(DWORD value);
92 | virtual bool ClampValue(float& value);
93 | virtual void ChangeStringValue(const char* tempVal, float flOldValue);
94 | virtual void Create(const char* pName, const char* pDefaultValue, int flags = 0,
95 | const char* pHelpString = 0, bool bMin = false, float fMin = 0.0,
96 | bool bMax = false, float fMax = false, FnChangeCallback_t callback = 0);
97 |
98 |
99 | //----------------------------
100 | // Non-virtual helper methods
101 | //----------------------------
102 | float get_float(void) const;
103 | int GetInt(void) const;
104 | //DWORD GetColor(void) const;
105 | const char* GetString(void) const;
106 | const char* GetDefault(void) const;
107 |
108 | void InstallChangeCallback(FnChangeCallback_t callback);
109 |
110 | // Value
111 | struct CVValue_t
112 | {
113 | char* m_pszString;
114 | int m_StringLength;
115 | float m_fValue;
116 | int m_nValue;
117 | };
118 |
119 | convar* m_pParent;
120 | const char* m_pszDefaultValue;
121 | CVValue_t m_Value;
122 | bool m_bHasMin;
123 | float m_fMinVal;
124 | bool m_bHasMax;
125 | float m_fMaxVal;
126 | FnChangeCallback_t m_fnChangeCallback;
127 |
128 | char pad_0x0000[0x4]; //0x0000
129 | convar* pNext; //0x0004
130 | __int32 bRegistered; //0x0008
131 | char* pszName; //0x000C
132 | char* pszHelpString; //0x0010
133 | __int32 nFlags; //0x0014
134 | char pad_0x0018[0x4]; //0x0018
135 | convar* pParent; //0x001C
136 | char* pszDefaultValue; //0x0020
137 | char* strString; //0x0024
138 | __int32 StringLength; //0x0028
139 | float fValue; //0x002C
140 | __int32 nValue; //0x0030
141 | __int32 bHasMin; //0x0034
142 | float fMinVal; //0x0038
143 | __int32 bHasMax; //0x003C
144 | float fMaxVal; //0x0040
145 | void* fnChangeCallback; //0x0044
146 | };
147 |
148 | class IAppSystem {
149 | public:
150 | virtual bool Connect(void* factory) = 0;
151 | virtual void Disconnect() = 0;
152 | virtual void* QueryInterface(const char* pInterfaceName) = 0;
153 | virtual int Init() = 0;
154 | virtual void Shutdown(char* reason) = 0;
155 | };
156 |
157 | class i_cvar : public IAppSystem {
158 | public:
159 | virtual int AllocateDLLIdentifier() = 0;
160 | virtual void RegisterConCommand(ConCommandBase* pCommandBase) = 0;
161 | virtual void UnregisterConCommand(ConCommandBase* pCommandBase) = 0;
162 | virtual void UnregisterConCommands(int id) = 0;
163 | virtual const char* GetCommandLineValue(const char* pVariableName) = 0;
164 | virtual ConCommandBase* FindCommandBase(const char* name) = 0;
165 | virtual const ConCommandBase* FindCommandBase(const char* name) const = 0;
166 | virtual convar* find_var(const char* var_name) = 0;
167 | virtual const convar* find_var(const char* var_name) const = 0;
168 | virtual ConCommand* FindCommand(const char* name) = 0;
169 | virtual const ConCommand* FindCommand(const char* name) const = 0;
170 | virtual ConCommandBase* GetCommands(void) = 0;
171 | virtual const ConCommandBase* GetCommands(void) const = 0;
172 | virtual void InstallGlobalChangeCallback(FnChangeCallback_t callback) = 0;
173 | virtual void RemoveGlobalChangeCallback(FnChangeCallback_t callback) = 0;
174 | virtual void CallGlobalChangeCallbacks(convar* var, const char* pOldString, float flOldValue) = 0;
175 | virtual void InstallConsoleDisplayFunc(void* pDisplayFunc) = 0;
176 | virtual void RemoveConsoleDisplayFunc(void* pDisplayFunc) = 0;
177 | virtual void ConsoleColorPrintf(const color& clr, const char* pFormat, ...) const = 0;
178 | virtual void ConsolePrintf(const char* pFormat, ...) const = 0;
179 | virtual void ConsoleDPrintf(const char* pFormat, ...) const = 0;
180 | virtual void RevertFlaggedConVars(int nFlag) = 0;
181 | virtual void InstallCVarQuery(void* pQuery) = 0;
182 | virtual bool IsMaterialThreadSetAllowed() const = 0;
183 | virtual void QueueMaterialThreadSetValue(convar* pConVar, const char* pValue) = 0;
184 | virtual void QueueMaterialThreadSetValue(convar* pConVar, int nValue) = 0;
185 | virtual void QueueMaterialThreadSetValue(convar* pConVar, float flValue) = 0;
186 | virtual bool HasQueuedMaterialThreadConVarSets() const = 0;
187 | virtual int ProcessQueuedMaterialThreadConVarSets() = 0;
188 |
189 | protected:
190 | class ICVarIteratorInternal;
191 |
192 | public:
193 | class Iterator {
194 | public:
195 | inline Iterator(i_cvar* icvar);
196 | inline ~Iterator(void);
197 | inline void SetFirst(void);
198 | inline void Next(void);
199 | inline bool IsValid(void);
200 | inline ConCommandBase* Get(void);
201 | private:
202 | ICVarIteratorInternal* m_pIter;
203 | };
204 |
205 | protected:
206 | class ICVarIteratorInternal {
207 | public:
208 | virtual ~ICVarIteratorInternal() {}
209 | virtual void SetFirst(void) = 0;
210 | virtual void Next(void) = 0;
211 | virtual bool IsValid(void) = 0;
212 | virtual ConCommandBase* Get(void) = 0;
213 | };
214 |
215 | virtual ICVarIteratorInternal* FactoryInternalIterator(void) = 0;
216 | friend class Iterator;
217 | };
218 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_game_movement.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class c_base_entity;
4 | class vector;
5 | class c_move_data;
6 |
7 | class c_game_movement
8 | {
9 | public:
10 | virtual ~c_game_movement(void) {}
11 |
12 | // Process the current movement command
13 | virtual void process_movement(c_base_entity* pPlayer, c_move_data* pMove) = 0;
14 | virtual void start_track_prediction_errors(c_base_entity* pPlayer) = 0;
15 | virtual void finish_track_prediction_errors(c_base_entity* pPlayer) = 0;
16 | virtual void diff_print(char const* fmt, ...) = 0;
17 |
18 | // Allows other parts of the engine to find out the normal and ducked player bbox sizes
19 | virtual vector get_player_mins(bool ducked) const = 0;
20 | virtual vector get_player_maxs(bool ducked) const = 0;
21 | virtual vector get_player_view_offset(bool ducked) const = 0;
22 | };
23 |
24 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_glow_manager.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\utils\math\vector.hpp"
3 |
4 | class glow_object_definition_t {
5 | public:
6 | void set(float r, float g, float b, float a) {
7 | color = vector(r, g, b);
8 | alpha = a;
9 | render_when_occluded = true;
10 | render_when_unoccluded = false;
11 | bloom_amount = 1.0f;
12 | }
13 | bool unused() {
14 | return next_free_slot != -2;
15 | }
16 |
17 | void* entity;
18 | vector color;
19 | float alpha;
20 | char unknown0[8];
21 | float bloom_amount;
22 | char unknown1[4];
23 | bool render_when_occluded;
24 | bool render_when_unoccluded;
25 | bool full_bloom_render;
26 | char unknown2[13];
27 | int next_free_slot;
28 | };
29 |
30 | class glow_manager_t {
31 | public:
32 | glow_object_definition_t* objects;
33 | char pad[8];
34 | int size;
35 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_handle.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define NUM_ENT_ENTRY_BITS (11 + 2)
4 | #define NUM_ENT_ENTRIES (1 << NUM_ENT_ENTRY_BITS)
5 | #define INVALID_EHANDLE_INDEX 0xFFFFFFFF
6 | #define NUM_SERIAL_NUM_BITS 16 // (32 - NUM_ENT_ENTRY_BITS)
7 | #define NUM_SERIAL_NUM_SHIFT_BITS (32 - NUM_SERIAL_NUM_BITS)
8 | #define ENT_ENTRY_MASK (( 1 << NUM_SERIAL_NUM_BITS) - 1)
9 |
10 | class c_base_handle;
11 |
12 | class IHandleEntity
13 | {
14 | public:
15 | virtual ~IHandleEntity() {}
16 | virtual void SetRefEHandle(const c_base_handle &handle) = 0;
17 | virtual const c_base_handle& GetRefEHandle() const = 0;
18 | };
19 |
20 | class c_base_handle
21 | {
22 | friend class c_base_entity_list;
23 | public:
24 | c_base_handle();
25 | c_base_handle(const c_base_handle &other);
26 | c_base_handle(unsigned long value);
27 | c_base_handle(int iEntry, int iSerialNumber);
28 |
29 | void Init(int iEntry, int iSerialNumber);
30 | void Term();
31 |
32 | // Even if this returns true, Get() still can return return a non-null value.
33 | // This just tells if the handle has been initted with any values.
34 | bool IsValid() const;
35 |
36 | int GetEntryIndex() const;
37 | int GetSerialNumber() const;
38 |
39 | int ToInt() const;
40 | bool operator !=(const c_base_handle &other) const;
41 | bool operator ==(const c_base_handle &other) const;
42 | bool operator ==(const IHandleEntity* pEnt) const;
43 | bool operator !=(const IHandleEntity* pEnt) const;
44 | bool operator <(const c_base_handle &other) const;
45 | bool operator <(const IHandleEntity* pEnt) const;
46 |
47 | // Assign a value to the handle.
48 | const c_base_handle& operator=(const IHandleEntity *pEntity);
49 | const c_base_handle& Set(const IHandleEntity *pEntity);
50 |
51 | IHandleEntity* Get() const;
52 | protected:
53 | unsigned long m_Index;
54 | };
55 |
56 | template< class T >
57 | class CHandle : public c_base_handle
58 | {
59 | public:
60 |
61 | CHandle();
62 | CHandle(int iEntry, int iSerialNumber);
63 | CHandle(const c_base_handle &handle);
64 | CHandle(T *pVal);
65 |
66 | static CHandle FromIndex(int index);
67 |
68 | T* Get() const;
69 | void Set(const T* pVal);
70 |
71 | operator T*();
72 | operator T*() const;
73 |
74 | bool operator !() const;
75 | bool operator==(T *val) const;
76 | bool operator!=(T *val) const;
77 | const c_base_handle& operator=(const T *val);
78 |
79 | T* operator->() const;
80 | };
81 |
82 | template
83 | CHandle::CHandle()
84 | {
85 | }
86 |
87 | template
88 | CHandle::CHandle(int iEntry, int iSerialNumber)
89 | {
90 | Init(iEntry, iSerialNumber);
91 | }
92 |
93 | template
94 | CHandle::CHandle(const c_base_handle &handle)
95 | : c_base_handle(handle)
96 | {
97 | }
98 |
99 | template
100 | CHandle::CHandle(T *pObj)
101 | {
102 | Term();
103 | Set(pObj);
104 | }
105 |
106 | template
107 | inline CHandle CHandle::FromIndex(int index)
108 | {
109 | CHandle ret;
110 | ret.m_Index = index;
111 | return ret;
112 | }
113 |
114 | template
115 | inline T* CHandle::Get() const
116 | {
117 | return (T*)c_base_handle::Get();
118 | }
119 |
120 | template
121 | inline CHandle::operator T *()
122 | {
123 | return Get();
124 | }
125 |
126 | template
127 | inline CHandle::operator T *() const
128 | {
129 | return Get();
130 | }
131 |
132 | template
133 | inline bool CHandle::operator !() const
134 | {
135 | return !Get();
136 | }
137 |
138 | template
139 | inline bool CHandle::operator==(T *val) const
140 | {
141 | return Get() == val;
142 | }
143 |
144 | template
145 | inline bool CHandle::operator!=(T *val) const
146 | {
147 | return Get() != val;
148 | }
149 |
150 | template
151 | void CHandle::Set(const T* pVal)
152 | {
153 | c_base_handle::Set(reinterpret_cast(pVal));
154 | }
155 |
156 | template
157 | inline const c_base_handle& CHandle::operator=(const T *val)
158 | {
159 | Set(val);
160 | return *this;
161 | }
162 |
163 | template
164 | T* CHandle::operator -> () const
165 | {
166 | return Get();
167 | }
168 |
169 | inline c_base_handle::c_base_handle()
170 | {
171 | m_Index = INVALID_EHANDLE_INDEX;
172 | }
173 |
174 | inline c_base_handle::c_base_handle(const c_base_handle &other)
175 | {
176 | m_Index = other.m_Index;
177 | }
178 |
179 | inline c_base_handle::c_base_handle(unsigned long value)
180 | {
181 | m_Index = value;
182 | }
183 |
184 | inline c_base_handle::c_base_handle(int iEntry, int iSerialNumber)
185 | {
186 | Init(iEntry, iSerialNumber);
187 | }
188 |
189 | inline void c_base_handle::Init(int iEntry, int iSerialNumber)
190 | {
191 | m_Index = (unsigned long)(iEntry | (iSerialNumber << NUM_SERIAL_NUM_SHIFT_BITS));
192 | }
193 |
194 | inline void c_base_handle::Term()
195 | {
196 | m_Index = INVALID_EHANDLE_INDEX;
197 | }
198 |
199 | inline bool c_base_handle::IsValid() const
200 | {
201 | return m_Index != INVALID_EHANDLE_INDEX;
202 | }
203 |
204 | inline int c_base_handle::GetEntryIndex() const
205 | {
206 | // There is a hack here: due to a bug in the original implementation of the
207 | // entity handle system, an attempt to look up an invalid entity index in
208 | // certain cirumstances might fall through to the the mask operation below.
209 | // This would mask an invalid index to be in fact a lookup of entity number
210 | // NUM_ENT_ENTRIES, so invalid ent indexes end up actually looking up the
211 | // last slot in the entities array. Since this slot is always empty, the
212 | // lookup returns NULL and the expected behavior occurs through this unexpected
213 | // route.
214 | // A lot of code actually depends on this behavior, and the bug was only exposed
215 | // after a change to NUM_SERIAL_NUM_BITS increased the number of allowable
216 | // static props in the world. So the if-stanza below detects this case and
217 | // retains the prior (bug-submarining) behavior.
218 | if (!IsValid())
219 | return NUM_ENT_ENTRIES - 1;
220 | return m_Index & ENT_ENTRY_MASK;
221 | }
222 |
223 | inline int c_base_handle::GetSerialNumber() const
224 | {
225 | return m_Index >> NUM_SERIAL_NUM_SHIFT_BITS;
226 | }
227 |
228 | inline int c_base_handle::ToInt() const
229 | {
230 | return (int)m_Index;
231 | }
232 |
233 | inline bool c_base_handle::operator !=(const c_base_handle &other) const
234 | {
235 | return m_Index != other.m_Index;
236 | }
237 |
238 | inline bool c_base_handle::operator ==(const c_base_handle &other) const
239 | {
240 | return m_Index == other.m_Index;
241 | }
242 |
243 | inline bool c_base_handle::operator ==(const IHandleEntity* pEnt) const
244 | {
245 | return Get() == pEnt;
246 | }
247 |
248 | inline bool c_base_handle::operator !=(const IHandleEntity* pEnt) const
249 | {
250 | return Get() != pEnt;
251 | }
252 |
253 | inline bool c_base_handle::operator <(const c_base_handle &other) const
254 | {
255 | return m_Index < other.m_Index;
256 | }
257 |
258 | inline bool c_base_handle::operator <(const IHandleEntity *pEntity) const
259 | {
260 | unsigned long otherIndex = (pEntity) ? pEntity->GetRefEHandle().m_Index : INVALID_EHANDLE_INDEX;
261 | return m_Index < otherIndex;
262 | }
263 |
264 | inline const c_base_handle& c_base_handle::operator=(const IHandleEntity *pEntity)
265 | {
266 | return Set(pEntity);
267 | }
268 |
269 | inline const c_base_handle& c_base_handle::Set(const IHandleEntity *pEntity)
270 | {
271 | if (pEntity)
272 | *this = pEntity->GetRefEHandle();
273 | else
274 | m_Index = INVALID_EHANDLE_INDEX;
275 |
276 | return *this;
277 | }
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_key_values.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "c_key_values.hpp"
3 | #include "..\..\utils\memory\memory.hpp"
4 | #include "..\..\utils\memory\memory.hpp"
5 |
6 | bool key_values::load_from_buffer(key_values* kv, char const* resourceName, const char* pBuffer, IBaseFileSystem* pFileSystem, const char* pPathID) {
7 | typedef int(__thiscall* LoadFromBufferFn)(key_values* kv, char const*, const char*, IBaseFileSystem*, const char*);
8 | static LoadFromBufferFn Load = (LoadFromBufferFn)memory::find_pattern("engine.dll", "55 8B EC 83 EC 38 53 8B 5D 0C");
9 | return Load(kv, resourceName, pBuffer, pFileSystem, pPathID);
10 | }
11 |
12 | key_values* key_values::init(key_values* kv, const char* name) {
13 | typedef key_values* (__thiscall* InitializeFn)(key_values*, const char*);
14 | static InitializeFn Init = (InitializeFn)(memory::find_pattern("engine.dll", "FF 15 ? ? ? ? 83 C4 08 89 06 8B C6") - 0x42);
15 | return Init(kv, name);
16 | }
17 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_key_values.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class IBaseFileSystem;
4 |
5 | class key_values
6 | {
7 | public:
8 | static key_values* init(key_values* kv, const char* name);
9 | static bool load_from_buffer(key_values* kv, char const* resourceName, const char* pBuffer, IBaseFileSystem* pFileSystem = 0, const char* pPathID = 0);
10 |
11 | int m_iKeyName; // keyname is a symbol defined in KeyValuesSystem
12 |
13 | char* m_sValue;
14 | wchar_t* m_wsValue;
15 |
16 | union
17 | {
18 | int m_iValue;
19 | float m_flValue;
20 | void* m_pValue;
21 | unsigned char m_Color[4];
22 | };
23 |
24 | char m_iDataType;
25 | char m_bHasEscapeSequences; // true, if while parsing this KeyValue, Escape Sequences are used (default false)
26 | char m_bEvaluateConditionals; // true, if while parsing this KeyValue, conditionals blocks are evaluated (default true)
27 | char unused[1];
28 |
29 | key_values* m_pPeer; // pointer to next key in list
30 | key_values* m_pSub; // pointer to Start of a new sub key list
31 | key_values* m_pChain;// Search here if it's not in our list
32 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_material_system.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\utils\utils.hpp"
3 |
4 | typedef unsigned short MaterialHandle_t;
5 | class i_material;
6 | class key_values;
7 |
8 | class c_material_system
9 | {
10 | public:
11 | i_material* find(char const* szMat, const char* szTextureGroup, bool bComplain = true, const char* szPrefix = NULL)
12 | {
13 | typedef i_material* (__thiscall* fn)(void*, const char*, const char*, bool, const char*);
14 | return utils::get_vfunc(this, 73)(this, szMat, szTextureGroup, bComplain, szPrefix);
15 | }
16 |
17 | i_material* create(char const* szName, key_values* pKV)
18 | {
19 | typedef i_material* (__thiscall* fn)(void*, const char*, key_values*);
20 | return utils::get_vfunc(this, 72)(this, szName, pKV);
21 | }
22 |
23 | i_material* get(MaterialHandle_t hMat)
24 | {
25 | typedef i_material* (__thiscall* fn)(void*, MaterialHandle_t);
26 | return utils::get_vfunc(this, 78)(this, hMat);
27 | }
28 |
29 | MaterialHandle_t first()
30 | {
31 | typedef MaterialHandle_t(__thiscall* fn)(void*);
32 | return utils::get_vfunc(this, 75)(this);
33 | }
34 |
35 | MaterialHandle_t invalid()
36 | {
37 | typedef MaterialHandle_t(__thiscall* fn)(void*);
38 | return utils::get_vfunc(this, 77)(this);
39 | }
40 |
41 | MaterialHandle_t next(MaterialHandle_t hMat)
42 | {
43 | typedef MaterialHandle_t(__thiscall* fn)(void*, MaterialHandle_t);
44 | return utils::get_vfunc(this, 76)(this, hMat);
45 | }
46 | };
47 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_model_info.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma warning( disable : 4099)
3 | #include "..\..\utils\utils.hpp"
4 |
5 | class model_t;
6 | class studiohdr_t;
7 |
8 | class c_model_info_client
9 | {
10 | public:
11 | model_t* get_model(int index)
12 | {
13 | typedef model_t* (__thiscall* fn)(void*, int);
14 | return utils::get_vfunc(this, 1)(this, index);
15 | }
16 |
17 | int get_model_index(const char* name)
18 | {
19 | typedef int(__thiscall* fn)(void*, const char*);
20 | return utils::get_vfunc(this, 2)(this, name);
21 | }
22 |
23 | const char* get_model_name(const model_t* model)
24 | {
25 | typedef const char* (__thiscall* fn)(void*, const model_t*);
26 | return utils::get_vfunc(this, 3)(this, model);
27 | }
28 |
29 | studiohdr_t* get_studio_model(const model_t* model)
30 | {
31 | typedef studiohdr_t* (__thiscall* fn)(void*, const model_t*);
32 | return utils::get_vfunc(this, 28)(this, model);
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/c_model_render.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\utils\utils.hpp"
3 | #include "../structs/enums.hpp"
4 |
5 | class i_material;
6 | class draw_model_state;
7 | class model_render_info;
8 | typedef float matrix3x4[3][4];
9 |
10 | class c_model_render
11 | {
12 | public:
13 | void forced_material_override(i_material* mat, override_type type = override_type::OVERRIDE_NORMAL)
14 | {
15 | typedef void(__thiscall* fn)(void*, i_material*, override_type);
16 | return utils::get_vfunc(this, 1)(this, mat, type);
17 | }
18 |
19 | void draw_model_execute(const draw_model_state* pState, const model_render_info& pInfo, matrix3x4* pBoneToWorld)
20 | {
21 | typedef void(__thiscall* fn)(void*, const draw_model_state*, const model_render_info&, matrix3x4*);
22 | return utils::get_vfunc(this, 19)(this, pState, pInfo, pBoneToWorld);
23 | }
24 | };
25 |
26 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_base_client_dll.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "i_entity.hpp"
3 | #include "..\..\utils\utils.hpp"
4 | #include "..\structs\structs.hpp"
5 |
6 | class RecvTable;
7 | class c_client_class
8 | {
9 | public:
10 | unsigned char _chPadding[8];
11 | char* szName;
12 | RecvTable* rtTable;
13 | c_client_class* pNextClass;
14 | int iClassID;
15 | };
16 |
17 | class i_base_client_dll
18 | {
19 | public:
20 | c_client_class * get_all_classes()
21 | {
22 | typedef c_client_class* (__thiscall* fn)(void*);
23 | return utils::get_vfunc(this, 8)(this);
24 | }
25 |
26 | bool get_player_view(c_viewsetup& playerView)
27 | {
28 | typedef bool(__thiscall* fn)(void*, c_viewsetup&);
29 | return utils::get_vfunc (this, 59)(this, playerView);
30 | }
31 | };
32 |
33 | class i_global_vars
34 | {
35 | public:
36 | // Absolute time (per frame still - Use Plat_FloatTime() for a high precision real time
37 | // perf clock, but not that it doesn't obey host_timescale/host_framerate)
38 | float realtime;
39 | // Absolute frame counter
40 | int framecount;
41 | // Non-paused frametime
42 | float absoluteframetime;
43 |
44 | // Current time
45 | //
46 | // On the client, this (along with tickcount) takes a different meaning based on what
47 | // piece of code you're in:
48 | //
49 | // - While receiving network packets (like in PreDataUpdate/PostDataUpdate and proxies),
50 | // this is set to the SERVER TICKCOUNT for that packet. There is no interval between
51 | // the server ticks.
52 | // [server_current_Tick * tick_interval]
53 | //
54 | // - While rendering, this is the exact client clock
55 | // [client_current_tick * tick_interval + interpolation_amount]
56 | //
57 | // - During prediction, this is based on the client's current tick:
58 | // [client_current_tick * tick_interval]
59 | float curtime;
60 |
61 | // Time spent on last server or client frame (has nothing to do with think intervals)
62 | float frametime;
63 | // current maxplayers setting
64 | int maxClients;
65 |
66 | // Simulation ticks
67 | int tickcount;
68 |
69 | // Simulation tick interval
70 | float interval_per_tick;
71 |
72 | // interpolation amount ( client-only ) based on fraction of next tick which has elapsed
73 | float interpolation_amount;
74 | int simTicksThisFrame;
75 |
76 | int network_protocol;
77 |
78 | // current saverestore data
79 | unsigned long* pSaveData;
80 |
81 | private:
82 | // Set to true in client code.
83 | bool m_bClient;
84 |
85 | // 100 (i.e., tickcount is rounded down to this base and then the "delta" from this base is networked
86 | int nTimestampNetworkingBase;
87 | // 32 (entindex() % nTimestampRandomizeWindow ) is subtracted from gpGlobals->tickcount to set the networking basis, prevents
88 | // all of the entities from forcing a new PackedEntity on the same tick (i.e., prevents them from getting lockstepped on this)
89 | int nTimestampRandomizeWindow;
90 | };
91 |
92 | class i_client_mode_shared
93 | {
94 | public:
95 | virtual ~i_client_mode_shared() {}
96 | virtual void init() = 0;
97 | virtual void init_viewport() = 0;
98 | virtual void shutdown() = 0;
99 | virtual void level_init(const char* newmap);
100 | virtual void level_shutdown(void);
101 | virtual void enable() = 0;
102 | virtual void disable() = 0;
103 | virtual void layout() = 0;
104 | virtual void reload_scheme(bool flushLowLevel) = 0;
105 | virtual void override_view(unsigned long* pSetup) = 0;
106 | virtual bool should_draw_detail_objects() = 0;
107 | virtual bool should_draw_entity(c_base_entity* pEnt) = 0;
108 | virtual bool should_draw_local_player(c_base_entity* pPlayer) = 0;
109 | virtual bool should_draw_view_model() = 0;
110 | virtual bool should_draw_particles() = 0;
111 | virtual bool should_draw_crosshair(void) = 0;
112 | virtual bool should_blackout_around_hud() = 0;
113 | virtual unsigned long should_override_headtrack_control() = 0;
114 | virtual void adjust_engine_viewport(int& x, int& y, int& width, int& height) = 0;
115 | virtual void pre_render(unsigned long* pSetup) = 0;
116 | virtual void post_render() = 0;
117 | virtual void post_render_vgui() = 0;
118 | virtual void process_input(bool bActive) = 0;
119 | virtual bool create_move(float flInputSampleTime, c_user_cmd* cmd) = 0;
120 | virtual void update() = 0;
121 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_client_networkable.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class i_client_unknown;
4 | class c_client_class;
5 | class bf_read;
6 |
7 | class i_client_networkable
8 | {
9 | public:
10 | virtual i_client_unknown* get_i_client_unknown() = 0;
11 | virtual void release() = 0;
12 | virtual c_client_class* get_client_class() = 0;
13 | virtual void notify_should_transmit(int state) = 0;
14 | virtual void on_pre_data_changed(int updateType) = 0;
15 | virtual void on_data_changed(int updateType) = 0;
16 | virtual void pre_data_update(int updateType) = 0;
17 | virtual void post_data_update(int updateType) = 0;
18 | virtual void __unkn(void) = 0;
19 | virtual bool is_dormant(void) = 0;
20 | virtual int ent_index(void) const = 0;
21 | virtual void receive_message(int classID, bf_read& msg) = 0;
22 | virtual void* get_data_table_base_ptr() = 0;
23 | virtual void set_destroyed_on_recreate_entities(void) = 0;
24 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_engine_vgui.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | enum vgui_panel;
4 |
5 | class i_engine_vgui
6 | {
7 | public:
8 | virtual ~i_engine_vgui(void) { }
9 | virtual unsigned int get_panel(vgui_panel type) = 0;
10 | virtual bool is_game_ui_visible() = 0;
11 | };
12 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_entity.cpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "i_entity.hpp"
3 | #include "..\..\utils\netvars\netvars.hpp"
4 | #include "..\..\utils\game\helpers.hpp"
5 | #include "..\..\utils\math\vector.hpp"
6 | #include "..\..\utils\utils.hpp"
7 | #include "..\..\utils\memory\memory.hpp"
8 | #include "..\structs\structs.hpp"
9 | #include "..\..\utils\math\math.hpp"
10 | #include "..\..\interfaces\interfaces.hpp"
11 |
12 | template
13 | t c_base_entity::get_value(const int offset) {
14 | return *reinterpret_cast(reinterpret_cast(this) + offset);
15 | }
16 |
17 | model_t* c_base_entity::get_model() {
18 | PVOID renderable = (PVOID)(this + 0x4);
19 | typedef model_t* (__thiscall* fn)(void*);
20 | return utils::get_vfunc(renderable, 9)(renderable);
21 | }
22 |
23 | int c_base_entity::get_owner() {
24 | static int life_state = g_netvar->get_offset("DT_BaseEntity", "m_hOwnerEntity");
25 | return get_value(life_state);
26 | }
27 |
28 | const char* c_base_entity::get_model_name() {
29 | return interfaces::model_info->get_model_name(get_model());
30 | }
31 |
32 | bool c_base_entity::get_life_state() {
33 | static int life_state = g_netvar->get_offset("DT_BasePlayer", "m_lifeState");
34 | return get_value(life_state);
35 | }
36 |
37 | bool c_base_entity::is_alive() {
38 | return (this->get_life_state() == life_states::ALIVE);
39 | }
40 |
41 | bool c_base_entity::is_player() {
42 | return (get_client_class()->class_id == class_ids::CTFPlayer);
43 | }
44 |
45 | int c_base_entity::get_health() {
46 | static int offset = g_netvar->get_offset("DT_BasePlayer", "m_iHealth");
47 | return get_value(offset);
48 | }
49 |
50 | int c_base_entity::get_max_health() {
51 | typedef int(__thiscall* fn)(void*);
52 | return utils::get_vfunc(this, 107)(this);
53 | }
54 |
55 | int c_base_entity::get_object_max_health() {
56 | static int offset = g_netvar->get_offset("DT_BaseObject", "m_iMaxHealth");
57 | return get_value(offset);
58 | }
59 |
60 | int c_base_entity::get_object_health() {
61 | static int offset = g_netvar->get_offset("DT_BaseObject", "m_iHealth");
62 | return get_value(offset);
63 | }
64 |
65 | int c_base_entity::get_team_num() {
66 | static int offset = g_netvar->get_offset("DT_BaseEntity", "m_iTeamNum");
67 | return get_value(offset);
68 | }
69 |
70 | bool c_base_entity::is_in_valid_team()
71 | {
72 | int Team = this->get_team_num();
73 | return (Team == 2 || Team == 3);
74 | }
75 |
76 | int c_base_entity::get_fov() {
77 | static int i_fov = g_netvar->get_offset("DT_BasePlayer", "m_iFOV");
78 | auto fov = get_value(i_fov);
79 |
80 | if (!fov) {
81 | static int m_IDefualtFov = g_netvar->get_offset("DT_BasePlayer", "m_iDefaultFOV");
82 | return get_value(m_IDefualtFov);
83 | }
84 | return fov;
85 | }
86 |
87 | vector c_base_entity::get_origin() {
88 | static int vector_origin = g_netvar->get_offset("DT_BaseEntity", "m_vecOrigin");
89 | return get_value(vector_origin);
90 | }
91 |
92 | vector c_base_entity::get_abs_origin() {
93 | typedef vector& (__thiscall* fn)(void*);
94 | return utils::get_vfunc(this, 9)(this);
95 | }
96 |
97 | vector c_base_entity::get_eye_position() {
98 | static int eye_position = g_netvar->get_offset("DT_BasePlayer", "localdata", "m_vecViewOffset[0]");
99 | return get_value(eye_position) + this->get_abs_origin();
100 | }
101 |
102 | vector c_base_entity::get_velocity() {
103 | typedef void(__thiscall* EstimateAbsVelocityFn)(c_base_entity*, vector&);
104 | static DWORD dwFn = memory::find_pattern("client.dll", "E8 ? ? ? ? F3 0F 10 4D ? 8D 85 ? ? ? ? F3 0F 10 45 ? F3 0F 59 C9 56 F3 0F 59 C0 F3 0F 58 C8 0F 2F 0D ? ? ? ? 76 07") + 0x1;
105 | static DWORD dwEstimate = ((*(PDWORD)(dwFn)) + dwFn + 0x4);
106 | EstimateAbsVelocityFn vel = (EstimateAbsVelocityFn)dwEstimate;
107 | vector v;
108 | vel(this, v);
109 | return v;
110 | }
111 |
112 | vector c_base_entity::get_view_angles() {
113 | static int offset = g_netvar->get_offset("DT_TFPlayer", "tfnonlocaldata", "m_angEyeAngles[0]");
114 | return get_value(offset);
115 | }
116 |
117 | int c_base_entity::get_class_id() {
118 | return get_client_class()->class_id;
119 | }
120 |
121 | int c_base_entity::get_class_number() {
122 | static int offset = g_netvar->get_offset("DT_TFPlayer", "m_PlayerClass", "m_iClass");
123 | return get_value(offset);
124 | }
125 |
126 | int c_base_entity::get_condition() {
127 | static int condition = g_netvar->get_offset("DT_TFPlayer", "m_Shared", "m_nPlayerCond");
128 | return get_value(condition);
129 | }
130 |
131 | int c_base_entity::get_flags() {
132 | static int flags = g_netvar->get_offset("DT_BasePlayer", "m_fFlags");
133 | return get_value(flags);
134 | }
135 |
136 | bool c_base_entity::can_backstab() {
137 | static int offset = g_netvar->get_offset("DT_TFWeaponKnife", "m_bReadyToBackstab");
138 | return get_value(offset);
139 | }
140 |
141 | bool c_base_entity::is_dormant() {
142 | void* networkable = (void*)(this + 0x8);
143 | typedef bool(__thiscall* fn)(void*);
144 | return utils::get_vfunc< fn >(networkable, 8)(networkable);
145 | }
146 |
147 | bool c_base_entity::is_taunting() {
148 | return (this->get_condition() & conditions::TAUNTING);
149 | }
150 |
151 | bool c_base_entity::is_ducking() {
152 | return (this->get_flags() & entity_flags::DUCKING);
153 | }
154 |
155 | bool c_base_entity::is_ubered() {
156 | return (this->get_condition() & conditions::UBERCHARGED);
157 | }
158 |
159 | bool c_base_entity::is_scoped() {
160 | return (this->get_condition() & conditions::ZOOMED);
161 | }
162 |
163 | bool c_base_entity::is_bonked() {
164 | return (this->get_condition() & conditions::BONKED);
165 | }
166 |
167 | bool c_base_entity::is_cloaked() {
168 | return (this->get_condition() & conditions::CLOAKED);
169 | }
170 |
171 | bool c_base_entity::is_on_ground() {
172 | return (this->get_condition() & entity_flags::GROUND);
173 | }
174 |
175 | bool c_base_entity::is_health_pack() {
176 | if (get_client_class()->class_id == class_ids::CBaseAnimating) {
177 | auto hash = hash_string(interfaces::model_info->get_model_name(get_model()));
178 | return is_health_hash(hash);
179 | }
180 | return false;
181 | }
182 |
183 | bool c_base_entity::is_ammo_pack() {
184 | if (get_client_class()->class_id == class_ids::CBaseAnimating) {
185 | auto hash = hash_string(interfaces::model_info->get_model_name(get_model()));
186 | return is_ammo_hash(hash);
187 | }
188 | return false;
189 | }
190 |
191 | client_class* c_base_entity::get_client_class() {
192 | void* pNetworkable = (void*)(this + 0x8);
193 | typedef client_class* (__thiscall* fn)(void*);
194 | return utils::get_vfunc (pNetworkable, 2)(pNetworkable);
195 | }
196 |
197 | bool c_base_entity::is_visible(c_base_entity* local_player) {
198 | trace_t trace;
199 | ray_t ray; // the future of variable naming
200 | c_trace_filter filter;
201 |
202 | filter.skip = local_player;
203 |
204 | auto local_eye = local_player->get_eye_position();
205 | auto entity_eye = this->get_eye_position();
206 | ray.init(local_eye, entity_eye);
207 |
208 | interfaces::trace->trace_ray(ray, MASK_SOLID, &filter, &trace);
209 |
210 | return (trace.entity == this);
211 | }
212 |
213 | int c_base_entity::get_hitbox_set() {
214 | static int hitbox = g_netvar->get_offset("DT_BaseAnimating", "m_nHitboxSet");
215 | return get_value(hitbox);
216 | }
217 |
218 | bool c_base_entity::setup_bones(matrix3x4* bone_to_world_out, int max_bones, int bone_mask, float current_time) {
219 | PVOID renderable = (void*)(this + 0x4);
220 | typedef bool(__thiscall* fn)(void*, matrix3x4*, int, int, float);
221 | return utils::get_vfunc (renderable, 16)(renderable, bone_to_world_out, max_bones, bone_mask, current_time);
222 | }
223 |
224 | vector c_base_entity::get_bone_pos(int bone) {
225 | matrix3x4 matrix[128];
226 |
227 | if (setup_bones(matrix, 128, 0x100, GetTickCount64()))
228 | return vector(matrix[bone][0][3], matrix[bone][1][3], matrix[bone][2][3]);
229 |
230 | return vector(0.0f, 0.0f, 0.0f);
231 | }
232 |
233 | vector c_base_entity::get_hitbox_pos(int hitbox) {
234 | model_t* model = get_model();
235 | if (!model)
236 | return {};
237 |
238 | studiohdr_t* hdr = (studiohdr_t*)interfaces::model_info->get_studio_model(model);
239 | if (!hdr)
240 | return {};
241 |
242 | matrix3x4 BoneMatrix[128];
243 | if (!setup_bones(BoneMatrix, 128, 0x100, interfaces::globals->curtime))
244 | return {};
245 |
246 | mstudiohitboxset_t* set = hdr->get_hitbox_set(get_hitbox_set());
247 | if (!set)
248 | return {};
249 |
250 | mstudiobbox_t* box = set->hitbox(hitbox);
251 | if (!box)
252 | return {};
253 |
254 | vector pos = (box->bbmin + box->bbmax) * 0.5f;
255 | vector out;
256 |
257 | math::vector_transform(pos, BoneMatrix[box->bone], out);
258 |
259 | return out;
260 | }
261 |
262 | vector c_base_entity::get_shoot_pos() {
263 | static auto fn = reinterpret_cast(memory::find_pattern("client.dll", "55 8B EC 56 8B 75 08 57 8B F9 56 8B 07 FF 90"));
264 | vector out;
265 | fn(this, &out);
266 | return out;
267 | }
268 |
269 | matrix3x4& c_base_entity::get_rgfl_coordinate_frame() {
270 | PVOID renderable = (PVOID)(this + 0x4);
271 | typedef matrix3x4& (__thiscall* fn)(PVOID);
272 | return utils::get_vfunc(renderable, 34)(renderable);
273 | }
274 |
275 | vector c_base_entity::get_collideable_mins() {
276 | static int hitbox = g_netvar->get_offset("DT_BaseEntity", "m_Collision", "m_vecMins");
277 | return get_value(hitbox);
278 | }
279 |
280 | vector c_base_entity::get_collideable_max() {
281 | static int hitbox = g_netvar->get_offset("DT_BaseEntity", "m_Collision", "m_vecMaxs");
282 | return get_value(hitbox);
283 | }
284 |
285 | c_base_combat_weapon* c_base_entity::get_active_weapon()
286 | {
287 | static int weapon = g_netvar->get_offset("DT_BaseCombatCharacter", "m_hActiveWeapon");
288 | return reinterpret_cast(interfaces::entity_list->get_client_entity_from_handle(get_value(weapon)));
289 | }
290 |
291 | bool& c_base_entity::glow_enabled() {
292 | static int offset = g_netvar->get_offset("DT_TFPlayer", "m_bGlowEnabled");
293 | return *reinterpret_cast(uintptr_t(this) + offset);
294 | }
295 |
296 | void c_base_entity::update_glow_effect() {
297 | typedef void(__thiscall* t)(void*);
298 | utils::get_vfunc(this, 226)(this);
299 | }
300 |
301 | void c_base_entity::destroy_glow_effect() {
302 | typedef void(__thiscall* t)(void*);
303 | utils::get_vfunc(this, 227)(this);
304 | }
305 |
306 | int c_base_entity::get_entity_index() {
307 | PVOID pNetworkable = (PVOID)(this + 0x8);
308 | typedef int(__thiscall* FN)(PVOID);
309 | return utils::get_vfunc(pNetworkable, 9)(pNetworkable);
310 | }
311 |
312 | int c_base_entity::get_observer_target() {
313 | static int offset = g_netvar->get_offset("DT_BasePlayer", "m_hObserverTarget");
314 | return get_value(offset);
315 | }
316 |
317 | int c_base_entity::get_observer_mode() {
318 | static int offset = g_netvar->get_offset("DT_BasePlayer", "m_iObserverMode");
319 | return get_value(offset);
320 | }
321 |
322 | bool c_base_entity::is_dispenser() {
323 | return get_client_class()->class_id == CObjectDispenser;
324 | }
325 |
326 | bool c_base_entity::is_sentry() {
327 | return get_client_class()->class_id == CObjectSentrygun;
328 | }
329 |
330 | bool c_base_entity::is_teleporter() {
331 | return get_client_class()->class_id == CObjectTeleporter;
332 | }
333 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_entity.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class c_base_combat_weapon;
4 | class client_class;
5 | class vector;
6 | struct model_t;
7 | typedef float matrix3x4[3][4];
8 |
9 | class c_base_entity
10 | {
11 | private:
12 | template
13 | t get_value(const int offset);
14 | public:
15 | model_t* get_model();
16 |
17 | int get_owner();
18 |
19 | const char* get_model_name();
20 |
21 | bool get_life_state();
22 |
23 | bool is_alive();
24 |
25 | bool is_player();
26 |
27 | int get_health();
28 |
29 | int get_max_health();
30 |
31 | int get_object_max_health();
32 |
33 | int get_object_health();
34 |
35 | int get_team_num();
36 |
37 | bool is_in_valid_team();
38 |
39 | int get_fov();
40 |
41 | vector get_origin();
42 |
43 | vector get_abs_origin();
44 |
45 | vector get_eye_position();
46 |
47 | vector get_velocity();
48 |
49 | vector get_view_angles();
50 |
51 | int get_class_id();
52 |
53 | int get_class_number();
54 |
55 | int get_condition();
56 |
57 | int get_flags();
58 |
59 | bool can_backstab();
60 |
61 | bool is_dormant();
62 |
63 | bool is_taunting();
64 |
65 | bool is_ducking();
66 |
67 | bool is_ubered();
68 |
69 | bool is_scoped();
70 |
71 | bool is_bonked();
72 |
73 | bool is_cloaked();
74 |
75 | bool is_on_ground();
76 |
77 | bool is_health_pack();
78 |
79 | bool is_ammo_pack();
80 |
81 | client_class* get_client_class();
82 |
83 | bool is_visible(c_base_entity* local_player);
84 |
85 | int get_hitbox_set();
86 |
87 | bool setup_bones(matrix3x4* bone_to_world_out, int max_bones, int bone_mask, float current_time);
88 |
89 | vector get_bone_pos(int bone);
90 |
91 | vector get_hitbox_pos(int hitbox);
92 |
93 | vector get_shoot_pos();
94 |
95 | matrix3x4& get_rgfl_coordinate_frame();
96 |
97 | vector get_collideable_mins();
98 |
99 | vector get_collideable_max();
100 |
101 | c_base_combat_weapon* get_active_weapon();
102 |
103 | bool& glow_enabled();
104 |
105 | void update_glow_effect();
106 |
107 | void destroy_glow_effect();
108 |
109 | int get_entity_index();
110 |
111 | int get_observer_target();
112 |
113 | int get_observer_mode();
114 |
115 | bool is_dispenser();
116 |
117 | bool is_sentry();
118 |
119 | bool is_teleporter();
120 | };
121 |
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_entity_list.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class i_client_networkable;
4 | class i_client_unknown;
5 | class c_base_handle;
6 | class c_base_entity;
7 | class vector;
8 |
9 | struct spatialization_info_t;
10 | class i_client_entity
11 | {
12 | public:
13 | // Delete yourself.
14 | virtual void release(void) = 0;
15 |
16 | // Network origin + angles
17 | virtual const vector& get_abs_origin(void) const = 0;
18 | virtual const vector& get_abs_angles(void) const = 0;
19 |
20 | virtual unsigned long* get_mouth(void) = 0;
21 |
22 | // Retrieve sound spatialization info for the specified sound on this entity
23 | // Return false to indicate sound is not audible
24 | virtual bool get_sound_spatialization(spatialization_info_t& info) = 0;
25 | };
26 |
27 | class i_client_entity_list
28 | {
29 | public:
30 | virtual i_client_networkable* get_client_networkable(int entnum) = 0;
31 | virtual i_client_networkable* get_client_networkable_from_handle(c_base_handle hEnt) = 0;
32 | virtual i_client_unknown* get_client_unknown_from_handle(c_base_handle hEnt) = 0;
33 | virtual c_base_entity* get_client_entity(int entnum) = 0;
34 | virtual i_client_entity* get_client_entity_from_handle(c_base_handle hEnt) = 0;
35 | virtual int number_of_entities(bool bIncludeNonNetworkable) = 0;
36 | virtual int get_highest_entity_index(void) = 0;
37 | virtual void set_max_entities(int maxents) = 0;
38 | virtual int get_max_entitys() = 0;
39 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_panels.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../../utils/utils.hpp"
3 |
4 | class i_panel
5 | {
6 | public:
7 | D3DMATRIX& get_latest_view_matrix(void)
8 | {
9 | static D3DMATRIX m;
10 | return m;
11 | }
12 |
13 | unsigned int get_panel(int type)
14 | {
15 | typedef unsigned int(__thiscall* fn)(void*, int type);
16 | return utils::get_vfunc(this, 1)(this, type);
17 | }
18 |
19 | void set_mouse_input_enabled(unsigned int panel, bool state)
20 | {
21 | utils::get_vfunc(this, 32)(this, panel, state);
22 | }
23 |
24 | void set_top_most_popup(unsigned int panel, bool state)
25 | {
26 | utils::get_vfunc(this, 59)(this, panel, state);
27 | }
28 |
29 | const char* get_name(unsigned int vguipanel)
30 | {
31 | typedef const char* (__thiscall* fn)(void*, unsigned int);
32 | return utils::get_vfunc(this, 36)(this, vguipanel);
33 | }
34 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_player_info_manager.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\utils\utils.hpp"
3 |
4 | class i_global_vars;
5 | class i_player_info_manager
6 | {
7 | public:
8 | i_global_vars* get_global_vars()
9 | {
10 | typedef i_global_vars* (__thiscall* fn)(void*);
11 | return utils::get_vfunc(this, 1)(this);
12 | }
13 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/i_surface.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\..\utils\utils.hpp"
3 |
4 | class i_surface
5 | {
6 | public:
7 | void unlock_cursor()
8 | {
9 | typedef void(__thiscall* fn)(void*);
10 | utils::get_vfunc< fn >(this, 61)(this);
11 | }
12 |
13 | void set_cursor_always_visible(bool toggle) {
14 | typedef void(__thiscall* fn)(void*, bool);
15 | utils::get_vfunc(this, 52)(this, toggle);
16 | }
17 |
18 | void set_color(int r, int g, int b, int a)
19 | {
20 | typedef void(__thiscall* fn)(void*, int, int, int, int);
21 | utils::get_vfunc< fn >(this, 11)(this, r, g, b, a);
22 | }
23 |
24 | void filled_rect(int x0, int y0, int x1, int y1)
25 | {
26 | typedef void(__thiscall* fn)(void*, int, int, int, int);
27 | utils::get_vfunc< fn >(this, 12)(this, x0, y0, x1, y1);
28 | }
29 |
30 | void outlined_rect(int x0, int y0, int x1, int y1)
31 | {
32 | typedef void(__thiscall* fn)(void*, int, int, int, int);
33 | utils::get_vfunc< fn >(this, 14)(this, x0, y0, x1, y1);
34 | }
35 |
36 | void outlined_circle(int x, int y, float radius, int segments)
37 | {
38 | typedef void(__thiscall* fn)(void*, int, int, float, int);
39 | utils::get_vfunc< fn >(this, 99)(this, x, y, radius, segments);
40 | }
41 |
42 | void line(int x0, int y0, int x1, int y1)
43 | {
44 | typedef void(__thiscall* fn)(void*, int, int, int, int);
45 | utils::get_vfunc(this, 15)(this, x0, y0, x1, y1);
46 | }
47 |
48 | void set_text_font(unsigned long font)
49 | {
50 | typedef void(__thiscall* fn)(void*, unsigned long);
51 | utils::get_vfunc< fn >(this, 17)(this, font);
52 | }
53 |
54 | void set_text_color(int r, int g, int b, int a)
55 | {
56 | typedef void(__thiscall* fn)(void*, int, int, int, int);
57 | utils::get_vfunc< fn >(this, 19)(this, r, g, b, a);
58 | }
59 |
60 | void set_text_pos(int x, int y)
61 | {
62 | typedef void(__thiscall* fn)(void*, int, int);
63 | utils::get_vfunc< fn >(this, 20)(this, x, y);
64 | }
65 |
66 | void print_text(const wchar_t* text, int textLen)
67 | {
68 | typedef void(__thiscall* fn)(void*, const wchar_t*, int, int);
69 | return utils::get_vfunc< fn >(this, 22)(this, text, textLen, 0);
70 | }
71 |
72 | unsigned long create_font()
73 | {
74 | typedef unsigned int(__thiscall* fn)(void*);
75 | return utils::get_vfunc< fn >(this, 66)(this);
76 | }
77 |
78 | void set_font_glyph(unsigned long& font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags)
79 | {
80 | typedef void(__thiscall* fn)(void*, unsigned long, const char*, int, int, int, int, int, int, int);
81 | utils::get_vfunc< fn >(this, 67)(this, font, windowsFontName, tall, weight, blur, scanlines, flags, 0, 0);
82 | }
83 |
84 | void get_text_size(unsigned long font, const wchar_t* text, int& wide, int& tall)
85 | {
86 | typedef void(__thiscall* fn)(void*, unsigned long, const wchar_t*, int&, int&);
87 | utils::get_vfunc< fn >(this, 75)(this, font, text, wide, tall);
88 | }
89 |
90 | int create_new_texture_i_d(bool procedural = true) {
91 | typedef int(__thiscall* fn)(void*, bool);
92 | return utils::get_vfunc(this, 37)(this, procedural);
93 | }
94 |
95 | bool draw_get_texture_file(int id, char* filename, int maxlen) {
96 | typedef bool(__thiscall* fn)(void*, int, char*, int);
97 | return utils::get_vfunc(this, 29)(this, id, filename, maxlen);
98 | };
99 |
100 | void draw_set_texture_file(int id, const char* filename, int hardwareFilter, bool forceReload) {
101 | typedef void(__thiscall* fn)(void*, int, const char*, int, bool);
102 | return utils::get_vfunc(this, 30)(this, id, filename, hardwareFilter, forceReload);
103 | };
104 |
105 | void draw_set_texture_rgba(int id, unsigned char const* rgba, int wide, int tall, int hardwareFilter = 0, bool forceReload = false) {
106 | typedef void(__thiscall* fn)(void*, int, unsigned char const*, int, int, int, bool);
107 | return utils::get_vfunc(this, 31)(this, id, rgba, wide, tall, hardwareFilter, forceReload);
108 | }
109 |
110 | void draw_set_texture(int id) {
111 | typedef void(__thiscall* fn)(void*, int);
112 | return utils::get_vfunc(this, 32)(this, id);
113 | }
114 |
115 | void draw_get_texture_size(int id, int& wide, int& tall) {
116 | typedef void(__thiscall* fn)(void*, int, int&, int&);
117 | return utils::get_vfunc(this, 33)(this, id, wide, tall);
118 | };
119 |
120 | bool is_texture_id_valid(int id) {
121 | typedef bool(__thiscall* fn)(void*, int);
122 | return utils::get_vfunc(this, 35)(this, id);
123 | }
124 |
125 | void draw_textured_rect(int x, int y, int w, int h) {
126 | typedef void(__thiscall* fn)(void*, int, int, int, int);
127 | return utils::get_vfunc(this, 34)(this, x, y, x + w, y + h);
128 | }
129 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/iv_debug_overlay.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class vector;
4 |
5 | class iv_debug_overlay
6 | {
7 | public:
8 | virtual void add_entity_text_overlay(int ent_index, int line_offset, float duration, int r, int g, int b, int a, const char* format, ...) = 0;
9 | virtual void add_box_overlay(const vector& origin, const vector& mins, const vector& max, QAngle const& orientation, int r, int g, int b, int a, float duration) = 0;
10 | virtual void add_triangle_overlay(const vector& p1, const vector& p2, const vector& p3, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
11 | virtual void add_line_overlay(const vector& origin, const vector& dest, int r, int g, int b,bool noDepthTest, float duration) = 0;
12 | virtual void add_text_overlay(const vector& origin, float duration, const char* format, ...) = 0;
13 | virtual void add_text_overlay(const vector& origin, int line_offset, float duration, const char* format, ...) = 0;
14 | virtual void add_screen_text_overlay(float flXPos, float flYPos,float flDuration, int r, int g, int b, int a, const char* text) = 0;
15 | virtual void add_swept_box_overlay(const vector& start, const vector& end, const vector& mins, const vector& max, const QAngle& angles, int r, int g, int b, int a, float flDuration) = 0;
16 | virtual void add_grid_overlay(const vector& origin) = 0;
17 | virtual int screen_position(const vector& point, vector& screen) = 0;
18 | virtual int screen_position(float flXPos, float flYPos, vector& screen) = 0;
19 |
20 | virtual unsigned long* get_first(void) = 0;
21 | virtual unsigned long* get_next(unsigned long* current) = 0;
22 | virtual void clear_dead_overlays(void) = 0;
23 | virtual void clear_all_overlays() = 0;
24 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/iv_engine_client.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include "../../utils/color.hpp"
4 | #include "../../utils/utils.hpp"
5 | #include "c_net_channel.hpp"
6 |
7 | #define FLOW_OUTGOING 0
8 | #define FLOW_INCOMING 1
9 | #define MAX_FLOWS 2 // in & out
10 | typedef float matrix3x4[3][4];
11 |
12 | typedef struct InputContextHandle_t__ *InputContextHandle_t;
13 | struct client_textmessage_t;
14 | struct model_t;
15 | struct player_info;
16 | class SurfInfo;
17 | class i_material;
18 | class CSentence;
19 | class CAudioSource;
20 | class AudioState_t;
21 | class ISpatialQuery;
22 | class IMaterialSystem;
23 | class CPhysCollide;
24 | class IAchievementMgr;
25 | class key_values;
26 |
27 | class i_net_channel_info
28 | {
29 | public:
30 | enum {
31 | GENERIC = 0, // must be first and is default group
32 | LOCALPLAYER, // bytes for local player entity update
33 | OTHERPLAYERS, // bytes for other players update
34 | ENTITIES, // all other entity bytes
35 | SOUNDS, // game sounds
36 | EVENTS, // event messages
37 | USERMESSAGES, // user messages
38 | ENTMESSAGES, // entity messages
39 | VOICE, // voice data
40 | STRINGTABLE, // a stringtable update
41 | MOVE, // client move cmds
42 | STRINGCMD, // string command
43 | SIGNON, // various signondata
44 | TOTAL, // must be last and is not a real group
45 | };
46 |
47 | virtual const char* get_name(void) const = 0; // get channel name
48 | virtual const char* get_address(void) const = 0; // get channel IP address as string
49 | virtual float get_time(void) const = 0; // current net time
50 | virtual float get_time_connected(void) const = 0; // get connection time in seconds
51 | virtual int get_buffer_size(void) const = 0; // netchannel packet history size
52 | virtual int get_data_rate(void) const = 0; // send data rate in byte/sec
53 |
54 | virtual bool is_loopback(void) const = 0; // true if loopback channel
55 | virtual bool is_timing_out(void) const = 0; // true if timing out
56 | virtual bool is_playback(void) const = 0; // true if demo playback
57 |
58 | virtual float get_latency(int flow) const = 0; // current latency (RTT), more accurate but jittering
59 | virtual float get_avg_latency(int flow) const = 0; // average packet latency in seconds
60 | virtual float get_avg_loss(int flow) const = 0; // avg packet loss[0..1]
61 | virtual float get_avg_choke(int flow) const = 0; // avg packet choke[0..1]
62 | virtual float get_avg_data(int flow) const = 0; // data flow in bytes/sec
63 | virtual float get_avg_packets(int flow) const = 0; // avg packets/sec
64 | virtual int get_total_data(int flow) const = 0; // total flow in/out in bytes
65 | virtual int get_sequence_nr(int flow) const = 0; // last send seq number
66 | virtual bool is_valid_packet(int flow, int frame_number) const = 0; // true if packet was not lost/dropped/chocked/flushed
67 | virtual float get_packet_time(int flow, int frame_number) const = 0; // time when packet was send
68 | virtual int get_packet_bytes(int flow, int frame_number, int group) const = 0; // group size of this packet
69 | virtual bool get_stream_progress(int flow, int* received, int* total) const = 0; // TCP progress if transmitting
70 | virtual float get_time_since_last_received(void) const = 0; // get time since last recieved packet in seconds
71 | virtual float get_command_interpolation_amount(int flow, int frame_number) const = 0;
72 | virtual void get_packet_response_latency(int flow, int frame_number, int* pnLatencyMsecs, int* pnChoke) const = 0;
73 | virtual void get_remote_framerate(float* pflFrameTime, float* pflFrameTimeStdDeviation) const = 0;
74 |
75 | virtual float get_timeout_seconds() const = 0;
76 | };
77 |
78 | class ISPSharedMemory;
79 | class CGamestatsData;
80 | class CSteamAPIContext;
81 | struct Frustum_t;
82 |
83 | class iv_engine_client
84 | {
85 | public:
86 | int get_player_for_user_i_d(int UserID)
87 | {
88 | using fn = int(__thiscall*)(void*, int);
89 | return utils::get_vfunc(this, 9)(this, UserID);
90 | }
91 |
92 | void server_cmd(const char* chCommandString, bool bReliable = true)
93 | {
94 | typedef void(__thiscall* fn)(void*, const char*, bool);
95 | return utils::get_vfunc(this, 6)(this, chCommandString, bReliable);
96 | }
97 |
98 | void get_screen_size(int& width, int& height)
99 | {
100 | typedef void(__thiscall* fn)(void*, int&, int&);
101 | return utils::get_vfunc(this, 5)(this, width, height);
102 | }
103 |
104 | bool con_is_visible(void)
105 | {
106 | typedef bool(__thiscall* fn)(void*);
107 | return utils::get_vfunc(this, 11)(this);
108 | }
109 |
110 | int get_local_player(void)
111 | {
112 | typedef int(__thiscall* fn)(void*);
113 | return utils::get_vfunc(this, 12)(this);
114 | }
115 |
116 | float time(void)
117 | {
118 | typedef float(__thiscall* fn)(void*);
119 | return utils::get_vfunc(this, 14)(this);
120 | }
121 |
122 | void get_view_angles(vector& va)
123 | {
124 | typedef void(__thiscall* fn)(void*, vector& va);
125 | return utils::get_vfunc(this, 19)(this, va);
126 | }
127 |
128 | void set_view_angles(vector& va)
129 | {
130 | typedef void(__thiscall* fn)(void*, vector& va);
131 | return utils::get_vfunc(this, 20)(this, va);
132 | }
133 |
134 | int get_max_clients(void)
135 | {
136 | typedef int(__thiscall* fn)(void*);
137 | return utils::get_vfunc(this, 21)(this);
138 | }
139 |
140 | bool is_in_game(void)
141 | {
142 | typedef bool(__thiscall* fn)(void*);
143 | return utils::get_vfunc(this, 26)(this);
144 | }
145 |
146 | bool is_connected(void)
147 | {
148 | typedef bool(__thiscall* fn)(void*);
149 | return utils::get_vfunc(this, 27)(this);
150 | }
151 |
152 | bool is_drawing_loading_image(void)
153 | {
154 | typedef bool(__thiscall* fn)(void*);
155 | return utils::get_vfunc(this, 28)(this);
156 | }
157 |
158 | const D3DMATRIX& world_to_screen_matrix(void)
159 | {
160 | typedef const D3DMATRIX& (__thiscall* fn)(void*);
161 | return utils::get_vfunc(this, 36)(this);
162 | }
163 |
164 | bool is_taking_screenshot(void)
165 | {
166 | typedef bool(__thiscall* fn)(void*);
167 | return utils::get_vfunc(this, 85)(this);
168 | }
169 |
170 | void client_cmd(const char* szCommandString)
171 | {
172 | typedef void(__thiscall* ClientCmdFn)(void*, const char*);
173 | return utils::get_vfunc(this, 7)(this, szCommandString);
174 | }
175 |
176 | int GetAppId()
177 | {
178 | typedef int(__thiscall* fn)(void*);
179 | return utils::get_vfunc(this, 104)(this);
180 | }
181 |
182 | void client_cmd__unrestricted(const char* chCommandString)
183 | {
184 | typedef void(__thiscall* fn)(void*, const char*);
185 | return utils::get_vfunc(this, 106)(this, chCommandString);
186 | }
187 |
188 | void server_cmd_key_values(void* kv)
189 | {
190 | typedef void(__thiscall* fn)(void*, void*);
191 | utils::get_vfunc(this, 127)(this, kv);
192 | }
193 |
194 | bool get_player_info(c_base_entity* player, player_info* play_info) {
195 | typedef bool(__thiscall* fn)(PVOID, int, player_info*);
196 | return utils::get_vfunc(this, 8)(this, player->get_entity_index(), play_info);
197 | }
198 |
199 | CNetChan* get_net_channel_info(void)
200 | {
201 | typedef CNetChan* (__thiscall* OriginalFn)(PVOID);
202 | return utils::get_vfunc(this, 72)(this);
203 | }
204 | };
--------------------------------------------------------------------------------
/core/source-sdk/interfaces/iv_render_view.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class ITexture;
4 | class c_viewsetup;
5 | class CEngineSprite;
6 | class IClientEntity;
7 | class i_material;
8 | class IClientRenderable;
9 |
10 | #define MAX_VIS_LEAVES 32
11 | #define MAX_AREA_STATE_BYTES 32
12 | #define MAX_AREA_PORTAL_STATE_BYTES 24
13 |
14 | #define SIDE_FRONT 0
15 | #define SIDE_BACK 1
16 | #define SIDE_ON 2
17 |
18 | #define FRUSTUM_NUMPLANES 6
19 |
20 | #define VP_EPSILON 0.01f
21 |
22 | class VPlane;
23 | class vector;
24 | class vector_2d;
25 | class vmatrix;
26 |
27 | //-----------------------------------------------------------------------------
28 | // Flags used by DrawWorldLists
29 | //-----------------------------------------------------------------------------
30 | enum
31 | {
32 | DRAWWORLDLISTS_DRAW_STRICTLYABOVEWATER = 0x001,
33 | DRAWWORLDLISTS_DRAW_STRICTLYUNDERWATER = 0x002,
34 | DRAWWORLDLISTS_DRAW_INTERSECTSWATER = 0x004,
35 | DRAWWORLDLISTS_DRAW_WATERSURFACE = 0x008,
36 | DRAWWORLDLISTS_DRAW_SKYBOX = 0x010,
37 | DRAWWORLDLISTS_DRAW_CLIPSKYBOX = 0x020,
38 | DRAWWORLDLISTS_DRAW_SHADOWDEPTH = 0x040,
39 | DRAWWORLDLISTS_DRAW_REFRACTION = 0x080,
40 | DRAWWORLDLISTS_DRAW_REFLECTION = 0x100,
41 | DRAWWORLDLISTS_DRAW_SSAO = 0x800,
42 | };
43 |
44 | enum
45 | {
46 | MAT_SORT_GROUP_STRICTLY_ABOVEWATER = 0,
47 | MAT_SORT_GROUP_STRICTLY_UNDERWATER,
48 | MAT_SORT_GROUP_INTERSECTS_WATER_SURFACE,
49 | MAT_SORT_GROUP_WATERSURFACE,
50 |
51 | MAX_MAT_SORT_GROUPS
52 | };
53 |
54 | enum ERenderDepthMode
55 | {
56 | DEPTH_MODE_NORMAL = 0,
57 | DEPTH_MODE_SHADOW = 1,
58 | DEPTH_MODE_SSA0 = 2,
59 | DEPTH_MODE_OVERRIDE = 3,
60 |
61 | DEPTH_MODE_MAX
62 | };
63 |
64 | typedef VPlane Frustum[FRUSTUM_NUMPLANES];
65 |
66 | //-----------------------------------------------------------------------------
67 | // Leaf index
68 | //-----------------------------------------------------------------------------
69 | typedef unsigned short LeafIndex_t;
70 | typedef short LeafFogVolume_t;
71 | enum
72 | {
73 | INVALID_LEAF_INDEX = (LeafIndex_t)~0
74 | };
75 |
76 |
77 | //-----------------------------------------------------------------------------
78 | // Describes the leaves to be rendered this view, set by BuildWorldLists
79 | //-----------------------------------------------------------------------------
80 | struct WorldListInfo_t
81 | {
82 | int m_ViewFogVolume;
83 | int m_LeafCount;
84 | LeafIndex_t* m_pLeafList;
85 | LeafFogVolume_t* m_pLeafFogVolume;
86 | };
87 |
88 | class IRefCounted
89 | {
90 | public:
91 | virtual int AddRef() = 0;
92 | virtual int Release() = 0;
93 | };
94 |
95 | class IWorldRenderList : public IRefCounted
96 | {
97 |
98 | };
99 |
100 | //-----------------------------------------------------------------------------
101 | // Describes the fog volume for a particular point
102 | //-----------------------------------------------------------------------------
103 | struct VisibleFogVolumeInfo_t
104 | {
105 | int m_nVisibleFogVolume;
106 | int m_nVisibleFogVolumeLeaf;
107 | bool m_bEyeInFogVolume;
108 | float m_flDistanceToWater;
109 | float m_flWaterHeight;
110 | i_material* m_pFogVolumeMaterial;
111 | };
112 |
113 | //-----------------------------------------------------------------------------
114 | // Vertex format for brush models
115 | //-----------------------------------------------------------------------------
116 | struct BrushVertex_t
117 | {
118 | vector m_Pos;
119 | vector m_Normal;
120 | vector m_TangentS;
121 | vector m_TangentT;
122 | vector_2d m_TexCoord;
123 | vector_2d m_LightmapCoord;
124 |
125 | private:
126 | BrushVertex_t(const BrushVertex_t& src);
127 | };
128 |
129 | //-----------------------------------------------------------------------------
130 | // Visibility data for area portal culling
131 | //-----------------------------------------------------------------------------
132 | struct VisOverrideData_t
133 | {
134 | vector m_vecVisOrigin; // The point to to use as the viewpoint for area portal backface cull checks.
135 | float m_fDistToAreaPortalTolerance; // The distance from an area portal before using the full screen as the viewable portion.
136 | };
137 |
138 | //-----------------------------------------------------------------------------
139 | // interface for asking about the Brush surfaces from the client DLL
140 | //-----------------------------------------------------------------------------
141 | class IBrushSurface
142 | {
143 | public:
144 | // Computes texture coordinates + lightmap coordinates given a world position
145 | virtual void ComputeTextureCoordinate(vector const& worldPos, vector_2d& texCoord) = 0;
146 | virtual void ComputeLightmapCoordinate(vector const& worldPos, vector_2d& lightmapCoord) = 0;
147 |
148 | // Gets the vertex data for this surface
149 | virtual int GetVertexCount() const = 0;
150 | virtual void GetVertexData(BrushVertex_t* pVerts) = 0;
151 |
152 | // Gets at the material properties for this surface
153 | virtual i_material* GetMaterial() = 0;
154 | };
155 |
156 | //-----------------------------------------------------------------------------
157 | // interface for installing a new renderer for brush surfaces
158 | //-----------------------------------------------------------------------------
159 | class IBrushRenderer
160 | {
161 | public:
162 | // Draws the surface; returns true if decals should be rendered on this surface
163 | virtual bool RenderBrushModelSurface(IClientEntity* pBaseEntity, IBrushSurface* pBrushSurface) = 0;
164 | };
165 |
166 | //-----------------------------------------------------------------------------
167 | // Purpose: Interface to client .dll to set up a rendering pass over world
168 | // The client .dll can call Render multiple times to overlay one or more world
169 | // views on top of one another
170 | //-----------------------------------------------------------------------------
171 | enum DrawBrushModelMode_t
172 | {
173 | DBM_DRAW_ALL = 0,
174 | DBM_DRAW_OPAQUE_ONLY,
175 | DBM_DRAW_TRANSLUCENT_ONLY,
176 | };
177 |
178 | struct model_t;
179 |
180 | class iv_render_view
181 | {
182 | public:
183 |
184 | // Draw normal brush model.
185 | // If pMaterialOverride is non-null, then all the faces of the bmodel will
186 | // set this material rather than their regular material.
187 | virtual void DrawBrushModel(
188 | IClientEntity* baseentity,
189 | model_t* model,
190 | const vector& origin,
191 | const vector& angles,
192 | bool bUnused) = 0;
193 |
194 | // Draw brush model that has no origin/angles change ( uses identity transform )
195 | // FIXME, Material proxy IClientEntity *baseentity is unused right now, use DrawBrushModel for brushes with
196 | // proxies for now.
197 | virtual void DrawIdentityBrushModel(IWorldRenderList* pList, model_t* model) = 0;
198 |
199 | // Mark this dynamic light as having changed this frame ( so light maps affected will be recomputed )
200 | virtual void TouchLight(struct dlight_t* light) = 0;
201 | // Draw 3D Overlays
202 | virtual void Draw3DDebugOverlays(void) = 0;
203 | // Sets global blending fraction
204 | virtual void set_blend(float blend) = 0;
205 | virtual float get_blend(void) = 0;
206 |
207 | // Sets global color modulation
208 | virtual void set_color_modulation(float const* blend) = 0;
209 | virtual void get_color_modulation(float* blend) = 0;
210 | inline void set_color_modulation(float r, float g, float b)
211 | {
212 | float clr[3] = { r, g, b };
213 | set_color_modulation(clr);
214 | }
215 | // Wrap entire scene drawing
216 | virtual void SceneBegin(void) = 0;
217 | virtual void SceneEnd(void) = 0;
218 |
219 | // Gets the fog volume for a particular point
220 | virtual void GetVisibleFogVolume(const vector& eyePoint, VisibleFogVolumeInfo_t* pInfo) = 0;
221 |
222 | // Wraps world drawing
223 | // If iForceViewLeaf is not -1, then it uses the specified leaf as your starting area for setting up area portal culling.
224 | // This is used by water since your reflected view origin is often in solid space, but we still want to treat it as though
225 | // the first portal we're looking out of is a water portal, so our view effectively originates under the water.
226 | virtual IWorldRenderList* CreateWorldList() = 0;
227 |
228 | virtual void BuildWorldLists(IWorldRenderList* pList, WorldListInfo_t* pInfo, int iForceFViewLeaf, const VisOverrideData_t* pVisData = NULL, bool bShadowDepth = false, float* pReflectionWaterHeight = NULL) = 0;
229 | virtual void DrawWorldLists(IWorldRenderList* pList, unsigned long flags, float waterZAdjust) = 0;
230 |
231 | // Optimization for top view
232 | virtual void DrawTopView(bool enable) = 0;
233 | virtual void TopViewBounds(vector_2d const& mins, vector_2d const& maxs) = 0;
234 |
235 | // Draw lights
236 | virtual void DrawLights(void) = 0;
237 | // FIXME: This function is a stub, doesn't do anything in the engine right now
238 | virtual void DrawMaskEntities(void) = 0;
239 |
240 | // Draw surfaces with alpha
241 | virtual void DrawTranslucentSurfaces(IWorldRenderList* pList, int sortIndex, unsigned long flags, bool bShadowDepth) = 0;
242 |
243 | // Draw Particles ( just draws the linefine for debugging map leaks )
244 | virtual void DrawLineFile(void) = 0;
245 | // Draw lightmaps
246 | virtual void DrawLightmaps(IWorldRenderList* pList, int pageId) = 0;
247 | // Wraps view render sequence, sets up a view
248 | virtual void ViewSetupVis(bool novis, int numorigins, const vector origin[]) = 0;
249 |
250 | // Return true if any of these leaves are visible in the current PVS.
251 | virtual bool AreAnyLeavesVisible(int* leafList, int nLeaves) = 0;
252 |
253 | virtual void VguiPaint(void) = 0;
254 | // Sets up view fade parameters
255 | virtual void ViewDrawFade(byte* color, i_material* pMaterial) = 0;
256 | // Sets up the projection matrix for the specified field of view
257 | virtual void OLD_SetProjectionMatrix(float fov, float zNear, float zFar) = 0;
258 | // Determine lighting at specified position
259 | virtual color GetLightAtPoint(vector& pos) = 0;
260 | // Whose eyes are we looking through?
261 | virtual int GetViewEntity(void) = 0;
262 | // Get engine field of view setting
263 | virtual float GetFieldOfView(void) = 0;
264 | // 1 == ducking, 0 == not
265 | virtual unsigned char** GetAreaBits(void) = 0;
266 |
267 | // Set up fog for a particular leaf
268 | virtual void SetFogVolumeState(int nVisibleFogVolume, bool bUseHeightFog) = 0;
269 |
270 | // Installs a brush surface draw override method, null means use normal renderer
271 | virtual void InstallBrushSurfaceRenderer(IBrushRenderer* pBrushRenderer) = 0;
272 |
273 | // Draw brush model shadow
274 | virtual void DrawBrushModelShadow(IClientRenderable* pRenderable) = 0;
275 |
276 | // Does the leaf contain translucent surfaces?
277 | virtual bool LeafContainsTranslucentSurfaces(IWorldRenderList* pList, int sortIndex, unsigned long flags) = 0;
278 |
279 | virtual bool DoesBoxIntersectWaterVolume(const vector& mins, const vector& maxs, int leafWaterDataID) = 0;
280 |
281 | virtual void SetAreaState(
282 | unsigned char chAreaBits[MAX_AREA_STATE_BYTES],
283 | unsigned char chAreaPortalBits[MAX_AREA_PORTAL_STATE_BYTES]) = 0;
284 |
285 | // See i
286 | virtual void VGui_Paint(int mode) = 0;
287 |
288 | // Push, pop views (see PushViewFlags_t above for flags)
289 | virtual void push_3d_view(const c_viewsetup& view, int nFlags, ITexture* pRenderTarget, Frustum frustumPlanes) = 0;
290 | virtual void push_2d_view(const c_viewsetup& view, int nFlags, ITexture* pRenderTarget, Frustum frustumPlanes) = 0;
291 | virtual void pop_view(Frustum frustumPlanes) = 0;
292 |
293 | // Sets the main view
294 | virtual void set_main_view(const vector& vecOrigin, const vector& angles) = 0;
295 |
296 | enum
297 | {
298 | VIEW_SETUP_VIS_EX_RETURN_FLAGS_USES_RADIAL_VIS = 0x00000001
299 | };
300 |
301 | // Wraps view render sequence, sets up a view
302 | virtual void view_setup_vis_ex(bool novis, int numorigins, const vector origin[], unsigned int& returnFlags) = 0;
303 |
304 | //replaces the current view frustum with a rhyming replacement of your choice
305 | virtual void override_view_frustum(Frustum custom) = 0;
306 |
307 | virtual void draw_brush_model_shadow_depth(IClientEntity* pBaseEnt, model_t* oModel, const vector& vOrigin, const vector& vAngles, ERenderDepthMode DepthMode) = 0;
308 | virtual void update_brush_model_lightmap(model_t* pModel, IClientRenderable* pRenderable) = 0;
309 | virtual void begin_update_lightmaps(void) = 0;
310 | virtual void end_update_lightmaps(void) = 0;
311 | virtual void OLD_SetOffCenterProjectionMatrix(float fov, float zNear, float zFar, float flAspectRatio, float flBottom, float flTop, float flLeft, float flRight) = 0;
312 | virtual void old_set_projection_matrix_ortho(float left, float top, float right, float bottom, float zNear, float zFar) = 0;
313 | virtual void push3_d_view(const c_viewsetup& view, int nFlags, ITexture* pRenderTarget, Frustum frustumPlanes, ITexture* pDepthTexture) = 0;
314 | virtual void get_matrices_for_view(const c_viewsetup& view, vmatrix* pWorldToView, vmatrix* pViewToProjection, vmatrix* pWorldToProjection, vmatrix* pWorldToPixels) = 0;
315 | virtual void draw_brush_model_ex(IClientEntity* baseentity, model_t* model, const vector& origin, const vector& angles, DrawBrushModelMode_t mode) = 0;
316 | };
317 |
--------------------------------------------------------------------------------
/core/utils/color.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class color
4 | {
5 | public:
6 | color() {
7 | *((int*)this) = 0;
8 | }
9 |
10 | color(int color32) {
11 | *((int *)this) = color32;
12 | }
13 |
14 | color(int _r, int _g, int _b) {
15 | set_color(_r, _g, _b, 255);
16 | }
17 |
18 | color(int _r, int _g, int _b, int _a) {
19 | set_color(_r, _g, _b, _a);
20 | }
21 |
22 | void set_color(int _r, int _g, int _b, int _a = 255)
23 | {
24 | _color[0] = (unsigned char)_r;
25 | _color[1] = (unsigned char)_g;
26 | _color[2] = (unsigned char)_b;
27 | _color[3] = (unsigned char)_a;
28 | }
29 |
30 | void get_color(int& _r, int& _g, int& _b, int& _a) const
31 | {
32 | _r = _color[0];
33 | _g = _color[1];
34 | _b = _color[2];
35 | _a = _color[3];
36 | }
37 |
38 | void set_raw_color(int color32)
39 | {
40 | *((int*)this) = color32;
41 | }
42 |
43 | int get_raw_color() const
44 | {
45 | return *((int*)this);
46 | }
47 |
48 | int get_d3d_color() const
49 | {
50 | return ((int)((((_color[3]) & 0xff) << 24) | (((_color[0]) & 0xff) << 16) | (((_color[1]) & 0xff) << 8) | ((_color[2]) & 0xff)));
51 | }
52 |
53 | inline int r() const
54 | {
55 | return _color[0];
56 | }
57 |
58 | inline int g() const
59 | {
60 | return _color[1];
61 | }
62 |
63 | inline int b() const
64 | {
65 | return _color[2];
66 | }
67 |
68 | inline int a() const
69 | {
70 | return _color[3];
71 | }
72 |
73 | inline float r_base() const
74 | {
75 | return _color[0] / 255.0f;
76 | }
77 |
78 | inline float g_base() const
79 | {
80 | return _color[1] / 255.0f;
81 | }
82 |
83 | inline float b_base() const
84 | {
85 | return _color[2] / 255.0f;
86 | }
87 |
88 | inline float a_base() const
89 | {
90 | return _color[3] / 255.0f;
91 | }
92 |
93 | unsigned char& operator[](int index)
94 | {
95 | return _color[index];
96 | }
97 |
98 | const unsigned char& operator[](int index) const
99 | {
100 | return _color[index];
101 | }
102 |
103 | bool operator ==(const color& rhs) const
104 | {
105 | return (*((int *)this) == *((int *)&rhs));
106 | }
107 |
108 | bool operator !=(const color& rhs) const
109 | {
110 | return !(operator==(rhs));
111 | }
112 |
113 | color& operator=(const color& rhs)
114 | {
115 | set_raw_color(rhs.get_raw_color());
116 | return *this;
117 | }
118 |
119 | float* base()
120 | {
121 | float clr[3];
122 |
123 | clr[0] = _color[0] / 255.0f;
124 | clr[1] = _color[1] / 255.0f;
125 | clr[2] = _color[2] / 255.0f;
126 |
127 | return &clr[0];
128 | }
129 |
130 | float* base_alpha()
131 | {
132 | float clr[4];
133 |
134 | clr[0] = _color[0] / 255.0f;
135 | clr[1] = _color[1] / 255.0f;
136 | clr[2] = _color[2] / 255.0f;
137 | clr[3] = _color[3] / 255.0f;
138 |
139 | return &clr[0];
140 | }
141 |
142 | float hue() const
143 | {
144 | if (_color[0] == _color[1] && _color[1] == _color[2])
145 | {
146 | return 0.0f;
147 | }
148 |
149 | float r = _color[0] / 255.0f;
150 | float g = _color[1] / 255.0f;
151 | float b = _color[2] / 255.0f;
152 |
153 | float max = r > g ? r : g > b ? g : b,
154 | min = r < g ? r : g < b ? g : b;
155 | float delta = max - min;
156 | float hue = 0.0f;
157 |
158 | if (r == max)
159 | {
160 | hue = (g - b) / delta;
161 | }
162 | else if (g == max)
163 | {
164 | hue = 2 + (b - r) / delta;
165 | }
166 | else if (b == max)
167 | {
168 | hue = 4 + (r - g) / delta;
169 | }
170 | hue *= 60;
171 |
172 | if (hue < 0.0f)
173 | {
174 | hue += 360.0f;
175 | }
176 | return hue;
177 | }
178 |
179 | float saturation() const
180 | {
181 | float r = _color[0] / 255.0f;
182 | float g = _color[1] / 255.0f;
183 | float b = _color[2] / 255.0f;
184 |
185 | float max = r > g ? r : g > b ? g : b,
186 | min = r < g ? r : g < b ? g : b;
187 | float l, s = 0;
188 |
189 | if (max != min)
190 | {
191 | l = (max + min) / 2;
192 | if (l <= 0.5f)
193 | s = (max - min) / (max + min);
194 | else
195 | s = (max - min) / (2 - max - min);
196 | }
197 | return s;
198 | }
199 |
200 | float brightness() const
201 | {
202 | float r = _color[0] / 255.0f;
203 | float g = _color[1] / 255.0f;
204 | float b = _color[2] / 255.0f;
205 |
206 | float max = r > g ? r : g > b ? g : b,
207 | min = r < g ? r : g < b ? g : b;
208 | return (max + min) / 2;
209 | }
210 |
211 | static color from_hsb(float hue, float saturation, float brightness)
212 | {
213 | float h = hue == 1.0f ? 0 : hue * 6.0f;
214 | float f = h - (int)h;
215 | float p = brightness * (1.0f - saturation);
216 | float q = brightness * (1.0f - saturation * f);
217 | float t = brightness * (1.0f - (saturation * (1.0f - f)));
218 |
219 | if (h < 1)
220 | {
221 | return color(
222 | (unsigned char)(brightness * 255),
223 | (unsigned char)(t * 255),
224 | (unsigned char)(p * 255)
225 | );
226 | }
227 | else if (h < 2)
228 | {
229 | return color(
230 | (unsigned char)(q * 255),
231 | (unsigned char)(brightness * 255),
232 | (unsigned char)(p * 255)
233 | );
234 | }
235 | else if (h < 3)
236 | {
237 | return color(
238 | (unsigned char)(p * 255),
239 | (unsigned char)(brightness * 255),
240 | (unsigned char)(t * 255)
241 | );
242 | }
243 | else if (h < 4)
244 | {
245 | return color(
246 | (unsigned char)(p * 255),
247 | (unsigned char)(q * 255),
248 | (unsigned char)(brightness * 255)
249 | );
250 | }
251 | else if (h < 5)
252 | {
253 | return color(
254 | (unsigned char)(t * 255),
255 | (unsigned char)(p * 255),
256 | (unsigned char)(brightness * 255)
257 | );
258 | }
259 | else
260 | {
261 | return color(
262 | (unsigned char)(brightness * 255),
263 | (unsigned char)(p * 255),
264 | (unsigned char)(q * 255)
265 | );
266 | }
267 | }
268 |
269 | static color red()
270 | {
271 | return color(255, 0, 0);
272 | }
273 |
274 | static color green()
275 | {
276 | return color(0, 255, 0);
277 | }
278 |
279 | static color blue()
280 | {
281 | return color(0, 0, 255);
282 | }
283 |
284 | static color light_blue()
285 | {
286 | return color(100, 100, 255);
287 | }
288 |
289 | static color grey()
290 | {
291 | return color(128, 128, 128);
292 | }
293 |
294 | static color dark_grey()
295 | {
296 | return color(45, 45, 45);
297 | }
298 |
299 | static color black()
300 | {
301 | return color(0, 0, 0);
302 | }
303 |
304 | static color white()
305 | {
306 | return color(255, 255, 255);
307 | }
308 |
309 | static color purple()
310 | {
311 | return color(220, 0, 220);
312 | }
313 |
314 | //Menu
315 | static color background()
316 | {
317 | return color(55, 55, 55);
318 | }
319 |
320 | static color frame_border()
321 | {
322 | return color(80, 80, 80);
323 | }
324 |
325 | static color main_text()
326 | {
327 | return color(230, 230, 230);
328 | }
329 |
330 | static color header_text()
331 | {
332 | return color(49, 124, 230);
333 | }
334 |
335 | static color current_tab()
336 | {
337 | return color(55, 55, 55);
338 | }
339 |
340 | static color tabs()
341 | {
342 | return color(23, 23, 23);
343 | }
344 |
345 | static color highlight()
346 | {
347 | return color(49, 124, 230);
348 | }
349 |
350 | static color element_border()
351 | {
352 | return color(0, 0, 0);
353 | }
354 |
355 | static color slider_scroll()
356 | {
357 | return color(78, 143, 230);
358 | }
359 |
360 | private:
361 | unsigned char _color[4] = {};
362 | };
--------------------------------------------------------------------------------
/core/utils/draw/draw.cpp:
--------------------------------------------------------------------------------
1 | #include "draw.hpp"
2 | #include "..\..\source-sdk\structs\enums.hpp"
3 |
4 | typedef float matrix3x4[3][4];
5 |
6 | int utils::screen_x = 0, utils::screen_y = 0;
7 | vmatrix utils::world_to_projection = {};
8 |
9 | namespace draw {
10 | int default_font_weight = 200;
11 |
12 | unsigned long health_font;
13 |
14 | unsigned long pickup_font;
15 |
16 | unsigned long object_font;
17 |
18 | unsigned long class_name_font;
19 |
20 | unsigned long watermark_font;
21 |
22 | void init() {
23 | if (!interfaces::surface) {
24 | return;
25 | }
26 |
27 | health_font = interfaces::surface->create_font();
28 | interfaces::surface->set_font_glyph(health_font, "Tahoma", 12, default_font_weight, 0, 0, font_flags::DROPSHADOW | font_flags::ANTIALIAS);
29 |
30 | pickup_font = interfaces::surface->create_font();
31 | interfaces::surface->set_font_glyph(pickup_font, "Tahoma", 14, default_font_weight, 0, 0, font_flags::DROPSHADOW | font_flags::ANTIALIAS);
32 |
33 | object_font = interfaces::surface->create_font();
34 | interfaces::surface->set_font_glyph(object_font, "Tahoma", 14, default_font_weight, 0, 0, font_flags::DROPSHADOW | font_flags::ANTIALIAS);
35 |
36 | class_name_font = interfaces::surface->create_font();
37 | interfaces::surface->set_font_glyph(class_name_font, "Tahoma", 15, default_font_weight, 0, 0, font_flags::DROPSHADOW | font_flags::ANTIALIAS);
38 |
39 | watermark_font = interfaces::surface->create_font();
40 | interfaces::surface->set_font_glyph(watermark_font, "Tahoma", 22, default_font_weight, 0, 0, font_flags::DROPSHADOW | font_flags::ANTIALIAS);
41 |
42 | interfaces::engine->get_screen_size(utils::screen_x, utils::screen_y);
43 |
44 | utils::log("[-] Draw Objects Initialized");
45 | }
46 |
47 | int get_text_size_width(unsigned long font, std::string text) {
48 | if (text.find(".") != std::string::npos) {
49 | text = text.substr(0, text.find("."));
50 | }
51 |
52 | wchar_t temp[128];
53 | int wide = 0, tall = 0;
54 |
55 | if (MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, temp, 128) > 0) {
56 | interfaces::surface->get_text_size(font, temp, wide, tall);
57 | }
58 | return wide;
59 | }
60 |
61 | int get_text_size_height(unsigned long font, std::string text) {
62 | wchar_t temp[128];
63 | int wide = 0, tall = 0;
64 |
65 | if (MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, temp, 128) > 0) {
66 | interfaces::surface->get_text_size(font, temp, wide, tall);
67 | }
68 | return tall;
69 | }
70 |
71 | bool w2s(const vector& origin, vector& screen) {
72 | return interfaces::debug_overlay->screen_position(origin, screen) != -1;
73 | }
74 |
75 | void line(int x1, int y1, int x2, int y2, color color) {
76 | interfaces::surface->set_color(color.r(), color.g(), color.b(), color.a());
77 | interfaces::surface->line(x1, y1, x2, y2);
78 | }
79 |
80 | void line(vector point1, vector point2, color color) {
81 | interfaces::surface->set_color(color.r(), color.g(), color.b(), color.a());
82 | interfaces::surface->line(point1.x, point1.y, point2.x, point2.y);
83 | }
84 |
85 | void rect(vector top_left, vector bottom_right, color color) {
86 | interfaces::surface->set_color(color.r(), color.g(), color.b(), color.a());
87 | interfaces::surface->outlined_rect(top_left.x, top_left.y, bottom_right.x, bottom_right.y);
88 | }
89 |
90 | void rect(int x, int y, int w, int h, color color) {
91 | interfaces::surface->set_color(color.r(), color.g(), color.b(), color.a());
92 | interfaces::surface->outlined_rect(x, y, x + w, y + h);
93 | }
94 |
95 | void filled_rect(int x, int y, int w, int h, color color) {
96 | interfaces::surface->set_color(color.r(), color.g(), color.b(), color.a());
97 | interfaces::surface->filled_rect(x, y, x + w, y + h);
98 | }
99 |
100 | void filled_rect(vector top_left, vector bottom_right, color color) {
101 | interfaces::surface->set_color(color.r(), color.g(), color.b(), color.a());
102 | interfaces::surface->filled_rect(top_left.x, top_left.y, bottom_right.x, bottom_right.y);
103 | }
104 |
105 | void circle(vector point, float radius, color color) {
106 | float step = (float)M_PI * 2.0f / 40;
107 |
108 | for (float a = 0; a < (M_PI * 2.0f); a += step) {
109 | vector start(radius * cosf(a) + point.x, radius * sinf(a) + point.y);
110 | vector end(radius * cosf(a + step) + point.x, radius * sinf(a + step) + point.y);
111 | line(start, end, color);
112 | }
113 | }
114 |
115 | void text(unsigned long font, std::string text, vector position, color color, bool center) {
116 | wchar_t temp[128];
117 | int text_width, text_height;
118 | if (MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, temp, 128) > 0) {
119 | interfaces::surface->set_text_font(font);
120 | if (center) {
121 | interfaces::surface->get_text_size(font, temp, text_width, text_height);
122 | interfaces::surface->set_text_pos(position.x - text_width / 2, position.y);
123 | }
124 | else
125 | interfaces::surface->set_text_pos(position.x, position.y);
126 | interfaces::surface->set_text_color(color.r(), color.g(), color.b(), color.a());
127 | interfaces::surface->print_text(temp, wcslen(temp));
128 | }
129 | }
130 |
131 | void text(unsigned long font, std::string text, int x, int y, color color, bool center) {
132 | wchar_t temp[128];
133 | int text_width, text_height;
134 | if (MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, temp, 128) > 0) {
135 | interfaces::surface->set_text_font(font);
136 | if (center) {
137 | interfaces::surface->get_text_size(font, temp, text_width, text_height);
138 | interfaces::surface->set_text_pos(x - text_width / 2, y);
139 | }
140 | else
141 | interfaces::surface->set_text_pos(x, y);
142 | interfaces::surface->set_text_color(color.r(), color.g(), color.b(), color.a());
143 | interfaces::surface->print_text(temp, wcslen(temp));
144 | }
145 | }
146 |
147 | void text(unsigned long font, const wchar_t* text, int x, int y, color color, bool center) {
148 | int text_width, text_height;
149 | interfaces::surface->set_text_font(font);
150 | if (center) {
151 | interfaces::surface->get_text_size(font, text, text_width, text_height);
152 | interfaces::surface->set_text_pos(x - text_width / 2, y);
153 | }
154 | else
155 | interfaces::surface->set_text_pos(x, y);
156 | interfaces::surface->set_text_color(color.r(), color.g(), color.b(), color.a());
157 | interfaces::surface->print_text(text, wcslen(text));
158 | }
159 |
160 | void text(unsigned long font, const wchar_t* text, vector position, color color, bool center) {
161 | int text_width, text_height;
162 | interfaces::surface->set_text_font(font);
163 | if (center) {
164 | interfaces::surface->get_text_size(font, text, text_width, text_height);
165 | interfaces::surface->set_text_pos(position.x - text_width / 2, position.y);
166 | }
167 | else
168 | interfaces::surface->set_text_pos(position.x, position.y);
169 | interfaces::surface->set_text_color(color.r(), color.g(), color.b(), color.a());
170 | interfaces::surface->print_text(text, wcslen(text));
171 | }
172 | }
--------------------------------------------------------------------------------
/core/utils/draw/draw.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "..\math\vector.hpp"
3 | #include "..\color.hpp"
4 | #include "..\..\interfaces\interfaces.hpp"
5 |
6 | namespace draw {
7 | extern unsigned long health_font;
8 |
9 | extern unsigned long pickup_font;
10 |
11 | extern unsigned long object_font;
12 |
13 | extern unsigned long class_name_font;
14 |
15 | extern unsigned long watermark_font;
16 |
17 | extern int default_font_size;
18 |
19 | extern int default_font_weight;
20 |
21 | void init();
22 |
23 | int get_text_size_width(unsigned long font, std::string text);
24 |
25 | int get_text_size_height(unsigned long font, std::string text);
26 |
27 | bool w2s(const vector& origin, vector& screen);
28 |
29 | void line(int x1, int y1, int x2, int y2, color color);
30 |
31 | void line(vector point1, vector point2, color color);
32 |
33 | void rect(vector top_left, vector bottom_right, color color);
34 |
35 | void rect(int x, int y, int w, int h, color color);
36 |
37 | void filled_rect(int x, int y, int w, int h, color color);
38 |
39 | void filled_rect(vector top_left, vector bottom_right, color color);
40 |
41 | void circle(vector point, float radius, color color);
42 |
43 | void text(unsigned long font, std::string text, vector position, color color, bool center=false);
44 |
45 | void text(unsigned long font, std::string text, int x, int y, color color, bool center=false);
46 |
47 | void text(unsigned long font, const wchar_t* text, int x, int y, color color, bool center=false);
48 |
49 | void text(unsigned long font, const wchar_t* text, vector position, color color, bool center=false);
50 | }
--------------------------------------------------------------------------------
/core/utils/game/helpers.cpp:
--------------------------------------------------------------------------------
1 | #include "..\math\vector.hpp"
2 | #include "..\color.hpp"
3 | #include "..\..\source-sdk\interfaces\i_entity.hpp"
4 | #include "..\..\source-sdk\interfaces\c_base_combat_weapon.hpp"
5 | #include "..\..\source-sdk\structs\enums.hpp"
6 | #include "../../interfaces/interfaces.hpp"
7 |
8 | const char* get_class_name_string(int class_id) {
9 | switch (class_id) {
10 | case 1:
11 | return "Scout";
12 | case 2:
13 | return "Sniper";
14 | case 3:
15 | return "Soldier";
16 | case 4:
17 | return "Demoman";
18 | case 5:
19 | return "Medic";
20 | case 6:
21 | return "Heavy";
22 | case 7:
23 | return "Pyro";
24 | case 8:
25 | return "Spy";
26 | case 9:
27 | return "Engineer";
28 | default:
29 | return "Enemy";
30 | }
31 | }
32 |
33 | color get_team_color(c_base_entity* entity) {
34 | return (entity->get_team_num() == 2
35 | ? color(255, 102, 0, 255)
36 | : entity->get_team_num() == 3
37 | ? color(0, 102, 255, 255)
38 | : color(255, 255, 255, 255));
39 | }
40 |
41 | int hash_string(const char* szOrg) {
42 | int iHash = 5381;
43 |
44 | while (int iStr = *szOrg++) iHash = iHash * 33 + iStr;
45 |
46 | return iHash;
47 | }
48 |
49 | bool is_health_hash(int nHash)
50 | {
51 | constexpr int MedKitSmall = 1941719626;
52 | constexpr int MedKitMedium = 642350162;
53 | constexpr int MedKitLarge = 1102367452;
54 | constexpr int MedKitSmallBday = -2020233079;
55 | constexpr int MedKitMediumBday = -1898223727;
56 | constexpr int MedKitLargeBday = -1183884197;
57 | constexpr int MedKitPlate = -159986486;
58 | constexpr int MedKitSteak = -1325824063;
59 | constexpr int MedKitSmallHalloween = 1667112440;
60 | constexpr int MedKitMediumHalloween = 170247616;
61 | constexpr int MedKitLargeHalloween = 827760266;
62 | constexpr int MedKitLargeMushRoom = 687823304;
63 |
64 | switch (nHash) {
65 | case MedKitSmall:
66 | case MedKitMedium:
67 | case MedKitLarge:
68 | case MedKitSmallBday:
69 | case MedKitMediumBday:
70 | case MedKitLargeBday:
71 | case MedKitSmallHalloween:
72 | case MedKitMediumHalloween:
73 | case MedKitLargeHalloween:
74 | case MedKitPlate:
75 | case MedKitSteak:
76 | case MedKitLargeMushRoom:
77 | return true;
78 | default:
79 | return false;
80 | }
81 | }
82 |
83 | bool is_ammo_hash(int nHash) {
84 | constexpr int AmmoSmall = 913481717;
85 | constexpr int AmmoMedium = 1070237533;
86 | constexpr int AmmoLarge = 74129543;
87 | constexpr int AmmoLargeBday = 1933898982;
88 | constexpr int AmmoMediumBday = -2090593924;
89 |
90 | switch (nHash) {
91 | case AmmoSmall:
92 | case AmmoMedium:
93 | case AmmoLarge:
94 | case AmmoMediumBday:
95 | case AmmoLargeBday:
96 | return true;
97 | default:
98 | return false;
99 | }
100 | }
101 |
102 | // credits to project_ic for the values
103 | bool get_projectile_info(c_base_entity* local_player, float& speed, float& gravity) {
104 | switch (local_player->get_active_weapon()->get_item_definition_index())
105 | {
106 | case Soldier_m_RocketLauncher:
107 | case Soldier_m_RocketLauncherR:
108 | case Soldier_m_TheBlackBox:
109 | case Soldier_m_TheCowMangler5000:
110 | case Soldier_m_TheOriginal:
111 | case Soldier_m_FestiveRocketLauncher:
112 | case Soldier_m_TheBeggarsBazooka:
113 | case Soldier_m_SilverBotkillerRocketLauncherMkI:
114 | case Soldier_m_GoldBotkillerRocketLauncherMkI:
115 | case Soldier_m_RustBotkillerRocketLauncherMkI:
116 | case Soldier_m_BloodBotkillerRocketLauncherMkI:
117 | case Soldier_m_CarbonadoBotkillerRocketLauncherMkI:
118 | case Soldier_m_DiamondBotkillerRocketLauncherMkI:
119 | case Soldier_m_SilverBotkillerRocketLauncherMkII:
120 | case Soldier_m_GoldBotkillerRocketLauncherMkII:
121 | case Soldier_m_FestiveBlackBox:
122 | case Soldier_m_TheAirStrike:
123 | case Soldier_m_WoodlandWarrior:
124 | case Soldier_m_SandCannon:
125 | case Soldier_m_AmericanPastoral:
126 | case Soldier_m_SmalltownBringdown:
127 | case Soldier_m_ShellShocker:
128 | case Soldier_m_AquaMarine:
129 | case Soldier_m_Autumn:
130 | case Soldier_m_BlueMew:
131 | case Soldier_m_BrainCandy:
132 | case Soldier_m_CoffinNail:
133 | case Soldier_m_HighRollers:
134 | case Soldier_m_Warhawk: {
135 | speed = 1100.0f;
136 | gravity = 0.0f;
137 | break;
138 | }
139 | case Soldier_m_TheDirectHit: {
140 | speed = 1980.0f;
141 | gravity = 0.0f;
142 | break;
143 | }
144 |
145 | case Soldier_m_TheLibertyLauncher: {
146 | speed = 1540.0f;
147 | gravity = 0.0f;
148 | break;
149 | }
150 | case Demoman_m_GrenadeLauncher:
151 | case Demoman_m_GrenadeLauncherR:
152 | case Demoman_m_FestiveGrenadeLauncher:
153 | case Demoman_m_TheIronBomber:
154 | case Demoman_m_Autumn:
155 | case Demoman_m_MacabreWeb:
156 | case Demoman_m_Rainbow:
157 | case Demoman_m_SweetDreams:
158 | case Demoman_m_CoffinNail:
159 | case Demoman_m_TopShelf:
160 | case Demoman_m_Warhawk:
161 | case Demoman_m_ButcherBird: {
162 | speed = 1217.0f;
163 | gravity = 0.4f;
164 | break;
165 | }
166 | case Soldier_s_TheRighteousBison:
167 | case Engi_m_ThePomson6000: {
168 | speed = 1200.0f;
169 | gravity = 0.0f;
170 | break;
171 | }
172 | case Demoman_m_TheLooseCannon: {
173 | speed = 1453.9f;
174 | gravity = 0.4f;
175 | break;
176 | }
177 | case Demoman_m_TheLochnLoad: {
178 | speed = 1513.3f;
179 | gravity = 0.4f;
180 | break;
181 | }
182 | case Engi_m_TheRescueRanger:
183 | case Medic_m_FestiveCrusadersCrossbow:
184 | case Medic_m_CrusadersCrossbow: {
185 | speed = 2400.0f;
186 | gravity = 0.2f;
187 | break;
188 | }
189 | case Pyro_m_DragonsFury: {
190 | speed = 3000.0f;
191 | gravity = 0.0f;
192 | break;
193 | }
194 | case Pyro_m_FlameThrower:
195 | case Pyro_m_ThePhlogistinator:
196 | case Pyro_m_TheBackburner:
197 | case Pyro_m_TheDegreaser: {
198 | speed = 1000.0f;
199 | gravity = 0.0f;
200 | break;
201 | }
202 | case Pyro_s_TheDetonator:
203 | case Pyro_s_TheFlareGun:
204 | case Pyro_s_FestiveFlareGun:
205 | case Pyro_s_TheScorchShot: {
206 | speed = 2000.0f;
207 | gravity = 0.3f;
208 | break;
209 | }
210 | case Pyro_s_TheManmelter: {
211 | speed = 3000.0f;
212 | gravity = 0.2f;
213 | break;
214 | }
215 | case Medic_m_SyringeGun:
216 | case Medic_m_SyringeGunR:
217 | case Medic_m_TheBlutsauger:
218 | case Medic_m_TheOverdose: {
219 | speed = 1000.0f;
220 | gravity = 0.2f;
221 | break;
222 | }
223 |
224 | case Sniper_m_TheHuntsman:
225 | case Sniper_m_FestiveHuntsman:
226 | case Sniper_m_TheFortifiedCompound: {
227 | float charge = (interfaces::globals->curtime - local_player->get_active_weapon()->get_charge_time());
228 | speed = ((fminf(fmaxf(charge, 0.0f), 1.0f) * 800.0f) + 1800.0f);
229 | gravity = ((fminf(fmaxf(charge, 0.0f), 1.0f) * -0.4f) + 0.5f);
230 | break;
231 | }
232 | default:
233 | speed = 0.0f;
234 | gravity = 0.0f;
235 | return false;
236 | }
237 | return true;
238 | }
--------------------------------------------------------------------------------
/core/utils/game/helpers.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class color;
4 | class c_base_entity;
5 |
6 | const char* get_class_name_string(int class_id);
7 |
8 | color get_team_color(c_base_entity* entity);
9 |
10 | int hash_string(const char* szOrg);
11 |
12 | bool is_health_hash(int nHash);
13 |
14 | bool is_ammo_hash(int nHash);
15 |
16 | // credits to project_ic for the values
17 | bool get_projectile_info(c_base_entity* local_player, float& speed, float& gravity);
--------------------------------------------------------------------------------
/core/utils/math/math.cpp:
--------------------------------------------------------------------------------
1 | #define NOMINMAX
2 | #include
3 | #include
4 | #include "math.hpp"
5 |
6 | #define M_RADPI 57.295779513082
7 | #define PI 3.14159265358979323846
8 |
9 | namespace math {
10 | void vector_transform(const vector& input, const matrix3x4& matrix, vector& output) {
11 | for (auto i = 0; i < 3; i++)
12 | output[i] = input.dot((vector&)matrix[i]) + matrix[i][3];
13 | }
14 |
15 | void sin_cos(float radians, float* sine, float* cosine) {
16 | _asm
17 | {
18 | fld DWORD PTR[radians]
19 | fsincos
20 |
21 | mov edx, DWORD PTR[cosine]
22 | mov eax, DWORD PTR[sine]
23 |
24 | fstp DWORD PTR[edx]
25 | fstp DWORD PTR[eax]
26 | }
27 | }
28 |
29 | void angle_vectors(const vector& angles, vector* forward) {
30 | float sp, sy, cp, cy;
31 |
32 | sin_cos(DEG2RAD(angles.x), &sp, &cp);
33 | sin_cos(DEG2RAD(angles.y), &sy, &cy);
34 |
35 | if (forward)
36 | {
37 | forward->x = cp * cy;
38 | forward->y = cp * sy;
39 | forward->z = -sp;
40 | }
41 | }
42 |
43 | vector calc_angle(const vector& source, const vector& destination, const vector& view_angles) {
44 | vector delta = source - destination;
45 | auto radians_to_degrees = [](float radians) { return radians * 180 / static_cast(M_PI); };
46 | vector angles;
47 | angles.x = radians_to_degrees(atanf(delta.z / std::hypotf(delta.x, delta.y))) - view_angles.x;
48 | angles.y = radians_to_degrees(atanf(delta.y / delta.x)) - view_angles.y;
49 | angles.z = 0.0f;
50 |
51 | if (delta.x >= 0.0)
52 | angles.y += 180.0f;
53 |
54 | // normalize
55 | angles.x = std::isfinite(angles.x) ? std::remainderf(angles.x, 360.0f) : 0.0f;
56 | angles.y = std::isfinite(angles.y) ? std::remainderf(angles.y, 360.0f) : 0.0f;
57 | angles.z = 0.0f;
58 |
59 | return angles;
60 | }
61 |
62 | vector calc_angle_projectile(const vector& source, const vector& destination) {
63 | vector angles = vector(0.0f, 0.0f, 0.0f);
64 | vector delta = (source - destination);
65 | float fHyp = FastSqrt((delta.x * delta.x) + (delta.y * delta.y));
66 |
67 | angles.x = (atanf(delta.z / fHyp) * M_RADPI);
68 | angles.y = (atanf(delta.y / delta.x) * M_RADPI);
69 | angles.z = 0.0f;
70 |
71 | if (delta.x >= 0.0f)
72 | angles.y += 180.0f;
73 |
74 | return angles;
75 | }
76 |
77 | float calc_fov(float distance, const vector& current_view_angles, const vector& angle_to_enemy) {
78 | vector aiming_at = {};
79 | math::angle_vectors(current_view_angles, &aiming_at);
80 | aiming_at *= distance;
81 |
82 | vector aim_to = {};
83 | math::angle_vectors(angle_to_enemy, &aim_to);
84 | aim_to *= distance;
85 |
86 | return aiming_at.dist_to(aim_to);
87 | }
88 |
89 | void normalize_angle(vector& angle)
90 | {
91 | while (angle.x > 89.f)
92 | {
93 | angle.x -= 180.f;
94 | }
95 | while (angle.x < -89.f)
96 | {
97 | angle.x += 180.f;
98 | }
99 | if (angle.y > 180)
100 | {
101 | angle.y -= (round(angle.y / 360) * 360.f);
102 | }
103 | else if (angle.y < -180)
104 | {
105 | angle.y += (round(angle.y / 360) * -360.f);
106 | }
107 | if ((angle.z > 50) || (angle.z < 50))
108 | {
109 | angle.z = 0;
110 | }
111 | }
112 |
113 | inline float normalize_clamp(float ang) {
114 | if (!std::isfinite(ang))
115 | return 0.0f;
116 |
117 | return std::remainder(ang, 360.0f);
118 | }
119 |
120 | void clamp_angles(vector& v) {
121 | v.x = std::max(-89.0f, std::min(89.0f, normalize_clamp(v.x)));
122 | v.y = normalize_clamp(v.y);
123 | v.z = 0.0f;
124 | }
125 | }
--------------------------------------------------------------------------------
/core/utils/math/math.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "vector.hpp"
3 |
4 | typedef float matrix3x4[3][4];
5 |
6 | namespace math {
7 | void vector_transform(const vector& input, const matrix3x4& matrix, vector& output);
8 |
9 | void sin_cos(float radians, float* sine, float* cosine);
10 |
11 | void angle_vectors(const vector& angles, vector* forward);
12 |
13 | vector calc_angle(const vector& source, const vector& destination, const vector& view_angles);
14 |
15 | vector calc_angle_projectile(const vector& source, const vector& destination);
16 |
17 | float calc_fov(float distance, const vector& src, const vector& dst);
18 |
19 | void normalize_angle(vector& angle);
20 |
21 | void clamp_angles(vector& v);
22 | }
--------------------------------------------------------------------------------
/core/utils/math/vmatrix.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "vector.hpp"
3 |
4 | class vmatrix {
5 | private:
6 | vector m[4][4];
7 |
8 | public:
9 | const matrix3x4& As3x4() const {
10 | return *((const matrix3x4*)this);
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/core/utils/memory/memory.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #define INRANGE(x,a,b) (x >= a && x <= b)
9 | #define getByte( x ) (getBits(x[0]) << 4 | getBits(x[1]))
10 | #define getBits( x ) (INRANGE((x&(~0x20)),'A','F') ? ((x&(~0x20)) - 'A' + 0xa) : (INRANGE(x,'0','9') ? x - '0' : 0))
11 |
12 | namespace memory {
13 | struct protect_t {
14 | protect_t(void* addr, uint32_t size, DWORD flags) {
15 | m_size = size;
16 | m_addr = addr;
17 |
18 | VirtualProtect(m_addr, m_size, flags, &m_flags);
19 | }
20 |
21 | ~protect_t() { VirtualProtect(m_addr, m_size, m_flags, &m_flags); }
22 |
23 | DWORD m_flags = 0ul;
24 | uint32_t m_size = 0u;
25 | void* m_addr = nullptr;
26 | };
27 |
28 | struct hook_t {
29 | hook_t() = default;
30 |
31 | hook_t(uintptr_t ptr) {
32 | m_vtable = reinterpret_cast(ptr);
33 |
34 | init();
35 | };
36 |
37 | hook_t(void* ptr) {
38 | m_vtable = reinterpret_cast(ptr);
39 |
40 | init();
41 | };
42 |
43 | __forceinline bool init() {
44 | if (!m_vtable)
45 | return false;
46 |
47 | const auto protect = protect_t(m_vtable, sizeof(uintptr_t), PAGE_READWRITE);
48 |
49 | m_original = *m_vtable;
50 |
51 | for (m_table_length = 0u; m_original[m_table_length]; m_table_length++) {
52 | if (IS_INTRESOURCE(m_original[m_table_length]))
53 | break;
54 | }
55 |
56 | if (!m_table_length)
57 | return false;
58 |
59 | m_replace = std::make_unique(m_table_length + 1);
60 |
61 | std::memset(m_replace.get(), 0, m_table_length * sizeof(uintptr_t) + sizeof(uintptr_t));
62 |
63 | std::memcpy(&m_replace[1], m_original, m_table_length * sizeof(uintptr_t));
64 |
65 | std::memcpy(m_replace.get(), &m_original[-1], sizeof(uintptr_t));
66 |
67 | *m_vtable = &m_replace[1];
68 |
69 | return true;
70 | }
71 |
72 | template
73 | __forceinline void hook(uint32_t index, T replace_function) {
74 | if (index > m_table_length) {
75 | return;
76 | }
77 |
78 | m_replace[index + 1u] = reinterpret_cast(replace_function);
79 | }
80 |
81 | template
82 | __forceinline T get_original(uint32_t index) {
83 | if (index > m_table_length) {
84 | return nullptr;
85 | }
86 |
87 | return reinterpret_cast(m_original[index]);
88 | }
89 |
90 | __forceinline void unhook(uint32_t index) {
91 | if (index > m_table_length) {
92 | return;
93 | }
94 |
95 | m_replace[index + 1u] = m_original[index];
96 | }
97 |
98 | __forceinline void unhook() {
99 | if (!m_original) {
100 | return;
101 | }
102 |
103 | const auto protect = protect_t(m_vtable, sizeof(uintptr_t), PAGE_READWRITE);
104 |
105 | *m_vtable = m_original;
106 | m_original = nullptr;
107 | }
108 |
109 | uint32_t m_table_length = 0u;
110 | uintptr_t** m_vtable = nullptr;
111 | uintptr_t* m_original = nullptr;
112 | std::unique_ptr m_replace = nullptr;
113 | };
114 |
115 | static DWORD find_pattern(std::string module_name, const std::string& pattern) {
116 | try {
117 | auto pat = pattern.c_str();
118 | DWORD first_match = 0;
119 | const auto range_start = DWORD(GetModuleHandleA(module_name.c_str()));
120 | MODULEINFO miModInfo;
121 | K32GetModuleInformation(GetCurrentProcess(), HMODULE(range_start), &miModInfo, sizeof(MODULEINFO));
122 | const auto range_end = range_start + miModInfo.SizeOfImage;
123 | for (auto p_cur = range_start; p_cur < range_end; p_cur++) {
124 | if (!*pat)
125 | return first_match;
126 |
127 | if (*(PBYTE)pat == '\?' || *(BYTE*)p_cur == getByte(pat)) {
128 | if (!first_match)
129 | first_match = p_cur;
130 |
131 | if (!pat[2])
132 | return first_match;
133 |
134 | if (*(PWORD)pat == '\?\?' || *(PBYTE)pat != '\?')
135 | pat += 3;
136 |
137 | else
138 | pat += 2;
139 | }
140 | else
141 | {
142 | pat = pattern.c_str();
143 | first_match = 0;
144 | }
145 | }
146 |
147 | return NULL;
148 | }
149 | catch (const std::exception& ex) {
150 | std::cout << "[-] Exception: \n" << ex.what() << std::endl;
151 | return NULL;
152 | }
153 | }
154 | }
--------------------------------------------------------------------------------
/core/utils/netvars/dt_common.hpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NMan1/OverflowTF2/ffdbcc69510782e52abd1351f880bf26babee0f4/core/utils/netvars/dt_common.hpp
--------------------------------------------------------------------------------
/core/utils/netvars/dt_recv.hpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NMan1/OverflowTF2/ffdbcc69510782e52abd1351f880bf26babee0f4/core/utils/netvars/dt_recv.hpp
--------------------------------------------------------------------------------
/core/utils/netvars/netvars.cpp:
--------------------------------------------------------------------------------
1 | #include "netvars.hpp"
2 | #include "..\..\interfaces\interfaces.hpp"
3 | #include "dt_recv.hpp"
4 |
5 | std::unique_ptr g_netvar;
6 |
7 | netvar::netvar()
8 | {
9 | const c_client_class* c_client_class = interfaces::client_dll->get_all_classes();
10 |
11 | while (c_client_class != nullptr)
12 | {
13 | const auto classInfo = std::make_shared(0);
14 | RecvTable* recvTable = c_client_class->rtTable;
15 |
16 | this->PopulateNodes(recvTable, &classInfo->nodes);
17 | nodes.emplace(recvTable->GetName(), classInfo);
18 |
19 | c_client_class = c_client_class->pNextClass;
20 | }
21 | }
22 |
23 | void netvar::PopulateNodes(RecvTable* recvTable, MapType* mapType)
24 | {
25 | for (auto i = 0; i < recvTable->GetNumProps(); i++)
26 | {
27 | const RecvProp* prop = recvTable->get_prop(i);
28 | const auto propInfo = std::make_shared(prop->get_offset());
29 |
30 | if (prop->GetType() == SendPropType::DPT_DataTable)
31 | this->PopulateNodes(prop->GetDataTable(), &propInfo->nodes);
32 |
33 | mapType->emplace(prop->GetName(), propInfo);
34 | }
35 | }
--------------------------------------------------------------------------------
/core/utils/netvars/netvars.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | class netvar
6 | {
7 | struct Node;
8 | using MapType = std::unordered_map>;
9 |
10 | struct Node
11 | {
12 | Node(int offset) : offset(offset) {}
13 | MapType nodes;
14 | int offset;
15 | };
16 |
17 | MapType nodes;
18 |
19 | public:
20 | netvar();
21 |
22 | private:
23 | void PopulateNodes(class RecvTable* recv_table, MapType* map);
24 | static int get_offset_recursive(MapType& map, int acc, const char* name)
25 | {
26 | return acc + map[name]->offset;
27 | }
28 | template
29 | int get_offset_recursive(MapType& map, int acc, const char* name, args_t ...args)
30 | {
31 | const auto& node = map[name];
32 | return this->get_offset_recursive(node->nodes, acc + node->offset, args...);
33 | }
34 |
35 | public:
36 | template
37 | int get_offset(const char* name, args_t ...args)
38 | {
39 | const auto& node = nodes[name];
40 | return this->get_offset_recursive(node->nodes, node->offset, args...);
41 | }
42 | }; extern std::unique_ptr g_netvar;
--------------------------------------------------------------------------------
/core/utils/settings/settings.cpp:
--------------------------------------------------------------------------------
1 | #include "settings.hpp"
2 | #include "..\color.hpp"
3 |
4 | namespace settings {
5 |
6 | bool visuals = true;
7 |
8 | bool team_visuals = false;
9 |
10 | bool box = true;
11 |
12 | color box_color = {255, 255, 255};
13 |
14 | bool health_bar = true;
15 |
16 | bool glow_players = false;
17 |
18 | bool skeleton = true;
19 |
20 | color skeleton_color = { 238, 130, 238 };
21 |
22 | bool snap_lines = false;
23 |
24 | color snap_lines_color = { 255, 255, 255 };
25 |
26 | bool direction_line = true;
27 |
28 | color direction_line_color = { 255, 255, 255 };
29 |
30 | bool health_text = true;
31 |
32 | bool class_name = true;
33 |
34 | color class_name_color = { 255, 255, 255 };
35 |
36 | bool buildings = true;
37 |
38 | color buildings_color = { 255, 0, 0 };
39 |
40 | bool glow_buildings = true;
41 |
42 | bool team_buildings = true;
43 |
44 | color team_buildings_color = { 0, 244, 0 };
45 |
46 | bool health_bar_buildings = true;
47 |
48 | bool pickups = false;
49 |
50 | bool health_pack_esp = true;
51 |
52 | color health_pack_esp_color = { 255, 255, 255 };
53 |
54 | bool ammo_box_esp = true;
55 |
56 | color ammo_box_esp_color = { 255, 255, 255 };
57 |
58 | bool chams = true;
59 |
60 | bool enemy_chams = false;
61 |
62 | color enemy_chams_color = { 255, 255, 255 };
63 |
64 | bool gold_arm = true;
65 |
66 | bool projectile_esp = false;
67 |
68 | color projectile_esp_color = { 111, 242, 253 };
69 |
70 | bool rocket_esp = false;
71 |
72 | bool arrow_esp = false;
73 |
74 | bool flare_esp = false;
75 |
76 | bool pipe_bomb_esp = false;
77 |
78 | bool visualize_backtrack = false;
79 |
80 | color visualize_backtrack_color = { 238, 130, 238 };
81 |
82 | // aimbot
83 |
84 | bool aimbot = true;
85 |
86 | int aimbot_key = 0x10; // VK_SHIFT
87 |
88 | int aimbot_bone = 1;
89 |
90 | int aimbot_fov = 5;
91 |
92 | float aimbot_smoothness = 0.0f;
93 |
94 | bool aimbot_proj = true;
95 |
96 | int aimbot_proj_fov = 30;
97 |
98 | float aimbot_proj_smoothness = 0;
99 |
100 | int aimbot_proj_launcher_bone = 0;
101 |
102 | bool triggerbot = false;
103 |
104 | int triggerbot_key = 0;
105 |
106 | int triggerbot_bone = 0;
107 |
108 | bool triggerbot_always_on = false;
109 |
110 | bool triggerbot_scoped_only = true;
111 |
112 | bool triggerbot_ignore_cloaked = true;
113 |
114 | bool legit_backtrack = true;
115 |
116 | // misc
117 |
118 | bool misc = true;
119 |
120 | bool bunny_hop = true;
121 |
122 | bool auto_backstab = false;
123 |
124 | // others
125 |
126 | bool spectator_list = true;
127 | }
--------------------------------------------------------------------------------
/core/utils/settings/settings.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class color;
4 |
5 | namespace settings {
6 |
7 | // visuals
8 |
9 | extern bool visuals;
10 |
11 | extern bool team_visuals;
12 |
13 | extern bool box;
14 |
15 | extern color box_color;
16 |
17 | extern bool health_bar;
18 |
19 | extern bool glow_players;
20 |
21 | extern bool skeleton;
22 |
23 | extern color skeleton_color;
24 |
25 | extern bool snap_lines;
26 |
27 | extern color snap_lines_color;
28 |
29 | extern bool direction_line;
30 |
31 | extern color direction_line_color;
32 |
33 | extern bool health_text;
34 |
35 | extern bool class_name;
36 |
37 | extern color class_name_color;
38 |
39 | extern bool buildings;
40 |
41 | extern color buildings_color;
42 |
43 | extern bool glow_buildings;
44 |
45 | extern bool team_buildings;
46 |
47 | extern color team_buildings_color;
48 |
49 | extern bool health_bar_buildings;
50 |
51 | extern bool pickups;
52 |
53 | extern bool health_pack_esp;
54 |
55 | extern color health_pack_esp_color;
56 |
57 | extern bool ammo_box_esp;
58 |
59 | extern color ammo_box_esp_color;
60 |
61 | extern bool chams;
62 |
63 | extern bool enemy_chams;
64 |
65 | extern color enemy_chams_color;
66 |
67 | extern bool gold_arm;
68 |
69 | extern bool projectile_esp;
70 |
71 | extern color projectile_esp_color;
72 |
73 | extern bool rocket_esp;
74 |
75 | extern bool arrow_esp;
76 |
77 | extern bool flare_esp;
78 |
79 | extern bool pipe_bomb_esp;
80 |
81 | extern bool visualize_backtrack;
82 |
83 | extern color visualize_backtrack_color;
84 |
85 | // aimbot
86 |
87 | extern bool aimbot;
88 |
89 | extern int aimbot_key;
90 |
91 | extern int aimbot_bone;
92 |
93 | extern int aimbot_fov;
94 |
95 | extern float aimbot_smoothness;
96 |
97 | extern float aimbot_smoothness;
98 |
99 | extern bool aimbot_proj;
100 |
101 | extern int aimbot_proj_fov;
102 |
103 | extern float aimbot_proj_smoothness;
104 |
105 | extern int aimbot_proj_launcher_bone;
106 |
107 | extern bool triggerbot;
108 |
109 | extern int triggerbot_key;
110 |
111 | extern int triggerbot_bone;
112 |
113 | extern bool triggerbot_always_on;
114 |
115 | extern bool triggerbot_scoped_only;
116 |
117 | extern bool triggerbot_ignore_cloaked;
118 |
119 | extern bool legit_backtrack;
120 |
121 | // misc
122 |
123 | extern bool misc;
124 |
125 | extern bool bunny_hop;
126 |
127 | extern bool auto_backstab;
128 |
129 | // others
130 |
131 | extern bool spectator_list;
132 | }
--------------------------------------------------------------------------------
/core/utils/utils.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | class vmatrix;
5 |
6 | namespace utils {
7 | template
8 | t get_vfunc(void* class_pointer, size_t index) {
9 | return (*(t**)class_pointer)[index];
10 | }
11 |
12 | static void log(const char* msg) {
13 | std::cout << msg << std::endl;
14 | }
15 |
16 | extern int screen_x, screen_y;
17 | extern vmatrix world_to_projection;
18 | extern void* tf2_window;
19 | }
--------------------------------------------------------------------------------