CLEO Help Convert for 0.3.DL help ?

CLEO related
Status
Not open for further replies.

MalikeiraOPoder

Active member
Joined
Mar 16, 2019
Messages
100
Reaction score
2
Hi everyone, I made this simple cheat to use in version 0.3.DL, but I do not know how to convert to 0.3.DL, someone knows how to convert and can help me?


my code:

PHP:
{$CLEO .cs}
thread "easy cheat" 

:cheat
wait 0 
if 
   SAMP.Available
else_jump @cheat 
0B34: samp register_client_command ".repair" to_label @repair 
0B34: samp register_client_command ".ammo" to_label @ammo
0B34: samp register_client_command ".removegun" to_label @removegun
0B34: samp register_client_command ".removeall" to_label @removeall
0B34: samp register_client_command ".gun" to_label @gun  

:idk
wait 0 
jump @idk

:removeall
   SAMP.IsCommandTyped(0@)
048F: actor $PLAYER_ACTOR remove_weapons 
SAMP.CmdRet

:removegun
   SAMP.IsCommandTyped(0@)
0470: 1@ = actor $PLAYER_ACTOR current_weapon 
0555: remove_weapon 1@ from_actor $PLAYER_ACTOR 
SAMP.CmdRet

:ammo
   SAMP.IsCommandTyped(0@)
if 
0AD4: 0@ = scan_string 0@ format "%d" 1@  
else_jump @error_1 
0470: 2@ = actor $PLAYER_ACTOR current_weapon 
Actor.SetCarWeapon($PLAYER_ACTOR, 2@, 1@)
SAMP.CmdRet

:repair
   SAMP.IsCommandTyped(0@)
if 
   Actor.Driving($PLAYER_ACTOR)
else_jump @error_2 
$car = Actor.CurrentCar($PLAYER_ACTOR)
0A30: repair_car $car 
053F: set_car $car tires_vulnerability 0 
Car.RemoveReferences($car)
SAMP.CmdRet

:gun
   SAMP.IsCommandTyped(0@)
if 
0AD4: 0@ = scan_string 0@ format "%d %d" 1@ 2@  
else_jump @error_3 
if and
   not 1@ == 19 
   not 1@ == 20 
   not 1@ == 21 
   not 1@ > 46 
  1@ >= 0 
else_jump @error_3 
0781: get_weapon_with_ID 1@ model_to 3@ 
Model.Load(3@)
038B: load_requested_models               
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, 1@, 2@)
SAMP.CmdRet

:error_1
chatmsg "{ff0000}* Error: Enter a number" 0 
SAMP.CmdRet

:error_2
chatmsg "{ff0000}* Error: You have to be driving!" 0 
SAMP.CmdRet

:error_3
chatmsg "{ff0000}* Error: Type /.gun [ 0 to 46 ] [ Amount ]" 0 
SAMP.CmdRet
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
If the russian website procedure is right to register client command without 0.3DL
then you need those offsets:
SAMP BASE,
SAMP_FUNC_ADDCLIENTCMD
and g_Input pointer/offset.

You can get all 3, they are in s0biet source too.
or 0.3DL btw
SAMP_CHAT_INPUT_INFO_OFFSET 0x2ACA14
SAMP_FUNC_ADDCLIENTCMD 0x691B0
base, you know how to do it or don't need it since the function already does it.

heres the updated func, this should work if I did it right.

Code:
:registerClientCommand // unsigned long dwSAMPHandle, char szCommandName[], CMDPROC CallBack
var
    3@: integer
    4@: integer
end

3@ = 0@ // dwSAMPHandle
3@ += 0x2ACA14 // struct
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 1
4@ = 0@ // dwSAMPHandle
4@ += 0x691B0 // function

0AA6: call_method 4@ struct 3@ num_params 2 pop 0 2@ 1@
0AB2: ret 0

Ye, I confirmed the offsets and replaced with the correct ones for 0.3DL
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
If the russian website procedure is right to register client command without 0.3DL
then you need those offsets:
SAMP BASE,
SAMP_FUNC_ADDCLIENTCMD
and g_Input pointer/offset.

You can get all 3, they are in s0biet source too.
or 0.3DL btw
SAMP_CHAT_INPUT_INFO_OFFSET 0x2ACA14
SAMP_FUNC_ADDCLIENTCMD 0x691B0
base, you know how to do it or don't need it since the function already does it.

heres the updated func, this should work if I did it right.

Code:
:registerClientCommand // unsigned long dwSAMPHandle, char szCommandName[], CMDPROC CallBack
var
    3@: integer
    4@: integer
end

3@ = 0@ // dwSAMPHandle
3@ += 0x2ACA14 // struct
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 1
4@ = 0@ // dwSAMPHandle
4@ += 0x691B0 // function

0AA6: call_method 4@ struct 3@ num_params 2 pop 0 2@ 1@
0AB2: ret 0

Ye, I confirmed the offsets and replaced with the correct ones for 0.3DL
But still need - Get last command params.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
If the russian website procedure is right to register client command without 0.3DL
then you need those offsets:
SAMP BASE,
SAMP_FUNC_ADDCLIENTCMD
and g_Input pointer/offset.

You can get all 3, they are in s0biet source too.
or 0.3DL btw
SAMP_CHAT_INPUT_INFO_OFFSET 0x2ACA14
SAMP_FUNC_ADDCLIENTCMD 0x691B0
base, you know how to do it or don't need it since the function already does it.

heres the updated func, this should work if I did it right.

Code:
:registerClientCommand // unsigned long dwSAMPHandle, char szCommandName[], CMDPROC CallBack
var
    3@: integer
    4@: integer
end

3@ = 0@ // dwSAMPHandle
3@ += 0x2ACA14 // struct
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 1
4@ = 0@ // dwSAMPHandle
4@ += 0x691B0 // function

0AA6: call_method 4@ struct 3@ num_params 2 pop 0 2@ 1@
0AB2: ret 0

Ye, I confirmed the offsets and replaced with the correct ones for 0.3DL

Tested and fully Working!

PHP:
{$cleo .cs}

0000:

const
SAMP_IS_READY = 1
end

repeat
wait 1000
0A8D: 0@ = read_memory 0xA444A0 size 4 virtual_protect 0
until 0@ == 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
        print "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@
 
Last edited:

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
0AC7: 3@ = var 31@ offset
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1

pretty sure those are for params

for example change

0AC7: 3@ = var 31@ offset
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1

the 31@ to 30@
and shit.

maybe you can do the strings. dunno
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania

MalikeiraOPoder

Active member
Joined
Mar 16, 2019
Messages
100
Reaction score
2
You still need it?
Yes, pls


If the russian website procedure is right to register client command without 0.3DL
then you need those offsets:
SAMP BASE,
SAMP_FUNC_ADDCLIENTCMD
and g_Input pointer/offset.

You can get all 3, they are in s0biet source too.
or 0.3DL btw
SAMP_CHAT_INPUT_INFO_OFFSET 0x2ACA14
SAMP_FUNC_ADDCLIENTCMD 0x691B0
base, you know how to do it or don't need it since the function already does it.

heres the updated func, this should work if I did it right.

Code:
:registerClientCommand // unsigned long dwSAMPHandle, char szCommandName[], CMDPROC CallBack
var
    3@: integer
    4@: integer
end

3@ = 0@ // dwSAMPHandle
3@ += 0x2ACA14 // struct
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 1
4@ = 0@ // dwSAMPHandle
4@ += 0x691B0 // function

0AA6: call_method 4@ struct 3@ num_params 2 pop 0 2@ 1@
0AB2: ret 0

Ye, I confirmed the offsets and replaced with the correct ones for 0.3DL


So hard for me, im beginner yet :( i didnt understand nothin
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
nEVER TESTED

PHP:
{$CLEO .cs}

0000:

wait 8500

if 8AA2: 0@ = load_library "samp.dll" // IF and SET
then 0A93: end_custom_thread
end

0AC6: 2@ = label @cmdname1 offset
0AB1: call_scm_func @registerClientParam1 0 _Return: CallBack 1@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 2@ CallBack: 1@

0AC6: 7@ = label @cmdname2 offset
0AB1: call_scm_func @registerClientParam2 0 _Return: CallBack 8@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 7@ CallBack: 8@

0AC6: 9@ = label @cmdname3 offset
0AB1: call_scm_func @registerClientParam3 0 _Return: CallBack 10@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 9@ CallBack: 10@

0AC6: 12@ = label @cmdname4 offset
0AB1: call_scm_func @registerClientParam4 0 _Return: CallBack 13@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 12@ CallBack: 13@

0AC6: 17@ = label @cmdname5 offset
0AB1: call_scm_func @registerClientParam5 0 _Return: CallBack 18@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 17@ CallBack: 18@

while true
    wait 0

if 31@ == 1 // gun
then 
    0AB1: @GetLastCommandParams 0 _returnCMDParams 3@   
    if 
    0AD4: $NOT_USED = scan_string 3@ format "%d %d" 4@ 5@  
    then
        if and
        not 4@ == 19 
        not 4@ == 20 
        not 4@ == 21 
        not 4@ > 46 
        4@ >= 0 
        then
            0781: get_weapon_with_ID 4@ model_to 6@ 
            Model.Load(6@)
            038B: load_requested_models               
            Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, 4@, 5@)
            31@ = 0
        end
    else
        0AD1: "* Error: Type /.gun [ 0 to 46 ] [ Amount ]" 1337 
        31@ = 0
    end
end

if 30@ == 1 // remove all
then
    048F: actor $PLAYER_ACTOR remove_weapons   
    30@ = 0   
end 

if 29@ == 1 // remove gun
then
    0470: 11@ = actor $PLAYER_ACTOR current_weapon 
    0555: remove_weapon 11@ from_actor $PLAYER_ACTOR   
    29@ = 0   
end

if 28@ == 1 // ammo
then
    0AB1: @GetLastCommandParams 0 _returnCMDParams 14@ 
    if 
    0AD4: $NOT_USED = scan_string 14@ format "%d" 15@  
    then
        0470: 16@ = actor $PLAYER_ACTOR current_weapon 
        Actor.SetCarWeapon($PLAYER_ACTOR, 16@, 15@)   
        28@ = 0
    else
        0AD1: "* Error: Enter a number" 1337 
        28@ = 0  
    end 
end

if 27@ == 1 // repair
then
    if 
    Actor.Driving($PLAYER_ACTOR)
    then
        19@ = Actor.CurrentCar($PLAYER_ACTOR)
        0A30: repair_car 19@
        053F: set_car 19@ tires_vulnerability 0 
        Car.RemoveReferences(19@)
        27@ = 0
    else
        0AD1: "* Error: You have to be driving!" 1337 
        27@ = 0   
    end 
end

end

:registerClientParam1
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@

:registerClientParam2
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 30@ offset                           
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
30@ = 0 // zeroing 31 var
0AB2: ret 1 1@

:registerClientParam3
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 29@ offset                           
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
29@ = 0 // zeroing 31 var
0AB2: ret 1 1@

:registerClientParam4
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 28@ offset                           
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
28@ = 0 // zeroing 31 var
0AB2: ret 1 1@

:registerClientParam5
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 27@ offset                           
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
27@ = 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

:cmdname1
hex
    ".gun" 0
end

:cmdname2
hex
    ".removeall" 0
end

:cmdname3
hex
    ".removegun" 0
end

:cmdname4
hex
    ".ammo" 0
end

:cmdname5
hex
    ".repair" 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
 

MalikeiraOPoder

Active member
Joined
Mar 16, 2019
Messages
100
Reaction score
2
nEVER TESTED

PHP:
{$CLEO .cs}

0000:

wait 8500

if 8AA2: 0@ = load_library "samp.dll" // IF and SET
then 0A93: end_custom_thread
end

0AC6: 2@ = label @cmdname1 offset
0AB1: call_scm_func @registerClientParam1 0 _Return: CallBack 1@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 2@ CallBack: 1@

0AC6: 7@ = label @cmdname2 offset
0AB1: call_scm_func @registerClientParam2 0 _Return: CallBack 8@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 7@ CallBack: 8@

0AC6: 9@ = label @cmdname3 offset
0AB1: call_scm_func @registerClientParam3 0 _Return: CallBack 10@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 9@ CallBack: 10@

0AC6: 12@ = label @cmdname4 offset
0AB1: call_scm_func @registerClientParam4 0 _Return: CallBack 13@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 12@ CallBack: 13@

0AC6: 17@ = label @cmdname5 offset
0AB1: call_scm_func @registerClientParam5 0 _Return: CallBack 18@
0AB1: call_scm_func @registerClientCommand 3 dwSAMPHandle: 0@ szCommandName: 17@ CallBack: 18@

while true
    wait 0

if 31@ == 1 // gun
then
    0AB1: @GetLastCommandParams 0 _returnCMDParams 3@  
    if
    0AD4: $NOT_USED = scan_string 3@ format "%d %d" 4@ 5@ 
    then
        if and
        not 4@ == 19
        not 4@ == 20
        not 4@ == 21
        not 4@ > 46
        4@ >= 0
        then
            0781: get_weapon_with_ID 4@ model_to 6@
            Model.Load(6@)
            038B: load_requested_models              
            Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, 4@, 5@)
            31@ = 0
        end
    else
        0AD1: "* Error: Type /.gun [ 0 to 46 ] [ Amount ]" 1337
        31@ = 0
    end
end

if 30@ == 1 // remove all
then
    048F: actor $PLAYER_ACTOR remove_weapons  
    30@ = 0  
end

if 29@ == 1 // remove gun
then
    0470: 11@ = actor $PLAYER_ACTOR current_weapon
    0555: remove_weapon 11@ from_actor $PLAYER_ACTOR  
    29@ = 0  
end

if 28@ == 1 // ammo
then
    0AB1: @GetLastCommandParams 0 _returnCMDParams 14@
    if
    0AD4: $NOT_USED = scan_string 14@ format "%d" 15@ 
    then
        0470: 16@ = actor $PLAYER_ACTOR current_weapon
        Actor.SetCarWeapon($PLAYER_ACTOR, 16@, 15@)  
        28@ = 0
    else
        0AD1: "* Error: Enter a number" 1337
        28@ = 0 
    end
end

if 27@ == 1 // repair
then
    if
    Actor.Driving($PLAYER_ACTOR)
    then
        19@ = Actor.CurrentCar($PLAYER_ACTOR)
        0A30: repair_car 19@
        053F: set_car 19@ tires_vulnerability 0
        Car.RemoveReferences(19@)
        27@ = 0
    else
        0AD1: "* Error: You have to be driving!" 1337
        27@ = 0  
    end
end

end

:registerClientParam1
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@

:registerClientParam2
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 30@ offset                          
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
30@ = 0 // zeroing 31 var
0AB2: ret 1 1@

:registerClientParam3
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 29@ offset                          
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
29@ = 0 // zeroing 31 var
0AB2: ret 1 1@

:registerClientParam4
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 28@ offset                          
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
28@ = 0 // zeroing 31 var
0AB2: ret 1 1@

:registerClientParam5
0AC6: 1@ = label @callback offset

// write 31@ address to assembly code
1@ += 2
0AC7: 3@ = var 27@ offset                          
0A8C: write_memory 1@ size 4 value 3@ virtual_protect 1
1@ -= 2
27@ = 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

:cmdname1
hex
    ".gun" 0
end

:cmdname2
hex
    ".removeall" 0
end

:cmdname3
hex
    ".removegun" 0
end

:cmdname4
hex
    ".ammo" 0
end

:cmdname5
hex
    ".repair" 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
is not working :(
 
Status
Not open for further replies.
Top