-
Notifications
You must be signed in to change notification settings - Fork 9
/
antiinvis.cpp
166 lines (161 loc) · 3.62 KB
/
antiinvis.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
#include "zxmgr.h"
#include "srvmgr.h"
bool block_invis = false;
char aAttackInvisible[] = "[invis_fix] %s/%s attacks %s!\n";
void __declspec(naked) stop_unit_attack() // fixes attack on invisible units
{
__asm
{
// [ebp-0x14] - attacking player
// [ebp-0x28] - target unit
cmp [ebp-0x14], 0
jz continue_cmd
cmp [ebp-0x28], 0
jz continue_cmd
mov eax, [ebp-0x28] // unit
mov eax, [eax+0x144]
and eax, 0x1000
test eax, eax
jz continue_cmd // visible
mov edx, 0x006A8B8C
mov edx, [edx]
mov eax, [ebp-0x28]
mov eax, [eax+0x14]
movsx ebx, [eax+0x04]
imul ebx, 0x46
mov eax, [ebp-0x14]
movsx ecx, [eax+0x04]
add ebx, ecx
add ebx, 0xA8C4
add ebx, edx
test byte ptr [ebx], 0x10
jnz continue_cmd
mov eax, [ebp-0x28]
mov eax, [eax+0x14]
push [eax+0x18] // target nickname
mov eax, [ebp-0x14]
push [eax+0x18] // attacker nickname
push [eax+0x0A78] // attacker login
push offset aAttackInvisible
call log_format // log cheater
// â áàí âñåõ ÷èòîðîâ
cmp byte ptr [block_invis], 0
jz continue_cmd
mov edx, 0x0050864E // exit from sub
jmp edx
continue_cmd:
mov edx, 0x006D1648
cmp dword ptr [edx], 0x02
jnz l_505580
mov edx, 0x0050556C
jmp edx
l_505580:
mov edx, 0x00505580
jmp edx
}
}
char aCastInvisible[] = "[invis_fix] %s/%s casts spell onto %s!\n";
void __declspec(naked) stop_unit_cast() // fixes spellcasting onto invisible units
{
__asm
{
// [ebp-0x14] - attacking player
// [ebp-0x28] - target unit
cmp [ebp-0x14], 0
jz continue_cmd
cmp [ebp-0x28], 0
jz continue_cmd
mov eax, [ebp-0x28] // unit
mov eax, [eax+0x144]
and eax, 0x1000
test eax, eax
jz continue_cmd // visible
mov edx, 0x006A8B8C
mov edx, [edx]
mov eax, [ebp-0x28]
mov eax, [eax+0x14]
movsx ebx, [eax+0x04]
imul ebx, 0x46
mov eax, [ebp-0x14]
movsx ecx, [eax+0x04]
add ebx, ecx
add ebx, 0xA8C4
add ebx, edx
test byte ptr [ebx], 0x10
jnz continue_cmd
mov eax, [ebp-0x28]
mov eax, [eax+0x14]
push [eax+0x18] // target nickname
mov eax, [ebp-0x14]
push [eax+0x18] // attacker nickname
push [eax+0x0A78] // attacker login
push offset aCastInvisible
call log_format // log cheater
// â áàí âñåõ ÷èòîðîâ
cmp byte ptr [block_invis], 0
jz continue_cmd
mov edx, 0x0050864E // exit from sub
jmp edx
continue_cmd:
mov edx, 0x006D1648
cmp dword ptr [edx], 0x02
jnz l_50566A
mov edx, 0x00505656
jmp edx
l_50566A:
mov edx, 0x0050566A
jmp edx
}
}
void __declspec(naked) stop_mage_cast() // fixes spellcasting onto invisible units
{
__asm
{
// [ebp-0x14] - attacking player
// [ebp-0x28] - target unit
cmp [ebp-0x14], 0
jz continue_cmd
cmp [ebp-0x28], 0
jz continue_cmd
mov eax, [ebp-0x28] // unit
mov eax, [eax+0x144]
and eax, 0x1000
test eax, eax
jz continue_cmd // visible
mov edx, 0x006A8B8C
mov edx, [edx]
mov eax, [ebp-0x28]
mov eax, [eax+0x14]
movsx ebx, [eax+0x04]
imul ebx, 0x46
mov eax, [ebp-0x14]
movsx ecx, [eax+0x04]
add ebx, ecx
add ebx, 0xA8C4
add ebx, edx
test byte ptr [ebx], 0x10
jnz continue_cmd
mov eax, [ebp-0x28]
mov eax, [eax+0x14]
push [eax+0x18] // target nickname
mov eax, [ebp-0x14]
push [eax+0x18] // attacker nickname
push [eax+0x0A78] // attacker login
push offset aAttackInvisible
call log_format // log cheater
// â áàí âñåõ ÷èòîðîâ
cmp byte ptr [block_invis], 0
jz continue_cmd
mov edx, 0x0050864E // exit from sub
jmp edx
continue_cmd:
mov edx, 0x006D1648
cmp dword ptr [edx], 0x02
jnz l_50561A
mov edx, 0x00505606
jmp edx
l_50561A:
mov edx, 0x0050561A
jmp edx
}
}