{$CLEO}
0000:
0662: "by legend2360"
0662: "BlastHack - cheating is art"
while not SAMP.Available()
wait 400
end
reg_cmd "push" @cmd
lo 0@ @push_set
alloc 1@ 256
memset 1@ 0 256
0C0F: array 0@ element 0 = -1
0C0F: array 0@ element 1 = 1@ // buf
1@ = 0 // no longer used
while true
wait 0
if 30@ == 1
then
chat "pushed {ffff00}%s" -1 1@
call @push_from_set 3 @push_set text 1@ expire_in_ms 60000
chat "Expires: {ffff00}60 mi" -1 1@
30@ = 0
end
if call @check_past_pushes 2 @push_set max_expire 60000 retr_el 3@
then
call @get_string_from_buf 2 @push_set el 3@ retr 4@
chat "deleted el %d - {ffff00}%s" -1 3@ 4@
call @free_el_in_buf 2 @push_set el 3@
continue
end
end
:cmd
gcp 1@
strlen 2@ 1@
if and
2@ > 0
2@ < 32
then 30@ = 1
end
cmdret
:get_string_from_buf
lo 0@ 0@
0C0E: 2@ = array 0@ element 1
0C1F: 3@ = string_array 2@ element 1@ size 32
0C18: 3@ = strstr string1 3@ string2 " "
3@++
ret 1 3@
:free_el_in_buf
lo 0@ 0@
0C0E: 2@ = array 0@ element 0
2@--
0C0F: array 0@ element 0 = 2@
0C0E: 2@ = array 0@ element 1
0C20: string_array 2@ element 1@ size 32 = ""
ret 0
:check_past_pushes
9@ = 0 // out
lo 0@ 0@
0C0E: 2@ = array 0@ element 0 // total items
if 2@ <> -1
then
0C0E: 3@ = array 0@ element 1 // buf
call @GetLocalTimeInMS 0 to 4@
for 5@ = 0 to 7 { 8 } step 1
0C1F: 6@ = string_array 3@ element 5@ size 32
0A8D: 30@ = read_memory 6@ size 1 virtual_protect 0
if 30@ <> 0x0
then
// atoi 7@ 6@
0AD4: 30@ = scan_string 6@ format "%d" 7@
0A8F: 8@ = 7@ - 4@
if 8@ <= 0
then
8@ = 0xffff
break
end
end
end
end
if 8@ == 0xffff
then ret_true
else ret_false
end
ret 1 5@
:push_from_set
// call @push_to_buf 3 push_set 0@ text 1@ expire_time_in_ms 2@
lo 0@ 0@
0C0E: 3@ = array 0@ element 0 // total items
0C0E: 4@ = array 0@ element 1 // buf
chat "total items %d" -1 3@
chat "pntr to buf %p" -1 4@
6@ = -1 // var push
if 3@ >= 0
then
if 3@ < 8
then
for 7@ = 0 to 7 { 8 } step 1
0C1F: 8@ = string_array 4@ element 7@ size 32
0A8D: 9@ = read_memory 8@ size 1 virtual_protect 0
if 9@ == 0
then
0085: 6@ = 7@
break
end
end
end
else 6@ = 0
end
chat "Free item: %d" -1 6@
if 6@ <> -1
then
call @GetLocalTimeInMS 0 to 5@
005a: 5@ += 2@
alloc 8@ 48
format 8@ = "%d %s" 5@ 1@
0C20: string_array 4@ element 6@ size 32 = 8@
free 8@
3@++
0C0F: array 0@ element 0 = 3@
ret_true
else ret_false
end
ret 0
:GetLocalTimeInMS
alloc 1@ 24
0AA5: call 0x81E514 num_params 1 pop 0 1@
0C0C: 2@ = struct 1@ offset 8 size 2 // Hour
0C0C: 3@ = struct 1@ offset 10 size 2 // Minute
0C0C: 4@ = struct 1@ offset 12 size 2 // Seconds
0C0C: 5@ = struct 1@ offset 14 size 2 // Milliseconds
free 1@
2@ *= 3600000 // hour to ms
3@ *= 60000 // minute to ms
4@ *= 1000 // second to ms
005a: 5@ += 2@
005a: 5@ += 3@
005a: 5@ += 4@
ret 1 5@
:push_set
hex
{0} 00 00 00 00 {4} 00 00 00 00 {8} 00
end