{$CLEO .cs}
0000:
repeat
wait 1000
0A8D: 0@ = read_memory 0xA444A0 size 4 virtual_protect 0
until 0@ == 1 // SAMP_IS_READY
if 8AA2: 0@ = load_library "samp.dll" // IF and SET
then 0A93: end_custom_thread
end
0AC6: 2@ = label @cmdname offset
0AB1: call_scm_func @registerClientParam 0 _Return: CallBack 1@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 2@ CallBack: 1@
while true
wait 0
if 31@ == 1
then
//wait 1000
0AB1: @GetLastCommandParams 0 _returnCMDParams 3@
0AD1: "%s" 2000 3@
31@ = 0
else
0AD1: "Disable" 1000
end
end
:registerClientParam
0AC6: 1@ = label @callback offset
// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 31@ offset
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
31@ = 0 // zeroing 31 var
0AB2: ret 1 1@
:registerClientCommand // unsigned long dwSAMPHandle, char szCommandName[], CMDPROC CallBack
0085: 3@ = 0@ // dwSAMPHandle
3@ += 0x2ACA14 // struct || SAMP_CHAT_INPUT_INFO_OFFSET
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 1
0085: 4@ = 0@ // dwSAMPHandle
4@ += 0x691B0 // function || SAMP_FUNC_ADDCLIENTCMD
0AA6: call_method 4@ struct 3@ num_params 2 pop 0 2@ 1@
0AB2: ret 0
:cmdname
hex
"test" 0
end
:callback
hex
83 35 11 11 11 11 01 // xor [11111111], 01
C3 // retn
end
:GetLastCommandParams
0AA2: 0@ = load_library "samp.dll"
0@ += 0x17FBB8 // SAMP CHAT OR DIALOG INPUT TEXT OFFSET || return like "/cmd BigWorld"
0AB1: @SkipCMD 1 StringPointer 0@ _Return 1@ // skip cmd and get "BigWorld"
0AB2: 1 1@
:SkipCMD
{
0AB1: @SkipCMD 1 StringPointer 5@ _Return 6@
}
0AB1: @strlen 1 string 0@ _return 31@
31@ -= 1
for 30@ = 0 to 31@
0A8D: 29@ = read_memory 0@ size 1 virtual_protect 1
if
29@ == 47 // 47 - /
then
0@++
0AB1: @strlen 1 string 0@ _return 28@
28@ -= 1
for 27@ = 0 to 28@
0A8D: 26@ = read_memory 0@ size 1 virtual_protect 1
if
26@ == 32 // 32 - space
then
0@++
0AB2: 1 0@
end
0@++
end
end
0@++
end
0AB2: 0
:strlen
{
Example: 0AB1: @strlen 1 string 1@ return: 3@
In: 0@ - text;
Out: 1@ - size;
}
for 1@ = 0 to 1024
0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
if not 2@ == 0
jf break
0@ += 1
end
0AB2: ret 1 1@