-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathD2CallStub.cpp
219 lines (192 loc) · 3.18 KB
/
D2CallStub.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#include "stdafx.h"
void __declspec(naked) __fastcall D2SetAutomapParty(DWORD flag)
{
__asm {
push esi
mov esi, ecx
call D2SetAutomapPartyStub
pop esi
ret
}
}
void __declspec(naked) __fastcall D2SetAutomapNames(DWORD flag)
{
__asm {
push esi
mov esi, ecx
call D2SetAutomapNamesStub
pop esi
ret
}
}
//ÁÄÌìÏûÏ¢
DWORD __declspec(naked) __fastcall D2ChatInput(D2MSG *pmsg)
{
__asm {
mov eax, 0xF
push ecx
call D2ChatInputStub
ret
}
}
DWORD __declspec(naked) __fastcall D2CheckUiStatus(DWORD dwUiNo)
{
__asm {
mov eax, ecx
call D2CheckUiStatusStub
ret
}
}
__declspec(naked) AutomapLayer* __fastcall D2InitAutomapLayer(DWORD nLayerNo)
{
__asm {
mov eax, ecx
call D2InitAutomapLayerStub
ret
}
}
__declspec(naked) UniqueItemTxt* __fastcall D2GetUniqueItemTxt(DWORD dwIdx)
{
__asm {
mov eax, ecx
mov ecx, [p_D2DataTables]
mov ecx , [ecx]
cmp eax, dword ptr [ecx+0xC28]
jge unkret
mov edx, dword ptr [ecx+0xC24]
imul eax, 0x14C
add eax, edx
ret
unkret:
xor eax , eax
ret
}
}
__declspec(naked) ItemStatCostTxt* __fastcall D2GetItemStatCostTxt(DWORD dwStatNo)
{
__asm {
mov eax, ecx
mov ecx, [p_D2DataTables]
mov ecx , [ecx]
cmp eax, dword ptr [ecx+0xBD4]
jge unkret
mov edx, dword ptr [ecx+0xBCC]
imul eax, 0x144
add eax, edx
ret
unkret:
xor eax , eax
ret
}
}
__declspec(naked) PropertiesTxt* __fastcall D2GetPropertiesTxt(DWORD dwPropNo)
{
__asm {
mov eax, ecx
mov ecx, [p_D2DataTables]
mov ecx , [ecx]
cmp eax, dword ptr [ecx+0xAC]
jge unkret
mov edx, dword ptr [ecx+0xA4]
imul eax, 0x2E
add eax, edx
ret
unkret:
xor eax , eax
ret
}
}
__declspec(naked) SetItemTxt* __fastcall D2GetSetItemTxt(DWORD dwIdx)
{
__asm {
mov eax, ecx
mov ecx, [p_D2DataTables]
mov ecx , [ecx]
cmp eax, dword ptr [ecx+0xC1C]
jge unkret
mov edx, dword ptr [ecx+0xC18]
imul eax, 0x1B8
add eax, edx
ret
unkret:
xor eax , eax
ret
}
}
__declspec(naked) ItemTypeTxt* __fastcall D2GetItemTypeTxt(DWORD dwIdx)
{
__asm {
mov eax, ecx
mov ecx, [p_D2DataTables]
mov ecx , [ecx]
cmp eax, dword ptr [ecx+0xBFC]
jge unkret
mov edx, dword ptr [ecx+0xBF8]
imul eax, 0xE4
add eax, edx
ret
unkret:
xor eax , eax
ret
}
}
__declspec(naked) RuneWordTxt* __fastcall D2GetRuneWordTxt(DWORD dwIdx)
{
__asm {
mov eax, ecx
mov ecx, [p_D2RuneWords]
mov ecx , [ecx]
cmp eax, ecx
jge unkret
mov edx ,[p_D2RuneWordTxt]
mov edx ,[edx]
imul eax, 0x120
add eax, edx
ret
unkret:
xor eax , eax
ret
}
}
DWORD __declspec(naked) __fastcall D2GetRuneWordTxtIndex(DWORD dwFileNo)
{
__asm {
push ebx
push ebp
mov ebx , ecx
mov ecx, [p_D2RuneWords]
mov ecx , [ecx]
mov edx ,[p_D2RuneWordTxt]
mov edx ,[edx]
xor ebp ,ebp
myloop:
mov eax , ebp
cmp eax, ecx
jge unkret
imul eax, 0x120
add eax, edx
inc ebp
cmp bx , word ptr [eax+0x82]
jne myloop
mov eax , ebp
dec eax
pop ebp
pop ebx
ret
unkret:
xor eax , eax
pop ebp
pop ebx
ret
}
}
__declspec(naked) CellFile* __fastcall D2LoadUiImage(char* szPath)
{
__asm
{
mov eax, ecx
push 0
call vD2LoadUiImageFunc
retn
}
}