├── .editorconfig
├── .gitignore
├── CCHookReloaded.sln
├── CCHookReloaded
├── CCHookReloaded.vcxproj
├── CCHookReloaded.vcxproj.filters
├── ETSDK
│ ├── etmain
│ │ └── ui
│ │ │ ├── menudef.h
│ │ │ └── menumacros.h
│ └── src
│ │ ├── cgame
│ │ ├── cg_local.h
│ │ ├── cg_public.h
│ │ └── tr_types.h
│ │ ├── game
│ │ ├── bg_classes.h
│ │ ├── bg_local.h
│ │ ├── bg_misc.c
│ │ ├── bg_public.h
│ │ ├── botlib.h
│ │ ├── g_local.h
│ │ ├── g_public.h
│ │ ├── g_team.h
│ │ ├── q_math.c
│ │ ├── q_shared.c
│ │ ├── q_shared.h
│ │ └── surfaceflags.h
│ │ └── ui
│ │ ├── keycodes.h
│ │ ├── ui_local.h
│ │ ├── ui_public.h
│ │ ├── ui_shared.c
│ │ └── ui_shared.h
├── RetSpoof.asm
├── base64.c
├── base64.h
├── config.h
├── crc32.c
├── crc32.h
├── dllmain.cpp
├── engine.cpp
├── engine.h
├── etsdk.h
├── globals.h
├── obfuscation.h
├── offsets.h
├── pch.cpp
├── pch.h
├── sha1.c
├── sha1.h
├── shaders.h
├── tools.cpp
├── tools.h
├── ui.cpp
└── ui.h
├── CCInject
├── CCInject.cpp
├── CCInject.vcxproj
├── CCInject.vcxproj.filters
└── framework.h
├── LICENSE
├── README.md
└── cch.pk3
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # Top-most EditorConfig file
4 | root = true
5 |
6 | # Tab indentation
7 | [*]
8 | indent_style = tab
9 | indent_size = 4
10 | tab_width = 4
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # ASP.NET Scaffolding
66 | ScaffoldingReadMe.txt
67 |
68 | # StyleCop
69 | StyleCopReport.xml
70 |
71 | # Files built by Visual Studio
72 | *_i.c
73 | *_p.c
74 | *_h.h
75 | *.ilk
76 | *.meta
77 | *.obj
78 | *.iobj
79 | *.pch
80 | *.pdb
81 | *.ipdb
82 | *.pgc
83 | *.pgd
84 | *.rsp
85 | *.sbr
86 | *.tlb
87 | *.tli
88 | *.tlh
89 | *.tmp
90 | *.tmp_proj
91 | *_wpftmp.csproj
92 | *.log
93 | *.tlog
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
298 | *.vbp
299 |
300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
301 | *.dsw
302 | *.dsp
303 |
304 | # Visual Studio 6 technical files
305 | *.ncb
306 | *.aps
307 |
308 | # Visual Studio LightSwitch build output
309 | **/*.HTMLClient/GeneratedArtifacts
310 | **/*.DesktopClient/GeneratedArtifacts
311 | **/*.DesktopClient/ModelManifest.xml
312 | **/*.Server/GeneratedArtifacts
313 | **/*.Server/ModelManifest.xml
314 | _Pvt_Extensions
315 |
316 | # Paket dependency manager
317 | .paket/paket.exe
318 | paket-files/
319 |
320 | # FAKE - F# Make
321 | .fake/
322 |
323 | # CodeRush personal settings
324 | .cr/personal
325 |
326 | # Python Tools for Visual Studio (PTVS)
327 | __pycache__/
328 | *.pyc
329 |
330 | # Cake - Uncomment if you are using it
331 | # tools/**
332 | # !tools/packages.config
333 |
334 | # Tabs Studio
335 | *.tss
336 |
337 | # Telerik's JustMock configuration file
338 | *.jmconfig
339 |
340 | # BizTalk build output
341 | *.btp.cs
342 | *.btm.cs
343 | *.odx.cs
344 | *.xsd.cs
345 |
346 | # OpenCover UI analysis results
347 | OpenCover/
348 |
349 | # Azure Stream Analytics local run output
350 | ASALocalRun/
351 |
352 | # MSBuild Binary and Structured Log
353 | *.binlog
354 |
355 | # NVidia Nsight GPU debugger configuration file
356 | *.nvuser
357 |
358 | # MFractors (Xamarin productivity tool) working folder
359 | .mfractor/
360 |
361 | # Local History for Visual Studio
362 | .localhistory/
363 |
364 | # Visual Studio History (VSHistory) files
365 | .vshistory/
366 |
367 | # BeatPulse healthcheck temp database
368 | healthchecksdb
369 |
370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
371 | MigrationBackup/
372 |
373 | # Ionide (cross platform F# VS Code tools) working folder
374 | .ionide/
375 |
376 | # Fody - auto-generated XML schema
377 | FodyWeavers.xsd
378 |
379 | # VS Code files for those working on multiple tools
380 | .vscode/*
381 | !.vscode/settings.json
382 | !.vscode/tasks.json
383 | !.vscode/launch.json
384 | !.vscode/extensions.json
385 | *.code-workspace
386 |
387 | # Local History for Visual Studio Code
388 | .history/
389 |
390 | # Windows Installer files from build outputs
391 | *.cab
392 | *.msi
393 | *.msix
394 | *.msm
395 | *.msp
396 |
397 | # JetBrains Rider
398 | *.sln.iml
--------------------------------------------------------------------------------
/CCHookReloaded.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.1585
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CCInject", "CCInject\CCInject.vcxproj", "{489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {B1135B08-8BCB-4254-A3BF-274E41E49725} = {B1135B08-8BCB-4254-A3BF-274E41E49725}
9 | EndProjectSection
10 | EndProject
11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CCHookReloaded", "CCHookReloaded\CCHookReloaded.vcxproj", "{B1135B08-8BCB-4254-A3BF-274E41E49725}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|x64 = Debug|x64
16 | Debug|x86 = Debug|x86
17 | Release|x64 = Release|x64
18 | Release|x86 = Release|x86
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Debug|x64.ActiveCfg = Debug|x64
22 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Debug|x64.Build.0 = Debug|x64
23 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Debug|x86.ActiveCfg = Debug|Win32
24 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Debug|x86.Build.0 = Debug|Win32
25 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Release|x64.ActiveCfg = Release|x64
26 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Release|x64.Build.0 = Release|x64
27 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Release|x86.ActiveCfg = Release|Win32
28 | {B1135B08-8BCB-4254-A3BF-274E41E49725}.Release|x86.Build.0 = Release|Win32
29 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Debug|x64.ActiveCfg = Debug|x64
30 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Debug|x64.Build.0 = Debug|x64
31 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Debug|x86.ActiveCfg = Debug|Win32
32 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Debug|x86.Build.0 = Debug|Win32
33 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Release|x64.ActiveCfg = Release|x64
34 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Release|x64.Build.0 = Release|x64
35 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Release|x86.ActiveCfg = Release|Win32
36 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}.Release|x86.Build.0 = Release|Win32
37 | EndGlobalSection
38 | GlobalSection(SolutionProperties) = preSolution
39 | HideSolutionNode = FALSE
40 | EndGlobalSection
41 | GlobalSection(ExtensibilityGlobals) = postSolution
42 | SolutionGuid = {CBE0FAAC-A8AE-4F5A-AE9D-5BAC8D4784AF}
43 | EndGlobalSection
44 | EndGlobal
45 |
--------------------------------------------------------------------------------
/CCHookReloaded/CCHookReloaded.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 | 15.0
23 | {B1135B08-8BCB-4254-A3BF-274E41E49725}
24 | Win32Proj
25 | CCHookReloaded
26 | 10.0
27 |
28 |
29 |
30 | DynamicLibrary
31 | true
32 | v143
33 | Unicode
34 |
35 |
36 | DynamicLibrary
37 | false
38 | v143
39 | true
40 | Unicode
41 |
42 |
43 | DynamicLibrary
44 | true
45 | v143
46 | Unicode
47 |
48 |
49 | DynamicLibrary
50 | false
51 | v143
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 |
75 | true
76 |
77 |
78 | true
79 |
80 |
81 | false
82 |
83 |
84 | false
85 |
86 |
87 |
88 | Use
89 | Level4
90 | Disabled
91 | true
92 | WIN32;_DEBUG;CCHOOKRELOADED_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);ETSDK_NO_STRINGDATA
93 | true
94 | pch.h
95 | stdcpp17
96 | 4706
97 | true
98 | MultiThreadedDebug
99 |
100 |
101 | Windows
102 | true
103 | false
104 | false
105 | Ws2_32.lib;%(AdditionalDependencies)
106 |
107 |
108 |
109 |
110 | Use
111 | Level4
112 | Disabled
113 | true
114 | _DEBUG;CCHOOKRELOADED_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);ETSDK_NO_STRINGDATA
115 | true
116 | pch.h
117 | stdcpp17
118 | 4706
119 | true
120 | MultiThreadedDebug
121 |
122 |
123 | Windows
124 | true
125 | false
126 | false
127 | Ws2_32.lib;%(AdditionalDependencies)
128 |
129 |
130 |
131 |
132 | Use
133 | Level4
134 | MaxSpeed
135 | true
136 | true
137 | true
138 | WIN32;NDEBUG;CCHOOKRELOADED_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);ETSDK_NO_STRINGDATA
139 | true
140 | pch.h
141 | stdcpp17
142 | None
143 | 4706
144 | true
145 | MultiThreaded
146 |
147 |
148 | Windows
149 | true
150 | true
151 | false
152 | false
153 | false
154 | Ws2_32.lib;%(AdditionalDependencies)
155 | /nocoffgrpinfo %(AdditionalOptions)
156 |
157 |
158 |
159 |
160 | Use
161 | Level4
162 | MaxSpeed
163 | true
164 | true
165 | true
166 | NDEBUG;CCHOOKRELOADED_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);ETSDK_NO_STRINGDATA
167 | true
168 | pch.h
169 | stdcpp17
170 | None
171 | 4706
172 | true
173 | MultiThreaded
174 |
175 |
176 | Windows
177 | true
178 | true
179 | false
180 | false
181 | false
182 | Ws2_32.lib;%(AdditionalDependencies)
183 | /nocoffgrpinfo %(AdditionalOptions)
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 | NotUsing
222 | NotUsing
223 | NotUsing
224 | NotUsing
225 |
226 |
227 | NotUsing
228 | NotUsing
229 | NotUsing
230 | NotUsing
231 |
232 |
233 |
234 |
235 | NotUsing
236 | NotUsing
237 | NotUsing
238 | NotUsing
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 | NotUsing
250 | NotUsing
251 | NotUsing
252 | NotUsing
253 |
254 |
255 | NotUsing
256 | NotUsing
257 | NotUsing
258 | NotUsing
259 |
260 |
261 | NotUsing
262 | NotUsing
263 | NotUsing
264 | NotUsing
265 |
266 |
267 | Create
268 | Create
269 | Create
270 | Create
271 |
272 |
273 | NotUsing
274 | NotUsing
275 | NotUsing
276 | NotUsing
277 |
278 |
279 |
280 |
281 |
282 |
283 | Document
284 |
285 |
286 |
287 |
288 |
289 |
290 |
--------------------------------------------------------------------------------
/CCHookReloaded/CCHookReloaded.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;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 | {14031345-f634-41af-8c8a-26f9f93566ae}
18 |
19 |
20 | {f0450cf4-6e4b-4bb1-9e77-2f7e4b4b72e7}
21 |
22 |
23 | {947a716b-cfd6-4e3f-b84a-86eb74cb5a22}
24 |
25 |
26 | {c5bf5577-acc4-4df6-8bf2-81f3a23c05bb}
27 |
28 |
29 | {644541cc-b4f1-424a-a87f-041001350fda}
30 |
31 |
32 | {266c236a-eeb4-46bd-a59e-f37ce2f1aaec}
33 |
34 |
35 | {e2ac145a-be96-4b4c-bf5c-b585d6ed37b9}
36 |
37 |
38 | {7e5c2582-72a4-408f-ae5f-02f7b84d8912}
39 |
40 |
41 | {60dfcf17-ea20-44fe-8fbd-7d6186fada8d}
42 |
43 |
44 | {663c1727-5ae1-4b49-8719-a7aec0688ddb}
45 |
46 |
47 | {7bd185d3-6f71-4d8b-9bcf-7ab06df9f385}
48 |
49 |
50 |
51 |
52 | Header Files
53 |
54 |
55 | Header Files\ETSDK\etmain\ui
56 |
57 |
58 | Header Files\ETSDK\etmain\ui
59 |
60 |
61 | Header Files\ETSDK\src\cgame
62 |
63 |
64 | Header Files\ETSDK\src\cgame
65 |
66 |
67 | Header Files\ETSDK\src\cgame
68 |
69 |
70 | Header Files\ETSDK\src\game
71 |
72 |
73 | Header Files\ETSDK\src\game
74 |
75 |
76 | Header Files\ETSDK\src\game
77 |
78 |
79 | Header Files\ETSDK\src\game
80 |
81 |
82 | Header Files\ETSDK\src\game
83 |
84 |
85 | Header Files\ETSDK\src\game
86 |
87 |
88 | Header Files\ETSDK\src\game
89 |
90 |
91 | Header Files\ETSDK\src\game
92 |
93 |
94 | Header Files\ETSDK\src\game
95 |
96 |
97 | Header Files\ETSDK\src\ui
98 |
99 |
100 | Header Files\ETSDK\src\ui
101 |
102 |
103 | Header Files\ETSDK\src\ui
104 |
105 |
106 | Header Files\ETSDK\src\ui
107 |
108 |
109 | Header Files\Crypto
110 |
111 |
112 | Header Files\Crypto
113 |
114 |
115 | Header Files\Crypto
116 |
117 |
118 | Header Files
119 |
120 |
121 | Header Files
122 |
123 |
124 | Header Files
125 |
126 |
127 | Header Files
128 |
129 |
130 | Header Files
131 |
132 |
133 | Header Files
134 |
135 |
136 | Header Files
137 |
138 |
139 | Header Files
140 |
141 |
142 | Header Files
143 |
144 |
145 |
146 |
147 | Source Files
148 |
149 |
150 | Source Files
151 |
152 |
153 | Source Files\ETSDK
154 |
155 |
156 | Source Files\ETSDK
157 |
158 |
159 | Source Files\ETSDK
160 |
161 |
162 | Source Files\ETSDK
163 |
164 |
165 | Source Files\Crypto
166 |
167 |
168 | Source Files\Crypto
169 |
170 |
171 | Source Files\Crypto
172 |
173 |
174 | Source Files
175 |
176 |
177 | Source Files
178 |
179 |
180 | Source Files
181 |
182 |
183 |
184 |
185 | Source Files\Assembly
186 |
187 |
188 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/etmain/ui/menudef.h:
--------------------------------------------------------------------------------
1 | #define ITEM_TYPE_TEXT 0 // simple text
2 | #define ITEM_TYPE_BUTTON 1 // button, basically text with a border
3 | #define ITEM_TYPE_RADIOBUTTON 2 // toggle button, may be grouped
4 | #define ITEM_TYPE_CHECKBOX 3 // check box
5 | #define ITEM_TYPE_EDITFIELD 4 // editable text, associated with a cvar
6 | #define ITEM_TYPE_COMBO 5 // drop down list
7 | #define ITEM_TYPE_LISTBOX 6 // scrollable list
8 | #define ITEM_TYPE_MODEL 7 // model
9 | #define ITEM_TYPE_OWNERDRAW 8 // owner draw, name specs what it is
10 | #define ITEM_TYPE_NUMERICFIELD 9 // editable text, associated with a cvar
11 | #define ITEM_TYPE_SLIDER 10 // mouse speed, volume, etc.
12 | #define ITEM_TYPE_YESNO 11 // yes no cvar setting
13 | #define ITEM_TYPE_MULTI 12 // multiple list setting, enumerated
14 | #define ITEM_TYPE_BIND 13 // multiple list setting, enumerated
15 | #define ITEM_TYPE_MENUMODEL 14 // special menu model
16 | #define ITEM_TYPE_TIMEOUT_COUNTER 15 // ydnar
17 | #define ITEM_TYPE_TRICHECKBOX 16 // tri-state check box
18 |
19 | #define ITEM_ALIGN_LEFT 0 // left alignment
20 | #define ITEM_ALIGN_CENTER 1 // center alignment
21 | #define ITEM_ALIGN_RIGHT 2 // right alignment
22 | #define ITEM_ALIGN_CENTER2 3 // center alignment
23 |
24 | #define ITEM_TEXTSTYLE_NORMAL 0 // normal text
25 | #define ITEM_TEXTSTYLE_BLINK 1 // fast blinking
26 | #define ITEM_TEXTSTYLE_PULSE 2 // slow pulsing
27 | #define ITEM_TEXTSTYLE_SHADOWED 3 // drop shadow ( need a color for this )
28 | #define ITEM_TEXTSTYLE_OUTLINED 4 // drop shadow ( need a color for this )
29 | #define ITEM_TEXTSTYLE_OUTLINESHADOWED 5 // drop shadow ( need a color for this )
30 | #define ITEM_TEXTSTYLE_SHADOWEDMORE 6 // drop shadow ( need a color for this )
31 |
32 | #define WINDOW_BORDER_NONE 0 // no border
33 | #define WINDOW_BORDER_FULL 1 // full border based on border color ( single pixel )
34 | #define WINDOW_BORDER_HORZ 2 // horizontal borders only
35 | #define WINDOW_BORDER_VERT 3 // vertical borders only
36 | #define WINDOW_BORDER_KCGRADIENT 4 // horizontal border using the gradient bars
37 |
38 | #define WINDOW_STYLE_EMPTY 0 // no background
39 | #define WINDOW_STYLE_FILLED 1 // filled with background color
40 | #define WINDOW_STYLE_GRADIENT 2 // gradient bar based on background color
41 | #define WINDOW_STYLE_SHADER 3 // gradient bar based on background color
42 | #define WINDOW_STYLE_TEAMCOLOR 4 // team color
43 | #define WINDOW_STYLE_CINEMATIC 5 // cinematic
44 |
45 | #define MENU_TRUE 1 // uh.. true
46 | #define MENU_FALSE 0 // and false
47 |
48 | #define HUD_VERTICAL 0x00
49 | #define HUD_HORIZONTAL 0x01
50 |
51 | #define RANGETYPE_ABSOLUTE 0
52 | #define RANGETYPE_RELATIVE 1
53 |
54 | // list box element types
55 | #define LISTBOX_TEXT 0x00
56 | #define LISTBOX_IMAGE 0x01
57 |
58 | // list feeders
59 | #define FEEDER_HEADS 0x00 // model heads
60 | #define FEEDER_MAPS 0x01 // text maps based on game type
61 | #define FEEDER_SERVERS 0x02 // servers
62 | #define FEEDER_CLANS 0x03 // clan names
63 | #define FEEDER_ALLMAPS 0x04 // all maps available, in graphic format
64 | #define FEEDER_REDTEAM_LIST 0x05 // red team members
65 | #define FEEDER_BLUETEAM_LIST 0x06 // blue team members
66 | #define FEEDER_PLAYER_LIST 0x07 // players
67 | #define FEEDER_TEAM_LIST 0x08 // team members for team voting
68 | #define FEEDER_MODS 0x09 // team members for team voting
69 | #define FEEDER_DEMOS 0x0a // team members for team voting
70 | #define FEEDER_SCOREBOARD 0x0b // team members for team voting
71 | #define FEEDER_Q3HEADS 0x0c // model heads
72 | #define FEEDER_SERVERSTATUS 0x0d // server status
73 | #define FEEDER_FINDPLAYER 0x0e // find player
74 | #define FEEDER_CINEMATICS 0x0f // cinematics
75 | #define FEEDER_SAVEGAMES 0x10 // savegames
76 | #define FEEDER_CAMPAIGNS 0x1a // Arnout: all unlocked campaigns available
77 | #define FEEDER_ALLCAMPAIGNS 0x1b // Arnout: all campaigns available
78 | #define FEEDER_PROFILES 0x1c // Arnout: profiles
79 | #define FEEDER_GLINFO 0x1d // Arnout: glinfo
80 |
81 | // display flags
82 | #define CG_SHOW_BLUE_TEAM_HAS_REDFLAG 0x00000001
83 | #define CG_SHOW_RED_TEAM_HAS_BLUEFLAG 0x00000002
84 | #define CG_SHOW_ANYTEAMGAME 0x00000004
85 | #define CG_SHOW_HARVESTER 0x00000008
86 | #define CG_SHOW_ONEFLAG 0x00000010
87 | #define CG_SHOW_CTF 0x00000020
88 | #define CG_SHOW_OBELISK 0x00000040
89 | #define CG_SHOW_HEALTHCRITICAL 0x00000080
90 | #define CG_SHOW_SINGLEPLAYER 0x00000100
91 | #define CG_SHOW_TOURNAMENT 0x00000200
92 | #define CG_SHOW_DURINGINCOMINGVOICE 0x00000400
93 | #define CG_SHOW_IF_PLAYER_HAS_FLAG 0x00000800
94 | #define CG_SHOW_LANPLAYONLY 0x00001000
95 | #define CG_SHOW_MINED 0x00002000
96 | #define CG_SHOW_HEALTHOK 0x00004000
97 | #define CG_SHOW_TEAMINFO 0x00008000
98 | #define CG_SHOW_NOTEAMINFO 0x00010000
99 | #define CG_SHOW_OTHERTEAMHASFLAG 0x00020000
100 | #define CG_SHOW_YOURTEAMHASENEMYFLAG 0x00040000
101 | #define CG_SHOW_ANYNONTEAMGAME 0x00080000
102 | //(SA)
103 | #define CG_SHOW_HIGHLIGHTED 0x00100000
104 |
105 | #define CG_SHOW_NOT_V_BINOC 0x00400000 //----(SA) added // hide on binoc huds
106 | #define CG_SHOW_NOT_V_SNOOPER 0x00800000 //----(SA) added // hide on snooper huds
107 | #define CG_SHOW_NOT_V_FGSCOPE 0x01000000 //----(SA) added // hide on fg42 scope huds
108 | #define CG_SHOW_NOT_V_CLEAR 0x02000000 //----(SA) added // hide on normal, full-view huds
109 | #define CG_SHOW_NOT_V_GARANDSCOPE 0x04000000 // Arnout: hide on garand scope huds
110 | #define CG_SHOW_NOT_V_K43SCOPE 0x08000000 // Arnout: hide on k43 scope huds
111 |
112 | #define CG_SHOW_2DONLY 0x10000000
113 |
114 |
115 | #define UI_SHOW_LEADER 0x00000001
116 | #define UI_SHOW_NOTLEADER 0x00000002
117 | #define UI_SHOW_FAVORITESERVERS 0x00000004
118 | #define UI_SHOW_ANYNONTEAMGAME 0x00000008
119 | #define UI_SHOW_ANYTEAMGAME 0x00000010
120 | #define UI_SHOW_NEWHIGHSCORE 0x00000020
121 | #define UI_SHOW_DEMOAVAILABLE 0x00000040
122 | #define UI_SHOW_NEWBESTTIME 0x00000080
123 | #define UI_SHOW_FFA 0x00000100
124 | #define UI_SHOW_NOTFFA 0x00000200
125 | #define UI_SHOW_NETANYNONTEAMGAME 0x00000400
126 | #define UI_SHOW_NETANYTEAMGAME 0x00000800
127 | #define UI_SHOW_NOTFAVORITESERVERS 0x00001000
128 |
129 | #define UI_SHOW_CAMPAIGNMAP1EXISTS 0x00002000
130 | #define UI_SHOW_CAMPAIGNMAP2EXISTS 0x00004000
131 | #define UI_SHOW_CAMPAIGNMAP3EXISTS 0x00008000
132 | #define UI_SHOW_CAMPAIGNMAP4EXISTS 0x00010000
133 | #define UI_SHOW_CAMPAIGNMAP5EXISTS 0x00020000
134 | #define UI_SHOW_CAMPAIGNMAP6EXISTS 0x00040000
135 |
136 | #define UI_SHOW_SELECTEDCAMPAIGNMAPPLAYABLE 0x00080000
137 | #define UI_SHOW_SELECTEDCAMPAIGNMAPNOTPLAYABLE 0x00100000
138 |
139 | #define UI_SHOW_PLAYERMUTED 0x01000000
140 | #define UI_SHOW_PLAYERNOTMUTED 0x02000000
141 | #define UI_SHOW_PLAYERNOREFEREE 0x04000000
142 | #define UI_SHOW_PLAYERREFEREE 0x08000000
143 |
144 | // owner draw types
145 | // ideally these should be done outside of this file but
146 | // this makes it much easier for the macro expansion to
147 | // convert them for the designers ( from the .menu files )
148 | #define CG_OWNERDRAW_BASE 1
149 | #define CG_PLAYER_ARMOR_ICON 1
150 | #define CG_PLAYER_ARMOR_VALUE 2
151 | #define CG_PLAYER_HEAD 3
152 | #define CG_PLAYER_HEALTH 4
153 | #define CG_PLAYER_AMMO_ICON 5
154 | #define CG_PLAYER_AMMO_VALUE 6
155 | #define CG_SELECTEDPLAYER_HEAD 7
156 | #define CG_SELECTEDPLAYER_NAME 8
157 | #define CG_SELECTEDPLAYER_STATUS 10
158 | #define CG_SELECTEDPLAYER_WEAPON 11
159 | #define CG_SELECTEDPLAYER_POWERUP 12
160 |
161 | #define CG_FLAGCARRIER_HEAD 13
162 | #define CG_FLAGCARRIER_NAME 14
163 | #define CG_FLAGCARRIER_LOCATION 15
164 | #define CG_FLAGCARRIER_STATUS 16
165 | #define CG_FLAGCARRIER_WEAPON 17
166 | #define CG_FLAGCARRIER_POWERUP 18
167 |
168 | #define CG_PLAYER_ITEM 19
169 | #define CG_PLAYER_SCORE 20
170 |
171 | /*#define CG_BLUE_FLAGHEAD 21
172 | #define CG_BLUE_FLAGSTATUS 22
173 | #define CG_BLUE_FLAGNAME 23
174 | #define CG_RED_FLAGHEAD 24
175 | #define CG_RED_FLAGSTATUS 25
176 | #define CG_RED_FLAGNAME 26*/
177 |
178 | #define CG_BLUE_SCORE 27
179 | #define CG_RED_SCORE 28
180 | /*#define CG_RED_NAME 29
181 | #define CG_BLUE_NAME 30
182 | #define CG_HARVESTER_SKULLS 31 // only shows in harvester
183 | #define CG_ONEFLAG_STATUS 32 // only shows in one flag*/
184 | #define CG_TEAM_COLOR 34
185 | //#define CG_CTF_POWERUP 35
186 |
187 | #define CG_AREA_POWERUP 36
188 | #define CG_AREA_LAGOMETER 37 // painted with old system
189 | #define CG_PLAYER_HASFLAG 38
190 | #define CG_GAME_TYPE 39 // not done
191 |
192 | #define CG_SELECTEDPLAYER_HEALTH 41
193 | #define CG_PLAYER_STATUS 42
194 | #define CG_FRAGGED_MSG 43 // painted with old system
195 | #define CG_PROXMINED_MSG 44 // painted with old system
196 | #define CG_AREA_FPSINFO 45 // painted with old system
197 | #define CG_AREA_SYSTEMCHAT 46 // painted with old system
198 | #define CG_AREA_TEAMCHAT 47 // painted with old system
199 | #define CG_AREA_CHAT 48 // painted with old system
200 | #define CG_GAME_STATUS 49
201 | #define CG_KILLER 50
202 | #define CG_PLAYER_ARMOR_ICON2D 51
203 | #define CG_PLAYER_AMMO_ICON2D 52
204 | #define CG_ACCURACY 53
205 | #define CG_ASSISTS 54
206 | #define CG_DEFEND 55
207 | #define CG_EXCELLENT 56
208 | #define CG_IMPRESSIVE 57
209 | #define CG_PERFECT 58
210 | #define CG_GAUNTLET 59
211 | #define CG_SPECTATORS 60
212 | #define CG_TEAMINFO 61
213 | #define CG_VOICE_HEAD 62
214 | #define CG_VOICE_NAME 63
215 | #define CG_PLAYER_HASFLAG2D 64
216 | #define CG_HARVESTER_SKULLS2D 65 // only shows in harvester
217 | #define CG_CAPFRAGLIMIT 66
218 | #define CG_1STPLACE 67
219 | #define CG_2NDPLACE 68
220 | #define CG_CAPTURES 69
221 |
222 | // (SA) adding
223 | #define CG_PLAYER_AMMOCLIP_VALUE 70
224 | #define CG_PLAYER_WEAPON_ICON2D 71
225 | #define CG_CURSORHINT 72
226 | #define CG_STAMINA 73
227 | #define CG_PLAYER_WEAPON_HEAT 74
228 | #define CG_PLAYER_POWERUP 75
229 | #define CG_PLAYER_INVENTORY 77
230 | #define CG_AREA_WEAPON 78 // draw weapons here
231 | #define CG_AREA_HOLDABLE 79
232 | #define CG_CURSORHINT_STATUS 80 // like 'health' bar when pointing at a func_explosive
233 | #define CG_PLAYER_WEAPON_STABILITY 81 // shows aimSpreadScale value
234 | #define CG_PLAYER_WEAPON_RECHARGE 82 // DHM - Nerve :: For various multiplayer weapons that have recharge times
235 |
236 | #define UI_OWNERDRAW_BASE 200
237 | #define UI_HANDICAP 200
238 | #define UI_EFFECTS 201
239 | #define UI_PLAYERMODEL 202
240 | #define UI_CLANNAME 203
241 | #define UI_CLANLOGO 204
242 | #define UI_GAMETYPE 205
243 | #define UI_MAPPREVIEW 206
244 | #define UI_NETMAPPREVIEW 207
245 | #define UI_BLUETEAMNAME 208
246 | #define UI_REDTEAMNAME 209
247 | #define UI_BLUETEAM1 210
248 | #define UI_BLUETEAM2 211
249 | #define UI_BLUETEAM3 212
250 | #define UI_BLUETEAM4 213
251 | #define UI_BLUETEAM5 214
252 | #define UI_REDTEAM1 215
253 | #define UI_REDTEAM2 216
254 | #define UI_REDTEAM3 217
255 | #define UI_REDTEAM4 218
256 | #define UI_REDTEAM5 219
257 | #define UI_NETSOURCE 220
258 | //#define UI_NETMAPPREVIEW 221
259 | #define UI_NETFILTER 222
260 | #define UI_TIER 223
261 | #define UI_OPPONENTMODEL 224
262 | #define UI_TIERMAP1 225
263 | #define UI_TIERMAP2 226
264 | #define UI_TIERMAP3 227
265 | #define UI_PLAYERLOGO 228
266 | #define UI_OPPONENTLOGO 229
267 | #define UI_PLAYERLOGO_METAL 230
268 | #define UI_OPPONENTLOGO_METAL 231
269 | #define UI_PLAYERLOGO_NAME 232
270 | #define UI_OPPONENTLOGO_NAME 233
271 | #define UI_TIER_MAPNAME 234
272 | #define UI_TIER_GAMETYPE 235
273 | #define UI_ALLMAPS_SELECTION 236
274 | #define UI_OPPONENT_NAME 237
275 | #define UI_VOTE_KICK 238
276 | #define UI_BOTNAME 239
277 | //#define UI_BOTSKILL 240
278 | #define UI_REDBLUE 241
279 | #define UI_CROSSHAIR 242
280 | #define UI_SELECTEDPLAYER 243
281 | #define UI_MAPCINEMATIC 244
282 | #define UI_NETGAMETYPE 245
283 | #define UI_NETMAPCINEMATIC 246
284 | #define UI_SERVERREFRESHDATE 247
285 | #define UI_SERVERMOTD 248
286 | #define UI_KEYBINDSTATUS 250
287 | #define UI_CLANCINEMATIC 251
288 | #define UI_MAP_TIMETOBEAT 252
289 | #define UI_JOINGAMETYPE 253
290 | #define UI_PREVIEWCINEMATIC 254
291 | #define UI_STARTMAPCINEMATIC 255
292 | #define UI_MAPS_SELECTION 256
293 | #define UI_LOADPANEL 257
294 |
295 | //----(SA) added
296 | #define UI_MENUMODEL 257
297 | #define UI_SAVEGAME_SHOT 258
298 | //----(SA) end
299 |
300 | // NERVE - SMF
301 | #define UI_LIMBOCHAT 259
302 | // -NERVE - SMF
303 |
304 | // Arnout: Enemy Territory
305 | #define UI_CAMPAIGNCINEMATIC 260
306 | #define UI_CAMPAIGNNAME 261
307 | #define UI_CAMPAIGNDESCRIPTION 262
308 | #define UI_CAMPAIGNMAP1_SHOT 263
309 | #define UI_CAMPAIGNMAP2_SHOT 264
310 | #define UI_CAMPAIGNMAP3_SHOT 265
311 | #define UI_CAMPAIGNMAP4_SHOT 266
312 | #define UI_CAMPAIGNMAP5_SHOT 267
313 | #define UI_CAMPAIGNMAP6_SHOT 268
314 |
315 | #define UI_CAMPAIGNMAP1_TEXT 269
316 | #define UI_CAMPAIGNMAP2_TEXT 270
317 | #define UI_CAMPAIGNMAP3_TEXT 271
318 | #define UI_CAMPAIGNMAP4_TEXT 272
319 | #define UI_CAMPAIGNMAP5_TEXT 273
320 | #define UI_CAMPAIGNMAP6_TEXT 274
321 |
322 | #define UI_GAMETYPEDESCRIPTION 280
323 |
324 | // Gordon: Mission briefing
325 | #define UI_MB_MAP 300
326 | #define UI_MB_TITLE 301
327 | #define UI_MB_OBJECTIVES 302
328 |
329 | #define VOICECHAT_GETFLAG "getflag" // command someone to get the flag
330 | #define VOICECHAT_OFFENSE "offense" // command someone to go on offense
331 | #define VOICECHAT_DEFEND "defend" // command someone to go on defense
332 | #define VOICECHAT_DEFENDFLAG "defendflag" // command someone to defend the flag
333 | #define VOICECHAT_PATROL "patrol" // command someone to go on patrol (roam)
334 | #define VOICECHAT_CAMP "camp" // command someone to camp (we don't have sounds for this one)
335 | #define VOICECHAT_FOLLOWME "followme" // command someone to follow you
336 | #define VOICECHAT_RETURNFLAG "returnflag" // command someone to return our flag
337 | #define VOICECHAT_FOLLOWFLAGCARRIER "followflagcarrier" // command someone to follow the flag carrier
338 | #define VOICECHAT_YES "yes" // yes, affirmative, etc.
339 | #define VOICECHAT_NO "no" // no, negative, etc.
340 | #define VOICECHAT_ONGETFLAG "ongetflag" // I'm getting the flag
341 | #define VOICECHAT_ONOFFENSE "onoffense" // I'm on offense
342 | #define VOICECHAT_ONDEFENSE "ondefense" // I'm on defense
343 | #define VOICECHAT_ONPATROL "onpatrol" // I'm on patrol (roaming)
344 | #define VOICECHAT_ONCAMPING "oncamp" // I'm camping somewhere
345 | #define VOICECHAT_ONFOLLOW "onfollow" // I'm following
346 | #define VOICECHAT_ONFOLLOWCARRIER "onfollowcarrier" // I'm following the flag carrier
347 | #define VOICECHAT_ONRETURNFLAG "onreturnflag" // I'm returning our flag
348 | #define VOICECHAT_INPOSITION "inposition" // I'm in position
349 | #define VOICECHAT_IHAVEFLAG "ihaveflag" // I have the flag
350 | #define VOICECHAT_BASEATTACK "baseattack" // the base is under attack
351 | #define VOICECHAT_ENEMYHASFLAG "enemyhasflag" // the enemy has our flag (CTF)
352 | #define VOICECHAT_STARTLEADER "startleader" // I'm the leader
353 | #define VOICECHAT_STOPLEADER "stopleader" // I resign leadership
354 | #define VOICECHAT_WHOISLEADER "whoisleader" // who is the team leader
355 | #define VOICECHAT_WANTONDEFENSE "wantondefense" // I want to be on defense
356 | #define VOICECHAT_WANTONOFFENSE "wantonoffense" // I want to be on offense
357 | #define VOICECHAT_KILLINSULT "kill_insult" // I just killed you
358 | #define VOICECHAT_TAUNT "taunt" // I want to taunt you
359 | #define VOICECHAT_DEATHINSULT "death_insult" // you just killed me
360 | #define VOICECHAT_KILLGAUNTLET "kill_gauntlet" // I just killed you with the gauntlet
361 | #define VOICECHAT_PRAISE "praise" // you did something good
362 |
363 | // NERVE - SMF - wolf multiplayer class/item selection mechanism
364 | #define WM_START_SELECT 0
365 |
366 | #define WM_SELECT_TEAM 1
367 | #define WM_SELECT_CLASS 2
368 | #define WM_SELECT_WEAPON 3
369 | #define WM_SELECT_PISTOL 4
370 | #define WM_SELECT_GRENADE 5
371 | #define WM_SELECT_ITEM1 6
372 |
373 | #define WM_AXIS 1
374 | #define WM_ALLIES 2
375 | #define WM_SPECTATOR 3
376 |
377 | #define WM_SOLDIER 1
378 | #define WM_MEDIC 2
379 | #define WM_LIEUTENANT 3
380 | #define WM_ENGINEER 4
381 | #define WM_COVERTOPS 5
382 |
383 | /*#define WM_PISTOL_1911 1
384 | #define WM_PISTOL_LUGER 2
385 |
386 | #define WM_WEAPON_MP40 3
387 | #define WM_WEAPON_THOMPSON 4
388 | #define WM_WEAPON_STEN 5
389 | #define WM_WEAPON_MAUSER 6
390 | #define WM_WEAPON_PANZERFAUST 8
391 | #define WM_WEAPON_VENOM 9
392 | #define WM_WEAPON_FLAMETHROWER 10
393 |
394 | #define WM_PINEAPPLE_GRENADE 11
395 | #define WM_STICK_GRENADE 12
396 |
397 | #define WM_WEAPON_KAR98 13
398 | #define WM_WEAPON_CARBINE 14
399 | #define WM_WEAPON_GARAND 15
400 | #define WM_WEAPON_FG42 16*/
401 | // -NERVE - SMF
402 |
403 | // Arnout: UI fonts, supports up to 6 fonts
404 | #define UI_FONT_ARIBLK_16 0
405 | #define UI_FONT_ARIBLK_27 1
406 | #define UI_FONT_COURBD_21 2
407 | #define UI_FONT_COURBD_30 3
408 |
409 | // OSP - callvote server setting toggles
410 | // CS_SERVERTOGGLES
411 | #define CV_SVS_MUTESPECS 1
412 | #define CV_SVS_FRIENDLYFIRE 2
413 | // 2 bits for warmup damage setting
414 | #define CV_SVS_WARMUPDMG 12
415 | #define CV_SVS_PAUSE 16
416 | #define CV_SVS_LOCKTEAMS 32
417 | #define CV_SVS_LOCKSPECS 64
418 | #define CV_SVS_ANTILAG 128
419 | #define CV_SVS_BALANCEDTEAMS 256
420 | #define CV_SVS_NEXTMAP 512
421 |
422 | // "cg_ui_voteFlags"
423 | #define CV_SVF_COMP 1
424 | #define CV_SVF_GAMETYPE 2
425 | #define CV_SVF_KICK 4
426 | #define CV_SVF_MAP 8
427 | #define CV_SVF_MATCHRESET 16
428 | #define CV_SVF_MUTESPECS 32
429 | #define CV_SVF_NEXTMAP 64
430 | #define CV_SVF_PUB 128
431 | #define CV_SVF_REFEREE 256
432 | #define CV_SVF_SHUFFLETEAMS 512
433 | #define CV_SVF_SWAPTEAMS 1024
434 | #define CV_SVF_FRIENDLYFIRE 2048
435 | #define CV_SVF_TIMELIMIT 4096
436 | #define CV_SVF_WARMUPDAMAGE 8192
437 | #define CV_SVF_ANTILAG 16384
438 | #define CV_SVF_BALANCEDTEAMS 32768
439 | #define CV_SVF_MUTING 65536
440 |
441 | // referee level
442 | #define RL_NONE 0
443 | #define RL_REFEREE 1
444 | #define RL_RCON 2
445 | // -OSP
446 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/cgame/cg_local.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ch40zz/CCHookReloaded/70b36d1bd4e72f23fbcaf3947aec895856aed9ae/CCHookReloaded/ETSDK/src/cgame/cg_local.h
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/cgame/cg_public.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #define CMD_BACKUP 64
4 | #define CMD_MASK (CMD_BACKUP - 1)
5 | // allow a lot of command backups for very fast systems
6 | // multiple commands may be combined into a single packet, so this
7 | // needs to be larger than PACKET_BACKUP
8 |
9 |
10 | #define MAX_ENTITIES_IN_SNAPSHOT 512
11 |
12 | // snapshots are a view of the server at a given time
13 |
14 | // Snapshots are generated at regular time intervals by the server,
15 | // but they may not be sent if a client's rate level is exceeded, or
16 | // they may be dropped by the network.
17 | typedef struct {
18 | int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
19 | int ping;
20 |
21 | int serverTime; // server time the message is valid for (in msec)
22 |
23 | byte areamask[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
24 |
25 | playerState_t ps; // complete information about the current player at this time
26 |
27 | int numEntities; // all of the entities that need to be presented
28 | entityState_t entities[MAX_ENTITIES_IN_SNAPSHOT]; // at the time of this snapshot
29 |
30 | int numServerCommands; // text based server commands to execute when this
31 | int serverCommandSequence; // snapshot becomes current
32 | } snapshot_t;
33 |
34 | typedef enum cgameEvent_e {
35 | CGAME_EVENT_NONE,
36 | CGAME_EVENT_GAMEVIEW,
37 | CGAME_EVENT_SPEAKEREDITOR,
38 | CGAME_EVENT_CAMPAIGNBREIFING,
39 | CGAME_EVENT_DEMO, // OSP
40 | CGAME_EVENT_FIRETEAMMSG,
41 | } cgameEvent_t;
42 |
43 | /*
44 | ==================================================================
45 |
46 | functions imported from the main executable
47 |
48 | ==================================================================
49 | */
50 |
51 | #define CGAME_IMPORT_API_VERSION 3
52 |
53 | typedef enum {
54 | CG_PRINT,
55 | CG_ERROR,
56 | CG_MILLISECONDS,
57 | CG_CVAR_REGISTER,
58 | CG_CVAR_UPDATE,
59 | CG_CVAR_SET,
60 | CG_CVAR_VARIABLESTRINGBUFFER,
61 | CG_CVAR_LATCHEDVARIABLESTRINGBUFFER,
62 | CG_ARGC,
63 | CG_ARGV,
64 | CG_ARGS,
65 | CG_FS_FOPENFILE,
66 | CG_FS_READ,
67 | CG_FS_WRITE,
68 | CG_FS_FCLOSEFILE,
69 | CG_FS_GETFILELIST,
70 | CG_FS_DELETEFILE,
71 | CG_SENDCONSOLECOMMAND,
72 | CG_ADDCOMMAND,
73 | CG_SENDCLIENTCOMMAND,
74 | CG_UPDATESCREEN,
75 | CG_CM_LOADMAP,
76 | CG_CM_NUMINLINEMODELS,
77 | CG_CM_INLINEMODEL,
78 | CG_CM_LOADMODEL,
79 | CG_CM_TEMPBOXMODEL,
80 | CG_CM_POINTCONTENTS,
81 | CG_CM_TRANSFORMEDPOINTCONTENTS,
82 | CG_CM_BOXTRACE,
83 | CG_CM_TRANSFORMEDBOXTRACE,
84 | // MrE:
85 | CG_CM_CAPSULETRACE,
86 | CG_CM_TRANSFORMEDCAPSULETRACE,
87 | CG_CM_TEMPCAPSULEMODEL,
88 | // done.
89 | CG_CM_MARKFRAGMENTS,
90 | CG_R_PROJECTDECAL, // ydnar: projects a decal onto brush models
91 | CG_R_CLEARDECALS, // ydnar: clears world/entity decals
92 | CG_S_STARTSOUND,
93 | CG_S_STARTSOUNDEX, //----(SA) added
94 | CG_S_STARTLOCALSOUND,
95 | CG_S_CLEARLOOPINGSOUNDS,
96 | CG_S_CLEARSOUNDS,
97 | CG_S_ADDLOOPINGSOUND,
98 | CG_S_UPDATEENTITYPOSITION,
99 | // Ridah, talking animations
100 | CG_S_GETVOICEAMPLITUDE,
101 | // done.
102 | CG_S_RESPATIALIZE,
103 | CG_S_REGISTERSOUND,
104 | CG_S_STARTBACKGROUNDTRACK,
105 | CG_S_FADESTREAMINGSOUND, //----(SA) modified
106 | CG_S_FADEALLSOUNDS, //----(SA) added for fading out everything
107 | CG_S_STARTSTREAMINGSOUND,
108 | CG_S_GETSOUNDLENGTH, // xkan - get the length (in milliseconds) of the sound
109 | CG_S_GETCURRENTSOUNDTIME,
110 | CG_R_LOADWORLDMAP,
111 | CG_R_REGISTERMODEL,
112 | CG_R_REGISTERSKIN,
113 | CG_R_REGISTERSHADER,
114 |
115 | CG_R_GETSKINMODEL, // client allowed to view what the .skin loaded so they can set their model appropriately
116 | CG_R_GETMODELSHADER, // client allowed the shader handle for given model/surface (for things like debris inheriting shader from explosive)
117 |
118 | CG_R_REGISTERFONT,
119 | CG_R_CLEARSCENE,
120 | CG_R_ADDREFENTITYTOSCENE,
121 | CG_GET_ENTITY_TOKEN,
122 | CG_R_ADDPOLYTOSCENE,
123 | // Ridah
124 | CG_R_ADDPOLYSTOSCENE,
125 | // done.
126 | CG_R_ADDPOLYBUFFERTOSCENE,
127 | CG_R_ADDLIGHTTOSCENE,
128 |
129 | CG_R_ADDCORONATOSCENE,
130 | CG_R_SETFOG,
131 | CG_R_SETGLOBALFOG,
132 |
133 | CG_R_RENDERSCENE,
134 | CG_R_SAVEVIEWPARMS,
135 | CG_R_RESTOREVIEWPARMS,
136 | CG_R_SETCOLOR,
137 | CG_R_DRAWSTRETCHPIC,
138 | CG_R_DRAWSTRETCHPIC_GRADIENT, //----(SA) added
139 | CG_R_MODELBOUNDS,
140 | CG_R_LERPTAG,
141 | CG_GETGLCONFIG,
142 | CG_GETGAMESTATE,
143 | CG_GETCURRENTSNAPSHOTNUMBER,
144 | CG_GETSNAPSHOT,
145 | CG_GETSERVERCOMMAND,
146 | CG_GETCURRENTCMDNUMBER,
147 | CG_GETUSERCMD,
148 | CG_SETUSERCMDVALUE,
149 | CG_SETCLIENTLERPORIGIN, // DHM - Nerve
150 | CG_R_REGISTERSHADERNOMIP,
151 | CG_MEMORY_REMAINING,
152 |
153 | CG_KEY_ISDOWN,
154 | CG_KEY_GETCATCHER,
155 | CG_KEY_SETCATCHER,
156 | CG_KEY_GETKEY,
157 | CG_KEY_GETOVERSTRIKEMODE,
158 | CG_KEY_SETOVERSTRIKEMODE,
159 |
160 | CG_PC_ADD_GLOBAL_DEFINE,
161 | CG_PC_LOAD_SOURCE,
162 | CG_PC_FREE_SOURCE,
163 | CG_PC_READ_TOKEN,
164 | CG_PC_SOURCE_FILE_AND_LINE,
165 | CG_PC_UNREAD_TOKEN,
166 |
167 | CG_S_STOPBACKGROUNDTRACK,
168 | CG_REAL_TIME,
169 | CG_SNAPVECTOR,
170 | CG_REMOVECOMMAND,
171 | CG_R_LIGHTFORPOINT,
172 |
173 | CG_CIN_PLAYCINEMATIC,
174 | CG_CIN_STOPCINEMATIC,
175 | CG_CIN_RUNCINEMATIC,
176 | CG_CIN_DRAWCINEMATIC,
177 | CG_CIN_SETEXTENTS,
178 | CG_R_REMAP_SHADER,
179 | CG_S_ADDREALLOOPINGSOUND,
180 | CG_S_STOPSTREAMINGSOUND, //----(SA) added
181 |
182 | CG_LOADCAMERA,
183 | CG_STARTCAMERA,
184 | CG_STOPCAMERA,
185 | CG_GETCAMERAINFO,
186 |
187 | CG_MEMSET = 150,
188 | CG_MEMCPY,
189 | CG_STRNCPY,
190 | CG_SIN,
191 | CG_COS,
192 | CG_ATAN2,
193 | CG_SQRT,
194 | CG_FLOOR,
195 | CG_CEIL,
196 |
197 | CG_TESTPRINTINT,
198 | CG_TESTPRINTFLOAT,
199 | CG_ACOS,
200 |
201 | CG_INGAME_POPUP, //----(SA) added
202 |
203 | // NERVE - SMF
204 | CG_INGAME_CLOSEPOPUP,
205 |
206 | CG_R_DRAWROTATEDPIC,
207 | CG_R_DRAW2DPOLYS,
208 |
209 | CG_KEY_GETBINDINGBUF,
210 | CG_KEY_SETBINDING,
211 | CG_KEY_KEYNUMTOSTRINGBUF,
212 | CG_KEY_BINDINGTOKEYS,
213 |
214 | CG_TRANSLATE_STRING,
215 | // -NERVE - SMF
216 |
217 | CG_R_INPVS,
218 | CG_GETHUNKDATA,
219 |
220 | CG_PUMPEVENTLOOP,
221 |
222 | // zinx
223 | CG_SENDMESSAGE,
224 | CG_MESSAGESTATUS,
225 | // -zinx
226 |
227 | // bani
228 | CG_R_LOADDYNAMICSHADER,
229 | // -bani
230 |
231 | // fretn
232 | CG_R_RENDERTOTEXTURE,
233 | // -fretn
234 | // bani
235 | CG_R_GETTEXTUREID,
236 | // -bani
237 | // bani
238 | CG_R_FINISH,
239 | // -bani
240 | } cgameImport_t;
241 |
242 |
243 | /*
244 | ==================================================================
245 |
246 | functions exported to the main executable
247 |
248 | ==================================================================
249 | */
250 |
251 | typedef enum {
252 | CG_INIT,
253 | // void CG_Init( int serverMessageNum, int serverCommandSequence )
254 | // called when the level loads or when the renderer is restarted
255 | // all media should be registered at this time
256 | // cgame will display loading status by calling SCR_Update, which
257 | // will call CG_DrawInformation during the loading process
258 | // reliableCommandSequence will be 0 on fresh loads, but higher for
259 | // demos, tourney restarts, or vid_restarts
260 |
261 | CG_SHUTDOWN,
262 | // void (*CG_Shutdown)( void );
263 | // oportunity to flush and close any open files
264 |
265 | CG_CONSOLE_COMMAND,
266 | // qboolean (*CG_ConsoleCommand)( void );
267 | // a console command has been issued locally that is not recognized by the
268 | // main game system.
269 | // use Cmd_Argc() / Cmd_Argv() to read the command, return qfalse if the
270 | // command is not known to the game
271 |
272 | CG_DRAW_ACTIVE_FRAME,
273 | // void (*CG_DrawActiveFrame)( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback );
274 | // Generates and draws a game scene and status information at the given time.
275 | // If demoPlayback is set, local movement prediction will not be enabled
276 |
277 | CG_CROSSHAIR_PLAYER,
278 | // int (*CG_CrosshairPlayer)( void );
279 |
280 | CG_LAST_ATTACKER,
281 | // int (*CG_LastAttacker)( void );
282 |
283 | CG_KEY_EVENT,
284 | // void (*CG_KeyEvent)( int key, qboolean down );
285 |
286 | CG_MOUSE_EVENT,
287 | // void (*CG_MouseEvent)( int dx, int dy );
288 | CG_EVENT_HANDLING,
289 | // void (*CG_EventHandling)(int type, qboolean fForced);
290 |
291 | CG_GET_TAG,
292 | // qboolean CG_GetTag( int clientNum, char *tagname, orientation_t *or );
293 |
294 | CG_CHECKEXECKEY,
295 |
296 | CG_WANTSBINDKEYS,
297 |
298 | // zinx
299 | CG_MESSAGERECEIVED,
300 | // void (*CG_MessageReceived)( const char *buf, int buflen, int serverTime );
301 | // -zinx
302 |
303 | } cgameExport_t;
304 |
305 | //----------------------------------------------
306 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/cgame/tr_types.h:
--------------------------------------------------------------------------------
1 | #ifndef __TR_TYPES_H
2 | #define __TR_TYPES_H
3 |
4 |
5 | #define MAX_CORONAS 32 //----(SA) not really a reason to limit this other than trying to keep a reasonable count
6 | #define MAX_DLIGHTS 32 // can't be increased, because bit flags are used on surfaces
7 | #define MAX_ENTITIES 1023 // can't be increased without changing drawsurf bit packing
8 |
9 | // renderfx flags
10 | #define RF_MINLIGHT 0x000001 // allways have some light (viewmodel, some items)
11 | #define RF_THIRD_PERSON 0x000002 // don't draw through eyes, only mirrors (player bodies, chat sprites)
12 | #define RF_FIRST_PERSON 0x000004 // only draw through eyes (view weapon, damage blood blob)
13 | #define RF_DEPTHHACK 0x000008 // for view weapon Z crunching
14 | #define RF_NOSHADOW 0x000010 // don't add stencil shadows
15 |
16 | #define RF_LIGHTING_ORIGIN 0x000020 // use refEntity->lightingOrigin instead of refEntity->origin
17 | // for lighting. This allows entities to sink into the floor
18 | // with their origin going solid, and allows all parts of a
19 | // player to get the same lighting
20 | #define RF_SHADOW_PLANE 0x000040 // use refEntity->shadowPlane
21 | #define RF_WRAP_FRAMES 0x000080 // mod the model frames by the maxframes to allow continuous
22 | // animation without needing to know the frame count
23 | #define RF_HILIGHT 0x000100 // more than RF_MINLIGHT. For when an object is "Highlighted" (looked at/training identification/etc)
24 | #define RF_BLINK 0x000200 // eyes in 'blink' state
25 | #define RF_FORCENOLOD 0x000400
26 |
27 | // refdef flags
28 | #define RDF_NOWORLDMODEL 1 // used for player configuration screen
29 | #define RDF_HYPERSPACE 4 // teleportation effect
30 |
31 | // Rafael
32 | #define RDF_SKYBOXPORTAL 8
33 |
34 | //----(SA)
35 | #define RDF_UNDERWATER (1<<4) // so the renderer knows to use underwater fog when the player is underwater
36 | #define RDF_DRAWINGSKY (1<<5)
37 | #define RDF_SNOOPERVIEW (1<<6) //----(SA) added
38 |
39 |
40 | typedef struct {
41 | vec3_t xyz;
42 | float st[2];
43 | byte modulate[4];
44 | } polyVert_t;
45 |
46 | typedef struct poly_s {
47 | qhandle_t hShader;
48 | int numVerts;
49 | polyVert_t *verts;
50 | } poly_t;
51 |
52 | typedef enum {
53 | RT_MODEL,
54 | RT_POLY,
55 | RT_SPRITE,
56 | RT_SPLASH, // ripple effect
57 | RT_BEAM,
58 | RT_RAIL_CORE,
59 | RT_RAIL_CORE_TAPER, // a modified core that creates a properly texture mapped core that's wider at one end
60 | RT_RAIL_RINGS,
61 | RT_LIGHTNING,
62 | RT_PORTALSURFACE, // doesn't draw anything, just info for portals
63 |
64 | RT_MAX_REF_ENTITY_TYPE
65 | } refEntityType_t;
66 |
67 | #define ZOMBIEFX_FADEOUT_TIME 10000
68 |
69 | #define REFLAG_ONLYHAND 1 // only draw hand surfaces
70 | #define REFLAG_FORCE_LOD 8 // force a low lod
71 | #define REFLAG_ORIENT_LOD 16 // on LOD switch, align the model to the player's camera
72 | #define REFLAG_DEAD_LOD 32 // allow the LOD to go lower than recommended
73 |
74 | typedef struct {
75 | refEntityType_t reType;
76 | int renderfx;
77 |
78 | qhandle_t hModel; // opaque type outside refresh
79 |
80 | // most recent data
81 | vec3_t lightingOrigin; // so multi-part models can be lit identically (RF_LIGHTING_ORIGIN)
82 | float shadowPlane; // projection shadows go here, stencils go slightly lower
83 |
84 | vec3_t axis[3]; // rotation vectors
85 | vec3_t torsoAxis[3]; // rotation vectors for torso section of skeletal animation
86 | qboolean nonNormalizedAxes; // axis are not normalized, i.e. they have scale
87 | float origin[3]; // also used as MODEL_BEAM's "from"
88 | int frame; // also used as MODEL_BEAM's diameter
89 | qhandle_t frameModel;
90 | int torsoFrame; // skeletal torso can have frame independant of legs frame
91 | qhandle_t torsoFrameModel;
92 |
93 | // previous data for frame interpolation
94 | float oldorigin[3]; // also used as MODEL_BEAM's "to"
95 | int oldframe;
96 | qhandle_t oldframeModel;
97 | int oldTorsoFrame;
98 | qhandle_t oldTorsoFrameModel;
99 | float backlerp; // 0.0 = current, 1.0 = old
100 | float torsoBacklerp;
101 |
102 | // texturing
103 | int skinNum; // inline skin index
104 | qhandle_t customSkin; // NULL for default skin
105 | qhandle_t customShader; // use one image for the entire thing
106 |
107 | // misc
108 | byte shaderRGBA[4]; // colors used by rgbgen entity shaders
109 | float shaderTexCoord[2]; // texture coordinates used by tcMod entity modifiers
110 | float shaderTime; // subtracted from refdef time to control effect start times
111 |
112 | // extra sprite information
113 | float radius;
114 | float rotation;
115 |
116 | // Ridah
117 | vec3_t fireRiseDir;
118 |
119 | // Ridah, entity fading (gibs, debris, etc)
120 | int fadeStartTime, fadeEndTime;
121 |
122 | float hilightIntensity; //----(SA) added
123 |
124 | int reFlags;
125 |
126 | int entityNum; // currentState.number, so we can attach rendering effects to specific entities (Zombie)
127 |
128 | } refEntity_t;
129 |
130 | //----(SA)
131 |
132 | // //
133 | // WARNING:: synch FOG_SERVER in sv_ccmds.c if you change anything //
134 | // //
135 | typedef enum {
136 | FOG_NONE, // 0
137 |
138 | FOG_SKY, // 1 fog values to apply to the sky when using density fog for the world (non-distance clipping fog) (only used if(glfogsettings[FOG_MAP].registered) or if(glfogsettings[FOG_MAP].registered))
139 | FOG_PORTALVIEW, // 2 used by the portal sky scene
140 | FOG_HUD, // 3 used by the 3D hud scene
141 |
142 | // The result of these for a given frame is copied to the scene.glFog when the scene is rendered
143 |
144 | // the following are fogs applied to the main world scene
145 | FOG_MAP, // 4 use fog parameter specified using the "fogvars" in the sky shader
146 | FOG_WATER, // 5 used when underwater
147 | FOG_SERVER, // 6 the server has set my fog (probably a target_fog) (keep synch in sv_ccmds.c !!!)
148 | FOG_CURRENT, // 7 stores the current values when a transition starts
149 | FOG_LAST, // 8 stores the current values when a transition starts
150 | FOG_TARGET, // 9 the values it's transitioning to.
151 |
152 | FOG_CMD_SWITCHFOG, // 10 transition to the fog specified in the second parameter of R_SetFog(...) (keep synch in sv_ccmds.c !!!)
153 |
154 | NUM_FOGS
155 | }glfogType_t;
156 |
157 |
158 | typedef struct {
159 | int mode; // GL_LINEAR, GL_EXP
160 | int hint; // GL_DONT_CARE
161 | int startTime; // in ms
162 | int finishTime; // in ms
163 | float color[4];
164 | float start; // near
165 | float end; // far
166 | qboolean useEndForClip; // use the 'far' value for the far clipping plane
167 | float density; // 0.0-1.0
168 | qboolean registered; // has this fog been set up?
169 | qboolean drawsky; // draw skybox
170 | qboolean clearscreen; // clear the GL color buffer
171 | } glfog_t;
172 |
173 | //----(SA) end
174 |
175 |
176 | #define MAX_RENDER_STRINGS 8
177 | #define MAX_RENDER_STRING_LENGTH 32
178 |
179 | typedef struct {
180 | int x, y, width, height;
181 | float fov_x, fov_y;
182 | vec3_t vieworg;
183 | vec3_t viewaxis[3]; // transformation matrix
184 |
185 | int time; // time in milliseconds for shader effects and other time dependent rendering issues
186 | int rdflags; // RDF_NOWORLDMODEL, etc
187 |
188 | // 1 bits will prevent the associated area from rendering at all
189 | byte areamask[MAX_MAP_AREA_BYTES];
190 |
191 |
192 |
193 |
194 | // text messages for deform text shaders
195 | char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH];
196 |
197 |
198 | //----(SA) added (needed to pass fog infos into the portal sky scene)
199 | glfog_t glfog;
200 | //----(SA) end
201 |
202 | } refdef_t;
203 |
204 |
205 | typedef enum {
206 | STEREO_CENTER,
207 | STEREO_LEFT,
208 | STEREO_RIGHT
209 | } stereoFrame_t;
210 |
211 |
212 | /*
213 | ** glconfig_t
214 | **
215 | ** Contains variables specific to the OpenGL configuration
216 | ** being run right now. These are constant once the OpenGL
217 | ** subsystem is initialized.
218 | */
219 | typedef enum {
220 | TC_NONE,
221 | TC_S3TC,
222 | TC_EXT_COMP_S3TC
223 | } textureCompression_t;
224 |
225 | typedef enum {
226 | GLDRV_ICD, // driver is integrated with window system
227 | // WARNING: there are tests that check for
228 | // > GLDRV_ICD for minidriverness, so this
229 | // should always be the lowest value in this
230 | // enum set
231 | GLDRV_STANDALONE, // driver is a non-3Dfx standalone driver
232 | GLDRV_VOODOO // driver is a 3Dfx standalone driver
233 | } glDriverType_t;
234 |
235 | typedef enum {
236 | GLHW_GENERIC, // where everthing works the way it should
237 | GLHW_3DFX_2D3D, // Voodoo Banshee or Voodoo3, relevant since if this is
238 | // the hardware type then there can NOT exist a secondary
239 | // display adapter
240 | GLHW_RIVA128, // where you can't interpolate alpha
241 | GLHW_RAGEPRO, // where you can't modulate alpha on alpha textures
242 | GLHW_PERMEDIA2 // where you don't have src*dst
243 | } glHardwareType_t;
244 |
245 | typedef struct {
246 | char renderer_string[MAX_STRING_CHARS];
247 | char vendor_string[MAX_STRING_CHARS];
248 | char version_string[MAX_STRING_CHARS];
249 | char extensions_string[MAX_STRING_CHARS*4]; // TTimo - bumping, some cards have a big extension string
250 |
251 | int maxTextureSize; // queried from GL
252 | int maxActiveTextures; // multitexture ability
253 |
254 | int colorBits, depthBits, stencilBits;
255 |
256 | glDriverType_t driverType;
257 | glHardwareType_t hardwareType;
258 |
259 | qboolean deviceSupportsGamma;
260 | textureCompression_t textureCompression;
261 | qboolean textureEnvAddAvailable;
262 | qboolean anisotropicAvailable; //----(SA) added
263 | float maxAnisotropy; //----(SA) added
264 |
265 | // vendor-specific support
266 | // NVidia
267 | qboolean NVFogAvailable; //----(SA) added
268 | int NVFogMode; //----(SA) added
269 | // ATI
270 | int ATIMaxTruformTess; // for truform support
271 | int ATINormalMode; // for truform support
272 | int ATIPointMode; // for truform support
273 |
274 | int vidWidth, vidHeight;
275 | // aspect is the screen's physical width / height, which may be different
276 | // than scrWidth / scrHeight if the pixels are non-square
277 | // normal screens should be 4/3, but wide aspect monitors may be 16/9
278 | float windowAspect;
279 |
280 | int displayFrequency;
281 |
282 | // synonymous with "does rendering consume the entire screen?", therefore
283 | // a Voodoo or Voodoo2 will have this set to TRUE, as will a Win32 ICD that
284 | // used CDS.
285 | qboolean isFullscreen;
286 | qboolean stereoEnabled;
287 | qboolean smpActive; // dual processor
288 | } glconfig_t;
289 |
290 |
291 | #if !defined _WIN32
292 |
293 | #define _3DFX_DRIVER_NAME "libMesaVoodooGL.so.3.1"
294 | #define OPENGL_DRIVER_NAME "libGL.so.1"
295 |
296 | #else
297 |
298 | #define _3DFX_DRIVER_NAME "3dfxvgl"
299 | #define OPENGL_DRIVER_NAME "opengl32"
300 | #define WICKED3D_V5_DRIVER_NAME "gl/openglv5.dll"
301 | #define WICKED3D_V3_DRIVER_NAME "gl/openglv3.dll"
302 |
303 | #endif // !defined _WIN32
304 |
305 |
306 | // =========================================
307 | // Gordon, these MUST NOT exceed the values for SHADER_MAX_VERTEXES/SHADER_MAX_INDEXES
308 | #define MAX_PB_VERTS 1025
309 | #define MAX_PB_INDICIES (MAX_PB_VERTS*6)
310 |
311 | typedef struct polyBuffer_s {
312 | vec4_t xyz[MAX_PB_VERTS];
313 | vec2_t st[MAX_PB_VERTS];
314 | byte color[MAX_PB_VERTS][4];
315 | int numVerts;
316 |
317 | int indicies[MAX_PB_INDICIES];
318 | int numIndicies;
319 |
320 | qhandle_t shader;
321 | } polyBuffer_t;
322 | // =========================================
323 |
324 | #endif // __TR_TYPES_H
325 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/game/bg_classes.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ch40zz/CCHookReloaded/70b36d1bd4e72f23fbcaf3947aec895856aed9ae/CCHookReloaded/ETSDK/src/game/bg_classes.h
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/game/bg_local.h:
--------------------------------------------------------------------------------
1 | // bg_local.h -- local definitions for the bg (both games) files
2 |
3 | #define MIN_WALK_NORMAL 0.7 // can't walk on very steep slopes
4 |
5 | #define STEPSIZE 18
6 |
7 | #define JUMP_VELOCITY 270
8 |
9 | #define TIMER_LAND 130
10 | #define TIMER_GESTURE (34*66+50)
11 |
12 | #define DOUBLE_TAP_DELAY 400
13 |
14 | #define MAX_MG42_HEAT 1500.f
15 |
16 |
17 | // all of the locals will be zeroed before each
18 | // pmove, just to make damn sure we don't have
19 | // any differences when running on client or server
20 | typedef struct {
21 | vec3_t forward, right, up;
22 | float frametime;
23 |
24 | int msec;
25 |
26 | qboolean walking;
27 | qboolean groundPlane;
28 | trace_t groundTrace;
29 |
30 | float impactSpeed;
31 |
32 | vec3_t previous_origin;
33 | vec3_t previous_velocity;
34 | int previous_waterlevel;
35 |
36 | // Ridah, ladders
37 | qboolean ladder;
38 | } pml_t;
39 |
40 | extern pmove_t *pm;
41 | extern pml_t pml;
42 |
43 | // movement parameters
44 | extern float pm_stopspeed;
45 | //extern float pm_duckScale;
46 |
47 | //----(SA) modified
48 | extern float pm_waterSwimScale;
49 | extern float pm_waterWadeScale;
50 | extern float pm_slagSwimScale;
51 | extern float pm_slagWadeScale;
52 |
53 | extern float pm_accelerate;
54 | extern float pm_airaccelerate;
55 | extern float pm_wateraccelerate;
56 | extern float pm_slagaccelerate;
57 | extern float pm_flyaccelerate;
58 |
59 | extern float pm_friction;
60 | extern float pm_waterfriction;
61 | extern float pm_slagfriction;
62 | extern float pm_flightfriction;
63 |
64 | //----(SA) end
65 |
66 | extern int c_pmove;
67 |
68 | void PM_AddTouchEnt( int entityNum );
69 | void PM_AddEvent( int newEvent );
70 |
71 | qboolean PM_SlideMove( qboolean gravity );
72 | void PM_StepSlideMove( qboolean gravity );
73 |
74 | qboolean PM_SlideMoveProne( qboolean gravity );
75 | void PM_StepSlideMoveProne( qboolean gravity );
76 |
77 | void PM_BeginWeaponChange( int oldweapon, int newweapon, qboolean reload );
78 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/game/g_public.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 1999-2000 Id Software, Inc.
2 | //
3 |
4 | // g_public.h -- game module information visible to server
5 |
6 | #define GAME_API_VERSION 8
7 |
8 | // entity->svFlags
9 | // the server does not know how to interpret most of the values
10 | // in entityStates (level eType), so the game must explicitly flag
11 | // special server behaviors
12 | #define SVF_NOCLIENT 0x00000001 // don't send entity to clients, even if it has effects
13 | #define SVF_VISDUMMY 0x00000004 // this ent is a "visibility dummy" and needs it's master to be sent to clients that can see it even if they can't see the master ent
14 | #define SVF_BOT 0x00000008
15 | #define SVF_POW 0x00000010 // Gordon: stole SVF_CASTAI as it's no longer used
16 |
17 | #define SVF_BROADCAST 0x00000020 // send to all connected clients
18 | #define SVF_PORTAL 0x00000040 // merge a second pvs at origin2 into snapshots
19 | #define SVF_BLANK 0x00000080 // Gordon: removed SVF_USE_CURRENT_ORIGIN as it plain doesnt do anything
20 | #define SVF_NOFOOTSTEPS 0x00000100
21 |
22 | // MrE:
23 | #define SVF_CAPSULE 0x00000200 // use capsule for collision detection
24 |
25 | #define SVF_VISDUMMY_MULTIPLE 0x00000400 // so that one vis dummy can add to snapshot multiple speakers
26 |
27 | // recent id changes
28 | #define SVF_SINGLECLIENT 0x00000800 // only send to a single client (entityShared_t->singleClient)
29 | #define SVF_NOSERVERINFO 0x00001000 // don't send CS_SERVERINFO updates to this client
30 | // so that it can be updated for ping tools without
31 | // lagging clients
32 | #define SVF_NOTSINGLECLIENT 0x00002000 // send entity to everyone but one client
33 | // (entityShared_t->singleClient)
34 | // Gordon:
35 | #define SVF_IGNOREBMODELEXTENTS 0x00004000 // just use origin for in pvs check for snapshots, ignore the bmodel extents
36 | #define SVF_SELF_PORTAL 0x00008000 // use self->origin2 as portal
37 | #define SVF_SELF_PORTAL_EXCLUSIVE 0x00010000 // use self->origin2 as portal and DONT add self->origin PVS ents
38 |
39 | //===============================================================
40 |
41 | #define MAX_TEAM_LANDMINES 10
42 |
43 | typedef qboolean (*addToSnapshotCallback)( int entityNum, int clientNum );
44 |
45 | typedef struct {
46 | // entityState_t s; // communicated by server to clients
47 |
48 | qboolean linked; // qfalse if not in any good cluster
49 | int linkcount;
50 |
51 | int svFlags; // SVF_NOCLIENT, SVF_BROADCAST, etc
52 | int singleClient; // only send to this client when SVF_SINGLECLIENT is set
53 |
54 | qboolean bmodel; // if false, assume an explicit mins / maxs bounding box
55 | // only set by trap_SetBrushModel
56 | vec3_t mins, maxs;
57 | int contents; // CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
58 | // a non-solid entity should set to 0
59 |
60 | vec3_t absmin, absmax; // derived from mins/maxs and origin + rotation
61 |
62 | // currentOrigin will be used for all collision detection and world linking.
63 | // it will not necessarily be the same as the trajectory evaluation for the current
64 | // time, because each entity must be moved one at a time after time is advanced
65 | // to avoid simultanious collision issues
66 | vec3_t currentOrigin;
67 | vec3_t currentAngles;
68 |
69 | // when a trace call is made and passEntityNum != ENTITYNUM_NONE,
70 | // an ent will be excluded from testing if:
71 | // ent->s.number == passEntityNum (don't interact with self)
72 | // ent->s.ownerNum = passEntityNum (don't interact with your own missiles)
73 | // entity[ent->s.ownerNum].ownerNum = passEntityNum (don't interact with other missiles from owner)
74 | int ownerNum;
75 | int eventTime;
76 |
77 | int worldflags; // DHM - Nerve
78 |
79 | qboolean snapshotCallback;
80 | } entityShared_t;
81 |
82 |
83 |
84 | // the server looks at a sharedEntity, which is the start of the game's gentity_t structure
85 | typedef struct {
86 | entityState_t s; // communicated by server to clients
87 | entityShared_t r; // shared by both the server system and game
88 | } sharedEntity_t;
89 |
90 |
91 |
92 | //===============================================================
93 |
94 | //
95 | // system traps provided by the main engine
96 | //
97 | typedef enum {
98 | //============== general Quake services ==================
99 |
100 | G_PRINT, // ( const char *string );
101 | // print message on the local console
102 |
103 | G_ERROR, // ( const char *string );
104 | // abort the game
105 |
106 | G_MILLISECONDS, // ( void );
107 | // get current time for profiling reasons
108 | // this should NOT be used for any game related tasks,
109 | // because it is not journaled
110 |
111 | // console variable interaction
112 | G_CVAR_REGISTER, // ( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
113 | G_CVAR_UPDATE, // ( vmCvar_t *vmCvar );
114 | G_CVAR_SET, // ( const char *var_name, const char *value );
115 | G_CVAR_VARIABLE_INTEGER_VALUE, // ( const char *var_name );
116 |
117 | G_CVAR_VARIABLE_STRING_BUFFER, // ( const char *var_name, char *buffer, int bufsize );
118 |
119 | G_CVAR_LATCHEDVARIABLESTRINGBUFFER,
120 |
121 | G_ARGC, // ( void );
122 | // ClientCommand and ServerCommand parameter access
123 |
124 | G_ARGV, // ( int n, char *buffer, int bufferLength );
125 |
126 | G_FS_FOPEN_FILE, // ( const char *qpath, fileHandle_t *file, fsMode_t mode );
127 | G_FS_READ, // ( void *buffer, int len, fileHandle_t f );
128 | G_FS_WRITE, // ( const void *buffer, int len, fileHandle_t f );
129 | G_FS_RENAME,
130 | G_FS_FCLOSE_FILE, // ( fileHandle_t f );
131 |
132 | G_SEND_CONSOLE_COMMAND, // ( const char *text );
133 | // add commands to the console as if they were typed in
134 | // for map changing, etc
135 |
136 |
137 | //=========== server specific functionality =============
138 |
139 | G_LOCATE_GAME_DATA, // ( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t,
140 | // playerState_t *clients, int sizeofGameClient );
141 | // the game needs to let the server system know where and how big the gentities
142 | // are, so it can look at them directly without going through an interface
143 |
144 | G_DROP_CLIENT, // ( int clientNum, const char *reason );
145 | // kick a client off the server with a message
146 |
147 | G_SEND_SERVER_COMMAND, // ( int clientNum, const char *fmt, ... );
148 | // reliably sends a command string to be interpreted by the given
149 | // client. If clientNum is -1, it will be sent to all clients
150 |
151 | G_SET_CONFIGSTRING, // ( int num, const char *string );
152 | // config strings hold all the index strings, and various other information
153 | // that is reliably communicated to all clients
154 | // All of the current configstrings are sent to clients when
155 | // they connect, and changes are sent to all connected clients.
156 | // All confgstrings are cleared at each level start.
157 |
158 | G_GET_CONFIGSTRING, // ( int num, char *buffer, int bufferSize );
159 |
160 | G_GET_USERINFO, // ( int num, char *buffer, int bufferSize );
161 | // userinfo strings are maintained by the server system, so they
162 | // are persistant across level loads, while all other game visible
163 | // data is completely reset
164 |
165 | G_SET_USERINFO, // ( int num, const char *buffer );
166 |
167 | G_GET_SERVERINFO, // ( char *buffer, int bufferSize );
168 | // the serverinfo info string has all the cvars visible to server browsers
169 |
170 | G_SET_BRUSH_MODEL, // ( gentity_t *ent, const char *name );
171 | // sets mins and maxs based on the brushmodel name
172 |
173 | G_TRACE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
174 | // collision detection against all linked entities
175 |
176 | G_POINT_CONTENTS, // ( const vec3_t point, int passEntityNum );
177 | // point contents against all linked entities
178 |
179 | G_IN_PVS, // ( const vec3_t p1, const vec3_t p2 );
180 |
181 | G_IN_PVS_IGNORE_PORTALS, // ( const vec3_t p1, const vec3_t p2 );
182 |
183 | G_ADJUST_AREA_PORTAL_STATE, // ( gentity_t *ent, qboolean open );
184 |
185 | G_AREAS_CONNECTED, // ( int area1, int area2 );
186 |
187 | G_LINKENTITY, // ( gentity_t *ent );
188 | // an entity will never be sent to a client or used for collision
189 | // if it is not passed to linkentity. If the size, position, or
190 | // solidity changes, it must be relinked.
191 |
192 | G_UNLINKENTITY, // ( gentity_t *ent );
193 | // call before removing an interactive entity
194 |
195 | G_ENTITIES_IN_BOX, // ( const vec3_t mins, const vec3_t maxs, gentity_t **list, int maxcount );
196 | // EntitiesInBox will return brush models based on their bounding box,
197 | // so exact determination must still be done with EntityContact
198 |
199 | G_ENTITY_CONTACT, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
200 | // perform an exact check against inline brush models of non-square shape
201 |
202 | // access for bots to get and free a server client (FIXME?)
203 | G_BOT_ALLOCATE_CLIENT, // ( int clientNum );
204 |
205 | G_BOT_FREE_CLIENT, // ( int clientNum );
206 |
207 | G_GET_USERCMD, // ( int clientNum, usercmd_t *cmd )
208 |
209 | G_GET_ENTITY_TOKEN, // qboolean ( char *buffer, int bufferSize )
210 | // Retrieves the next string token from the entity spawn text, returning
211 | // false when all tokens have been parsed.
212 | // This should only be done at GAME_INIT time.
213 |
214 | G_FS_GETFILELIST,
215 | G_DEBUG_POLYGON_CREATE,
216 | G_DEBUG_POLYGON_DELETE,
217 | G_REAL_TIME,
218 | G_SNAPVECTOR,
219 | // MrE:
220 |
221 | G_TRACECAPSULE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
222 | // collision detection using capsule against all linked entities
223 |
224 | G_ENTITY_CONTACTCAPSULE, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
225 | // perform an exact check against inline brush models of non-square shape
226 | // done.
227 |
228 | G_GETTAG,
229 |
230 | G_REGISTERTAG,
231 | // Gordon: load a serverside tag
232 |
233 | G_REGISTERSOUND, // xkan, 10/28/2002 - register the sound
234 | G_GET_SOUND_LENGTH, // xkan, 10/28/2002 - get the length of the sound
235 |
236 | BOTLIB_SETUP = 200, // ( void );
237 | BOTLIB_SHUTDOWN, // ( void );
238 | BOTLIB_LIBVAR_SET,
239 | BOTLIB_LIBVAR_GET,
240 | BOTLIB_PC_ADD_GLOBAL_DEFINE,
241 | BOTLIB_START_FRAME,
242 | BOTLIB_LOAD_MAP,
243 | BOTLIB_UPDATENTITY,
244 | BOTLIB_TEST,
245 |
246 | BOTLIB_GET_SNAPSHOT_ENTITY, // ( int client, int ent );
247 | BOTLIB_GET_CONSOLE_MESSAGE, // ( int client, char *message, int size );
248 | BOTLIB_USER_COMMAND, // ( int client, usercmd_t *ucmd );
249 |
250 | BOTLIB_AAS_ENTITY_VISIBLE = 300, //FIXME: remove
251 | BOTLIB_AAS_IN_FIELD_OF_VISION, //FIXME: remove
252 | BOTLIB_AAS_VISIBLE_CLIENTS, //FIXME: remove
253 | BOTLIB_AAS_ENTITY_INFO,
254 |
255 | BOTLIB_AAS_INITIALIZED,
256 | BOTLIB_AAS_PRESENCE_TYPE_BOUNDING_BOX,
257 | BOTLIB_AAS_TIME,
258 |
259 | // Ridah
260 | BOTLIB_AAS_SETCURRENTWORLD,
261 | // done.
262 |
263 | BOTLIB_AAS_POINT_AREA_NUM,
264 | BOTLIB_AAS_TRACE_AREAS,
265 | BOTLIB_AAS_BBOX_AREAS,
266 | BOTLIB_AAS_AREA_CENTER,
267 | BOTLIB_AAS_AREA_WAYPOINT,
268 |
269 | BOTLIB_AAS_POINT_CONTENTS,
270 | BOTLIB_AAS_NEXT_BSP_ENTITY,
271 | BOTLIB_AAS_VALUE_FOR_BSP_EPAIR_KEY,
272 | BOTLIB_AAS_VECTOR_FOR_BSP_EPAIR_KEY,
273 | BOTLIB_AAS_FLOAT_FOR_BSP_EPAIR_KEY,
274 | BOTLIB_AAS_INT_FOR_BSP_EPAIR_KEY,
275 |
276 | BOTLIB_AAS_AREA_REACHABILITY,
277 | BOTLIB_AAS_AREA_LADDER,
278 |
279 | BOTLIB_AAS_AREA_TRAVEL_TIME_TO_GOAL_AREA,
280 |
281 | BOTLIB_AAS_SWIMMING,
282 | BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT,
283 |
284 | // Ridah, route-tables
285 | BOTLIB_AAS_RT_SHOWROUTE,
286 | //BOTLIB_AAS_RT_GETHIDEPOS,
287 | //BOTLIB_AAS_FINDATTACKSPOTWITHINRANGE,
288 | BOTLIB_AAS_NEARESTHIDEAREA,
289 | BOTLIB_AAS_LISTAREASINRANGE,
290 | BOTLIB_AAS_AVOIDDANGERAREA,
291 | BOTLIB_AAS_RETREAT,
292 | BOTLIB_AAS_ALTROUTEGOALS,
293 | BOTLIB_AAS_SETAASBLOCKINGENTITY,
294 | BOTLIB_AAS_RECORDTEAMDEATHAREA,
295 | // done.
296 |
297 | BOTLIB_EA_SAY = 400,
298 | BOTLIB_EA_SAY_TEAM,
299 | BOTLIB_EA_USE_ITEM,
300 | BOTLIB_EA_DROP_ITEM,
301 | BOTLIB_EA_USE_INV,
302 | BOTLIB_EA_DROP_INV,
303 | BOTLIB_EA_GESTURE,
304 | BOTLIB_EA_COMMAND,
305 |
306 | BOTLIB_EA_SELECT_WEAPON,
307 | BOTLIB_EA_TALK,
308 | BOTLIB_EA_ATTACK,
309 | BOTLIB_EA_RELOAD,
310 | BOTLIB_EA_USE,
311 | BOTLIB_EA_RESPAWN,
312 | BOTLIB_EA_JUMP,
313 | BOTLIB_EA_DELAYED_JUMP,
314 | BOTLIB_EA_CROUCH,
315 | BOTLIB_EA_WALK,
316 | BOTLIB_EA_MOVE_UP,
317 | BOTLIB_EA_MOVE_DOWN,
318 | BOTLIB_EA_MOVE_FORWARD,
319 | BOTLIB_EA_MOVE_BACK,
320 | BOTLIB_EA_MOVE_LEFT,
321 | BOTLIB_EA_MOVE_RIGHT,
322 | BOTLIB_EA_MOVE,
323 | BOTLIB_EA_VIEW,
324 | // START xkan, 9/16/2002
325 | BOTLIB_EA_PRONE,
326 | // END xkan, 9/16/2002
327 |
328 | BOTLIB_EA_END_REGULAR,
329 | BOTLIB_EA_GET_INPUT,
330 | BOTLIB_EA_RESET_INPUT,
331 |
332 |
333 | BOTLIB_AI_LOAD_CHARACTER = 500,
334 | BOTLIB_AI_FREE_CHARACTER,
335 | BOTLIB_AI_CHARACTERISTIC_FLOAT,
336 | BOTLIB_AI_CHARACTERISTIC_BFLOAT,
337 | BOTLIB_AI_CHARACTERISTIC_INTEGER,
338 | BOTLIB_AI_CHARACTERISTIC_BINTEGER,
339 | BOTLIB_AI_CHARACTERISTIC_STRING,
340 |
341 | BOTLIB_AI_ALLOC_CHAT_STATE,
342 | BOTLIB_AI_FREE_CHAT_STATE,
343 | BOTLIB_AI_QUEUE_CONSOLE_MESSAGE,
344 | BOTLIB_AI_REMOVE_CONSOLE_MESSAGE,
345 | BOTLIB_AI_NEXT_CONSOLE_MESSAGE,
346 | BOTLIB_AI_NUM_CONSOLE_MESSAGE,
347 | BOTLIB_AI_INITIAL_CHAT,
348 | BOTLIB_AI_REPLY_CHAT,
349 | BOTLIB_AI_CHAT_LENGTH,
350 | BOTLIB_AI_ENTER_CHAT,
351 | BOTLIB_AI_STRING_CONTAINS,
352 | BOTLIB_AI_FIND_MATCH,
353 | BOTLIB_AI_MATCH_VARIABLE,
354 | BOTLIB_AI_UNIFY_WHITE_SPACES,
355 | BOTLIB_AI_REPLACE_SYNONYMS,
356 | BOTLIB_AI_LOAD_CHAT_FILE,
357 | BOTLIB_AI_SET_CHAT_GENDER,
358 | BOTLIB_AI_SET_CHAT_NAME,
359 |
360 | BOTLIB_AI_RESET_GOAL_STATE,
361 | BOTLIB_AI_RESET_AVOID_GOALS,
362 | BOTLIB_AI_PUSH_GOAL,
363 | BOTLIB_AI_POP_GOAL,
364 | BOTLIB_AI_EMPTY_GOAL_STACK,
365 | BOTLIB_AI_DUMP_AVOID_GOALS,
366 | BOTLIB_AI_DUMP_GOAL_STACK,
367 | BOTLIB_AI_GOAL_NAME,
368 | BOTLIB_AI_GET_TOP_GOAL,
369 | BOTLIB_AI_GET_SECOND_GOAL,
370 | BOTLIB_AI_CHOOSE_LTG_ITEM,
371 | BOTLIB_AI_CHOOSE_NBG_ITEM,
372 | BOTLIB_AI_TOUCHING_GOAL,
373 | BOTLIB_AI_ITEM_GOAL_IN_VIS_BUT_NOT_VISIBLE,
374 | BOTLIB_AI_GET_LEVEL_ITEM_GOAL,
375 | BOTLIB_AI_AVOID_GOAL_TIME,
376 | BOTLIB_AI_INIT_LEVEL_ITEMS,
377 | BOTLIB_AI_UPDATE_ENTITY_ITEMS,
378 | BOTLIB_AI_LOAD_ITEM_WEIGHTS,
379 | BOTLIB_AI_FREE_ITEM_WEIGHTS,
380 | BOTLIB_AI_SAVE_GOAL_FUZZY_LOGIC,
381 | BOTLIB_AI_ALLOC_GOAL_STATE,
382 | BOTLIB_AI_FREE_GOAL_STATE,
383 |
384 | BOTLIB_AI_RESET_MOVE_STATE,
385 | BOTLIB_AI_MOVE_TO_GOAL,
386 | BOTLIB_AI_MOVE_IN_DIRECTION,
387 | BOTLIB_AI_RESET_AVOID_REACH,
388 | BOTLIB_AI_RESET_LAST_AVOID_REACH,
389 | BOTLIB_AI_REACHABILITY_AREA,
390 | BOTLIB_AI_MOVEMENT_VIEW_TARGET,
391 | BOTLIB_AI_ALLOC_MOVE_STATE,
392 | BOTLIB_AI_FREE_MOVE_STATE,
393 | BOTLIB_AI_INIT_MOVE_STATE,
394 | // Ridah
395 | BOTLIB_AI_INIT_AVOID_REACH,
396 | // done.
397 |
398 | BOTLIB_AI_CHOOSE_BEST_FIGHT_WEAPON,
399 | BOTLIB_AI_GET_WEAPON_INFO,
400 | BOTLIB_AI_LOAD_WEAPON_WEIGHTS,
401 | BOTLIB_AI_ALLOC_WEAPON_STATE,
402 | BOTLIB_AI_FREE_WEAPON_STATE,
403 | BOTLIB_AI_RESET_WEAPON_STATE,
404 |
405 | BOTLIB_AI_GENETIC_PARENTS_AND_CHILD_SELECTION,
406 | BOTLIB_AI_INTERBREED_GOAL_FUZZY_LOGIC,
407 | BOTLIB_AI_MUTATE_GOAL_FUZZY_LOGIC,
408 | BOTLIB_AI_GET_NEXT_CAMP_SPOT_GOAL,
409 | BOTLIB_AI_GET_MAP_LOCATION_GOAL,
410 | BOTLIB_AI_NUM_INITIAL_CHATS,
411 | BOTLIB_AI_GET_CHAT_MESSAGE,
412 | BOTLIB_AI_REMOVE_FROM_AVOID_GOALS,
413 | BOTLIB_AI_PREDICT_VISIBLE_POSITION,
414 |
415 | BOTLIB_AI_SET_AVOID_GOAL_TIME,
416 | BOTLIB_AI_ADD_AVOID_SPOT,
417 | BOTLIB_AAS_ALTERNATIVE_ROUTE_GOAL,
418 | BOTLIB_AAS_PREDICT_ROUTE,
419 | BOTLIB_AAS_POINT_REACHABILITY_AREA_INDEX,
420 |
421 | BOTLIB_PC_LOAD_SOURCE,
422 | BOTLIB_PC_FREE_SOURCE,
423 | BOTLIB_PC_READ_TOKEN,
424 | BOTLIB_PC_SOURCE_FILE_AND_LINE,
425 | BOTLIB_PC_UNREAD_TOKEN,
426 |
427 | PB_STAT_REPORT,
428 |
429 | // zinx
430 | G_SENDMESSAGE,
431 | G_MESSAGESTATUS,
432 | // -zinx
433 | } gameImport_t;
434 |
435 |
436 | //
437 | // functions exported by the game subsystem
438 | //
439 | typedef enum {
440 | GAME_INIT, // ( int levelTime, int randomSeed, int restart );
441 | // init and shutdown will be called every single level
442 | // The game should call G_GET_ENTITY_TOKEN to parse through all the
443 | // entity configuration text and spawn gentities.
444 |
445 | GAME_SHUTDOWN, // (void);
446 |
447 | GAME_CLIENT_CONNECT, // ( int clientNum, qboolean firstTime, qboolean isBot );
448 | // return NULL if the client is allowed to connect, otherwise return
449 | // a text string with the reason for denial
450 |
451 | GAME_CLIENT_BEGIN, // ( int clientNum );
452 |
453 | GAME_CLIENT_USERINFO_CHANGED, // ( int clientNum );
454 |
455 | GAME_CLIENT_DISCONNECT, // ( int clientNum );
456 |
457 | GAME_CLIENT_COMMAND, // ( int clientNum );
458 |
459 | GAME_CLIENT_THINK, // ( int clientNum );
460 |
461 | GAME_RUN_FRAME, // ( int levelTime );
462 |
463 | GAME_CONSOLE_COMMAND, // ( void );
464 | // ConsoleCommand will be called when a command has been issued
465 | // that is not recognized as a builtin function.
466 | // The game can issue trap_argc() / trap_argv() commands to get the command
467 | // and parameters. Return qfalse if the game doesn't recognize it as a command.
468 |
469 | GAME_SNAPSHOT_CALLBACK, // ( int entityNum, int clientNum ); // return qfalse if you don't want it to be added
470 |
471 | BOTAI_START_FRAME, // ( int time );
472 |
473 | // Ridah, Cast AI
474 | BOT_VISIBLEFROMPOS,
475 | BOT_CHECKATTACKATPOS,
476 | // done.
477 |
478 | // zinx
479 | GAME_MESSAGERECEIVED, // ( int cno, const char *buf, int buflen, int commandTime );
480 | // -zinx
481 | } gameExport_t;
482 |
483 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/game/g_team.h:
--------------------------------------------------------------------------------
1 |
2 | // JPW NERVE -- more #defs for GT_WOLF gametype
3 | #define WOLF_CAPTURE_BONUS 15 // capturing major game objective
4 | #define WOLF_STEAL_OBJ_BONUS 10 // stealing objective (first part of capture)
5 | #define WOLF_SECURE_OBJ_BONUS 10 // securing objective from slain enemy
6 | #define WOLF_MEDIC_BONUS 2 // medic resurrect teammate
7 | #define WOLF_REPAIR_BONUS 2 // engineer repair (mg42 etc) bonus
8 | #define WOLF_DYNAMITE_BONUS 5 // engineer dynamite barriacade (dynamite only flag)
9 | #define WOLF_FRAG_CARRIER_BONUS 10 // bonus for fragging enemy carrier
10 | #define WOLF_FLAG_DEFENSE_BONUS 5 // bonus for frag when shooter or target near flag position
11 | #define WOLF_CP_CAPTURE 3 // uncapped checkpoint bonus
12 | #define WOLF_CP_RECOVER 5 // capping an enemy-held checkpoint bonus
13 | #define WOLF_SP_CAPTURE 1 // uncapped spawnpoint bonus
14 | #define WOLF_SP_RECOVER 2 // recovering enemy-held spawnpoint
15 | #define WOLF_CP_PROTECT_BONUS 3 // protect a capture point by shooting target near it
16 | #define WOLF_SP_PROTECT_BONUS 1 // protect a spawnpoint
17 | #define WOLF_FRIENDLY_PENALTY -3 // penalty for fragging teammate
18 | #define WOLF_FRAG_BONUS 1 // score for fragging enemy soldier
19 | #define WOLF_DYNAMITE_PLANT 5 // planted dynamite at objective
20 | #define WOLF_DYNAMITE_DIFFUSE 5 // diffused dynamite at objective
21 | #define WOLF_CP_PROTECT_RADIUS 600 // wolf capture protect radius
22 | #define WOLF_AMMO_UP 1 // pt for giving ammo not to self
23 | #define WOLF_HEALTH_UP 1 // pt for giving health not to self
24 | #define AXIS_OBJECTIVE 1
25 | #define ALLIED_OBJECTIVE 2
26 | #define OBJECTIVE_DESTROYED 4
27 | // jpw
28 |
29 | #define CONSTRUCTIBLE_START_BUILT 1
30 | #define CONSTRUCTIBLE_INVULNERABLE 2
31 | #define AXIS_CONSTRUCTIBLE 4
32 | #define ALLIED_CONSTRUCTIBLE 8
33 | #define CONSTRUCTIBLE_BLOCK_PATHS_WHEN_BUILD 16
34 | #define CONSTRUCTIBLE_NO_AAS_BLOCKING 32
35 | #define CONSTRUCTIBLE_AAS_SCRIPTED 64
36 |
37 | #define EXPLOSIVE_START_INVIS 1
38 | #define EXPLOSIVE_TOUCHABLE 2
39 | #define EXPLOSIVE_USESHADER 4
40 | #define EXPLOSIVE_LOWGRAV 8
41 | #define EXPLOSIVE_NO_AAS_BLOCKING 16
42 | #define EXPLOSIVE_TANK 32
43 |
44 | #define CTF_TARGET_PROTECT_RADIUS 400 // the radius around an object being defended where a target will be worth extra frags
45 |
46 | /*#define CTF_CAPTURE_BONUS 5 // what you get for capture
47 | #define CTF_TEAM_BONUS 0 // what your team gets for capture
48 | #define CTF_RECOVERY_BONUS 1 // what you get for recovery
49 | #define CTF_FLAG_BONUS 0 // what you get for picking up enemy flag
50 | #define CTF_FRAG_CARRIER_BONUS 2 // what you get for fragging enemy flag carrier
51 | #define CTF_FLAG_RETURN_TIME 40000 // seconds until auto return
52 |
53 | #define CTF_CARRIER_DANGER_PROTECT_BONUS 2 // bonus for fraggin someone who has recently hurt your flag carrier
54 | #define CTF_CARRIER_PROTECT_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag carrier
55 | #define CTF_FLAG_DEFENSE_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag
56 | #define CTF_RETURN_FLAG_ASSIST_BONUS 1 // awarded for returning a flag that causes a capture to happen almost immediately
57 | #define CTF_FRAG_CARRIER_ASSIST_BONUS 2 // award for fragging a flag carrier if a capture happens almost immediately
58 |
59 | #define CTF_ATTACKER_PROTECT_RADIUS 400 // the radius around an object being defended where an attacker will get extra frags when making kills
60 |
61 | #define CTF_CARRIER_DANGER_PROTECT_TIMEOUT 8
62 | #define CTF_FRAG_CARRIER_ASSIST_TIMEOUT 10000
63 | #define CTF_RETURN_FLAG_ASSIST_TIMEOUT 10000
64 |
65 | #define CTF_GRAPPLE_SPEED 750 // speed of grapple in flight
66 | #define CTF_GRAPPLE_PULL_SPEED 750 // speed player is pulled at*/
67 |
68 | // Prototypes
69 |
70 | int OtherTeam(int team);
71 | const char *TeamName(int team);
72 | const char *OtherTeamName(int team);
73 | const char *TeamColorString(int team);
74 |
75 | void Team_RemoveFlag(int team);
76 | void Team_DroppedFlagThink(gentity_t *ent);
77 | void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker);
78 | void Team_CheckHurtCarrier(gentity_t *targ, gentity_t *attacker);
79 | void Team_InitGame(void);
80 | void Team_ReturnFlag(gentity_t *ent);
81 | void Team_FreeEntity(gentity_t *ent);
82 | gentity_t *SelectCTFSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles, int spawnObjective );
83 | // START Mad Doc - TDF
84 | gentity_t *SelectPlayerSpawnPoint ( team_t team, int teamstate, vec3_t origin, vec3_t angles);
85 | // END Mad Doc - TDF
86 | int Team_GetLocation(gentity_t *ent);
87 | qboolean Team_GetLocationMsg(gentity_t *ent, char *loc, int loclen);
88 | void TeamplayInfoMessage( team_t team );
89 | void CheckTeamStatus(void);
90 |
91 | int Pickup_Team( gentity_t *ent, gentity_t *other );
92 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/game/surfaceflags.h:
--------------------------------------------------------------------------------
1 | // This file must be identical in the quake and utils directories
2 |
3 |
4 |
5 |
6 |
7 |
8 | // contents flags are seperate bits
9 | // a given brush can contribute multiple content bits
10 |
11 | // these definitions also need to be in q_shared.h!
12 |
13 | #define CONTENTS_SOLID 0x00000001
14 | #define CONTENTS_LIGHTGRID 0x00000004
15 | #define CONTENTS_LAVA 0x00000008
16 | #define CONTENTS_SLIME 0x00000010
17 | #define CONTENTS_WATER 0x00000020
18 | #define CONTENTS_FOG 0x00000040
19 | #define CONTENTS_MISSILECLIP 0x00000080
20 | #define CONTENTS_ITEM 0x00000100
21 | #define CONTENTS_MOVER 0x00004000
22 | #define CONTENTS_AREAPORTAL 0x00008000
23 | #define CONTENTS_PLAYERCLIP 0x00010000
24 | #define CONTENTS_MONSTERCLIP 0x00020000
25 | #define CONTENTS_TELEPORTER 0x00040000
26 | #define CONTENTS_JUMPPAD 0x00080000
27 | #define CONTENTS_CLUSTERPORTAL 0x00100000
28 | #define CONTENTS_DONOTENTER 0x00200000
29 | #define CONTENTS_DONOTENTER_LARGE 0x00400000
30 | #define CONTENTS_ORIGIN 0x01000000 // removed before bsping an entity
31 | #define CONTENTS_BODY 0x02000000 // should never be on a brush, only in game
32 | #define CONTENTS_CORPSE 0x04000000
33 | #define CONTENTS_DETAIL 0x08000000 // brushes not used for the bsp
34 |
35 | #define CONTENTS_STRUCTURAL 0x10000000 // brushes used for the bsp
36 | #define CONTENTS_TRANSLUCENT 0x20000000 // don't consume surface fragments inside
37 | #define CONTENTS_TRIGGER 0x40000000
38 | #define CONTENTS_NODROP 0x80000000 // don't leave bodies or items (death fog, lava)
39 |
40 | #define SURF_NODAMAGE 0x00000001 // never give falling damage
41 | #define SURF_SLICK 0x00000002 // effects game physics
42 | #define SURF_SKY 0x00000004 // lighting from environment map
43 | #define SURF_LADDER 0x00000008
44 | #define SURF_NOIMPACT 0x00000010 // don't make missile explosions
45 | #define SURF_NOMARKS 0x00000020 // don't leave missile marks
46 | #define SURF_SPLASH 0x00000040 // out of surf's, so replacing unused 'SURF_FLESH' - and as SURF_CERAMIC wasn't used, it's now SURF_SPLASH
47 | #define SURF_NODRAW 0x00000080 // don't generate a drawsurface at all
48 | #define SURF_HINT 0x00000100 // make a primary bsp splitter
49 | #define SURF_SKIP 0x00000200 // completely ignore, allowing non-closed brushes
50 | #define SURF_NOLIGHTMAP 0x00000400 // surface doesn't need a lightmap
51 | #define SURF_POINTLIGHT 0x00000800 // generate lighting info at vertexes
52 | #define SURF_METAL 0x00001000 // clanking footsteps
53 | #define SURF_NOSTEPS 0x00002000 // no footstep sounds
54 | #define SURF_NONSOLID 0x00004000 // don't collide against curves with this set
55 | #define SURF_LIGHTFILTER 0x00008000 // act as a light filter during q3map -light
56 | #define SURF_ALPHASHADOW 0x00010000 // do per-pixel light shadow casting in q3map
57 | #define SURF_NODLIGHT 0x00020000 // don't dlight even if solid (solid lava, skies)
58 | #define SURF_WOOD 0x00040000
59 | #define SURF_GRASS 0x00080000
60 | #define SURF_GRAVEL 0x00100000
61 | #define SURF_GLASS 0x00200000 // out of surf's, so replacing unused 'SURF_SMGROUP'
62 | #define SURF_SNOW 0x00400000
63 | #define SURF_ROOF 0x00800000
64 | #define SURF_RUBBLE 0x01000000
65 | #define SURF_CARPET 0x02000000
66 | #define SURF_MONSTERSLICK 0x04000000 // slick surf that only affects ai's
67 | #define SURF_MONSLICK_W 0x08000000
68 | #define SURF_MONSLICK_N 0x10000000
69 | #define SURF_MONSLICK_E 0x20000000
70 | #define SURF_MONSLICK_S 0x40000000
71 |
72 | #define SURF_LANDMINE 0x80000000 // ydnar: ok to place landmines on this surface
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/ui/keycodes.h:
--------------------------------------------------------------------------------
1 | #ifndef __KEYCODES_H__
2 | #define __KEYCODES_H__
3 |
4 | //
5 | // these are the key numbers that should be passed to KeyEvent
6 | //
7 |
8 | // normal keys should be passed as lowercased ascii
9 |
10 | typedef enum {
11 | K_TAB = 9,
12 | K_ENTER = 13,
13 | K_ESCAPE = 27,
14 | K_SPACE = 32,
15 |
16 | K_BACKSPACE = 127,
17 |
18 | K_COMMAND = 128,
19 | K_CAPSLOCK,
20 | K_POWER,
21 | K_PAUSE,
22 |
23 | K_UPARROW,
24 | K_DOWNARROW,
25 | K_LEFTARROW,
26 | K_RIGHTARROW,
27 |
28 | K_ALT,
29 | K_CTRL,
30 | K_SHIFT,
31 | K_INS,
32 | K_DEL,
33 | K_PGDN,
34 | K_PGUP,
35 | K_HOME,
36 | K_END,
37 |
38 | K_F1,
39 | K_F2,
40 | K_F3,
41 | K_F4,
42 | K_F5,
43 | K_F6,
44 | K_F7,
45 | K_F8,
46 | K_F9,
47 | K_F10,
48 | K_F11,
49 | K_F12,
50 | K_F13,
51 | K_F14,
52 | K_F15,
53 |
54 | K_KP_HOME,
55 | K_KP_UPARROW,
56 | K_KP_PGUP,
57 | K_KP_LEFTARROW,
58 | K_KP_5,
59 | K_KP_RIGHTARROW,
60 | K_KP_END,
61 | K_KP_DOWNARROW,
62 | K_KP_PGDN,
63 | K_KP_ENTER,
64 | K_KP_INS,
65 | K_KP_DEL,
66 | K_KP_SLASH,
67 | K_KP_MINUS,
68 | K_KP_PLUS,
69 | K_KP_NUMLOCK,
70 | K_KP_STAR,
71 | K_KP_EQUALS,
72 |
73 | K_MOUSE1,
74 | K_MOUSE2,
75 | K_MOUSE3,
76 | K_MOUSE4,
77 | K_MOUSE5,
78 |
79 | K_MWHEELDOWN,
80 | K_MWHEELUP,
81 |
82 | K_JOY1,
83 | K_JOY2,
84 | K_JOY3,
85 | K_JOY4,
86 | K_JOY5,
87 | K_JOY6,
88 | K_JOY7,
89 | K_JOY8,
90 | K_JOY9,
91 | K_JOY10,
92 | K_JOY11,
93 | K_JOY12,
94 | K_JOY13,
95 | K_JOY14,
96 | K_JOY15,
97 | K_JOY16,
98 | K_JOY17,
99 | K_JOY18,
100 | K_JOY19,
101 | K_JOY20,
102 | K_JOY21,
103 | K_JOY22,
104 | K_JOY23,
105 | K_JOY24,
106 | K_JOY25,
107 | K_JOY26,
108 | K_JOY27,
109 | K_JOY28,
110 | K_JOY29,
111 | K_JOY30,
112 | K_JOY31,
113 | K_JOY32,
114 |
115 | K_AUX1,
116 | K_AUX2,
117 | K_AUX3,
118 | K_AUX4,
119 | K_AUX5,
120 | K_AUX6,
121 | K_AUX7,
122 | K_AUX8,
123 | K_AUX9,
124 | K_AUX10,
125 | K_AUX11,
126 | K_AUX12,
127 | K_AUX13,
128 | K_AUX14,
129 | K_AUX15,
130 | K_AUX16,
131 |
132 | K_LAST_KEY // this had better be <256!
133 | } keyNum_t;
134 |
135 |
136 | // The menu code needs to get both key and char events, but
137 | // to avoid duplicating the paths, the char events are just
138 | // distinguished by or'ing in K_CHAR_FLAG (ugly)
139 | #define K_CHAR_FLAG 1024
140 |
141 | #endif
142 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/ui/ui_public.h:
--------------------------------------------------------------------------------
1 | #ifndef __UI_PUBLIC_H__
2 | #define __UI_PUBLIC_H__
3 |
4 | #define UI_API_VERSION 4
5 |
6 | typedef struct {
7 | connstate_t connState;
8 | int connectPacketCount;
9 | int clientNum;
10 | char servername[MAX_STRING_CHARS];
11 | char updateInfoString[MAX_STRING_CHARS];
12 | char messageString[MAX_STRING_CHARS];
13 | } uiClientState_t;
14 |
15 | typedef enum {
16 | UI_ERROR,
17 | UI_PRINT,
18 | UI_MILLISECONDS,
19 | UI_CVAR_SET,
20 | UI_CVAR_VARIABLEVALUE,
21 | UI_CVAR_VARIABLESTRINGBUFFER,
22 | UI_CVAR_LATCHEDVARIABLESTRINGBUFFER,
23 | UI_CVAR_SETVALUE,
24 | UI_CVAR_RESET,
25 | UI_CVAR_CREATE,
26 | UI_CVAR_INFOSTRINGBUFFER,
27 | UI_ARGC,
28 | UI_ARGV,
29 | UI_CMD_EXECUTETEXT,
30 | UI_ADDCOMMAND,
31 | UI_FS_FOPENFILE,
32 | UI_FS_READ,
33 | UI_FS_WRITE,
34 | UI_FS_FCLOSEFILE,
35 | UI_FS_GETFILELIST,
36 | UI_FS_DELETEFILE,
37 | UI_FS_COPYFILE,
38 | UI_R_REGISTERMODEL,
39 | UI_R_REGISTERSKIN,
40 | UI_R_REGISTERSHADERNOMIP,
41 | UI_R_CLEARSCENE,
42 | UI_R_ADDREFENTITYTOSCENE,
43 | UI_R_ADDPOLYTOSCENE,
44 | UI_R_ADDPOLYSTOSCENE,
45 | // JOSEPH 12-6-99
46 | UI_R_ADDLIGHTTOSCENE,
47 | // END JOSEPH
48 | //----(SA)
49 | UI_R_ADDCORONATOSCENE,
50 | //----(SA)
51 | UI_R_RENDERSCENE,
52 | UI_R_SETCOLOR,
53 | UI_R_DRAW2DPOLYS,
54 | UI_R_DRAWSTRETCHPIC,
55 | UI_R_DRAWROTATEDPIC,
56 | UI_UPDATESCREEN, // 30
57 | UI_CM_LERPTAG,
58 | UI_CM_LOADMODEL,
59 | UI_S_REGISTERSOUND,
60 | UI_S_STARTLOCALSOUND,
61 | UI_S_FADESTREAMINGSOUND, //----(SA) added
62 | UI_S_FADEALLSOUNDS, //----(SA) added
63 | UI_KEY_KEYNUMTOSTRINGBUF,
64 | UI_KEY_GETBINDINGBUF,
65 | UI_KEY_SETBINDING,
66 | UI_KEY_BINDINGTOKEYS,
67 | UI_KEY_ISDOWN,
68 | UI_KEY_GETOVERSTRIKEMODE,
69 | UI_KEY_SETOVERSTRIKEMODE,
70 | UI_KEY_CLEARSTATES,
71 | UI_KEY_GETCATCHER,
72 | UI_KEY_SETCATCHER,
73 | UI_GETCLIPBOARDDATA,
74 | UI_GETGLCONFIG,
75 | UI_GETCLIENTSTATE,
76 | UI_GETCONFIGSTRING,
77 | UI_LAN_GETLOCALSERVERCOUNT,
78 | UI_LAN_GETLOCALSERVERADDRESSSTRING,
79 | UI_LAN_GETGLOBALSERVERCOUNT, // 50
80 | UI_LAN_GETGLOBALSERVERADDRESSSTRING,
81 | UI_LAN_GETPINGQUEUECOUNT,
82 | UI_LAN_CLEARPING,
83 | UI_LAN_GETPING,
84 | UI_LAN_GETPINGINFO,
85 | UI_CVAR_REGISTER,
86 | UI_CVAR_UPDATE,
87 | UI_MEMORY_REMAINING,
88 |
89 | UI_GET_CDKEY,
90 | UI_SET_CDKEY,
91 | UI_R_REGISTERFONT,
92 | UI_R_MODELBOUNDS,
93 | UI_PC_ADD_GLOBAL_DEFINE,
94 | UI_PC_REMOVE_ALL_GLOBAL_DEFINES,
95 | UI_PC_LOAD_SOURCE,
96 | UI_PC_FREE_SOURCE,
97 | UI_PC_READ_TOKEN,
98 | UI_PC_SOURCE_FILE_AND_LINE,
99 | UI_PC_UNREAD_TOKEN,
100 | UI_S_STOPBACKGROUNDTRACK,
101 | UI_S_STARTBACKGROUNDTRACK,
102 | UI_REAL_TIME,
103 | UI_LAN_GETSERVERCOUNT,
104 | UI_LAN_GETSERVERADDRESSSTRING,
105 | UI_LAN_GETSERVERINFO,
106 | UI_LAN_MARKSERVERVISIBLE,
107 | UI_LAN_UPDATEVISIBLEPINGS,
108 | UI_LAN_RESETPINGS,
109 | UI_LAN_LOADCACHEDSERVERS,
110 | UI_LAN_SAVECACHEDSERVERS,
111 | UI_LAN_ADDSERVER,
112 | UI_LAN_REMOVESERVER,
113 | UI_CIN_PLAYCINEMATIC,
114 | UI_CIN_STOPCINEMATIC,
115 | UI_CIN_RUNCINEMATIC,
116 | UI_CIN_DRAWCINEMATIC,
117 | UI_CIN_SETEXTENTS,
118 | UI_R_REMAP_SHADER,
119 | UI_VERIFY_CDKEY,
120 | UI_LAN_SERVERSTATUS,
121 | UI_LAN_GETSERVERPING,
122 | UI_LAN_SERVERISVISIBLE,
123 | UI_LAN_COMPARESERVERS,
124 | UI_LAN_SERVERISINFAVORITELIST,
125 | UI_CL_GETLIMBOSTRING, // NERVE - SMF
126 | UI_SET_PBCLSTATUS, // DHM - Nerve
127 | UI_CHECKAUTOUPDATE, // DHM - Nerve
128 | UI_GET_AUTOUPDATE, // DHM - Nerve
129 | UI_CL_TRANSLATE_STRING,
130 | UI_OPENURL,
131 | UI_SET_PBSVSTATUS, // TTimo
132 |
133 | UI_MEMSET = 200,
134 | UI_MEMCPY,
135 | UI_STRNCPY,
136 | UI_SIN,
137 | UI_COS,
138 | UI_ATAN2,
139 | UI_SQRT,
140 | UI_FLOOR,
141 | UI_CEIL,
142 | UI_GETHUNKDATA
143 |
144 | } uiImport_t;
145 |
146 | #define SORT_HOST 0
147 | #define SORT_MAP 1
148 | #define SORT_CLIENTS 2
149 | #define SORT_GAME 3
150 | #define SORT_PING 4
151 | #define SORT_FILTERS 5
152 | #define SORT_FAVOURITES 6
153 |
154 | typedef enum {
155 | UI_GETAPIVERSION = 0, // system reserved
156 |
157 | UI_INIT,
158 | // void UI_Init( void );
159 |
160 | UI_SHUTDOWN,
161 | // void UI_Shutdown( void );
162 |
163 | UI_KEY_EVENT,
164 | // void UI_KeyEvent( int key );
165 |
166 | UI_MOUSE_EVENT,
167 | // void UI_MouseEvent( int dx, int dy );
168 |
169 | UI_REFRESH,
170 | // void UI_Refresh( int time );
171 |
172 | UI_IS_FULLSCREEN,
173 | // qboolean UI_IsFullscreen( void );
174 |
175 | UI_SET_ACTIVE_MENU,
176 | // void UI_SetActiveMenu( uiMenuCommand_t menu );
177 |
178 | UI_GET_ACTIVE_MENU,
179 | // void UI_GetActiveMenu( void );
180 |
181 | UI_CONSOLE_COMMAND,
182 | // qboolean UI_ConsoleCommand( void );
183 |
184 | UI_DRAW_CONNECT_SCREEN,
185 | // void UI_DrawConnectScreen( qboolean overlay );
186 | UI_HASUNIQUECDKEY,
187 | // if !overlay, the background will be drawn, otherwise it will be
188 | // overlayed over whatever the cgame has drawn.
189 | // a GetClientState syscall will be made to get the current strings
190 | UI_CHECKEXECKEY, // NERVE - SMF
191 |
192 | UI_WANTSBINDKEYS,
193 |
194 | } uiExport_t;
195 |
196 | #endif
197 |
--------------------------------------------------------------------------------
/CCHookReloaded/ETSDK/src/ui/ui_shared.c:
--------------------------------------------------------------------------------
1 | #include "../game/q_shared.h"
2 | #include "../cgame/tr_types.h"
3 | #include "keycodes.h"
4 |
5 | #include "../../etmain/ui/menudef.h"
6 |
7 | void MiniAngleToAxis(vec_t angle, vec2_t axes[2])
8 | {
9 | axes[0][0] = (vec_t)sin( -angle );
10 | axes[0][1] = -(vec_t)cos( -angle );
11 |
12 | axes[1][0] = -axes[0][1];
13 | axes[1][1] = axes[0][0];
14 | }
15 | void SetupRotatedThing(polyVert_t* verts, vec2_t org, float w, float h, vec_t angle)
16 | {
17 | vec2_t axes[2];
18 |
19 | MiniAngleToAxis( angle, axes );
20 |
21 | verts[0].xyz[0] = org[0] - ( w * 0.5f ) * axes[0][0];
22 | verts[0].xyz[1] = org[1] - ( w * 0.5f ) * axes[0][1];
23 | verts[0].xyz[2] = 0;
24 | verts[0].st[0] = 0;
25 | verts[0].st[1] = 1;
26 | verts[0].modulate[0] = 255;
27 | verts[0].modulate[1] = 255;
28 | verts[0].modulate[2] = 255;
29 | verts[0].modulate[3] = 255;
30 |
31 | verts[1].xyz[0] = verts[0].xyz[0] + w * axes[0][0];
32 | verts[1].xyz[1] = verts[0].xyz[1] + w * axes[0][1];
33 | verts[1].xyz[2] = 0;
34 | verts[1].st[0] = 1;
35 | verts[1].st[1] = 1;
36 | verts[1].modulate[0] = 255;
37 | verts[1].modulate[1] = 255;
38 | verts[1].modulate[2] = 255;
39 | verts[1].modulate[3] = 255;
40 |
41 | verts[2].xyz[0] = verts[1].xyz[0] + h * axes[1][0];
42 | verts[2].xyz[1] = verts[1].xyz[1] + h * axes[1][1];
43 | verts[2].xyz[2] = 0;
44 | verts[2].st[0] = 1;
45 | verts[2].st[1] = 0;
46 | verts[2].modulate[0] = 255;
47 | verts[2].modulate[1] = 255;
48 | verts[2].modulate[2] = 255;
49 | verts[2].modulate[3] = 255;
50 |
51 | verts[3].xyz[0] = verts[2].xyz[0] - w * axes[0][0];
52 | verts[3].xyz[1] = verts[2].xyz[1] - w * axes[0][1];
53 | verts[3].xyz[2] = 0;
54 | verts[3].st[0] = 0;
55 | verts[3].st[1] = 0;
56 | verts[3].modulate[0] = 255;
57 | verts[3].modulate[1] = 255;
58 | verts[3].modulate[2] = 255;
59 | verts[3].modulate[3] = 255;
60 | }
61 |
--------------------------------------------------------------------------------
/CCHookReloaded/RetSpoof.asm:
--------------------------------------------------------------------------------
1 | .686p
2 | .xmm
3 | .model flat
4 | .code
5 |
6 | @SpoofCall12@72 PROC
7 | ;
8 | ; 00448AE2 | 83 C4 34 | add esp,34 |
9 | ; 00448B0C | 85 FF | test edi,edi |
10 | ; 00448B0E | 74 06 <--| je et.448B16 |
11 | ; 00448B10 | 89 3D F0 29 02 01 | | mov dword ptr ds:[10229F0],edi |
12 | ; 00448B16 | 5F -->| pop edi |
13 | ; 00448B17 | 5E | pop esi |
14 | ; 00448B18 | C3 | ret |
15 | ;
16 | ;
17 | ; -------------------
18 | ; SpoofCall:
19 | ; ecx = VM_Call_vmMain return address (0x00448AE2)
20 | ; edx = orig_vmMain
21 | ; -------------------
22 | ; 40 push 0 <- retaddr
23 | ; 3C push 0 <- esi
24 | ; 38 push 0 <- edi
25 | ; 34 push a12
26 | ; 30 push a11
27 | ; 2C push a10
28 | ; 28 push a9
29 | ; 24 push a8
30 | ; 20 push a7
31 | ; 1C push a6
32 | ; 18 push a5
33 | ; 14 push a4
34 | ; 10 push a3
35 | ; C push a2
36 | ; 8 push a1
37 | ; 4 push id
38 | ; 0 retaddr
39 |
40 | ; Preserve return address, esi, edi
41 | mov eax, [esp]
42 | mov [esp + 40h], eax
43 | mov [esp + 3Ch], esi
44 | mov [esp + 38h], edi
45 |
46 | ; Set fake return address
47 | mov [esp], ecx
48 | jmp edx
49 | @SpoofCall12@72 ENDP
50 |
51 |
52 | @SpoofCall12_Steam@76 PROC
53 | ;
54 | ; 0043BF48 | 83 C4 34 | add esp, 34h |
55 | ; 0043BF6A | 8B C8 | mov ecx, eax |
56 | ; 0043BF6C | 85 FF | test edi, edi |
57 | ; 0043BF6E | A1 38 53 A7 00 | mov eax, currentVM |
58 | ; 0043BF73 | 0F 45 C7 | cmovnz eax, edi |
59 | ; 0043BF76 | 5F | pop edi |
60 | ; 0043BF77 | A3 38 53 A7 00 | mov currentVM, eax |
61 | ; 0043BF7C | 8B C1 | mov eax, ecx |
62 | ; 0043BF7E | 5E | pop esi |
63 | ; 0043BF7F | 5D | pop ebp |
64 | ; 0043BF80 | C3 | ret |
65 | ;
66 | ;
67 | ; -------------------
68 | ; SpoofCall:
69 | ; ecx = VM_Call_vmMain return address (0x0043BF48)
70 | ; edx = orig_vmMain
71 | ; -------------------
72 | ; 44 push 0 <- retaddr
73 | ; 40 push 0 <- ebp
74 | ; 3C push 0 <- esi
75 | ; 38 push 0 <- edi
76 | ; 34 push a12
77 | ; 30 push a11
78 | ; 2C push a10
79 | ; 28 push a9
80 | ; 24 push a8
81 | ; 20 push a7
82 | ; 1C push a6
83 | ; 18 push a5
84 | ; 14 push a4
85 | ; 10 push a3
86 | ; C push a2
87 | ; 8 push a1
88 | ; 4 push id
89 | ; 0 retaddr
90 |
91 | ; Preserve return address, ebp, esi, edi
92 | mov eax, [esp]
93 | mov [esp + 44h], eax
94 | mov [esp + 40h], ebp
95 | mov [esp + 3Ch], esi
96 | mov [esp + 38h], edi
97 |
98 | ; Set fake return address
99 | mov [esp], ecx
100 | jmp edx
101 | @SpoofCall12_Steam@76 ENDP
102 |
103 |
104 | @SpoofCall16@92 PROC
105 | ;
106 | ; 0042813B 83 C4 44 add esp, 44h
107 | ; 0042813E 8B C8 mov ecx, eax
108 | ; ...
109 | ; 00428154 A1 10 C8 9C 00 mov eax, dword_9CC810
110 | ; 00428159 85 FF test edi, edi
111 | ; 0042815B 0F 45 C7 cmovnz eax, edi
112 | ; 0042815E A3 10 C8 9C 00 mov dword_9CC810, eax
113 | ; 00428163 8B C1 mov eax, ecx
114 | ; 00428165 8B 4D FC mov ecx, [ebp+var_4]
115 | ; 00428168 5F pop edi
116 | ; 00428169 33 CD xor ecx, ebp ; StackCookie
117 | ; 0042816B 5E pop esi
118 | ; 0042816C E8 59 0D 34 00 call @__security_check_cookie@4 ; __security_check_cookie(x)
119 | ; 00428171 8B E5 mov esp, ebp
120 | ; 00428173 5D pop ebp
121 | ; 00428174 C3 retn
122 | ;
123 | ;
124 | ; -------------------
125 | ; SpoofCall:
126 | ; ecx = VM_Call_vmMain return address
127 | ; edx = orig_vmMain
128 | ; -------------------
129 | ; 54 push 0 <- retaddr
130 | ; 50 push 0 <- ebp
131 | ; 4C push 0 <- esi
132 | ; 48 push 0 <- edi
133 | ; 44 push a16
134 | ; 40 push a15
135 | ; 3C push a14
136 | ; 38 push a13
137 | ; 34 push a12
138 | ; 30 push a11
139 | ; 2C push a10
140 | ; 28 push a9
141 | ; 24 push a8
142 | ; 20 push a7
143 | ; 1C push a6
144 | ; 18 push a5
145 | ; 14 push a4
146 | ; 10 push a3
147 | ; C push a2
148 | ; 8 push a1
149 | ; 4 push id
150 | ; 0 retaddr
151 |
152 | ; Grab stack cookie and prepare xor key
153 | mov eax, [esp + 50h]
154 | add esp, 50h
155 | xor eax, esp ; esp == future ebp value
156 | mov [esp - 4h], eax ; ~~
157 | sub esp, 50h
158 |
159 | ; Preserve return address, ebp, esi, edi
160 | mov eax, [esp]
161 | mov [esp + 54h], eax
162 | mov [esp + 50h], ebp
163 | ;mov [esp + 4Ch], esi ; Trashed, overwritten by security cookie
164 | mov [esp + 48h], edi
165 |
166 | lea ebp, [esp + 50h]
167 |
168 | ; Set fake return address
169 | mov [esp], ecx
170 | jmp edx
171 | @SpoofCall16@92 ENDP
172 |
173 | end
--------------------------------------------------------------------------------
/CCHookReloaded/base64.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 | *
4 | * @APPLE_LICENSE_HEADER_START@
5 | *
6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 | *
8 | * This file contains Original Code and/or Modifications of Original Code
9 | * as defined in and that are subject to the Apple Public Source License
10 | * Version 2.0 (the 'License'). You may not use this file except in
11 | * compliance with the License. Please obtain a copy of the License at
12 | * http://www.opensource.apple.com/apsl/ and read it before using this
13 | * file.
14 | *
15 | * The Original Code and all software distributed under the License are
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 | * Please see the License for the specific language governing rights and
21 | * limitations under the License.
22 | *
23 | * @APPLE_LICENSE_HEADER_END@
24 | */
25 | /* ====================================================================
26 | * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
27 | *
28 | * Redistribution and use in source and binary forms, with or without
29 | * modification, are permitted provided that the following conditions
30 | * are met:
31 | *
32 | * 1. Redistributions of source code must retain the above copyright
33 | * notice, this list of conditions and the following disclaimer.
34 | *
35 | * 2. Redistributions in binary form must reproduce the above copyright
36 | * notice, this list of conditions and the following disclaimer in
37 | * the documentation and/or other materials provided with the
38 | * distribution.
39 | *
40 | * 3. All advertising materials mentioning features or use of this
41 | * software must display the following acknowledgment:
42 | * "This product includes software developed by the Apache Group
43 | * for use in the Apache HTTP server project (http://www.apache.org/)."
44 | *
45 | * 4. The names "Apache Server" and "Apache Group" must not be used to
46 | * endorse or promote products derived from this software without
47 | * prior written permission. For written permission, please contact
48 | * apache@apache.org.
49 | *
50 | * 5. Products derived from this software may not be called "Apache"
51 | * nor may "Apache" appear in their names without prior written
52 | * permission of the Apache Group.
53 | *
54 | * 6. Redistributions of any form whatsoever must retain the following
55 | * acknowledgment:
56 | * "This product includes software developed by the Apache Group
57 | * for use in the Apache HTTP server project (http://www.apache.org/)."
58 | *
59 | * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
60 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
63 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
64 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
65 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
66 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
68 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
69 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70 | * OF THE POSSIBILITY OF SUCH DAMAGE.
71 | * ====================================================================
72 | *
73 | * This software consists of voluntary contributions made by many
74 | * individuals on behalf of the Apache Group and was originally based
75 | * on public domain software written at the National Center for
76 | * Supercomputing Applications, University of Illinois, Urbana-Champaign.
77 | * For more information on the Apache Group and the Apache HTTP server
78 | * project, please see .
79 | *
80 | */
81 |
82 | /* Base64 encoder/decoder. Originally Apache file ap_base64.c
83 | */
84 |
85 | #include
86 |
87 | #include "base64.h"
88 |
89 | /* aaaack but it's fast and const should make it shared text page. */
90 | static const unsigned char pr2six[256] =
91 | {
92 | /* ASCII table */
93 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
94 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
95 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 63, 64, 64,
96 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
97 | 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
98 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
99 | 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
100 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
101 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
102 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
103 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
104 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
105 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
106 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
107 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
108 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
109 | };
110 |
111 | int Base64decode_len(const char *bufcoded)
112 | {
113 | int nbytesdecoded;
114 | register const unsigned char *bufin;
115 | register int nprbytes;
116 |
117 | bufin = (const unsigned char *) bufcoded;
118 | while (pr2six[*(bufin++)] <= 63);
119 |
120 | nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
121 | nbytesdecoded = ((nprbytes + 3) / 4) * 3;
122 |
123 | return nbytesdecoded + 1;
124 | }
125 |
126 | int Base64decode(char *bufplain, const char *bufcoded)
127 | {
128 | int nbytesdecoded;
129 | register const unsigned char *bufin;
130 | register unsigned char *bufout;
131 | register int nprbytes;
132 |
133 | bufin = (const unsigned char *) bufcoded;
134 | while (pr2six[*(bufin++)] <= 63);
135 | nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
136 | nbytesdecoded = ((nprbytes + 3) / 4) * 3;
137 |
138 | bufout = (unsigned char *) bufplain;
139 | bufin = (const unsigned char *) bufcoded;
140 |
141 | while (nprbytes > 4) {
142 | *(bufout++) =
143 | (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
144 | *(bufout++) =
145 | (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
146 | *(bufout++) =
147 | (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
148 | bufin += 4;
149 | nprbytes -= 4;
150 | }
151 |
152 | /* Note: (nprbytes == 1) would be an error, so just ingore that case */
153 | if (nprbytes > 1) {
154 | *(bufout++) =
155 | (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
156 | }
157 | if (nprbytes > 2) {
158 | *(bufout++) =
159 | (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
160 | }
161 | if (nprbytes > 3) {
162 | *(bufout++) =
163 | (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
164 | }
165 |
166 | *(bufout++) = '\0';
167 | nbytesdecoded -= (4 - nprbytes) & 3;
168 | return nbytesdecoded;
169 | }
170 |
171 | static const char basis_64[] =
172 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";
173 |
174 | int Base64encode_len(int len)
175 | {
176 | return ((len + 2) / 3 * 4) + 1;
177 | }
178 |
179 | int Base64encode(char *encoded, const char *string, int len)
180 | {
181 | int i;
182 | char *p;
183 |
184 | p = encoded;
185 | for (i = 0; i < len - 2; i += 3) {
186 | *p++ = basis_64[(string[i] >> 2) & 0x3F];
187 | *p++ = basis_64[((string[i] & 0x3) << 4) |
188 | ((int) (string[i + 1] & 0xF0) >> 4)];
189 | *p++ = basis_64[((string[i + 1] & 0xF) << 2) |
190 | ((int) (string[i + 2] & 0xC0) >> 6)];
191 | *p++ = basis_64[string[i + 2] & 0x3F];
192 | }
193 | if (i < len) {
194 | *p++ = basis_64[(string[i] >> 2) & 0x3F];
195 | if (i == (len - 1)) {
196 | *p++ = basis_64[((string[i] & 0x3) << 4)];
197 | //*p++ = '='; // The ETPro implementation is not adding padding
198 | }
199 | else {
200 | *p++ = basis_64[((string[i] & 0x3) << 4) |
201 | ((int) (string[i + 1] & 0xF0) >> 4)];
202 | *p++ = basis_64[((string[i + 1] & 0xF) << 2)];
203 | }
204 | //*p++ = '='; // The ETPro implementation is not adding padding
205 | }
206 |
207 | *p++ = '\0';
208 | return p - encoded;
209 | }
--------------------------------------------------------------------------------
/CCHookReloaded/base64.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 | *
4 | * @APPLE_LICENSE_HEADER_START@
5 | *
6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 | *
8 | * This file contains Original Code and/or Modifications of Original Code
9 | * as defined in and that are subject to the Apple Public Source License
10 | * Version 2.0 (the 'License'). You may not use this file except in
11 | * compliance with the License. Please obtain a copy of the License at
12 | * http://www.opensource.apple.com/apsl/ and read it before using this
13 | * file.
14 | *
15 | * The Original Code and all software distributed under the License are
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 | * Please see the License for the specific language governing rights and
21 | * limitations under the License.
22 | *
23 | * @APPLE_LICENSE_HEADER_END@
24 | */
25 | /* ====================================================================
26 | * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
27 | *
28 | * Redistribution and use in source and binary forms, with or without
29 | * modification, are permitted provided that the following conditions
30 | * are met:
31 | *
32 | * 1. Redistributions of source code must retain the above copyright
33 | * notice, this list of conditions and the following disclaimer.
34 | *
35 | * 2. Redistributions in binary form must reproduce the above copyright
36 | * notice, this list of conditions and the following disclaimer in
37 | * the documentation and/or other materials provided with the
38 | * distribution.
39 | *
40 | * 3. All advertising materials mentioning features or use of this
41 | * software must display the following acknowledgment:
42 | * "This product includes software developed by the Apache Group
43 | * for use in the Apache HTTP server project (http://www.apache.org/)."
44 | *
45 | * 4. The names "Apache Server" and "Apache Group" must not be used to
46 | * endorse or promote products derived from this software without
47 | * prior written permission. For written permission, please contact
48 | * apache@apache.org.
49 | *
50 | * 5. Products derived from this software may not be called "Apache"
51 | * nor may "Apache" appear in their names without prior written
52 | * permission of the Apache Group.
53 | *
54 | * 6. Redistributions of any form whatsoever must retain the following
55 | * acknowledgment:
56 | * "This product includes software developed by the Apache Group
57 | * for use in the Apache HTTP server project (http://www.apache.org/)."
58 | *
59 | * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
60 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
63 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
64 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
65 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
66 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
68 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
69 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70 | * OF THE POSSIBILITY OF SUCH DAMAGE.
71 | * ====================================================================
72 | *
73 | * This software consists of voluntary contributions made by many
74 | * individuals on behalf of the Apache Group and was originally based
75 | * on public domain software written at the National Center for
76 | * Supercomputing Applications, University of Illinois, Urbana-Champaign.
77 | * For more information on the Apache Group and the Apache HTTP server
78 | * project, please see .
79 | *
80 | */
81 |
82 |
83 |
84 | #ifndef _BASE64_H_
85 | #define _BASE64_H_
86 |
87 | #ifdef __cplusplus
88 | extern "C" {
89 | #endif
90 |
91 | int Base64encode_len(int len);
92 | int Base64encode(char * coded_dst, const char *plain_src,int len_plain_src);
93 |
94 | int Base64decode_len(const char * coded_src);
95 | int Base64decode(char * plain_dst, const char *coded_src);
96 |
97 | #ifdef __cplusplus
98 | }
99 | #endif
100 |
101 | #endif //_BASE64_H_
--------------------------------------------------------------------------------
/CCHookReloaded/config.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | struct SConfig
4 | {
5 | // General
6 | const char *pakName = "cch";
7 |
8 |
9 | // Chams
10 | bool pickupChams = true;
11 | vec4_t pickupVisRGBA = { 0, 255, 0, 0 };
12 | vec4_t pickupInvRGBA = { 0, 40, 0, 0 };
13 |
14 | bool missileChams = true;
15 | vec4_t missileVisRGBA = { 255, 0, 0, 0 };
16 | vec4_t missileInvRGBA = { 80, 0, 0, 0 };
17 |
18 | bool playerChams = true;
19 | bool playerOutlineChams = false;
20 | bool playerCorpseChams = true;
21 | vec4_t playerVulnRGBA = { 255, 0, 0, 0 };
22 | vec4_t playerInvulnRGBA = { 255, 0, 255, 0 };
23 | qhandle_t& playerShader = media.coverShader;
24 |
25 |
26 | // Visuals
27 | bool scopedWalk = true;
28 | bool noScopeFov = false;
29 | bool noScopeBlackout = true;
30 | bool bulletTracers = false;
31 | bool grenadeTrajectory = true;
32 | bool noDamageFeedback = true;
33 | bool noCamExplosionShake = true;
34 | bool noSmoke = true;
35 | bool noFoliage = true;
36 | bool noWeather = true;
37 |
38 |
39 | // Aimbot
40 | bool aimbotEnabled = true;
41 | int aimbotAimkey = VK_LBUTTON; // 0 = No Aimkey
42 | bool aimbotStickyAim = true;
43 | bool aimbotStickyAutoReset = true;
44 | bool aimbotLockViewangles = true;
45 | bool aimbotAutoshoot = false;
46 | bool aimbotVelocityPrediction = false;
47 | bool aimbotPingPrediction = false;
48 | bool aimbotHumanAim = false;
49 | float aimbotHumanFovX = 10.0f;
50 | float aimbotHumanFovY = 15.0f;
51 | float aimbotHumanFovMaxX = 5.0f;
52 | float aimbotHumanFovMaxY = 10.0f;
53 | float aimbotHumanSpeed = 0.0666f;
54 | float aimbotHeadBoxTraceStep = 0.5f;
55 | float aimbotBodyBoxTraceStep = 0.3f;
56 | float aimbotHeadHeightOffset = 0.0f; // -5.0f aims roughly at the neck
57 |
58 |
59 | // Spoofer
60 | // nullptr: do not spoof
61 | // string: spoof to that value, fill '?' with random hex chars
62 | const char *etproGuid = "????????????????????????????????????????"; //SHA1 hash, uppercase
63 | const char *nitmodMac = "04-92-26-??-??-??"; // MAC Address, uppercase, byte separation: '-'
64 | uint32_t spoofSeed = 0; // 0 = Random each game start
65 |
66 |
67 | // Misc
68 | bool spectatorWarning = true;
69 | bool enemySpawnTimer = true;
70 | bool customDmgSounds = true;
71 | bool quickUnbanReconnect = true; // F10
72 | bool cleanScreenshots = true;
73 | bool cvarUnlocker = false; // Might be detected by some Anti-Cheats
74 | bool picmipHack = false; // Visible on Screenshots
75 | bool bunnyHop = true;
76 |
77 |
78 | // ESP
79 | bool headBbox = true;
80 | bool bodyBbox = false;
81 | bool boneEsp = true;
82 | bool nameEsp = false;
83 | int nameEspMode = 0; // 0 = Anchor Feet, 1 = Anchor Head
84 | bool missileEsp = true;
85 | bool missileRadius = false;
86 | bool pickupEsp = true;
87 | float maxEspDistance = FLT_MAX;
88 | };
89 |
90 | inline SConfig cfg;
91 |
--------------------------------------------------------------------------------
/CCHookReloaded/crc32.c:
--------------------------------------------------------------------------------
1 | /*-
2 | * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or
3 | * code or tables extracted from it, as desired without restriction.
4 | *
5 | * First, the polynomial itself and its table of feedback terms. The
6 | * polynomial is
7 | * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
8 | *
9 | * Note that we take it "backwards" and put the highest-order term in
10 | * the lowest-order bit. The X^32 term is "implied"; the LSB is the
11 | * X^31 term, etc. The X^0 term (usually shown as "+1") results in
12 | * the MSB being 1
13 | *
14 | * Note that the usual hardware shift register implementation, which
15 | * is what we're using (we're merely optimizing it by doing eight-bit
16 | * chunks at a time) shifts bits into the lowest-order term. In our
17 | * implementation, that means shifting towards the right. Why do we
18 | * do it this way? Because the calculated CRC must be transmitted in
19 | * order from highest-order term to lowest-order term. UARTs transmit
20 | * characters in order from LSB to MSB. By storing the CRC this way
21 | * we hand it to the UART in the order low-byte to high-byte; the UART
22 | * sends each low-bit to hight-bit; and the result is transmission bit
23 | * by bit from highest- to lowest-order term without requiring any bit
24 | * shuffling on our part. Reception works similarly
25 | *
26 | * The feedback terms table consists of 256, 32-bit entries. Notes
27 | *
28 | * The table can be generated at runtime if desired; code to do so
29 | * is shown later. It might not be obvious, but the feedback
30 | * terms simply represent the results of eight shift/xor opera
31 | * tions for all combinations of data and CRC register values
32 | *
33 | * The values must be right-shifted by eight bits by the "updcrc
34 | * logic; the shift must be unsigned (bring in zeroes). On some
35 | * hardware you could probably optimize the shift in assembler by
36 | * using byte-swap instructions
37 | * polynomial $edb88320
38 | *
39 | *
40 | * CRC32 code derived from work by Gary S. Brown.
41 | */
42 |
43 | #include "crc32.h"
44 |
45 | uint32_t
46 | crc32(uint32_t crc, const void *buf, size_t size)
47 | {
48 | const uint8_t *p;
49 |
50 | p = buf;
51 | crc = crc ^ ~0U;
52 |
53 | while (size--)
54 | crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
55 |
56 | return crc ^ ~0U;
57 | }
58 |
--------------------------------------------------------------------------------
/CCHookReloaded/crc32.h:
--------------------------------------------------------------------------------
1 | #ifndef _CRC32_H_
2 | #define _CRC32_H_
3 |
4 | #include
5 |
6 | #ifdef __cplusplus
7 | extern "C" {
8 | #endif
9 |
10 | static uint32_t crc32_tab[] = {
11 | 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
12 | 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
13 | 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
14 | 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
15 | 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
16 | 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
17 | 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
18 | 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
19 | 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
20 | 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
21 | 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
22 | 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
23 | 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
24 | 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
25 | 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
26 | 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
27 | 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
28 | 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
29 | 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
30 | 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
31 | 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
32 | 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
33 | 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
34 | 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
35 | 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
36 | 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
37 | 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
38 | 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
39 | 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
40 | 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
41 | 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
42 | 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
43 | 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
44 | 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
45 | 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
46 | 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
47 | 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
48 | 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
49 | 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
50 | 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
51 | 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
52 | 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
53 | 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
54 | };
55 |
56 | uint32_t crc32(uint32_t crc, const void *buf, size_t size);
57 |
58 | #ifdef __cplusplus
59 | }
60 | #endif
61 |
62 | #endif //_CRC32_H_
--------------------------------------------------------------------------------
/CCHookReloaded/engine.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "globals.h"
3 | #include "engine.h"
4 | #include "tools.h"
5 |
6 | #include "config.h"
7 | #include "offsets.h"
8 |
9 | namespace eng
10 | {
11 | static int cg_numSolidEntities = 0;
12 | static int cg_numSolidFTEntities = 0;
13 | static int cg_numTriggerEntities = 0;
14 | static const entityState_t* cg_solidEntities[MAX_ENTITIES_IN_SNAPSHOT];
15 | static const entityState_t* cg_solidFTEntities[MAX_ENTITIES_IN_SNAPSHOT];
16 | static const entityState_t* cg_triggerEntities[MAX_ENTITIES_IN_SNAPSHOT];
17 |
18 | void CG_ParseReinforcementTimes(const char *pszReinfSeedString)
19 | {
20 | const char *tmp = pszReinfSeedString, *tmp2;
21 | unsigned int i, j, dwDummy, dwOffset[TEAM_NUM_TEAMS];
22 |
23 | #define GETVAL(x,y) if((tmp = strchr(tmp, ' ')) == NULL) return; x = atoi(++tmp)/y;
24 |
25 | dwOffset[TEAM_ALLIES] = atoi(pszReinfSeedString) >> REINF_BLUEDELT;
26 | GETVAL(dwOffset[TEAM_AXIS], (1 << REINF_REDDELT));
27 | tmp2 = tmp;
28 |
29 | for(i = TEAM_AXIS; i <= TEAM_ALLIES; i++)
30 | {
31 | tmp = tmp2;
32 |
33 | for(j = 0; j(cg_snapshot.numEntities, MAX_ENTITIES_IN_SNAPSHOT);
85 | for (size_t i = 0; i < numEntities; i++)
86 | {
87 | const entityState_t* ent = &cg_snapshot.entities[i];
88 |
89 | if (ent->solid == SOLID_BMODEL && (ent->eFlags & EF_NONSOLID_BMODEL))
90 | continue;
91 |
92 | if (ent->eType == ET_ITEM ||
93 | ent->eType == ET_PUSH_TRIGGER ||
94 | ent->eType == ET_TELEPORT_TRIGGER ||
95 | ent->eType == ET_CONCUSSIVE_TRIGGER ||
96 | ent->eType == ET_OID_TRIGGER
97 | #ifdef VISIBLE_TRIGGERS
98 | || ent->eType == ET_TRIGGER_MULTIPLE
99 | || ent->eType == ET_TRIGGER_FLAGONLY
100 | || ent->eType == ET_TRIGGER_FLAGONLY_MULTIPLE
101 | #endif
102 | )
103 | {
104 |
105 | cg_triggerEntities[cg_numTriggerEntities] = ent;
106 | cg_numTriggerEntities++;
107 | continue;
108 | }
109 |
110 | if (ent->eType == ET_CONSTRUCTIBLE)
111 | {
112 | cg_triggerEntities[cg_numTriggerEntities] = ent;
113 | cg_numTriggerEntities++;
114 | }
115 |
116 | if (ent->solid)
117 | {
118 | cg_solidEntities[cg_numSolidEntities] = ent;
119 | cg_numSolidEntities++;
120 |
121 | cg_solidFTEntities[cg_numSolidFTEntities] = ent;
122 | cg_numSolidFTEntities++;
123 | }
124 | }
125 | }
126 | void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask, int capsule, trace_t* tr)
127 | {
128 | for (int i = 0; i < cg_numSolidEntities; i++)
129 | {
130 | const entityState_t* ent = cg_solidEntities[i];
131 |
132 | if (ent->number == skipNumber)
133 | continue;
134 |
135 | clipHandle_t cmodel;
136 | vec3_t origin, angles;
137 |
138 | if (ent->solid == SOLID_BMODEL)
139 | {
140 | cmodel = DoSyscall(CG_CM_INLINEMODEL, ent->modelindex);
141 |
142 | BG_EvaluateTrajectory(&ent->apos, cg_time, angles, qtrue, ent->effect2Time);
143 | BG_EvaluateTrajectory(&ent->pos, cg_time, origin, qfalse, ent->effect2Time);
144 | }
145 | else
146 | {
147 | vec3_t bmins, bmaxs;
148 | if (ent->eFlags & EF_FAKEBMODEL)
149 | {
150 | // repurposed origin2 and angles2 to receive mins and maxs of func_fakebrush
151 | VectorCopy(ent->origin2, bmins);
152 | VectorCopy(ent->angles2, bmaxs);
153 | }
154 | else
155 | {
156 | int x = (ent->solid & 255);
157 | int zd = ((ent->solid >> 8) & 255);
158 | int zu = ((ent->solid >> 16) & 255) - 32;
159 |
160 | bmins[0] = bmins[1] = -x;
161 | bmaxs[0] = bmaxs[1] = x;
162 | bmins[2] = -zd;
163 | bmaxs[2] = zu;
164 | }
165 |
166 | cmodel = DoSyscall(CG_CM_TEMPBOXMODEL, bmins, bmaxs);
167 |
168 | VectorCopy(vec3_origin, angles);
169 | VectorCopy(ent->pos.trBase, origin);
170 | }
171 |
172 | trace_t trace;
173 | if (capsule)
174 | DoSyscall(CG_CM_TRANSFORMEDCAPSULETRACE, &trace, start, end, mins, maxs, cmodel, mask, origin, angles);
175 | else
176 | DoSyscall(CG_CM_TRANSFORMEDBOXTRACE, &trace, start, end, mins, maxs, cmodel, mask, origin, angles);
177 |
178 | if (trace.allsolid || trace.fraction < tr->fraction)
179 | {
180 | trace.entityNum = ent->number;
181 | *tr = trace;
182 | }
183 | else if (trace.startsolid)
184 | {
185 | tr->startsolid = qtrue;
186 | }
187 |
188 | if (tr->allsolid)
189 | return;
190 | }
191 | }
192 | void CG_Trace(trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask)
193 | {
194 | DoSyscall(CG_CM_BOXTRACE, result, start, end, mins, maxs, 0, mask);
195 |
196 | result->entityNum = result->fraction != 1.0 ? ENTITYNUM_WORLD : ENTITYNUM_NONE;
197 |
198 | CG_ClipMoveToEntities(start, mins, maxs, end, skipNumber, mask, qfalse, result);
199 | }
200 | bool IsPointVisible(const vec3_t start, const vec3_t pt, int skipNumber)
201 | {
202 | trace_t t;
203 | eng::CG_Trace(&t, start, NULL, NULL, pt, skipNumber, MASK_SHOT);
204 |
205 | return (t.fraction == 1.f);
206 | }
207 | bool IsBoxVisible(const vec3_t start, const vec3_t mins, const vec3_t maxs, float step, vec3_t visOut, int skipNumber)
208 | {
209 | // Trivial case: Middle is visible
210 |
211 | VectorAdd(mins, maxs, visOut);
212 | VectorScale(visOut, 0.5f, visOut);
213 |
214 | if (IsPointVisible(start, visOut, skipNumber))
215 | return true;
216 |
217 |
218 | // Middle wasn't visible, trace the whole box.
219 | // Interpolate between different box sizes up to 99%.
220 | // Always start with the smallest box and the middle of each edge.
221 |
222 | const vec3_t boxSize =
223 | {
224 | abs(maxs[0] - mins[0]),
225 | abs(maxs[1] - mins[1]),
226 | abs(maxs[2] - mins[2])
227 | };
228 |
229 | for (float sd = step; sd < 0.99f; sd += step)
230 | {
231 | vec3_t scaledMins, scaledMaxs;
232 | VectorScale(boxSize, -sd/2.0f, scaledMins);
233 | VectorScale(boxSize, +sd/2.0f, scaledMaxs);
234 | VectorAdd(scaledMins, visOut, scaledMins);
235 | VectorAdd(scaledMaxs, visOut, scaledMaxs);
236 |
237 | const vec3_t boxCorner[] =
238 | {
239 | { scaledMaxs[0], scaledMaxs[1], scaledMaxs[2] },
240 | { scaledMaxs[0], scaledMaxs[1], scaledMins[2] },
241 | { scaledMins[0], scaledMaxs[1], scaledMins[2] },
242 | { scaledMins[0], scaledMaxs[1], scaledMaxs[2] },
243 | { scaledMaxs[0], scaledMins[1], scaledMaxs[2] },
244 | { scaledMaxs[0], scaledMins[1], scaledMins[2] },
245 | { scaledMins[0], scaledMins[1], scaledMins[2] },
246 | { scaledMins[0], scaledMins[1], scaledMaxs[2] }
247 | };
248 |
249 | // Try all mid values first
250 | for (size_t i = 0; i < std::size(boxCorner) - 1; i++)
251 | {
252 | vec3_t mid;
253 | VectorAdd(boxCorner[i], boxCorner[i + 1], mid);
254 | VectorScale(mid, 0.5f, mid);
255 |
256 | if (IsPointVisible(start, mid, skipNumber))
257 | {
258 | VectorCopy(mid, visOut);
259 | return true;
260 | }
261 | }
262 |
263 | // Try all corners last
264 | for (size_t i = 0; i < std::size(boxCorner); i++)
265 | {
266 | if (IsPointVisible(start, boxCorner[i], skipNumber))
267 | {
268 | VectorCopy(boxCorner[i], visOut);
269 | return true;
270 | }
271 | }
272 | }
273 |
274 | return false;
275 | }
276 | bool AimAtTarget(const vec3_t target)
277 | {
278 | vec3_t predictVieworg;
279 | VectorMA(cg_refdef.vieworg, cg_frametime / 1000.0f, cg_snapshot.ps.velocity, predictVieworg);
280 |
281 | vec3_t dir, ang;
282 | VectorSubtract(target, predictVieworg, dir);
283 | vectoangles(dir, ang);
284 |
285 | vec3_t refdefViewAngles;
286 | vectoangles(cg_refdef.viewaxis[0], refdefViewAngles);
287 |
288 | float yawOffset = AngleNormalize180(ang[YAW] - refdefViewAngles[YAW]);
289 | float pitchOffset = AngleNormalize180(ang[PITCH] - refdefViewAngles[PITCH]);
290 |
291 | vec_t *angles = off::cur.viewangles();
292 |
293 | if (cfg.aimbotHumanAim)
294 | {
295 | const float targetDist = VectorDistance(predictVieworg, target);
296 |
297 | float targetScreenSizeDegX = cfg.aimbotHumanFovX / targetDist * 180.0f;
298 | float targetScreenSizeDegY = cfg.aimbotHumanFovY / targetDist * 180.0f;
299 |
300 | targetScreenSizeDegX = min(targetScreenSizeDegX, cfg.aimbotHumanFovMaxX);
301 | targetScreenSizeDegY = min(targetScreenSizeDegY, cfg.aimbotHumanFovMaxY);
302 |
303 | if (abs(yawOffset) < targetScreenSizeDegX &&
304 | abs(pitchOffset) < targetScreenSizeDegY)
305 | {
306 | angles[YAW] += yawOffset * cfg.aimbotHumanSpeed;
307 | angles[PITCH] += pitchOffset * cfg.aimbotHumanSpeed;
308 |
309 | return true;
310 | }
311 | }
312 | else
313 | {
314 | angles[YAW] += yawOffset;
315 | angles[PITCH] += pitchOffset;
316 |
317 | return true;
318 | }
319 |
320 | return false;
321 | }
322 | bool IsKeyActionActive(const char *action)
323 | {
324 | int key1, key2;
325 | DoSyscall(CG_KEY_BINDINGTOKEYS, action, &key1, &key2);
326 |
327 | return DoSyscall(CG_KEY_ISDOWN, key1) || DoSyscall(CG_KEY_ISDOWN, key2);
328 | }
329 | hitbox_t GetHeadHitbox(const SClientInfo &ci)
330 | {
331 | const int modIndex = static_cast(currentMod);
332 | auto &hitbox = head_hitboxes[modIndex];
333 |
334 | if (ci.flags & (EF_PRONE | EF_PRONE_MOVING))
335 | return { hitbox.prone_offset, hitbox.size };
336 |
337 | bool isMoving = !!VectorCompare(ci.velocity, vec3_origin);
338 |
339 | if (ci.flags & EF_CROUCHING)
340 | return { isMoving ? hitbox.crouch_offset_moving : hitbox.crouch_offset, hitbox.size };
341 |
342 | return { isMoving ? hitbox.stand_offset_moving : hitbox.stand_offset, hitbox.size };
343 | }
344 | bool IsEntityArmed(const entityState_t* entState)
345 | {
346 | if (currentMod == EMod::Legacy)
347 | return entState->effect1Time != 0;
348 |
349 | return entState->teamNum == TEAM_AXIS || entState->teamNum == TEAM_ALLIES;
350 | }
351 | bool IsValidTeam(int team)
352 | {
353 | return team == TEAM_AXIS || team == TEAM_ALLIES;
354 | }
355 | qhandle_t RegisterAndLoadShader(const char *shaderData, uint32_t seed)
356 | {
357 | char shaderName[17] = {};
358 | tools::RandomizeHexString(shaderName, std::size(shaderName) - 1, '\0', seed);
359 |
360 | char newShaderData[1024];
361 | if (sprintf_s(newShaderData, shaderData, shaderName) < 0)
362 | return 0;
363 |
364 | (void)DoSyscall(CG_R_LOADDYNAMICSHADER, shaderName, newShaderData);
365 | qhandle_t shaderHandle = DoSyscall(CG_R_REGISTERSHADER, shaderName);
366 |
367 | // Immediately delete the dynamic shaders after registration.
368 | // ET:Legacy client crashes otherwise, as they have a bug which crashes the game on `vid_restart` when the dynamic shader list isn't empty...
369 | //
370 | // Crash callstack:
371 | // R_InitShaders()
372 | // CreateExternalShaders()
373 | // R_FindShader("projectionShadow")
374 | // FindShaderInShaderText()
375 | // if (!dptr->shadertext || !strlen(dptr->shadertext))
376 | // dptr->shadertext == 0xAAAAAAAA
377 | DoSyscall(CG_R_LOADDYNAMICSHADER, nullptr, nullptr);
378 |
379 | return shaderHandle;
380 | }
381 | }
382 |
--------------------------------------------------------------------------------
/CCHookReloaded/engine.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace eng
4 | {
5 | void CG_ParseReinforcementTimes(const char *pszReinfSeedString);
6 | int CG_CalculateReinfTime(team_t team);
7 | void CG_RailTrail(const vec3_t from, const vec3_t to, const vec4_t col, int renderfx=0);
8 | void CG_BuildSolidList();
9 | void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask, int capsule, trace_t* tr);
10 | void CG_Trace(trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask);
11 | bool IsPointVisible(const vec3_t start, const vec3_t pt, int skipNumber);
12 | bool IsBoxVisible(const vec3_t start, const vec3_t mins, const vec3_t maxs, float step, vec3_t visOut, int skipNumber);
13 | bool AimAtTarget(const vec3_t target);
14 | bool IsKeyActionActive(const char *action);
15 | hitbox_t GetHeadHitbox(const SClientInfo &ci);
16 | bool IsEntityArmed(const entityState_t* entState);
17 | bool IsValidTeam(int team);
18 | qhandle_t RegisterAndLoadShader(const char *shaderData, uint32_t seed);
19 | }
20 |
--------------------------------------------------------------------------------
/CCHookReloaded/etsdk.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "ETSDK/src/cgame/cg_local.h"
4 | #include "ETSDK/src/ui/ui_public.h"
5 | #include "ETSDK/src/ui/ui_shared.h"
6 |
7 |
8 | // Custom cheat types/structs
9 |
10 | enum class EMod
11 | {
12 | None,
13 | EtMain,
14 | EtPub,
15 | EtPro,
16 | JayMod,
17 | Nitmod,
18 | NoQuarter,
19 | Silent,
20 | Legacy,
21 | Unknown
22 | };
23 |
24 | struct SClientInfo
25 | {
26 | bool valid;
27 |
28 | int id;
29 | bool invuln;
30 | int flags;
31 | int weapId;
32 |
33 | // Sent via snapshot (not interpolated, possibly extrapolated)
34 | vec3_t origin;
35 | vec3_t velocity;
36 |
37 | // Updated and interpolated by client
38 | vec3_t interOrigin;
39 |
40 | int teamNum;
41 | int classNum;
42 | char name[MAX_QPATH];
43 | char cleanName[MAX_QPATH];
44 | };
45 |
46 | struct SDraw3dCommand
47 | {
48 | enum class EType
49 | {
50 | RailTrail,
51 | Decal,
52 | } type;
53 |
54 | union
55 | {
56 | struct
57 | {
58 | vec3_t from;
59 | vec3_t to;
60 | vec4_t col;
61 | int renderfx;
62 | } railTrail;
63 |
64 | struct
65 | {
66 | vec3_t pos;
67 | vec3_t dir;
68 | vec4_t col;
69 | qhandle_t shader;
70 | float scale;
71 | } decal;
72 | };
73 |
74 | SDraw3dCommand() = default;
75 |
76 | SDraw3dCommand(const vec3_t from, const vec3_t to, const vec4_t col, int renderfx)
77 | {
78 | type = EType::RailTrail;
79 |
80 | VectorCopy(from, railTrail.from);
81 | VectorCopy(to, railTrail.to);
82 | Vector4Copy(col, railTrail.col);
83 | railTrail.renderfx = renderfx;
84 | }
85 |
86 | SDraw3dCommand(const vec3_t pos, const vec3_t dir, const vec4_t col, qhandle_t shader, float scale)
87 | {
88 | type = EType::Decal;
89 |
90 | VectorCopy(pos, decal.pos);
91 | VectorCopy(dir, decal.dir);
92 | Vector4Copy(col, decal.col);
93 | decal.shader = shader;
94 | decal.scale = scale;
95 | }
96 | };
97 |
--------------------------------------------------------------------------------
/CCHookReloaded/globals.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | struct SMedia
4 | {
5 | fontInfo_t limboFont1, limboFont2;
6 | qhandle_t hitSounds[4], dmgSounds[4];
7 | qhandle_t pickupModels[11];
8 | qhandle_t grassModels[3];
9 | qhandle_t weatherSprites[3];
10 | qhandle_t whiteShader, coverShader, plainShader, quadShader, crystalShader, plasticShader,
11 | onFireShader, railCoreShader, reticleShader, binocShader, nullShader,
12 | smokepuffShader, circleShader;
13 | qhandle_t landmineIcon, dynamiteIcon, smokeIcon, grenadeIcon, pineappleIcon,
14 | satchelIcon, medkitIcon, ammoIcon, mp40Icon, thompsonIcon, stenIcon, fg42Icon;
15 | qhandle_t cursorIcon, checkboxChecked, checkboxUnchecked;
16 | };
17 | inline SMedia media;
18 |
19 | inline int cg_time;
20 | inline int cg_frametime;
21 | inline int sv_frametime;
22 | inline int cg_showGameView;
23 |
24 | inline refdef_t cg_refdef;
25 | inline glconfig_t cg_glconfig;
26 | inline snapshot_t cg_snapshot;
27 | inline gamestate_t cgs_gameState;
28 | inline refEntity_t cg_entities[MAX_ENTITIES];
29 | inline bool cg_missiles[MAX_ENTITIES];
30 | inline int cgs_levelStartTime = 0;
31 | inline int cgs_aReinfOffset[TEAM_NUM_TEAMS];
32 | inline bool cg_iszoomed = false;
33 | inline int cgDC_cursorx = 320;
34 | inline int cgDC_cursory = 240;
35 |
36 |
37 | inline CL_CgameSystemCalls_t orig_CL_CgameSystemCalls;
38 |
39 | inline bool showMenu = false;
40 | inline EMod currentMod = EMod::None;
41 | inline SClientInfo cgs_clientinfo[MAX_CLIENTS];
42 |
--------------------------------------------------------------------------------
/CCHookReloaded/obfuscation.h:
--------------------------------------------------------------------------------
1 | //-------------------------------------------------------------//
2 | // "Malware related compile-time hacks with C++11" by LeFF //
3 | // You can use this code however you like, I just don't really //
4 | // give a shit, but if you feel some respect for me, please //
5 | // don't cut off this comment when copy-pasting... ;-) //
6 | //-------------------------------------------------------------//
7 |
8 | // Modified to have a larger XOR key and also support wchar_t.
9 | // Higher resistance to removal due to compiler optimizations.
10 |
11 | #include
12 |
13 | namespace obf
14 | {
15 | #ifdef __clang__
16 | template
17 | struct noopt { [[clang::optnone]] unsigned char operator()() const { return C; } };
18 |
19 | #define NODATA(v) (obf::noopt<(v)>{}())
20 | #else
21 | #define NODATA(v)
22 | #endif
23 |
24 |
25 | template
26 | struct EnsureCompileTime
27 | {
28 | enum : unsigned long
29 | {
30 | Value = V
31 | };
32 | };
33 |
34 | constexpr auto Seed = ((__TIME__[7] - '0') * 1 + (__TIME__[6] - '0') * 10 + \
35 | (__TIME__[4] - '0') * 60 + (__TIME__[3] - '0') * 600 + \
36 | (__TIME__[1] - '0') * 3600 + (__TIME__[0] - '0') * 36000 + \
37 | (__DATE__[0] << 0) + (__DATE__[1] << 3) + (__DATE__[2] << 6) + (__DATE__[4] << 9) + \
38 | (__DATE__[5] << 12) + (__DATE__[7] << 15) + (__DATE__[8] << 18) + (__DATE__[9] << 21) + (__DATE__[10] << 24));
39 |
40 | constexpr unsigned long LinearCongruentGenerator(int Rounds)
41 | {
42 | return static_cast(
43 | 1013904223ull + 1664525ull * ((Rounds > 0) ? LinearCongruentGenerator(Rounds - 1) : Seed)
44 | );
45 | }
46 |
47 | template
48 | constexpr unsigned long Random()
49 | {
50 | return EnsureCompileTime::Value;
51 | }
52 |
53 | template
54 | constexpr T RandBetween(T Min, T Max)
55 | {
56 | return ((Min) + (Random() % ((Max) - (Min) + 1)));
57 | }
58 |
59 |
60 | template struct IndexList {};
61 |
62 | template struct Append;
63 | template struct Append, Right>
64 | {
65 | typedef IndexList Result;
66 | };
67 |
68 | template struct ConstructIndexList
69 | {
70 | typedef typename Append::Result, N - 1>::Result Result;
71 | };
72 |
73 | template <> struct ConstructIndexList<0>
74 | {
75 | typedef IndexList<> Result;
76 | };
77 |
78 |
79 | const BYTE XORKEY_1 = static_cast(RandBetween<12>(0, 0xFF));
80 | const BYTE XORKEY_2 = static_cast(RandBetween<07>(0, 0xFF));
81 | const BYTE XORKEY_3 = static_cast(RandBetween<23>(0, 0xFF));
82 |
83 | template
84 | __forceinline constexpr Char CryptCharacter(const Char Character, int Index)
85 | {
86 | return Character ^ (XORKEY_1 + ((Index + 69) << 3)) ^ (XORKEY_2 - (Index + 12)) ^ (-XORKEY_3);
87 | }
88 |
89 | template
90 | class CXorString;
91 |
92 | template
93 | class CXorString >
94 | {
95 | volatile Char Value[sizeof...(Index)];
96 |
97 | public:
98 | __forceinline constexpr CXorString(const Char *const String) : Value{ CryptCharacter(String[Index], Index)... } {}
99 |
100 | __forceinline Char *decrypt()
101 | {
102 | for (int t = 0; t < sizeof...(Index); t++)
103 | Value[t] = CryptCharacter(Value[t], t);
104 |
105 | Value[sizeof...(Index)-1] = (Char)(0);
106 |
107 | return (Char*)Value;
108 | }
109 |
110 | __forceinline Char *get()
111 | {
112 | return (Char*)Value;
113 | }
114 |
115 | __forceinline size_t len() const
116 | {
117 | return sizeof...(Index)-1;
118 | }
119 |
120 | __forceinline ~CXorString()
121 | {
122 | for (int t = 0; t < sizeof...(Index); t++)
123 | Value[t] = 0;
124 | }
125 | };
126 | }
127 |
128 | #define XorS(X, String) obf::CXorString::type, \
129 | obf::ConstructIndexList::Result> X(String)
130 |
131 | #define XorString(String) (obf::CXorString::type, \
132 | obf::ConstructIndexList::Result>(String).decrypt())
133 |
--------------------------------------------------------------------------------
/CCHookReloaded/pch.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 |
--------------------------------------------------------------------------------
/CCHookReloaded/sha1.c:
--------------------------------------------------------------------------------
1 | /*
2 | SHA-1 in C
3 | By Steve Reid
4 | 100% Public Domain
5 | Test Vectors (from FIPS PUB 180-1)
6 | "abc"
7 | A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
8 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
9 | 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
10 | A million repetitions of "a"
11 | 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
12 | */
13 |
14 | /* #define LITTLE_ENDIAN * This should be #define'd already, if true. */
15 | /* #define SHA1HANDSOFF * Copies data before messing with it. */
16 |
17 | #define SHA1HANDSOFF
18 |
19 | #include
20 | #include
21 |
22 | /* for uint32_t */
23 | #include
24 |
25 | #include "sha1.h"
26 |
27 |
28 | #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
29 |
30 | /* blk0() and blk() perform the initial expand. */
31 | /* I got the idea of expanding during the round function from SSLeay */
32 | #if BYTE_ORDER == LITTLE_ENDIAN
33 | #define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
34 | |(rol(block->l[i],8)&0x00FF00FF))
35 | #elif BYTE_ORDER == BIG_ENDIAN
36 | #define blk0(i) block->l[i]
37 | #else
38 | #error "Endianness not defined!"
39 | #endif
40 | #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
41 | ^block->l[(i+2)&15]^block->l[i&15],1))
42 |
43 | /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
44 | #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
45 | #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
46 | #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
47 | #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
48 | #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
49 |
50 |
51 | /* Hash a single 512-bit block. This is the core of the algorithm. */
52 |
53 | void SHA1Transform(
54 | uint32_t state[5],
55 | const uint8_t buffer[64]
56 | )
57 | {
58 | uint32_t a, b, c, d, e;
59 |
60 | typedef union
61 | {
62 | uint8_t c[64];
63 | uint32_t l[16];
64 | } CHAR64LONG16;
65 |
66 | #ifdef SHA1HANDSOFF
67 | CHAR64LONG16 block[1]; /* use array to appear as a pointer */
68 |
69 | memcpy(block, buffer, 64);
70 | #else
71 | /* The following had better never be used because it causes the
72 | * pointer-to-const buffer to be cast into a pointer to non-const.
73 | * And the result is written through. I threw a "const" in, hoping
74 | * this will cause a diagnostic.
75 | */
76 | CHAR64LONG16 *block = (const CHAR64LONG16 *) buffer;
77 | #endif
78 | /* Copy context->state[] to working vars */
79 | a = state[0];
80 | b = state[1];
81 | c = state[2];
82 | d = state[3];
83 | e = state[4];
84 | /* 4 rounds of 20 operations each. Loop unrolled. */
85 | R0(a, b, c, d, e, 0);
86 | R0(e, a, b, c, d, 1);
87 | R0(d, e, a, b, c, 2);
88 | R0(c, d, e, a, b, 3);
89 | R0(b, c, d, e, a, 4);
90 | R0(a, b, c, d, e, 5);
91 | R0(e, a, b, c, d, 6);
92 | R0(d, e, a, b, c, 7);
93 | R0(c, d, e, a, b, 8);
94 | R0(b, c, d, e, a, 9);
95 | R0(a, b, c, d, e, 10);
96 | R0(e, a, b, c, d, 11);
97 | R0(d, e, a, b, c, 12);
98 | R0(c, d, e, a, b, 13);
99 | R0(b, c, d, e, a, 14);
100 | R0(a, b, c, d, e, 15);
101 | R1(e, a, b, c, d, 16);
102 | R1(d, e, a, b, c, 17);
103 | R1(c, d, e, a, b, 18);
104 | R1(b, c, d, e, a, 19);
105 | R2(a, b, c, d, e, 20);
106 | R2(e, a, b, c, d, 21);
107 | R2(d, e, a, b, c, 22);
108 | R2(c, d, e, a, b, 23);
109 | R2(b, c, d, e, a, 24);
110 | R2(a, b, c, d, e, 25);
111 | R2(e, a, b, c, d, 26);
112 | R2(d, e, a, b, c, 27);
113 | R2(c, d, e, a, b, 28);
114 | R2(b, c, d, e, a, 29);
115 | R2(a, b, c, d, e, 30);
116 | R2(e, a, b, c, d, 31);
117 | R2(d, e, a, b, c, 32);
118 | R2(c, d, e, a, b, 33);
119 | R2(b, c, d, e, a, 34);
120 | R2(a, b, c, d, e, 35);
121 | R2(e, a, b, c, d, 36);
122 | R2(d, e, a, b, c, 37);
123 | R2(c, d, e, a, b, 38);
124 | R2(b, c, d, e, a, 39);
125 | R3(a, b, c, d, e, 40);
126 | R3(e, a, b, c, d, 41);
127 | R3(d, e, a, b, c, 42);
128 | R3(c, d, e, a, b, 43);
129 | R3(b, c, d, e, a, 44);
130 | R3(a, b, c, d, e, 45);
131 | R3(e, a, b, c, d, 46);
132 | R3(d, e, a, b, c, 47);
133 | R3(c, d, e, a, b, 48);
134 | R3(b, c, d, e, a, 49);
135 | R3(a, b, c, d, e, 50);
136 | R3(e, a, b, c, d, 51);
137 | R3(d, e, a, b, c, 52);
138 | R3(c, d, e, a, b, 53);
139 | R3(b, c, d, e, a, 54);
140 | R3(a, b, c, d, e, 55);
141 | R3(e, a, b, c, d, 56);
142 | R3(d, e, a, b, c, 57);
143 | R3(c, d, e, a, b, 58);
144 | R3(b, c, d, e, a, 59);
145 | R4(a, b, c, d, e, 60);
146 | R4(e, a, b, c, d, 61);
147 | R4(d, e, a, b, c, 62);
148 | R4(c, d, e, a, b, 63);
149 | R4(b, c, d, e, a, 64);
150 | R4(a, b, c, d, e, 65);
151 | R4(e, a, b, c, d, 66);
152 | R4(d, e, a, b, c, 67);
153 | R4(c, d, e, a, b, 68);
154 | R4(b, c, d, e, a, 69);
155 | R4(a, b, c, d, e, 70);
156 | R4(e, a, b, c, d, 71);
157 | R4(d, e, a, b, c, 72);
158 | R4(c, d, e, a, b, 73);
159 | R4(b, c, d, e, a, 74);
160 | R4(a, b, c, d, e, 75);
161 | R4(e, a, b, c, d, 76);
162 | R4(d, e, a, b, c, 77);
163 | R4(c, d, e, a, b, 78);
164 | R4(b, c, d, e, a, 79);
165 | /* Add the working vars back into context.state[] */
166 | state[0] += a;
167 | state[1] += b;
168 | state[2] += c;
169 | state[3] += d;
170 | state[4] += e;
171 | /* Wipe variables */
172 | a = b = c = d = e = 0;
173 | #ifdef SHA1HANDSOFF
174 | memset(block, '\0', sizeof(block));
175 | #endif
176 | }
177 |
178 |
179 | /* SHA1Init - Initialize new context */
180 |
181 | void SHA1Init(
182 | SHA1_CTX * context
183 | )
184 | {
185 | /* SHA1 initialization constants */
186 | context->state[0] = 0x67452301;
187 | context->state[1] = 0xEFCDAB89;
188 | context->state[2] = 0x98BADCFE;
189 | context->state[3] = 0x10325476;
190 | context->state[4] = 0xC3D2E1F0;
191 | context->count[0] = context->count[1] = 0;
192 | }
193 |
194 |
195 | /* Run your data through this. */
196 |
197 | void SHA1Update(
198 | SHA1_CTX * context,
199 | const uint8_t *data,
200 | uint32_t len
201 | )
202 | {
203 | uint32_t i;
204 |
205 | uint32_t j;
206 |
207 | j = context->count[0];
208 | if ((context->count[0] += len << 3) < j)
209 | context->count[1]++;
210 | context->count[1] += (len >> 29);
211 | j = (j >> 3) & 63;
212 | if ((j + len) > 63)
213 | {
214 | memcpy(&context->buffer[j], data, (i = 64 - j));
215 | SHA1Transform(context->state, context->buffer);
216 | for (; i + 63 < len; i += 64)
217 | {
218 | SHA1Transform(context->state, &data[i]);
219 | }
220 | j = 0;
221 | }
222 | else
223 | i = 0;
224 | memcpy(&context->buffer[j], &data[i], len - i);
225 | }
226 |
227 |
228 | /* Add padding and return the message digest. */
229 |
230 | void SHA1Final(
231 | uint8_t digest[20],
232 | SHA1_CTX * context
233 | )
234 | {
235 | unsigned i;
236 |
237 | unsigned char finalcount[8];
238 |
239 | unsigned char c;
240 |
241 | #if 0 /* untested "improvement" by DHR */
242 | /* Convert context->count to a sequence of bytes
243 | * in finalcount. Second element first, but
244 | * big-endian order within element.
245 | * But we do it all backwards.
246 | */
247 | unsigned char *fcp = &finalcount[8];
248 |
249 | for (i = 0; i < 2; i++)
250 | {
251 | uint32_t t = context->count[i];
252 |
253 | int j;
254 |
255 | for (j = 0; j < 4; t >>= 8, j++)
256 | *--fcp = (unsigned char) t}
257 | #else
258 | for (i = 0; i < 8; i++)
259 | {
260 | finalcount[i] = (unsigned char) ((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */
261 | }
262 | #endif
263 | c = 0200;
264 | SHA1Update(context, &c, 1);
265 | while ((context->count[0] & 504) != 448)
266 | {
267 | c = 0000;
268 | SHA1Update(context, &c, 1);
269 | }
270 | SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
271 | for (i = 0; i < 20; i++)
272 | {
273 | digest[i] = (unsigned char)
274 | ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255);
275 | }
276 | /* Wipe variables */
277 | memset(context, '\0', sizeof(*context));
278 | memset(&finalcount, '\0', sizeof(finalcount));
279 | }
280 |
281 | void SHA1(
282 | char *hash_out,
283 | const char *str,
284 | uint32_t len)
285 | {
286 | SHA1_CTX ctx;
287 | unsigned int ii;
288 |
289 | SHA1Init(&ctx);
290 | for (ii=0; ii
7 | 100% Public Domain
8 | */
9 |
10 | #include "stdint.h"
11 |
12 | #ifdef __cplusplus
13 | extern "C" {
14 | #endif
15 |
16 | typedef struct
17 | {
18 | uint32_t state[5];
19 | uint32_t count[2];
20 | uint8_t buffer[64];
21 | } SHA1_CTX;
22 |
23 | void SHA1Transform(
24 | uint32_t state[5],
25 | const uint8_t buffer[64]
26 | );
27 |
28 | void SHA1Init(
29 | SHA1_CTX * context
30 | );
31 |
32 | void SHA1Update(
33 | SHA1_CTX * context,
34 | const uint8_t *data,
35 | uint32_t len
36 | );
37 |
38 | void SHA1Final(
39 | uint8_t digest[20],
40 | SHA1_CTX * context
41 | );
42 |
43 | void SHA1(
44 | char *hash_out,
45 | const char *str,
46 | uint32_t len);
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 |
52 | #endif /* SHA1_H */
--------------------------------------------------------------------------------
/CCHookReloaded/shaders.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define SHADER_COVER_SCRIPT \
4 | "%s\n\
5 | {\n\
6 | cull none\n\
7 | deformVertexes wave 100 sin 1.5 0 0 0\n\
8 | {\n\
9 | map textures/sfx/construction.tga\n\
10 | blendfunc GL_SRC_ALPHA GL_ONE\n\
11 | rgbgen entity\n\
12 | tcGen environment\n\
13 | tcmod rotate 30\n\
14 | tcmod scroll 1 .1\n\
15 | }\n\
16 | }\n"
17 |
18 | #define SHADER_PLAIN_SCRIPT \
19 | "%s\n\
20 | {\n\
21 | nomipmaps\n\
22 | nofog\n\
23 | nopicmip\n\
24 | {\n\
25 | map *white\n\
26 | rgbGen const ( 0 0 0 )\n\
27 | blendFunc gl_dst_color gl_zero\n\
28 | }\n\
29 | {\n\
30 | map *white\n\
31 | rgbGen entity\n\
32 | depthWrite\n\
33 | }\n\
34 | }\n"
35 |
36 | #define SHADER_QUAD_SCRIPT \
37 | "%s\n\
38 | {\n\
39 | deformVertexes wave 100 sin 3 0 0 0\n\
40 | {\n\
41 | map gfx/effects/quad.tga\n\
42 | blendfunc GL_ONE GL_ONE\n\
43 | rgbgen entity\n\
44 | tcGen environment\n\
45 | depthWrite\n\
46 | tcmod rotate 30\n\
47 | tcmod scroll 1 .1\n\
48 | }\n\
49 | }\n"
50 |
51 | #define SHADER_CRYSTAL_SCRIPT \
52 | "%s\n\
53 | {\n\
54 | cull none\n\
55 | deformVertexes wave 100 sin 2 0 0 0\n\
56 | noPicmip\n\
57 | surfaceparm trans\n\
58 | {\n\
59 | map textures/sfx/construction.tga\n\
60 | blendFunc GL_SRC_ALPHA GL_ONE\n\
61 | rgbGen entity\n\
62 | tcGen environment\n\
63 | tcMod scroll 0.025 -0.07625\n\
64 | }\n\
65 | }\n"
66 |
67 | #define SHADER_PLASTIC_SCRIPT \
68 | "%s\n\
69 | {\n\
70 | deformVertexes wave 100 sin 0 0 0 0\n\
71 | {\n\
72 | map gfx/effects/fx_white.tga\n\
73 | rgbGen entity\n\
74 | blendfunc GL_ONE GL_ONE\n\
75 | }\n\
76 | }\n"
77 |
78 | #define SHADER_CIRCLE_SCRIPT \
79 | "%s\n\
80 | {\n\
81 | polygonOffset\n\
82 | {\n\
83 | map gfx/effects/disk.tga\n\
84 | blendFunc GL_SRC_ALPHA GL_ONE\n\
85 | rgbGen exactVertex\n\
86 | }\n\
87 | }"
88 |
--------------------------------------------------------------------------------
/CCHookReloaded/tools.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "globals.h"
3 | #include "tools.h"
4 |
5 | #include "config.h"
6 | #include "offsets.h"
7 |
8 | namespace tools
9 | {
10 | static unsigned int s_Seed = 0;
11 | int Rand()
12 | {
13 | return (((s_Seed = s_Seed * 214013L + 2531011L) >> 16) & 0x7fff);
14 | }
15 | void Srand(unsigned int seed)
16 | {
17 | s_Seed = seed;
18 | }
19 |
20 | uint8_t *FindPattern(uint8_t *start_pos, size_t search_len, const uint8_t *pattern, const char *mask)
21 | {
22 | for(uint8_t *region_it = start_pos; region_it < (start_pos + search_len); ++region_it)
23 | {
24 | if(*region_it != *pattern)
25 | continue;
26 |
27 | const uint8_t *pattern_it = pattern;
28 | const uint8_t *memory_it = region_it;
29 | const char *mask_it = mask;
30 |
31 | bool found = true;
32 |
33 | for(; *mask_it && (memory_it < (start_pos + search_len)); ++mask_it, ++pattern_it, ++memory_it)
34 | {
35 | if(*mask_it != 'x')
36 | continue;
37 |
38 | if(*memory_it != *pattern_it)
39 | {
40 | found = false;
41 | break;
42 | }
43 | }
44 |
45 | if(found)
46 | return region_it;
47 | }
48 |
49 | return nullptr;
50 | }
51 | void *DetourFunction(BYTE *src, const BYTE *dst, size_t len)
52 | {
53 | BYTE *jmp = (BYTE*)VirtualAlloc(0, len+5, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
54 | if (!jmp)
55 | return nullptr;
56 |
57 | DWORD dwback;
58 | VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwback);
59 |
60 | memcpy(jmp, src, len);
61 | jmp += len;
62 | jmp[0] = 0xE9;
63 | *(uint32_t*)(jmp+1) = (uint32_t)(src+len - jmp) - 5;
64 |
65 | src[0] = 0xE9;
66 | *(uint32_t*)(src+1) = (uint32_t)(dst - src) - 5;
67 |
68 | VirtualProtect(src, len, dwback, &dwback);
69 |
70 | return jmp - len;
71 | }
72 | std::filesystem::path GetModulePath(HMODULE mod)
73 | {
74 | wchar_t exePath[MAX_PATH + 1];
75 | GetModuleFileNameW(mod, exePath, std::size(exePath) - 1);
76 | return exePath;
77 | }
78 | EMod GetETMod(char *_modName)
79 | {
80 | HMODULE cgame = GetModuleHandleA(XorString("cgame_mp_x86.dll"));
81 | if (!cgame)
82 | return EMod::None;
83 |
84 | const auto modPath = GetModulePath(cgame).parent_path();
85 | const auto modName = modPath.filename().string();
86 |
87 | if (_modName)
88 | strcpy(_modName, modName.c_str());
89 |
90 | if (!_stricmp(modName.c_str(), XorString("etmain")))
91 | return EMod::EtMain;
92 | if (!_stricmp(modName.c_str(), XorString("etpub")))
93 | return EMod::EtPub;
94 | if (!_stricmp(modName.c_str(), XorString("etpro")))
95 | return EMod::EtPro;
96 | if (!_stricmp(modName.c_str(), XorString("jaymod")))
97 | return EMod::JayMod;
98 | if (!_stricmp(modName.c_str(), XorString("nitmod")))
99 | return EMod::Nitmod;
100 | if (!_stricmp(modName.c_str(), XorString("nq")))
101 | return EMod::NoQuarter;
102 | if (!_stricmp(modName.c_str(), XorString("silent")))
103 | return EMod::Silent;
104 | if (!_stricmp(modName.c_str(), XorString("legacy")))
105 | return EMod::Legacy;
106 |
107 | return EMod::Unknown;
108 | }
109 | bool UnlockPak()
110 | {
111 | // We simply override the checksum and pure_checksum of our
112 | // custom .pk3 file with the ones from pak0.pk3.
113 | // This will allow us to use any content of the file
114 | // since the server allows that exact hash.
115 |
116 | if (off::cur.IsEtLegacy())
117 | {
118 | legacy_pack_t* pak0 = nullptr;
119 |
120 | legacy_searchpath_t *search = (legacy_searchpath_t*)off::cur.fs_searchpaths();
121 | for (; search; search = search->next)
122 | {
123 | legacy_pack_t *pak = search->pack;
124 | if (!pak)
125 | continue;
126 |
127 | if (!pak0 && !_stricmp(pak->pakBasename, XorString("pak0")))
128 | {
129 | pak0 = pak;
130 | }
131 | else if (pak0 && !_stricmp(pak->pakBasename, cfg.pakName))
132 | {
133 | // Do not send the hash to server (already sent once by original pak0.pk3).
134 | // This ensures the server can't easily detect us simply by checking if checksum exists twice.
135 | pak->referenced = 0;
136 |
137 | // But make sure we can access all data locally because hash is whitelisted :)
138 | pak->checksum = pak0->checksum;
139 | pak->pure_checksum = pak0->pure_checksum;
140 |
141 | return true;
142 | }
143 | }
144 | }
145 | else
146 | {
147 | pack_t* pak0 = nullptr;
148 |
149 | searchpath_t *search = off::cur.fs_searchpaths();
150 | for (; search; search = search->next)
151 | {
152 | pack_t *pak = search->pack;
153 | if (!pak)
154 | continue;
155 |
156 | if (!pak0 && !_stricmp(pak->pakBasename, XorString("pak0")))
157 | {
158 | pak0 = pak;
159 | }
160 | else if (pak0 && !_stricmp(pak->pakBasename, cfg.pakName))
161 | {
162 | // Do not send the hash to server (already sent once by original pak0.pk3).
163 | // This ensures the server can't easily detect us simply by checking if checksum exists twice.
164 | pak->referenced = 0;
165 |
166 | // But make sure we can access all data locally because hash is whitelisted :)
167 | pak->checksum = pak0->checksum;
168 | pak->pure_checksum = pak0->pure_checksum;
169 |
170 | return true;
171 | }
172 | }
173 | }
174 |
175 | printf(XorString("WARNING: Failed to find '%s.pk3' - make sure you placed it in etmain folder!\n"), cfg.pakName);
176 |
177 | return false;
178 | }
179 | char *Info_ValueForKeyInbuff(char *s, const char *key)
180 | {
181 | bool isKey = false;
182 |
183 | size_t keyIndex = 0;
184 | size_t keySize = strlen(key);
185 |
186 | for(; *s; s++)
187 | {
188 | if (*s == '\\')
189 | {
190 | if (isKey)
191 | {
192 | if (keyIndex == keySize)
193 | return s + 1;
194 |
195 | keyIndex = 0;
196 | }
197 |
198 | isKey = !isKey;
199 | continue;
200 | }
201 |
202 | if (keyIndex >= keySize)
203 | keyIndex = size_t(-1);
204 |
205 | if (isKey && keyIndex != -1)
206 | {
207 | if (*s != key[keyIndex++])
208 | keyIndex = size_t(-1);
209 | }
210 | }
211 |
212 | return nullptr;
213 | }
214 | bool GatherSpectatorInfo(std::vector &spectatorNames)
215 | {
216 | // Do not query data when we are not actually playing ourselves
217 | if (cg_snapshot.serverTime == 0 ||
218 | cg_snapshot.ps.pm_type != PM_NORMAL ||
219 | cg_snapshot.ps.pm_flags & PMF_FOLLOW)
220 | return false;
221 |
222 | // Get current network destination and fix it up for localhost if needed
223 | uint16_t port;
224 | ADDRESS_FAMILY family;
225 | size_t addressSize;
226 | uint8_t address[32];
227 |
228 | if (off::cur.IsEtLegacy())
229 | {
230 | const netadr_legacy_t* remoteAddress = (netadr_legacy_t*)off::cur.remoteAddress();
231 | switch (remoteAddress->type)
232 | {
233 | case netadrtype_legacy_t::NA_IP:
234 | family = AF_INET;
235 | port = remoteAddress->port;
236 | addressSize = sizeof(remoteAddress->ip);
237 | memcpy(address, remoteAddress->ip, addressSize);
238 | break;
239 | case netadrtype_legacy_t::NA_IP6:
240 | family = AF_INET6;
241 | port = remoteAddress->port;
242 | addressSize = sizeof(remoteAddress->ip6);
243 | memcpy(address, remoteAddress->ip6, addressSize);
244 | break;
245 | default:
246 | family = AF_INET;
247 | vmCvar_t net_port; // localhost port
248 | DoSyscall(CG_CVAR_REGISTER, &net_port, XorString("net_port"), XorString("27960"), 0);
249 | port = htons(net_port.integer);
250 | addressSize = sizeof(remoteAddress->ip);
251 | *(uint32_t*)address = 0x0100007F;
252 | break;
253 | }
254 | }
255 | else
256 | {
257 | const netadr_t* remoteAddress = off::cur.remoteAddress();
258 | switch (remoteAddress->type)
259 | {
260 | case netadrtype_t::NA_IP:
261 | family = AF_INET;
262 | port = remoteAddress->port;
263 | addressSize = sizeof(remoteAddress->ip);
264 | memcpy(address, remoteAddress->ip, addressSize);
265 | break;
266 | case netadrtype_t::NA_IPX:
267 | family = AF_IPX;
268 | port = remoteAddress->port;
269 | addressSize = sizeof(remoteAddress->ipx);
270 | memcpy(address, remoteAddress->ipx, addressSize);
271 | break;
272 | default:
273 | family = AF_INET;
274 | vmCvar_t net_port; // localhost port
275 | DoSyscall(CG_CVAR_REGISTER, &net_port, XorString("net_port"), XorString("27960"), 0);
276 | port = htons(net_port.integer);
277 | addressSize = sizeof(remoteAddress->ip);
278 | *(uint32_t*)address = 0x0100007F;
279 | break;
280 | }
281 | }
282 |
283 | static SOCKET sock = INVALID_SOCKET;
284 |
285 | // Send server status request every 500 ms
286 | static int timeout_ms = 0;
287 | if ((timeout_ms -= cg_frametime) <= 0)
288 | {
289 | timeout_ms = 500;
290 |
291 | // Re-Create socket if needed
292 |
293 | if (sock != INVALID_SOCKET)
294 | closesocket(sock);
295 |
296 | sock = socket(family, SOCK_DGRAM, IPPROTO_UDP);
297 | if (sock != INVALID_SOCKET)
298 | {
299 | // Make socket non-blocking for obvious reasons
300 | u_long mode = 1;
301 | ioctlsocket(sock, FIONBIO, &mode);
302 | }
303 |
304 | sockaddr_in sockAddr;
305 | sockAddr.sin_family = family;
306 | sockAddr.sin_port = port;
307 | memcpy(&sockAddr.sin_addr, address, addressSize);
308 |
309 | // UDP messages always arrive (if they arrive) in the exact same size as sent
310 | sendto(sock, XorString(NET_STATUS_REQUEST), sizeof(NET_STATUS_REQUEST)-1, 0, (sockaddr*)&sockAddr, sizeof(sockAddr));
311 | }
312 |
313 |
314 | // Keep receiving data at all time
315 |
316 | sockaddr_in sockAddr;
317 | int fromlen = sizeof(sockAddr);
318 |
319 | // UDP messages always arrive (if they arrive) in the exact same size as sent
320 | char buffer[4096];
321 | int read = recvfrom(sock, buffer, sizeof(buffer) - 1, 0, (sockaddr*)&sockAddr, &fromlen);
322 | if (read <= 0)
323 | return false;
324 |
325 | buffer[read] = '\0';
326 |
327 | if (sockAddr.sin_family != family || sockAddr.sin_port != port || memcmp(&sockAddr.sin_addr, address, addressSize))
328 | return false;
329 |
330 | if (memcmp(buffer, XorString(NET_STATUS_RESPONSE), sizeof(NET_STATUS_RESPONSE) - 1))
331 | return false;
332 |
333 | // Parse the server info to find all spectators.
334 | // A spectator will always inherit the XP numbers of the spectated player.
335 | // Because XP numbers are rather unique, this can detect spectators.
336 | // To be 100% certain, we should filter out existing players.
337 |
338 | spectatorNames.clear();
339 |
340 | std::stringstream playersstream(buffer + sizeof(NET_STATUS_RESPONSE)-1);
341 |
342 | std::string playerStats;
343 | if (std::getline(playersstream, playerStats, '\n'))
344 | while (std::getline(playersstream, playerStats, '\n'))
345 | {
346 | std::stringstream statsstream(playerStats);
347 |
348 | // ' ""'
349 | std::string _xp, _ping, name;
350 | std::getline(statsstream, _xp, ' ');
351 | std::getline(statsstream, _ping, ' ');
352 | std::getline(statsstream, name, '\n');
353 |
354 | int xp = atoi(_xp.c_str());
355 | int ping = atoi(_ping.c_str());
356 |
357 | // Get rid of quotes in the name
358 | if (name.front() == '"' && name.back() == '"')
359 | {
360 | name.erase(0, 1);
361 | name.erase(name.size() - 1);
362 | }
363 |
364 | // Ignore people who are still connecting
365 | if(ping == 999)
366 | continue;
367 | if (!xp || xp != cg_snapshot.ps.persistant[PERS_SCORE])
368 | continue;
369 |
370 | // We found a player who is having the same XP numbers as we do.
371 | // Make sure the player is not in the player list (must be spectator).
372 |
373 | bool isSpectator = false;
374 | bool playerExists = false;
375 |
376 | for (size_t i = 0; i < MAX_CLIENTS; i++)
377 | {
378 | auto &player = cgs_clientinfo[i];
379 |
380 | if (!player.valid)
381 | continue;
382 | if (strcmp(player.name, name.c_str()))
383 | continue;
384 |
385 | playerExists = true;
386 |
387 | if (player.teamNum == TEAM_SPECTATOR)
388 | {
389 | isSpectator = true;
390 | break;
391 | }
392 | }
393 |
394 | if (isSpectator || !playerExists)
395 | spectatorNames.push_back(name);
396 | }
397 |
398 | return true;
399 | }
400 | void RandomizeHexString(char *string, size_t length, char wildcard, uint32_t seed)
401 | {
402 | for (size_t i = 0; i < length; i++)
403 | {
404 | if (string[i] != wildcard)
405 | continue;
406 |
407 | const uint16_t randVal = (((seed = seed * 214013L + 2531011L) >> 16) & 0x7fff);
408 |
409 | const char newChar = (randVal & 0x4000)
410 | ? 'A' + (char)(randVal % 6)
411 | : '0' + (char)(randVal % 10);
412 |
413 | string[i] = newChar;
414 | }
415 | }
416 | }
417 |
--------------------------------------------------------------------------------
/CCHookReloaded/tools.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace tools
4 | {
5 | int Rand();
6 | void Srand(unsigned int seed);
7 |
8 | uint8_t *FindPattern(uint8_t *start_pos, size_t search_len, const uint8_t *pattern, const char *mask);
9 | void* DetourFunction(BYTE* src, const BYTE* dst, size_t len);
10 | std::filesystem::path GetModulePath(HMODULE mod);
11 | EMod GetETMod(char *_modName);
12 | bool UnlockPak();
13 | char *Info_ValueForKeyInbuff(char *s, const char *key);
14 | bool GatherSpectatorInfo(std::vector &spectatorNames);
15 | void RandomizeHexString(char *string, size_t length, char wildcard, uint32_t seed);
16 | }
17 |
--------------------------------------------------------------------------------
/CCHookReloaded/ui.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "globals.h"
3 | #include "ui.h"
4 |
5 | #include "config.h"
6 |
7 | namespace ui
8 | {
9 | static int16_t btnDelete = 0, btnMouseL = 0;
10 |
11 | void AdjustFrom640(float *x, float *y, float *w, float *h)
12 | {
13 | *x *= cg_glconfig.vidWidth / 640.0f;
14 | *y *= cg_glconfig.vidHeight / 480.0f;
15 |
16 | *w *= cg_glconfig.vidWidth / 640.0f;
17 | *h *= cg_glconfig.vidHeight / 480.0f;
18 | }
19 | bool WorldToScreen(const vec3_t worldCoord, float *x, float *y)
20 | {
21 | vec3_t trans;
22 | VectorSubtract(worldCoord, cg_refdef.vieworg, trans);
23 |
24 | // z = how far is the object in our forward direction, negative = behind/mirrored
25 | float z = DotProduct(trans, cg_refdef.viewaxis[0]);
26 | if (z <= 0.001)
27 | return false;
28 |
29 | float xc = 640.0 / 2.0;
30 | float yc = 480.0 / 2.0;
31 |
32 | float px = tan(cg_refdef.fov_x * (M_PI / 360));
33 | float py = tan(cg_refdef.fov_y * (M_PI / 360));
34 |
35 | *x = xc - DotProduct(trans, cg_refdef.viewaxis[1])*xc/(z*px);
36 | *y = yc - DotProduct(trans, cg_refdef.viewaxis[2])*yc/(z*py);
37 |
38 | return true;
39 | }
40 | void DrawLine2D(float x0, float y0, float x1, float y1, float f, const vec4_t color)
41 | {
42 | ui::AdjustFrom640(&x0, &y0, &x1, &y1);
43 |
44 | vec2_t org;
45 | org[0] = (x0+x1)/2.0f;
46 | org[1] = (y0+y1)/2.0f;
47 |
48 | float w = sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));
49 | float angle = atan2((x1-x0), (y1-y0));
50 |
51 | polyVert_t verts[4];
52 | SetupRotatedThing(verts, org, w, f, angle);
53 |
54 | // Set color for all vertices
55 | for (size_t i = 0; i < std::size(verts); i++)
56 | {
57 | verts[i].modulate[0] = color[0] * 255;
58 | verts[i].modulate[1] = color[1] * 255;
59 | verts[i].modulate[2] = color[2] * 255;
60 | verts[i].modulate[3] = 255;
61 | }
62 |
63 | DoSyscall(CG_R_DRAW2DPOLYS, verts, 4, media.whiteShader);
64 | }
65 | void DrawLine3D(const vec3_t from, const vec3_t to, float f, const vec4_t col)
66 | {
67 | float fromX, fromY,
68 | toX, toY;
69 |
70 | if (WorldToScreen(from, &fromX, &fromY) && WorldToScreen(to, &toX, &toY))
71 | DrawLine2D(fromX, fromY, toX, toY, f, col);
72 | }
73 | void DrawBox2D(float x, float y, float w, float h, const vec4_t color, qhandle_t shader)
74 | {
75 | AdjustFrom640(&x, &y, &w, &h);
76 |
77 | DoSyscall(CG_R_SETCOLOR, color);
78 | DoSyscall(CG_R_DRAWSTRETCHPIC, x, y, w, h, 0.0f, 0.0f, 1.0f, 1.0f, shader);
79 | DoSyscall(CG_R_SETCOLOR, nullptr);
80 | }
81 | void DrawBox3D(const vec3_t mins, const vec3_t maxs, float f, const vec4_t color)
82 | {
83 | vec3_t boundingBox[] =
84 | {
85 | { maxs[0], maxs[1], maxs[2] },
86 | { maxs[0], maxs[1], mins[2] },
87 | { mins[0], maxs[1], mins[2] },
88 | { mins[0], maxs[1], maxs[2] },
89 | { maxs[0], mins[1], maxs[2] },
90 | { maxs[0], mins[1], mins[2] },
91 | { mins[0], mins[1], mins[2] },
92 | { mins[0], mins[1], maxs[2] }
93 | };
94 |
95 | //Upper rect
96 | DrawLine3D(boundingBox[0], boundingBox[1], f, color);
97 | DrawLine3D(boundingBox[0], boundingBox[3], f, color);
98 | DrawLine3D(boundingBox[2], boundingBox[1], f, color);
99 | DrawLine3D(boundingBox[2], boundingBox[3], f, color);
100 |
101 | //Upper to lower rect
102 | DrawLine3D(boundingBox[0], boundingBox[4], f, color);
103 | DrawLine3D(boundingBox[1], boundingBox[5], f, color);
104 | DrawLine3D(boundingBox[2], boundingBox[6], f, color);
105 | DrawLine3D(boundingBox[3], boundingBox[7], f, color);
106 |
107 | //Lower rect
108 | DrawLine3D(boundingBox[4], boundingBox[5], f, color);
109 | DrawLine3D(boundingBox[4], boundingBox[7], f, color);
110 | DrawLine3D(boundingBox[6], boundingBox[5], f, color);
111 | DrawLine3D(boundingBox[6], boundingBox[7], f, color);
112 | }
113 | void DrawBoxBordered2D(float x, float y, float w, float h, const vec4_t fillColor, const vec4_t borderColor, qhandle_t shader)
114 | {
115 | const float borderSize = 1.0f;
116 |
117 | AdjustFrom640(&x, &y, &w, &h);
118 |
119 | DoSyscall(CG_R_SETCOLOR, fillColor);
120 | DoSyscall(CG_R_DRAWSTRETCHPIC, x, y, w, h, 0.0f, 0.0f, 0.0f, 1.0f, shader);
121 |
122 | DoSyscall(CG_R_SETCOLOR, borderColor);
123 | DoSyscall(CG_R_DRAWSTRETCHPIC, x-borderSize, y-borderSize, w+borderSize*2, borderSize, 0.0f, 0.0f, 0.0f, 1.0f, shader);
124 | DoSyscall(CG_R_DRAWSTRETCHPIC, x-borderSize, y+h, w+borderSize*2, borderSize, 0.0f, 0.0f, 0.0f, 1.0f, shader);
125 | DoSyscall(CG_R_DRAWSTRETCHPIC, x-borderSize, y, borderSize, h, 0.0f, 0.0f, 0.0f, 1.0f, shader);
126 | DoSyscall(CG_R_DRAWSTRETCHPIC, x+w, y, borderSize, h, 0.0f, 0.0f, 0.0f, 1.0f, shader);
127 |
128 | DoSyscall(CG_R_SETCOLOR, nullptr);
129 | }
130 | void SizeText(float scalex, float scaley, const char *text, int limit, const fontInfo_t *font, float *width, float *height)
131 | {
132 | int len = strlen(text);
133 | if (limit > 0 && len > limit)
134 | len = limit;
135 |
136 | const uint8_t *s = (uint8_t*)text;
137 |
138 | float w = 0.0f;
139 | float h = 0.0f;
140 |
141 | for (int count = 0; *s && count < len; )
142 | {
143 | if (Q_IsColorString(s))
144 | {
145 | s += 2;
146 | continue;
147 | }
148 |
149 | const glyphInfo_t &glyph = font->glyphs[*s];
150 | w += glyph.xSkip;
151 |
152 | if (glyph.height > h)
153 | h = glyph.height;
154 |
155 | count++;
156 | s++;
157 | }
158 |
159 | *width = w * font->glyphScale * scalex;
160 | *height = h * font->glyphScale * scaley;
161 | }
162 | void DrawText(float x, float y, float scalex, float scaley, const vec4_t color, const char *text, float adjust, int limit, int style, int align, const fontInfo_t *font)
163 | {
164 | float w, h;
165 | SizeText(scalex, scaley, text, limit, font, &w, &h);
166 |
167 | if (align == ITEM_ALIGN_CENTER2)
168 | y += h / 2.0f;
169 | else
170 | y += h;
171 |
172 | if (align == ITEM_ALIGN_CENTER || align == ITEM_ALIGN_CENTER2)
173 | x -= w / 2.0f;
174 | else if (align == ITEM_ALIGN_RIGHT)
175 | x -= w;
176 |
177 | scalex *= font->glyphScale;
178 | scaley *= font->glyphScale;
179 |
180 | const uint8_t *s = (uint8_t*)text;
181 | int len = strlen(text);
182 |
183 | if (limit > 0 && len > limit)
184 | len = limit;
185 |
186 | vec4_t newColor;
187 | Vector4Copy(color, newColor);
188 | DoSyscall(CG_R_SETCOLOR, color);
189 |
190 | for (int count = 0; *s && count < len; )
191 | {
192 | const glyphInfo_t &glyph = font->glyphs[*s];
193 |
194 | if (Q_IsColorString(s))
195 | {
196 | const uint8_t newColorChar = *(s + 1);
197 |
198 | // Do not copy alpha value ever again, only initialized once
199 | if(newColorChar == COLOR_NULL)
200 | VectorCopy(color, newColor);
201 | else
202 | VectorCopy(g_color_table[ColorIndex(newColorChar)], newColor);
203 |
204 | DoSyscall(CG_R_SETCOLOR, newColor);
205 |
206 | s += 2;
207 | continue;
208 | }
209 |
210 | float x_adj = x + glyph.pitch*scalex;
211 | float y_adj = y - glyph.top*scaley;
212 | float w_adj = glyph.imageWidth*scalex;
213 | float h_adj = glyph.imageHeight*scaley;
214 |
215 | AdjustFrom640(&x_adj, &y_adj, &w_adj, &h_adj);
216 |
217 | // Draw the drop shadow first
218 | if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE)
219 | {
220 | vec4_t outlineCol = {0, 0, 0, newColor[3]};
221 | float ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1.0f : 2.0f;
222 |
223 | DoSyscall(CG_R_SETCOLOR, outlineCol);
224 | DoSyscall(CG_R_DRAWSTRETCHPIC, x_adj + ofs, y_adj + ofs, w_adj, h_adj, glyph.s, glyph.t, glyph.s2, glyph.t2, glyph.glyph);
225 | DoSyscall(CG_R_SETCOLOR, newColor);
226 | }
227 |
228 | DoSyscall(CG_R_DRAWSTRETCHPIC, x_adj, y_adj, w_adj, h_adj, glyph.s, glyph.t, glyph.s2, glyph.t2, glyph.glyph);
229 |
230 | x += (glyph.xSkip * scalex) + adjust;
231 | count++;
232 | s++;
233 | }
234 |
235 | DoSyscall(CG_R_SETCOLOR, nullptr);
236 | }
237 | void DrawBoxedText(float x, float y, float scalex, float scaley, const vec4_t textColor, const char *text, float adjust, int limit, int style, int align, const fontInfo_t *font, const vec4_t bgColor, const vec4_t boColor)
238 | {
239 | const float boxPadding = 7.0f;
240 |
241 | float w, h;
242 | SizeText(scalex, scaley, text, limit, font, &w, &h);
243 |
244 | float _x = x, _y = y;
245 |
246 | if (align == ITEM_ALIGN_CENTER2)
247 | _y += h / 2.0f;
248 |
249 | if (align == ITEM_ALIGN_CENTER || align == ITEM_ALIGN_CENTER2)
250 | _x -= w / 2.0f;
251 | else if (align == ITEM_ALIGN_RIGHT)
252 | _x -= w;
253 |
254 | DrawBoxBordered2D(_x, _y, w + boxPadding, h + boxPadding, bgColor, boColor, media.whiteShader);
255 |
256 | DrawText(x + boxPadding/2.0f, y + boxPadding/2.0f, scalex, scaley, textColor, text, adjust, limit, style, align, font);
257 | }
258 | void DrawIcon(float x, float y, float w, float h, const vec4_t color, qhandle_t shader)
259 | {
260 | AdjustFrom640(&x, &y, &w, &h);
261 |
262 | DoSyscall(CG_R_SETCOLOR, color);
263 | DoSyscall(CG_R_DRAWSTRETCHPIC, x - w/2.0f, y - h/2.0f, w, h, 0.0f, 0.0f, 1.0f, 1.0f, shader);
264 | DoSyscall(CG_R_SETCOLOR, nullptr);
265 | }
266 |
267 | void DrawButton(float x, float y, float w, float h, const char *text, std::function callback, int *currentTab = nullptr, int myTab = 0)
268 | {
269 | const bool IsHovering = cgDC_cursorx >= x && cgDC_cursorx < x + w &&
270 | cgDC_cursory >= y && cgDC_cursory < y + h;
271 |
272 | const bool DoDrawHovering = IsHovering || (currentTab && *currentTab == myTab);
273 |
274 | const vec_t* bgColor = DoDrawHovering
275 | ? (btnMouseL < 0 && IsHovering)
276 | ? colorMenuBgPr
277 | : colorMenuBgHl
278 | : colorMenuBg;
279 |
280 | const vec_t* boColor = DoDrawHovering
281 | ? (btnMouseL < 0 && IsHovering)
282 | ? colorMenuBoPr
283 | : colorMenuBoHl
284 | : colorMenuBo;
285 |
286 | const int flags = DoDrawHovering
287 | ? (btnMouseL < 0 && IsHovering)
288 | ? ITEM_TEXTSTYLE_SHADOWEDMORE
289 | : ITEM_TEXTSTYLE_SHADOWED
290 | : 0;
291 |
292 | DrawBoxBordered2D(x, y, w, h, bgColor, boColor, media.whiteShader);
293 | DrawText(x + w/2.0f, y + h/2.0f, 0.14f, 0.14f, colorWhite,
294 | text, 0.0f, 0, flags, ITEM_ALIGN_CENTER2, &media.limboFont2);
295 |
296 | if (IsHovering && (btnMouseL & 1))
297 | {
298 | if (currentTab)
299 | *currentTab = myTab;
300 |
301 | if (callback)
302 | callback();
303 | }
304 | }
305 | void DrawCheckbox(float x, float y, const char *text, bool *state)
306 | {
307 | float textW, textH;
308 | SizeText(0.14f, 0.14f, text, 0, &media.limboFont2, &textW, &textH);
309 |
310 | const int w = 9, h = 9;
311 | const bool IsHovering = cgDC_cursorx >= x && cgDC_cursorx < (x + w + 2.0f + textW) &&
312 | cgDC_cursory >= y && cgDC_cursory < y + h;
313 | const vec_t *color = IsHovering ? colorCheckboxHl : colorCheckbox;
314 |
315 | DrawBox2D(x, y, w, h, color, *state ? media.checkboxChecked : media.checkboxUnchecked);
316 | DrawText(x + w + 2.0f, y + h/2 - textH/2 + 0.5, 0.14f, 0.14f, color, text, 0.0f, 0, 0, ITEM_ALIGN_LEFT, &media.limboFont2);
317 |
318 | if (IsHovering && (btnMouseL & 1))
319 | *state ^= 1;
320 | }
321 | void DrawMenu()
322 | {
323 | const int menuSizeX = 245;
324 | const int menuSizeY = 150;
325 | const int menuX = 320 - menuSizeX/2;
326 | const int menuY = 240 - menuSizeY/2;
327 |
328 | static int currentTab = 0;
329 |
330 | // DoSyscall(CG_KEY_ISDOWN, K_MOUSE1)?
331 | btnDelete = GetAsyncKeyState(VK_DELETE);
332 | btnMouseL = GetAsyncKeyState(VK_LBUTTON);
333 |
334 | DrawBoxedText(10.0f, 10.0f, 0.16f, 0.16f, colorWhite, XorString("^1CC^7Hook^1:^9Reloaded"),
335 | 0.0f, 0, ITEM_TEXTSTYLE_NORMAL, ITEM_ALIGN_LEFT, &media.limboFont1, colorMenuBg, colorMenuBo);
336 |
337 | if ((btnDelete & 1) && !(DoSyscall(CG_KEY_GETCATCHER) & (KEYCATCH_CONSOLE | KEYCATCH_UI)))
338 | {
339 | showMenu = !showMenu;
340 |
341 | // Disable user input block and mouse capturing
342 | if (!showMenu)
343 | DoSyscall(CG_KEY_SETCATCHER, DoSyscall(CG_KEY_GETCATCHER) & ~(KEYCATCH_MESSAGE | KEYCATCH_CGAME));
344 | }
345 |
346 | if (!showMenu)
347 | return;
348 |
349 | // Block user input for CGame and capture mouse move events
350 | DoSyscall(CG_KEY_SETCATCHER, DoSyscall(CG_KEY_GETCATCHER) | KEYCATCH_CGAME | KEYCATCH_MESSAGE);
351 |
352 |
353 | DrawBoxBordered2D(menuX, menuY, menuSizeX, menuSizeY, colorMenuBg, colorMenuBo, media.whiteShader);
354 | DrawBox2D(menuX, menuY, menuSizeX, 12.0f, colorMenuBg, media.whiteShader);
355 | DrawText(menuX + menuSizeX/2.0f, menuY + 3.5f, 0.16f, 0.16f, colorWhite,
356 | XorString("^1CC^7Hook^1:^9Reloaded"), 0.0f, 0, ITEM_TEXTSTYLE_OUTLINED, ITEM_ALIGN_CENTER, &media.limboFont1);
357 | DrawBox2D(menuX, menuY + 12, menuSizeX, 0.5f, colorMenuBo, media.whiteShader);
358 |
359 | DrawButton(menuX + 5, menuY + 17, 55, 10, XorString("Aimbot"), nullptr, ¤tTab, 0);
360 | DrawButton(menuX + 65, menuY + 17, 55, 10, XorString("Visuals"), nullptr, ¤tTab, 1);
361 | DrawButton(menuX + 125, menuY + 17, 55, 10, XorString("ESP"), nullptr, ¤tTab, 2);
362 | DrawButton(menuX + 185, menuY + 17, 55, 10, XorString("Misc"), nullptr, ¤tTab, 3);
363 |
364 | DrawBoxBordered2D(menuX + 5, menuY + 31, menuSizeX - 10, menuSizeY - 35, colorMenuBg, colorMenuBo, media.whiteShader);
365 |
366 | switch (currentTab)
367 | {
368 | case 0: // Aimbot
369 | DrawCheckbox(menuX + 10, menuY + 35, XorString("Aimbot Enabled"), &cfg.aimbotEnabled);
370 | DrawCheckbox(menuX + 10, menuY + 45, XorString("Sticky Aim"), &cfg.aimbotStickyAim);
371 | DrawCheckbox(menuX + 10, menuY + 55, XorString("Sticky Auto-Reset"), &cfg.aimbotStickyAutoReset);
372 | DrawCheckbox(menuX + 10, menuY + 65, XorString("Lock Viewangles"), &cfg.aimbotLockViewangles);
373 | DrawCheckbox(menuX + 10, menuY + 75, XorString("Autoshoot"), &cfg.aimbotAutoshoot);
374 | DrawCheckbox(menuX + 10, menuY + 85, XorString("Velocity Prediction"), &cfg.aimbotVelocityPrediction);
375 | DrawCheckbox(menuX + 10, menuY + 95, XorString("Ping Prediction"), &cfg.aimbotPingPrediction);
376 | DrawCheckbox(menuX + 10, menuY + 105, XorString("Human Aim"), &cfg.aimbotHumanAim);
377 | break;
378 | case 1: // Visuals
379 | DrawCheckbox(menuX + 10, menuY + 35, XorString("Scoped Walk"), &cfg.scopedWalk);
380 | DrawCheckbox(menuX + 10, menuY + 45, XorString("No Scope-FoV"), &cfg.noScopeFov);
381 | DrawCheckbox(menuX + 10, menuY + 55, XorString("No Scope-Blackout"), &cfg.noScopeBlackout);
382 | DrawCheckbox(menuX + 10, menuY + 65, XorString("Bullet Tracers"), &cfg.bulletTracers);
383 | DrawCheckbox(menuX + 10, menuY + 75, XorString("Grenade Trajectory"), &cfg.grenadeTrajectory);
384 | DrawCheckbox(menuX + 10, menuY + 85, XorString("No Damage Feedback"), &cfg.noDamageFeedback);
385 | DrawCheckbox(menuX + 10, menuY + 95, XorString("No Camera Shake"), &cfg.noCamExplosionShake);
386 | DrawCheckbox(menuX + 10, menuY + 105, XorString("No Smoke"), &cfg.noSmoke);
387 | DrawCheckbox(menuX + 10, menuY + 115, XorString("No Foliage"), &cfg.noFoliage);
388 | DrawCheckbox(menuX + 10, menuY + 125, XorString("No Weather"), &cfg.noWeather);
389 |
390 | DrawCheckbox(menuX + 120, menuY + 35, XorString("Pickup Chams"), &cfg.pickupChams);
391 | DrawCheckbox(menuX + 120, menuY + 45, XorString("Missile Chams"), &cfg.missileChams);
392 | DrawCheckbox(menuX + 120, menuY + 55, XorString("Player Chams"), &cfg.playerChams);
393 | DrawCheckbox(menuX + 120, menuY + 65, XorString("Player Outline"), &cfg.playerOutlineChams);
394 | DrawCheckbox(menuX + 120, menuY + 75, XorString("Player Corpse"), &cfg.playerCorpseChams);
395 | break;
396 | case 2: // ESP
397 | DrawCheckbox(menuX + 10, menuY + 35, XorString("Head BBox"), &cfg.headBbox);
398 | DrawCheckbox(menuX + 10, menuY + 45, XorString("Body BBox"), &cfg.bodyBbox);
399 | DrawCheckbox(menuX + 10, menuY + 55, XorString("Bone ESP"), &cfg.boneEsp);
400 | DrawCheckbox(menuX + 10, menuY + 65, XorString("Name ESP"), &cfg.nameEsp);
401 | DrawCheckbox(menuX + 10, menuY + 75, XorString("Missile ESP"), &cfg.missileEsp);
402 | DrawCheckbox(menuX + 10, menuY + 85, XorString("Missile Radius"), &cfg.missileRadius);
403 | DrawCheckbox(menuX + 10, menuY + 95, XorString("Pickup ESP"), &cfg.pickupEsp);
404 | break;
405 | case 3: // Misc
406 | DrawCheckbox(menuX + 10, menuY + 35, XorString("Spectator Warning"), &cfg.spectatorWarning);
407 | DrawCheckbox(menuX + 10, menuY + 45, XorString("Enemy Spawntimer"), &cfg.enemySpawnTimer);
408 | DrawCheckbox(menuX + 10, menuY + 55, XorString("Custom Damage Sounds"), &cfg.customDmgSounds);
409 | DrawCheckbox(menuX + 10, menuY + 65, XorString("Quick Unban-Reconnect (F10)"), &cfg.quickUnbanReconnect);
410 | DrawCheckbox(menuX + 10, menuY + 75, XorString("Clean Screenshots"), &cfg.cleanScreenshots);
411 | DrawCheckbox(menuX + 10, menuY + 85, XorString("CVAR Unlocker (Caution)"), &cfg.cvarUnlocker);
412 | DrawCheckbox(menuX + 10, menuY + 95, XorString("PicMip Hack (Visible on Screenshots)"), &cfg.picmipHack);
413 | DrawCheckbox(menuX + 10, menuY + 105, XorString("Bunny Hop"), &cfg.bunnyHop);
414 | break;
415 | }
416 |
417 | ui::DrawBox2D(cgDC_cursorx, cgDC_cursory, 32, 32, colorWhite, media.cursorIcon);
418 | }
419 | }
420 |
--------------------------------------------------------------------------------
/CCHookReloaded/ui.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace ui
4 | {
5 | void AdjustFrom640(float *x, float *y, float *w, float *h);
6 | bool WorldToScreen(const vec3_t worldCoord, float *x, float *y);
7 | void DrawLine2D(float x0, float y0, float x1, float y1, float f, const vec4_t color);
8 | void DrawLine3D(const vec3_t from, const vec3_t to, float f, const vec4_t col);
9 | void DrawBox2D(float x, float y, float w, float h, const vec4_t color, qhandle_t shader);
10 | void DrawBox3D(const vec3_t mins, const vec3_t maxs, float f, const vec4_t color);
11 | void DrawBoxBordered2D(float x, float y, float w, float h, const vec4_t fillColor, const vec4_t borderColor, qhandle_t shader);
12 | void SizeText(float scalex, float scaley, const char *text, int limit, const fontInfo_t *font, float *width, float *height);
13 | void DrawText(float x, float y, float scalex, float scaley, const vec4_t color, const char *text, float adjust, int limit, int style, int align, const fontInfo_t *font);
14 | void DrawBoxedText(float x, float y, float scalex, float scaley, const vec4_t textColor, const char *text, float adjust, int limit, int style, int align, const fontInfo_t *font, const vec4_t bgColor, const vec4_t boColor);
15 | void DrawIcon(float x, float y, float w, float h, const vec4_t color, qhandle_t shader);
16 |
17 | void DrawMenu();
18 | }
19 |
--------------------------------------------------------------------------------
/CCInject/CCInject.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 | 15.0
23 | {489F7B01-5C7E-4BC1-BE39-BE8D2C0CC7E7}
24 | Win32Proj
25 | CCInject
26 | 10.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v143
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v143
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v143
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | v143
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 | false
75 | CCHookReloaded
76 |
77 |
78 | true
79 | CCHookReloaded
80 |
81 |
82 | true
83 | CCHookReloaded
84 |
85 |
86 | false
87 | CCHookReloaded
88 |
89 |
90 |
91 |
92 |
93 | Level4
94 | MaxSpeed
95 | true
96 | true
97 | true
98 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
99 | true
100 | true
101 | stdcpp17
102 | MultiThreaded
103 | None
104 |
105 |
106 | Windows
107 | true
108 | true
109 | false
110 |
111 |
112 |
113 |
114 |
115 |
116 | Level4
117 | Disabled
118 | true
119 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
120 | true
121 | true
122 | stdcpplatest
123 | MultiThreadedDebug
124 |
125 |
126 | Windows
127 | true
128 |
129 |
130 |
131 |
132 |
133 |
134 | Level4
135 | Disabled
136 | true
137 | _DEBUG;_WINDOWS;%(PreprocessorDefinitions)
138 | true
139 | true
140 | stdcpplatest
141 | MultiThreadedDebug
142 |
143 |
144 | Windows
145 | true
146 |
147 |
148 |
149 |
150 |
151 |
152 | Level4
153 | MaxSpeed
154 | true
155 | true
156 | true
157 | NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
158 | true
159 | true
160 | stdcpplatest
161 | MultiThreaded
162 |
163 |
164 | Windows
165 | true
166 | true
167 | true
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
--------------------------------------------------------------------------------
/CCInject/CCInject.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;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 | Header Files
20 |
21 |
22 |
23 |
24 | Source Files
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CCInject/framework.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Ch40zz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CCHook:Reloaded - A modern, mod independent open source cheat for Enemy Territory
2 |
3 | [](https://www.youtube.com/watch?v=JvmvVpG1D1Y "CCHook:Reloaded")
4 |
5 | ## General
6 | This cheat is the result of a previous Proof-of-Concept made to showcase an alternative way to hook the Quake VM system in an undetected way.
7 | The rest of the cheat then followed the same rules to stay undetected, without compromising the ease of use of engine functions.
8 | This is the only cheat I know of that does not patch **any** read-only memory or leaves any other nasty detections such as spawned threads or incorrectly implemented hooks.
9 |
10 |
11 | ## Usage
12 | Modify `config.h` to your liking. Many of the config values cannot be changed at runtime and are statically compiled into the binary.
13 | Copy `cch.pk3` into your `etmain` folder and make sure to rename it. Set the new name in the config (`pakName`) without the `.pk3` extension.
14 | Ensure that `USE_DEBUG` macro is not defined in `pch.h` if you don't want to debug the cheat. This will significantly lower detection risk.
15 | Compile the project (Visual Studio 2022, Windows 10 SDK). It will yield 2 binaries in the ``Release`` output folder:
16 | - `CCHookReloaded.dll`: actual cheat DLL which has to be injected into the game
17 | - `CCHookReloaded.exe`: LdrLoadDll injector to start the game and inject the DLL
18 |
19 | **Please make sure to rename both files before launching the injector to avoid anti-cheat detections!**
20 |
21 | When the game has been started and the cheat has been injected with the injector, join any server.
22 | The cheat will be loaded upon mod initialization. To enable/disable cheat features, you can now open the WIP ingame menu by pressing the `DEL` key on your keyboard:
23 | 
24 |
25 |
26 | ## Hooking
27 | The cheat utilizes the `LdrRegisterDllNotification()` API to gain code execution on every DLL load/unload without the need to create any threads.
28 | Because every mod will load their own new copy of `cgame_mp_x86.dll` we will always have the perfect timing to place our hooks right after the mod loaded.
29 | From there, we hook the exported render routines of the `refexport_t` struct.
30 | This hook can be removed after a few frames if required but currently stays in tact to detect key presses in the main menu when no mod is loaded yet.
31 | The renderer functions that get hooked are `refexport_t::Shutdown()`, `refexport_t::EndRegistration()` and `refexport_t::EndFrame()`.
32 | Now that we are in the correct thread, we can finally hook the function we will use for rendering and logic: `vmMain()`.
33 | This is done by finding the pointer to the `cgvm` and swapping out its `entryPoint` address with our hook:
34 |
35 | ```cpp
36 | vm_t *_cgvm = off::cur.cgvm();
37 | if (_cgvm)
38 | {
39 | vmMain_t vmMain = _cgvm->entryPoint;
40 | if (vmMain && vmMain != hooked_vmMain)
41 | {
42 | orig_vmMain = vmMain;
43 | _cgvm->entryPoint = hooked_vmMain;
44 | }
45 | }
46 | ```
47 |
48 | This alone would be relatively easy to detect for an anti-cheat.
49 | Thats why we have another trick up our sleeves: All anti-cheats in this game are implemented in the mod's `cgame_mp_x86.dll`.
50 | This means that they can only execute code, when their `vmMain` gets invoked by the engine.
51 | To mask our `vmMain` hook, we simply spoof the return address and temporarily remove all our hooks until the mod is done running and passes execution back to our cheat.
52 | To also easily hook the syscalls made by the mod back into the engine, we have yet another trick: we locate the `currentVM` pointer, duplicate the whole VM object and replace its `systemCall` address with our own.
53 | This hook however, needs to stay when we call into the original `vmMain`. To make it undetected, we simply swap the `currentVM` pointer with our copy.
54 | This way an anticheat will think it has the correct `systemCall` address, while the engine **internally** will still end up calling our hook:
55 |
56 | ```cpp
57 | intptr_t __cdecl hooked_vmMain(intptr_t id, intptr_t a1, intptr_t a2, ...)
58 | {
59 | // Hook syscall func by replacing currentVM
60 | vm_t *curVM = off::cur.currentVM();
61 | memcpy(&hookVM, (void*)curVM, sizeof(hookVM));
62 | orig_CL_CgameSystemCalls = hookVM.systemCall;
63 | hookVM.systemCall = hooked_CL_CgameSystemCalls;
64 | off::cur.currentVM() = &hookVM;
65 |
66 | auto VmMainCall = [&](intptr_t _id, intptr_t _a1=0, intptr_t _a2=0, ...) -> intptr_t {
67 | // Restore vmMain original temporarily
68 | vm_t *_cgvm = off::cur.cgvm();
69 | _cgvm->entryPoint = orig_vmMain;
70 |
71 | // Spoof the return address when calling "orig_vmMain" to make sure ACs don't easily detect our hook (e.g. as ETPro does).
72 | // NOTE: This is not supported for ET:Legacy but support can be added if required.
73 | intptr_t result = SpoofCall12(off::cur.VM_Call_vmMain(), (uintptr_t)orig_vmMain, _id, _a1, _a2, ...);
74 |
75 | // Rehook vmMain
76 | _cgvm->entryPoint = hooked_vmMain;
77 |
78 |
79 | // Restore currentVM
80 | off::cur.currentVM() = curVM;
81 |
82 | return result;
83 | };
84 |
85 | intptr_t result = VmMainCall(id, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
86 |
87 | ...
88 |
89 | return result;
90 | }
91 | ```
92 |
93 | We now have access to every `vmMain` call (engine -> mod) and every `systemCall` (mod -> engine), giving us full control over all in- and output of the mod.
94 |
95 |
96 | ## Hardware/GUID Spoofing
97 |
98 | The game itself has no real knowledge about the underlying hardware IDs.
99 | The only way to track a player without additional code is to look at their `etkey` that is sent to the server on connect.
100 | These keys can be manually generated by anyone at any time and therefore do not uniquely identify a player.
101 | To implement player tracking, mods resort to reading the Hardware-ID of the system.
102 | This is done by querying disk drive serials or the MAC address(es) of the network cards.
103 | To implement a hookless Hardware-ID/GUID spoofing, the cheat directly accesses the sent packet queue `clc.reliableCommands`.
104 | This requires reverse engineering of the specific mods and is generally inferior to placing simple hooks.
105 | If you wish to generically bypass any HWID tracking, you should therefore resort to simple hooking of the APIs in question.
106 |
107 |
108 | ## Screenshot (PBSS) cleaning
109 |
110 | The game is driven by the OpenGL renderer.
111 | Screenshots are therefore also taken with OpenGL.
112 | To read the current displayed pixels, one can call `opengl32!glReadPixels()`.
113 | Luckily, this function is pretty easy to hook by swapping a .data pointer on Windows.
114 | OpenGL on Windows is allocating a big API dispatch table and storing the pointer to that table via TLS (thread local storage).
115 | The cheat extracts this table address by disassembling the instructions at `glReadPixels`.
116 | After receiving the dispatch table address, we can easily swap out any function with our hook.
117 | The hook then proceeds to set a global boolean value, indicating that all rendering should be disabled.
118 | To update the screen data, the engine function `SCR_UpdateScreen()` is executed.
119 | After the screen has been cleared, the original `glReadPixels` can be invoked to gather the cleaned screen data.
120 | This whole process usually takes no more than a few milliseconds.
121 |
122 |
123 | ## Gathering entity data
124 |
125 | Most cheats rely on reversing each individual mod to find the address of the `cg_entities` array.
126 | This is however not needed. Entity data is transmitted to the client each server tick and is received by the mod using the `CG_GETSNAPSHOT` syscall.
127 | Since we can intercept all syscalls done by the mod, we can just wait for the mod to request the data and then copy it off.
128 | This makes it even possible to modify the data the mod will receive, allowing us to modify or even delete events sent from the server.
129 |
130 |
131 | ## Unlocking unpure PAK files
132 |
133 | Other cheats implemented this feature by hooking `FS_PureServerSetLoadedPaks()`.
134 | This is however not really needed. One can simply walk all loaded PAKs in `fs_searchpaths`.
135 | Find the PAK file you want to unlock. To please the server, spoof the `checksum` and `pure_checksum` fields with the values from any legit pak file such as pak0.
136 | Now that we use the same hash as pak0, we do not want to send the hash multiple times to the server (since it was already sent).
137 | To do this, we simply set the pak's `referenced` count to 0.
138 | Now the client will be able to use the unpure pak file without the server even knowing about its existence.
139 |
140 |
141 | ## Possible improvements
142 |
143 | The biggest improvement right now would be creating weapon and event lists for each supported mod and fall back to the default ET implementation only if the mod is unknown.
144 | As it currently stands, many mods have additional and/or removed weapons, which leads to some code not working correctly on some mods.
145 | This however is pretty trivial and might be done soon.
146 | Another already mentioned improvement would be adding a more generic HWID spoofing by directly hooking the Windows APIs in question.
147 | This hasn't be done yet because the goal of this cheat was to not modify any read-only data.
148 | Lastly, the aimbot prediction is really just rudimentary and should be replaced with some more advanced techniques.
149 | One big improvement would be the use of backtracking as it is done nowadays for quake (source) based such as Counter-Strike.
150 |
--------------------------------------------------------------------------------
/cch.pk3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ch40zz/CCHookReloaded/70b36d1bd4e72f23fbcaf3947aec895856aed9ae/cch.pk3
--------------------------------------------------------------------------------