Хук работает

  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
{$CLEO}
0000:
0662: "by legend2360"
0662: "BlastHack - cheating is art"
while not SAMP.Available()
wait 800
end
call @addOffsetFromSampBase 1 offset 0x21C607 retr_to 0@
0DB6: 1@ = create_hook from_addr 0@ to_label @hook_join pop_count 0 var_to_set_hook 1
0DB7: plant_hook 1@
call @addOffsetFromSampBase 1 offset 0x2B18DF retr_to 2@
0DB6: 3@ = create_hook from_addr 2@ to_label @hook_quit pop_count 0 var_to_set_hook 3
0DB7: plant_hook 3@
if call @create_admin_list 0 retr_buf 4@
then
lo 5@ @pntr_adm_list
0A8C: write_memory 5@ size 4 value 4@ virtual_protect 0
chat "list buffer created %p" -1 4@
alloc 4@ 26104
memset 4@ 0 26104
lo 5@ @pntr_online_list
0A8C: write_memory 5@ size 4 value 4@ virtual_protect 0
chat "online list buffer created %p" -1 4@
end
while true
wait 0
end
:hook_join
call @hook_join_proc 2 addr 0@ hook 1@
0D98: callback_retn
:hook_quit
call @hook_quit_proc 2 addr 2@ hook 3@
0D98: callback_retn
:addOffsetFromSampBase
1@ = SAMP.Base()
005a: 1@ += 0@
ret 1 1@
:add_to_online_list
lo 2@ @pntr_online_list
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
alloc 3@ 26
memset 3@ 0 26
format 3@ = "%d %s" 0@ 1@
0C20: string_array 2@ element 0@ size 26 = 3@
free 3@
ret 0
:remove_from_online_list
lo 1@ @pntr_online_list
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
0C1F: 2@ = string_array 1@ element 0@ size 26
0AD4: 3@ = scan_string 2@ format "%d" 4@
if and
3@ == 1
003b: 4@ == 0@
then
0C19: 5@ = strcspn string1 2@ string2 " "
5@++
005a: 2@ += 5@
alloc 6@ 21
format 6@ = "%s" 2@
0C20: string_array 1@ element 0@ size 26 = ""
ret_true
else ret_false
end
ret 1 6@
:create_admin_list
if 0@ = File.Open("CLEO\INI\admins.txt", "rt")
then
alloc 1@ 50000
alloc 2@ 64
memset 1@ 0 50000
memset 2@ 0 64
0085: 4@ = 1@
while not File.EOF(0@)
if File.ReadString(0@, 2@, 60)
then
strlen 3@ 2@
call @add_space 2 2@ 3@
memcpy 1@ 2@ 3@
005a: 1@ += 3@
end
memset 2@ 0 64
end
0085: 1@ = 4@
strlen 3@ 1@
3@++
alloc 5@ 3@
memset 5@ 0 3@
3@--
memcpy 5@ 1@ 3@
free 1@
free 2@
ret_true
else ret_false
end
ret 1 5@
:add_space
var
0@ : int // - string
1@ : int // - size
end
1@--
0@ += 1@
0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
if 2@ == 0xA
then memset 0@ 0x20 1
end
0@ -= 1@
ret 0
:hook_join_proc
0DB9: get_hook 1@ last_param_pntr_to 2@
call @call_func_ServerJoin_FromHook 3 addr 0@ hook 1@ params 2@
alloc 3@ 21
memset 3@ 0 21
0A8E: 4@ = 2@ + 8 // ID
0A8D: 4@ = read_memory 4@ size 2 virtual_protect 0
0A8E: 5@ = 2@ + 15 // nick len
0A8D: 5@ = read_memory 5@ size 1 virtual_protect 0
0A8E: 6@ = 2@ + 16 // nick
memcpy 3@ 6@ 5@
lo 7@ @pntr_adm_list
0A8D: 7@ = read_memory 7@ size 4 virtual_protect 0
0C18: 8@ = strstr string1 7@ string2 3@
if 8@ <> 0
then
chat "Admin connected %s[%d]" -1 3@ 4@
call @add_to_online_list 2 id 4@ nick 3@
end
free 3@
ret 0
:hook_quit_proc
0DB9: get_hook 1@ last_param_pntr_to 2@
call @call_func_ServerQuit_FromHook 3 addr 0@ hook 1@ params 2@
0A8E: 3@ = 2@ + 8 // ID
0A8D: 3@ = read_memory 3@ size 2 virtual_protect 0
if call @remove_from_online_list 1 id 3@ retr_name 4@
then
chat "Admin disconnected %s[%d]" -1 4@ 3@
free 4@
end
ret 0
:call_func_ServerJoin_FromHook
// call @call_func_ServerJoinFromHook 3 addr 0@ hook 1@ params 2@
0C0E: 3@ = array 2@ element -2
0C0E: 4@ = array 2@ element 1 // ID
0C0E: 5@ = array 2@ element 2 // unk
0C0E: 6@ = array 2@ element 3 // unk2
0C0E: 7@ = array 2@ element 4 // nick len
0C0E: 8@ = array 2@ element 5 // nick
0DB8: unplant_hook 1@
0AA6: call_method 0@ struct 3@ num_params 5 pop 5 params 8@ 7@ 6@ 5@ 4@
0DB7: plant_hook 1@
ret 0
:call_func_ServerQuit_FromHook
// call @call_func_ServerJoinFromHook 3 addr 0@ hook 1@ params 2@
0C0E: 3@ = array 2@ element -2
0C0E: 4@ = array 2@ element 1 // ID
0C0E: 5@ = array 2@ element 2 // unk
0DB8: unplant_hook 1@
0AA6: call_method 0@ struct 3@ num_params 2 pop 2 params 5@ 4@
0DB7: plant_hook 1@
ret 0
:pntr_adm_list
hex
00 00 00 00
end
:pntr_online_list
hex
00 00 00 00
end