-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinput.d
More file actions
323 lines (252 loc) · 9.4 KB
/
input.d
File metadata and controls
323 lines (252 loc) · 9.4 KB
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
/*
* zCInput_GetFirstBindedLogicalKey
*/
func int zCInput_GetFirstBindedLogicalKey (var int key) {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C3270 public: unsigned short __thiscall zCInput::GetFirstBindedLogicalKey(unsigned short)
const int zCInput__GetFirstBindedLogicalKey_G1 = 4993648;
//0x004CC5D0 public: unsigned short __thiscall zCInput::GetFirstBindedLogicalKey(unsigned short)
const int zCInput__GetFirstBindedLogicalKey_G2 = 5031376;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
var int zinputPtr; zinputPtr = MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2);
CALL_PutRetValTo (_@(retVal));
CALL_IntParam(_@(key));
CALL__thiscall(zinputPtr, MEMINT_SwitchG1G2(zCInput__GetFirstBindedLogicalKey_G1, zCInput__GetFirstBindedLogicalKey_G2));
call = CALL_End();
};
return + (retVal & 255);
};
/*
* zCInput_IsBinded
*/
func int zCInput_IsBinded (var int logicalID, var int key) {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C3050 public: int __thiscall zCInput::IsBinded(unsigned short,unsigned short)
const int zCInput__IsBinded_G1 = 4993104;
//0x004CC370 public: int __thiscall zCInput::IsBinded(unsigned short,unsigned short)
const int zCInput__IsBinded_G2 = 5030768;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
var int zinputPtr; zinputPtr = MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2);
CALL_PutRetValTo (_@(retVal));
CALL_IntParam(_@(key));
CALL_IntParam(_@(logicalID));
CALL__thiscall(zinputPtr, MEMINT_SwitchG1G2(zCInput__IsBinded_G1, zCInput__IsBinded_G2));
call = CALL_End();
};
return + retVal;
};
/*
* zCInput_ClearKeyBuffer
*/
func void zCInput_ClearKeyBuffer() {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C2950 public: virtual void __thiscall zCInput::ClearKeyBuffer(void)
const int zCInput__ClearKeyBuffer_G1 = 4991312;
//0x004CBC90 public: virtual void __thiscall zCInput::ClearKeyBuffer(void)
const int zCInput__ClearKeyBuffer_G2 = 5029008;
var int zinputPtr; zinputPtr = MEM_ReadInt(MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2));
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall(_@(zinputPtr), MEMINT_SwitchG1G2(zCInput__ClearKeyBuffer_G1, zCInput__ClearKeyBuffer_G2));
call = CALL_End();
};
};
/*
* zCInput_ResetRepeatKey
*/
func void zCInput_ResetRepeatKey(var int resetLastKey) {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C2910 public: virtual void __thiscall zCInput::ResetRepeatKey(int)
const int zCInput__ResetRepeatKey_G1 = 4991248;
//0x004CBC50 public: virtual void __thiscall zCInput::ResetRepeatKey(int)
const int zCInput__ResetRepeatKey_G2 = 5028944;
var int zinputPtr; zinputPtr = MEM_ReadInt(MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2));
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam(_@(resetLastKey));
CALL__thiscall(_@(zinputPtr), MEMINT_SwitchG1G2(zCInput__ResetRepeatKey_G1, zCInput__ResetRepeatKey_G2));
call = CALL_End();
};
};
/*
* zCInput_Win32_GetToggled
* - consecutive calls return FALSE
*/
func int zCInput_Win32_GetToggled(var int logicalID) {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C8630 public: virtual int __thiscall zCInput_Win32::GetToggled(unsigned short)
const int zCInput_Win32__GetToggled_G1 = 5015088;
//0x004D5020 public: virtual int __thiscall zCInput_Win32::GetToggled(unsigned short)
const int zCInput_Win32__GetToggled_G2 = 5066784;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
var int zinputPtr; zinputPtr = MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2);
CALL_PutRetValTo(_@(retVal));
CALL_IntParam(_@(logicalID));
CALL__thiscall(zinputPtr, MEMINT_SwitchG1G2(zCInput_Win32__GetToggled_G1, zCInput_Win32__GetToggled_G2));
call = CALL_End();
};
return + retVal;
};
/*
* zCInput_Win32_ResetRepeatKey
*/
func void zCInput_Win32_ResetRepeatKey(var int resetLastKey) {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C8860 public: virtual void __thiscall zCInput_Win32::ResetRepeatKey(int)
const int zCInput_Win32__ResetRepeatKey_G1 = 5015648;
//0x004D5330 public: virtual void __thiscall zCInput_Win32::ResetRepeatKey(int)
const int zCInput_Win32__ResetRepeatKey_G2 = 5067568;
var int zinputPtr; zinputPtr = MEM_ReadInt(MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2));
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam(_@(resetLastKey));
CALL__thiscall(_@(zinputPtr), MEMINT_SwitchG1G2(zCInput_Win32__ResetRepeatKey_G1, zCInput_Win32__ResetRepeatKey_G2));
call = CALL_End();
};
};
/*
* zCInput_Win32_ClearKeyBuffer
*/
func void zCInput_Win32_ClearKeyBuffer() {
//0x0086CCA0 class zCInput * zinput
const int zinput_addr_G1 = 8834208;
//0x008D1650 class zCInput * zinput
const int zinput_addr_G2 = 9246288;
//0x004C8AE0 public: virtual void __thiscall zCInput_Win32::ClearKeyBuffer(void)
const int zCInput_Win32__ClearKeyBuffer_G1 = 5016288;
//0x004D55D0 public: virtual void __thiscall zCInput_Win32::ClearKeyBuffer(void)
const int zCInput_Win32__ClearKeyBuffer_G2 = 5068240;
var int zinputPtr; zinputPtr = MEM_ReadInt(MEMINT_SwitchG1G2(zinput_addr_G1, zinput_addr_G2));
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall(_@(zinputPtr), MEMINT_SwitchG1G2(zCInput_Win32__ClearKeyBuffer_G1, zCInput_Win32__ClearKeyBuffer_G2));
call = CALL_End();
};
};
/*
* zCInput_IsBindedToggled
*/
func int zCInput_IsBindedToggled(var int logicalID, var int key) {
return + (zCInput_IsBinded(logicalID, key) && zCInput_Win32_GetToggled(logicalID));
};
/*
* zCInputCallback_SetHandleEventTop
*/
func void zCInputCallback_SetHandleEventTop(var int inputCallBackPtr) {
//0x006FB880 public: void __thiscall zCInputCallback::SetHandleEventTop(void)
const int zCInputCallback__SetHandleEventTop_G1 = 7321728;
//0x007A5470 public: void __thiscall zCInputCallback::SetHandleEventTop(void)
const int zCInputCallback__SetHandleEventTop_G2 = 8017008;
if (!inputCallBackPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall(_@(inputCallBackPtr), MEMINT_SwitchG1G2(zCInputCallback__SetHandleEventTop_G1, zCInputCallback__SetHandleEventTop_G2));
call = CALL_End();
};
};
/*
* zCInputCallback_DoEvents
*/
func int zCInputCallback_DoEvents(var int key) {
//0x006FB9A0 public: static int __cdecl zCInputCallback::DoEvents(int)
const int zCInputCallback__DoEvents_G1 = 7322016;
//0x007A5590 public: static int __cdecl zCInputCallback::DoEvents(int)
const int zCInputCallback__DoEvents_G2 = 8017296;
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam(_@(key));
CALL__cdecl(MEMINT_SwitchG1G2(zCInputCallback__DoEvents_G1, zCInputCallback__DoEvents_G2));
call = CALL_End();
};
};
/*
* zCInputCallback_SetKey **hack
*/
func void zCInputCallback_SetKey(var int key) {
MEM_WriteInt(ESP + 4, key);
EDI = key;
MEM_WriteInt(ESP - 40, EDI);
};
/*
* zCInputCallback_GetEnableHandleEvent
*/
func int zCInputCallback_GetEnableHandleEvent(var int inputCallbackPtr) {
//0x006FB970 public: int __thiscall zCInputCallback::GetEnableHandleEvent(void)
const int zCInputCallback__GetEnableHandleEvent_G1 = 7321968;
//0x007A5560 public: int __thiscall zCInputCallback::GetEnableHandleEvent(void)
const int zCInputCallback__GetEnableHandleEvent_G2 = 8017248;
if (!inputCallbackPtr) { return 0; };
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo(_@(retVal));
CALL__thiscall(_@(inputCallbackPtr), MEMINT_SwitchG1G2(zCInputCallback__GetEnableHandleEvent_G1, zCInputCallback__GetEnableHandleEvent_G2));
call = CALL_End();
};
return + retVal;
};
/*
* zCInputCallback_SetEnableHandleEvent
*/
func void zCInputCallback_SetEnableHandleEvent(var int inputCallbackPtr, var int enabled) {
//0x006FB8F0 public: void __thiscall zCInputCallback::SetEnableHandleEvent(int)
const int zCInputCallback__SetEnableHandleEvent_G1 = 7321840;
//0x007A54E0 public: void __thiscall zCInputCallback::SetEnableHandleEvent(int)
const int zCInputCallback__SetEnableHandleEvent_G2 = 8017120;
if (!inputCallbackPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam(_@(enabled));
CALL__thiscall(_@(inputCallbackPtr), MEMINT_SwitchG1G2(zCInputCallback__SetEnableHandleEvent_G1, zCInputCallback__SetEnableHandleEvent_G2));
call = CALL_End();
};
};
/*
* GetCharFromDIK
*/
func int GetCharFromDIK(var int key, var int shift, var int alt) {
//0x004C7590 char __cdecl GetCharFromDIK(char,char)
const int GetCharFromDIK_G1 = 5010832;
//0x004D2130 unsigned char __cdecl GetCharFromDIK(int,int,int)
const int GetCharFromDIK_G2 = 5054768;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo(_@(retVal));
if (MEMINT_SwitchG1G2(0, 1)) {
CALL_IntParam(_@(alt));
};
CALL_IntParam(_@(shift));
CALL_IntParam(_@(key));
CALL__cdecl(MEMINT_SwitchG1G2(GetCharFromDIK_G1, GetCharFromDIK_G2));
call = CALL_End();
};
if (retVal == -1) {
return + retVal;
};
return + (retVal & 255);
};