Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit b688792

Browse files
committed
Base with hooked CL_CreateMove
0 parents  commit b688792

20 files changed

+1477
-0
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
46+
[Dd]ebug/
47+
[Rr]elease/
48+
x64/
49+
build/
50+
[Bb]in/
51+
[Oo]bj/
52+
53+
# MSTest test Results
54+
[Tt]est[Rr]esult*/
55+
[Bb]uild[Ll]og.*
56+
57+
*_i.c
58+
*_p.c
59+
*.ilk
60+
*.meta
61+
*.obj
62+
*.pch
63+
*.pdb
64+
*.pgc
65+
*.pgd
66+
*.rsp
67+
*.sbr
68+
*.tlb
69+
*.tli
70+
*.tlh
71+
*.tmp
72+
*.tmp_proj
73+
*.log
74+
*.vspscc
75+
*.vssscc
76+
.builds
77+
*.pidb
78+
*.log
79+
*.scc
80+
81+
# Visual C++ cache files
82+
ipch/
83+
*.aps
84+
*.ncb
85+
*.opensdf
86+
*.sdf
87+
*.cachefile
88+
89+
# Visual Studio profiler
90+
*.psess
91+
*.vsp
92+
*.vspx
93+
94+
# Guidance Automation Toolkit
95+
*.gpState
96+
97+
# ReSharper is a .NET coding add-in
98+
_ReSharper*/
99+
*.[Rr]e[Ss]harper
100+
101+
# TeamCity is a build add-in
102+
_TeamCity*
103+
104+
# DotCover is a Code Coverage Tool
105+
*.dotCover
106+
107+
# NCrunch
108+
*.ncrunch*
109+
.*crunch*.local.xml
110+
111+
# Installshield output folder
112+
[Ee]xpress/
113+
114+
# DocProject is a documentation generator add-in
115+
DocProject/buildhelp/
116+
DocProject/Help/*.HxT
117+
DocProject/Help/*.HxC
118+
DocProject/Help/*.hhc
119+
DocProject/Help/*.hhk
120+
DocProject/Help/*.hhp
121+
DocProject/Help/Html2
122+
DocProject/Help/html
123+
124+
# Click-Once directory
125+
publish/
126+
127+
# Publish Web Output
128+
*.Publish.xml
129+
*.pubxml
130+
131+
# NuGet Packages Directory
132+
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133+
#packages/
134+
135+
# Windows Azure Build Output
136+
csx
137+
*.build.csdef
138+
139+
# Windows Store app package directory
140+
AppPackages/
141+
142+
# Others
143+
sql/
144+
*.Cache
145+
ClientBin/
146+
[Ss]tyle[Cc]op.*
147+
~$*
148+
*~
149+
*.dbmdl
150+
*.[Pp]ublish.xml
151+
*.pfx
152+
*.publishsettings
153+
154+
# RIA/Silverlight projects
155+
Generated_Code/
156+
157+
# Backup & report files from converting an old project file to a newer
158+
# Visual Studio version. Backup files are not needed, because we have git ;-)
159+
_UpgradeReport_Files/
160+
Backup*/
161+
UpgradeLog*.XML
162+
UpgradeLog*.htm
163+
164+
# SQL Server files
165+
App_Data/*.mdf
166+
App_Data/*.ldf
167+
168+
#############
169+
## Windows detritus
170+
#############
171+
172+
# Windows image file caches
173+
Thumbs.db
174+
ehthumbs.db
175+
176+
# Folder config file
177+
Desktop.ini
178+
179+
# Recycle Bin used on file shares
180+
$RECYCLE.BIN/
181+
182+
# Mac crap
183+
.DS_Store
184+
185+
186+
#############
187+
## Python
188+
#############
189+
190+
*.py[co]
191+
192+
# Packages
193+
*.egg
194+
*.egg-info
195+
dist/
196+
build/
197+
eggs/
198+
parts/
199+
var/
200+
sdist/
201+
develop-eggs/
202+
.installed.cfg
203+
204+
# Installer logs
205+
pip-log.txt
206+
207+
# Unit test / coverage reports
208+
.coverage
209+
.tox
210+
211+
#Translations
212+
*.mo
213+
214+
#Mr Developer
215+
.mr.developer.cfg
216+
injmthd.ini
217+
*.exe
218+
*.dll

auto_offsets.asm

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
proc AO_InitWait
2+
local sleepTime dd 0
3+
4+
mov esi, moduleList
5+
6+
.loop:
7+
invoke Sleep, [sleepTime]
8+
inc [sleepTime]
9+
10+
.next:
11+
stdcall AO_ParseModule
12+
test eax, eax
13+
jz .loop
14+
15+
add esi, sizeof.hl_module
16+
cmp esi, moduleListEnd
17+
jne .next
18+
19+
ret
20+
endp
21+
22+
proc AO_ParseModule ;hl_module param at esi
23+
virtual at esi
24+
.m hl_module
25+
end virtual
26+
27+
invoke GetModuleHandleA, [.m.name]
28+
test eax, eax
29+
jz .fail
30+
31+
locals
32+
mi MODULEINFO
33+
endl
34+
35+
lea ecx, [mi]
36+
invoke GetModuleInformation, [hlexe], eax, ecx, sizeof.MODULEINFO
37+
test eax, eax
38+
jz .fail
39+
40+
mov eax, [mi.lpBaseOfDll]
41+
mov ecx, [mi.SizeOfImage]
42+
mov [.m.base], eax
43+
mov [.m.size], ecx
44+
45+
.fail: ;if fail, eax = 0, otherwise eax=lpBaseOfDll
46+
ret
47+
endp
48+
49+
proc AO_GetAll uses ebp ;ebp is the only register that is saved between calls of AO_??? because of FindBytePattern
50+
mov ebp, ao_getList
51+
.next:
52+
call dword[ebp]
53+
add ebp, 4
54+
cmp ebp, ao_getListEnd
55+
jne .next
56+
ret
57+
endp
58+
59+
proc AO_GetEngine
60+
stdcall FindBytePattern, [hw.base], [hw.size], szScreenFade, sizeof.szScreenFade - 1
61+
test eax, eax
62+
jnz .found1
63+
stdcall ShowFatalError, szErr_GetEngine_screenfade
64+
.found1:
65+
FindRefWithPrefix [hw.base], [hw.size], ASM_INSTR_PUSH_DWORD, sizeof.ASM_INSTR_PUSH_DWORD, eax
66+
test eax, eax
67+
jnz .found2
68+
stdcall ShowFatalError, szErr_GetEngine_ref
69+
.found2:
70+
add eax, 0x0D
71+
mov eax, [eax]
72+
mov [pEngine], eax
73+
memcpy Engine, eax, sizeof.Engine_s
74+
ret
75+
endp
76+
77+
proc AO_GetClientDLL
78+
stdcall FindBytePattern, [hw.base], [hw.size], szScreenFade, sizeof.szScreenFade - 1
79+
test eax, eax
80+
jnz .found1
81+
stdcall ShowFatalError, szErr_GetClientDLL_screenfade
82+
.found1:
83+
FindRefWithPrefix [hw.base], [hw.size], ASM_INSTR_PUSH_DWORD, sizeof.ASM_INSTR_PUSH_DWORD, eax
84+
test eax, eax
85+
jnz .found2
86+
stdcall ShowFatalError, szErr_GetClientDLL_ref
87+
.found2:
88+
add eax, 0x13
89+
mov eax, [eax]
90+
mov [pClientDLL], eax
91+
memcpy ClientDLL, eax, sizeof.ClientDLL_s
92+
ret
93+
endp
94+
95+
proc AO_GetClientDLL_Interface_Version
96+
mov eax, [pClientDLL]
97+
if ~ ClientDLL_s.Initialize = 0
98+
add eax, ClientDLL_s.Initialize ;Initialize should be 0
99+
end if
100+
FindRefWithPrefix [hw.base], [hw.size], ASM_INSTR_CALL_DWORD_PTR, sizeof.ASM_INSTR_CALL_DWORD_PTR, eax
101+
test eax, eax
102+
jnz .found1
103+
stdcall ShowFatalError, szErr_GetClientDLL_IV_ref
104+
.found1:
105+
sub eax, 7
106+
cmp byte[eax], ASM_INSTR_PUSH_BYTE
107+
je .ver_is_byte
108+
stdcall ShowFatalError, szErr_GetClientDLL_IV_notbyte
109+
.ver_is_byte:
110+
mov al, [eax + 1]
111+
mov byte[ClientDLL_Interface_Version], al
112+
ret
113+
endp
114+
115+
proc AO_GetConsoleColor
116+
;DWORD dwConColor = (*(DWORD*)(((**(DWORD**)((((DWORD)FindCmd("clear") + 26) + (*(DWORD*)((DWORD)FindCmd("clear") + 26)) + 4) + 2)) + 8)) + 296 ); // This is my version of it with 2xFindCmd
117+
;pConColor = (color24*)dwConColor;
118+
;pConColorDev = (color24*)(dwConColor + 4);
119+
ret
120+
endp

auto_offsets.inc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
struct hl_module
2+
name dd ?
3+
base dd ?
4+
size dd ?
5+
ends
6+
7+
string szhwdll, 'hw.dll'
8+
string szclientdll, 'client.dll'
9+
string szvgui2dll, 'vgui2.dll'
10+
11+
moduleList:
12+
hw hl_module szhwdll
13+
client hl_module szclientdll
14+
vgui2 hl_module szvgui2dll
15+
moduleListEnd:
16+
17+
ao_getList:
18+
dd AO_GetEngine
19+
dd AO_GetClientDLL
20+
dd AO_GetClientDLL_Interface_Version
21+
ao_getListEnd:
22+
23+
;Patterns:
24+
string szScreenFade, 'ScreenFade'
25+
26+
;Error messages:
27+
string szErr_GetEngine_screenfade, 'AO_GetEngine failed to find "ScreenFade" location'
28+
string szErr_GetEngine_ref, 'AO_GetEngine failed to find reference of push dword addr of "ScreenFade"'
29+
30+
string szErr_GetClientDLL_screenfade, 'AO_GetClientDLL failed to find "ScreenFade" location'
31+
string szErr_GetClientDLL_ref, 'AO_GetClientDLL failed to find reference of push dword addr of "ScreenFade"'
32+
33+
string szErr_GetClientDLL_IV_ref, 'AO_GetClientDLL_Interface_Version failed to find reference of call dword ptr ClientDLL.Initialize'
34+
string szErr_GetClientDLL_IV_notbyte, 'AO_GetClientDLL_Interface_Version found version is not byte (?)'

0 commit comments

Comments
 (0)