Вопросы по CLEO-скриптингу

1234 Good Night

Новичок
3
0
скинуть блок кода, где ты это делаешь ?
скинуть блок кода, где ты это делаешь ?
CLEO:
{$CLEO}
{$NOSOURCE}
{$INCLUDE SF}
{$USE CLEO+} // без него 0B20 не сущействует
0000:
 
repeat
    wait 400
until 0AFA:  is_samp_available 

0BE3: raknet setup_incoming_rpc_hook @incoming

0BDE: pause_thread 0

:incoming
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if
    0@ == 171
then
    0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
    0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_SHORT    // playerid
    0BE7: raknet 3@ = bit_stream_read 1@ type BS_TYPE_SHORT    // style

    0B20: samp 4@ = actor_handle_by_samp_player_id 2@
end
0BE0: raknet hook_ret true
 
D

deleted-user-222200

Гость
Я никогда не писал сценарии в CLEO. Можете ли вы помочь мне с полным сценарием или файлом .cs с командой (/nos id)? Я был бы благодарен.
u can't set nitro to another player's car
Но визуально для себя сделать можно
Активация как в задании

NOS:
{$CLEO .cs}

0000: NOP

:Label2
0001: wait 500 ms
0AFA:  is_samp_available
004D: jump_if_false @Label2
0B34: samp register_client_command "nos" to_label @Label32
0BDE: pause_thread 0

:Label32
0001: wait 0 ms
00D6: if
0B35: samp 0@ = get_last_command_params
004D: jump_if_false @Label115
00D6: if
0AD4: 2@ = scan_string 0@ format "%d" 1@
004D: jump_if_false @Label199
0AFF: samp 3@ = car_handle_by_samp_vehicle_id 1@
00D6: if
056E:   car 3@ defined
004D: jump_if_false @Label199
09E9: car 3@ set_single_nitro
0002: jump @Label296

:Label115
0AF8: samp add_message_to_chat "[ERROR] {FF0000}Type argument after cmd (/nos id). For Example: /nos 257!" color -1
0002: jump @Label296

:Label199
0AF8: samp add_message_to_chat "[ERROR] {FF0000}Type id of existing vehicle in zone stream!" color -1
0002: jump @Label296

:Label296
0B43: samp cmd_ret
 

Вложения

  • NOS.cs
    277 байт · Просмотры: 2

balaninkxo

Участник
72
0
Can anyone edit this script so that it is possible to change the fov within the game even without having to go to the .ini and change it?
 

Вложения

  • SilentAim_v8.0[English Version] (1).cs
    48.7 KB · Просмотры: 2

Ninklosd

Новичок
12
0
why i can't click spawn when active cheat, version 0.3dl


CLEO:
[/B]
{$CLEO .cs}

0000:

Wait 0

{ RPC 67 - setplayerarmweapons }
0AB1: @READ_SAMP_MEMORY 2 offset 0x18950 size 2 _Retruned: Value 0@

{ RPC 124 - toggleplayerspecting }
0AB1: @READ_SAMP_MEMORY 2 offset 0x1BE80 size 2 _Retruned: Value 1@

{ RPC 53 - Death }
0AB1: @READ_SAMP_MEMORY 2 offset 0x5660 size 2 _Retruned: Value 2@

{ RPC 113 - setplayerattachedobject }
0AB1: @READ_SAMP_MEMORY 2 offset 0x18A00 size 2 _Retruned: Value 3@

{ RPC 52 - SPAWN }
0AB1: @READ_SAMP_MEMORY 2 offset 0x3B20 size 2 _Retruned: Value 4@

{ RPC 52 - request SPAWN }
0AB1: @READ_SAMP_MEMORY 2 offset 0x3F40 size 2 _Retruned: Value 5@

{ RPC 52 - request class }
0AB1: @READ_SAMP_MEMORY 2 offset 0x5720 size 2 _Retruned: Value 6@


while true
wait 0
    if 
        0AB0: 113
    then
        wait 100   
        0470: 2@ = actor $PLAYER_ACTOR current_weapon 
        0114: set_actor $PLAYER_ACTOR weapon 2@ add_ammo 100
    end
    
    If 
        0AB0: 90 // Z key pressed
    then
        { RPC 67 - setplayerarmweapons }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x18950 value 0xC390 size 2
        
        { RPC 124 - toggleplayerspecting }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x1BE80 value 0xC390 size 2*/
        
        { RPC 53 - Death }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x5660 value 0xC390 size 2
        
        { RPC 113 - setplayerattachedobject }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x18A00 value 0xC390 size 2

        { RPC 52 - requestSPAWN }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x3F40 value 0xC390 size 1
            
        
        { RPC 52 - SPAWN }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x3B20 value 0xC390 size 1  
        
      end 
    
    

end

         
                                                                                                        
:WRITE_SAMP_MEMORY
{
0AB1: @WRITE_SAMP_MEMORY 3 offset 0x6310 value 0xC390 size 2
}
IF 0AA2: 10@ = "samp.dll"
THEN  
    0A8E: 11@ = 10@ + 0@ // SAMP_DIALOG_INFO_OFFSET
    0A8C: write_memory 11@ size 2@ value 1@ virtual_protect 1
END
0AB2: 0

:READ_SAMP_MEMORY
{
0AB1: @READ_SAMP_MEMORY 2 offset 0x615FB size 2 _Retruned: Value 0@
}
IF 0AA2: 10@ = "samp.dll"
THEN   
    0A8E: 11@ = 10@ + 0@ // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = read_memory 11@ size 1@ virtual_protect 1
END
0AB2: 1 12@
[B]
 
Последнее редактирование:

Barako

Новичок
11
0
someone edit the range of streams to kill in this cleo or decrypt it

why my game keep crashing when i load this cleo
{$CLEO .cs}
{$USE bitwise}
{$USE CLEO+}

0000: NOP

:Label2
8AFA: not is_samp_available
004D: jump_if_false @Label22
0001: wait 0 ms
0002: jump @Label2

:Label22
0B34: samp register_client_command "dmgall" to_label @Label368
0B34: samp register_client_command "sdmg" to_label @Label380

:Label51
0001: wait 0 ms
00D6: if
0039: 31@ == 1
004D: jump_if_false @Label280
0006: 0@ = 0

:Label80
0B20: samp 11@ = actor_handle_by_samp_player_id 0@
0B37: samp 29@ = get_player_color 0@
00D6: if and
056D: actor 11@ defined
8118: not actor 11@ dead
8B5C: not samp is_player 0@ paused
004D: jump_if_false @Label258
00A0: store_actor $PLAYER_ACTOR position_to 20@ 21@ 22@
00A0: store_actor 11@ position_to 23@ 24@ 25@
050A: 26@ = distance_between_XYZ 20@ 21@ 22@ and_XYZ 23@ 24@ 25@
00D6: if
0033: 25.0 >= 26@
004D: jump_if_false @Label258
0AB1: call_scm_func @Label287 4 0@ 0.0 41 3
0B36: samp 12@ = get_player_nickname 0@
0AD1: show_formatted_text_highpriority "KUKOLD to %s[%d]" time 1300 12@ 0@
0001: wait 10 ms

:Label258
000A: 0@ += 1
0019: 0@ > 1000
004D: jump_if_false @Label80

:Label280
0002: jump @Label51

:Label287
0B3D: raknet 10@ = new_bit_stream
0B40: raknet bit_stream 10@ write 0 type 1 size 1
0B40: raknet bit_stream 10@ write 0@ type 2 size 2
0B40: raknet bit_stream 10@ write 1@ type 3 size 4
0B40: raknet bit_stream 10@ write 2@ type 3 size 4
0B40: raknet bit_stream 10@ write 3@ type 3 size 4
0B8A: raknet send_rpc 115 bit_stream 10@
0B3E: raknet delete_bit_stream 10@
0AB2: 0 ret

:Label368
0B12: 31@ = 31@ XOR 1
0B43: samp cmd_ret

:Label380
0AF8: samp add_message_to_chat "kukold ïåðåçàãðóæåí." color -1
0A92: create_custom_thread "kukold.cs"
0A93: end_custom_thread
0B43: samp cmd_ret
 

Вложения

  • kukold (3).cs
    425 байт · Просмотры: 3
Последнее редактирование:
D

deleted-user-222200

Гость
1. someone edit the range of streams to kill in this cleo or decrypt it
2. why my game keep crashing when i load this cleo
CLEO IS NOT ENCRYPTED (????)
1. To increase the range of fire you need to edit this float value
1708245966597.png

2. Try to install "SannyBuilder Data" from SAMPFUNCS theme to the %SannyBuilder directory%/data/sa and recompile script
 

Ninklosd

Новичок
12
0
why i can't click spawn when active cheat, version 0.3dl


CLEO:
[/B]
{$CLEO .cs}

0000:

Wait 0

{ RPC 67 - setplayerarmweapons }
0AB1: @READ_SAMP_MEMORY 2 offset 0x18950 size 2 _Retruned: Value 0@

{ RPC 124 - toggleplayerspecting }
0AB1: @READ_SAMP_MEMORY 2 offset 0x1BE80 size 2 _Retruned: Value 1@

{ RPC 53 - Death }
0AB1: @READ_SAMP_MEMORY 2 offset 0x5660 size 2 _Retruned: Value 2@

{ RPC 113 - setplayerattachedobject }
0AB1: @READ_SAMP_MEMORY 2 offset 0x18A00 size 2 _Retruned: Value 3@

{ RPC 52 - SPAWN }
0AB1: @READ_SAMP_MEMORY 2 offset 0x3B20 size 2 _Retruned: Value 4@

{ RPC 52 - request SPAWN }
0AB1: @READ_SAMP_MEMORY 2 offset 0x3F40 size 2 _Retruned: Value 5@

{ RPC 52 - request class }
0AB1: @READ_SAMP_MEMORY 2 offset 0x5720 size 2 _Retruned: Value 6@


while true
wait 0
    if 
        0AB0: 113
    then
        wait 100   
        0470: 2@ = actor $PLAYER_ACTOR current_weapon 
        0114: set_actor $PLAYER_ACTOR weapon 2@ add_ammo 100
    end
    
    If 
        0AB0: 90 // Z key pressed
    then
        { RPC 67 - setplayerarmweapons }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x18950 value 0xC390 size 2
        
        { RPC 124 - toggleplayerspecting }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x1BE80 value 0xC390 size 2*/
        
        { RPC 53 - Death }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x5660 value 0xC390 size 2
        
        { RPC 113 - setplayerattachedobject }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x18A00 value 0xC390 size 2

        { RPC 52 - requestSPAWN }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x3F40 value 0xC390 size 1
            
        
        { RPC 52 - SPAWN }
        0AB1: @WRITE_SAMP_MEMORY 3 offset 0x3B20 value 0xC390 size 1  
        
      end 
    
    

end

         
                                                                                                        
:WRITE_SAMP_MEMORY
{
0AB1: @WRITE_SAMP_MEMORY 3 offset 0x6310 value 0xC390 size 2
}
IF 0AA2: 10@ = "samp.dll"
THEN  
    0A8E: 11@ = 10@ + 0@ // SAMP_DIALOG_INFO_OFFSET
    0A8C: write_memory 11@ size 2@ value 1@ virtual_protect 1
END
0AB2: 0

:READ_SAMP_MEMORY
{
0AB1: @READ_SAMP_MEMORY 2 offset 0x615FB size 2 _Retruned: Value 0@
}
IF 0AA2: 10@ = "samp.dll"
THEN   
    0A8E: 11@ = 10@ + 0@ // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = read_memory 11@ size 1@ virtual_protect 1
END
0AB2: 1 12@
[B]
Someone please help me, i very need it, it so important with me.
 

whyega52

Гений, миллионер, плейбой, долбаеб
Модератор
2,798
2,659
Есть вот такой скрипт:
CLEO:
{$CLEO .cs}

get_label_pointer 0@ = label @Noname_1187
write_memory 6995123 size 1 value 184 virtual_protect 1
write_memory 6995124 size 4 value 0@ virtual_protect 1
write_memory 6995128 size 2 value 57599 virtual_protect 1
0@ += 1
get_var_pointer 1@ = var 0@
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 2@
get_label_pointer 0@ = label @Noname_1198
0@ += 1
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1370
0@ += 1
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1221
get_var_pointer 1@ = var 6@
0@ += 1
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 5@
0@ += 6
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 4@
0@ += 6
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1244
get_var_pointer 1@ = var 8@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 7@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1276
get_var_pointer 1@ = var 8@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 7@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1299
get_var_pointer 1@ = var 9@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 7@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1322
get_var_pointer 1@ = var 9@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_var_pointer 1@ = var 7@
0@ += 7
write_memory 0@ size 4 value 1@ virtual_protect 0
get_label_pointer 0@ = label @Noname_1267
0@ += 1
get_var_pointer 1@ = var 0@
write_memory 0@ size 4 value 1@ virtual_protect 0
3@ = -1

:Noname_538
wait 0
if
  not Player.Defined($PLAYER_CHAR)
goto_if_false @Noname_565
goto @Noname_1111

:Noname_565
if and
  Actor.Driving($PLAYER_ACTOR)
  not is_char_on_any_bike $PLAYER_ACTOR
  not is_char_in_any_boat $PLAYER_ACTOR
  not is_char_in_flying_vehicle $PLAYER_ACTOR
  not is_char_in_any_train $PLAYER_ACTOR
goto_if_false @Noname_1053
10@ = Actor.CurrentCar($PLAYER_ACTOR)
if
  not is_int_lvar_equal_to_int_lvar 10@ == 3@
goto_if_false @Noname_650
set_lvar_int_to_lvar_int 3@ = 10@
0@ = 0
goto @Noname_1053

:Noname_650
if
  test_cheat "NEONRED"
goto_if_false @Noname_701
4@ = 128
5@ = 0
6@ = 0
gosub @Noname_1118

:Noname_701
if
  test_cheat "NEONBLUE"
goto_if_false @Noname_753
4@ = 0
5@ = 0
6@ = 128
gosub @Noname_1118

:Noname_753
if
  test_cheat "NEONGREEN"
goto_if_false @Noname_806
4@ = 0
5@ = 128
6@ = 0
gosub @Noname_1118

:Noname_806
if
  test_cheat "NEONWHITE"
goto_if_false @Noname_861
4@ = 128
5@ = 128
6@ = 128
gosub @Noname_1118

:Noname_861
if
  test_cheat "NEONYELLOW"
goto_if_false @Noname_916
4@ = 128
5@ = 128
6@ = 0
gosub @Noname_1118

:Noname_916
if
  test_cheat "NEONCYAN"
goto_if_false @Noname_969
4@ = 0
5@ = 128
6@ = 128
gosub @Noname_1118

:Noname_969
if
  test_cheat "NEONPURPLE"
goto_if_false @Noname_1024
4@ = 128
5@ = 0
6@ = 128
gosub @Noname_1118

:Noname_1024
if
  test_cheat "NEONOFF"
goto_if_false @Noname_1053
0@ = 0

:Noname_1053
if
  does_vehicle_exist 3@
goto_if_false @Noname_1104
if or
  Car.Wrecked(3@)
  is_car_upsidedown 3@
goto_if_false @Noname_1097
0@ = 0

:Noname_1097
goto @Noname_1111

:Noname_1104
0@ = 0

:Noname_1111
goto @Noname_538

:Noname_1118
set_lvar_int_to_lvar_int 3@ = 10@
31@ = Car.Model(3@)
get_model_dimensions 31@ dimensions_cornerA_to 31@ 30@ 29@ dimensions_cornerB_to 8@ 9@ 28@
8@ += 0.3
9@ += 0.3
get_vehicle_pointer 0@ = vehicle 3@
return

:Noname_1187
hex
 A1 00 00 00 00 3B F0 75 47 89 F0
end

:Noname_1198
hex
 A3 00 00 00 00 0F 94 C0 50 6A 00 68 00 00 80 3F
 6A 00 68 00 00 00 40
end

:Noname_1221
hex
 A1 00 00 00 00 50 A1 00 00 00 00 50 A1 00 00 00
 00 50 68 FF 00 00 00
end

:Noname_1244
hex
 8B 46 14 D9 40 04 B8 00 00 00 00 D8 08 B8 00 00
 00 00 D9 18 8B 00 50
end

:Noname_1267
hex
 A1 00 00 00 00 3B F0 75 65
end

:Noname_1276
hex
 8B 46 14 D9 40 00 B8 00 00 00 00 D8 08 B8 00 00
 00 00 D9 18 8B 00 50
end

:Noname_1299
hex
 8B 46 14 D9 40 14 B8 00 00 00 00 D8 08 B8 00 00
 00 00 D9 18 8B 00 50
end

:Noname_1322
hex
 8B 46 14 D9 40 10 B8 00 00 00 00 D8 08 B8 00 00
 00 00 D9 18 8B 00 50 8B 46 14 83 C0 30 50 A1 F4
 03 C4 00 50 6A 02 B8 90 73 70 00 FF D0 83 C4 40
end

:Noname_1370
hex
 A1 00 00 00 00 89 C6 8B 46 14 89 F1 50 B8 60 1A
 6E 00 FF D0 B8 BE BC 6A 00 FF E0
end
Большую часть кода интуитивно разобрал, а вот то, что за вакханалия в 3-59 строчке до конца не могу осознать. Кому не трудно, раскидайте молодому за клео, либо кинуть какой-то псевдокод на любом из более понятных языков (C++, Lua)

1710624984743.png
 

san0

Известный
Друг
411
268
Кому не трудно, раскидайте молодому за клео, либо кинуть какой-то псевдокод на любом из более понятных языков (C++, Lua)
Это не столько клео, сколько ассемблерная вставка.
Причем сам листинг скорее всего автогенерируемый, потому что странная логика в нескольких моментах, да и в целом можно
было уже все написать на ассемблере чтоб не перекидывать значения между CLEO и хуком.

Было:

Код:
8B 46 14          mov     eax, [esi+14h]
8B CE             mov     ecx, esi
50                push    eax
E8 A2 5D 03 00    call    CVehicle::DoVehicleLights(CMatrix &,uint)

Стало:

ASP.net:
B8 [patch_point]   mov    eax, [patch_point]
FF E0              jmp    eax

C:
//
// указатель на текущее авто для которого рисовать неон
// или нулевой если неон не нужен
// в CLEO это была 0@
//
static void* active_vehicle;

//
// временная переменная со стека потока CLEO, которая зачем-то вместо стека используется
// хранит в себе указатель на авто, который игра обрабатывает и используется для вычисления флага draw on buildings
// в CLEO это была 2@
//
static void* tmp; // 2@

//
// цвета (0 - 128)
// в CLEO это была 6@
static unsigned int color_blue; // 6@
// в CLEO это была 5@
static unsigned int color_green; // 5@
// в CLEO это была 4@
static unsigned int color_red; // 4@

//
// переменная, которая используется для хранения размера модели
// в CLEO это была 8@
static float dimension_corner_b_x;

//
// временная переменная со стека потока CLEO, которая зачем-то вместо стека используется
// в CLEO это была 7@
static float tmp_dimension;

//
// переменная, которая используется для хранения размера модели
// в CLEO это была 9@
static float dimension_corner_b_y;


extern __declspec(naked) void patch_point(/* CVehicle* vehicle<esi> */) {
    __asm {
        /* 00: A1 00 00 00 00 */   mov eax, dword ptr active_vehicle
        /* 05: 3B F0 */            cmp esi, eax
        /* 07: 75 47 */            jnz short store_shadow
        /* 09: 89 F0 */            mov eax, esi
        /* 0B: A3 00 00 00 00 */   mov dword ptr tmp, eax
        /* 10: 0F 94 C0 */         setz al
        /* 13: 50 */               push eax
        /* 14: 6A 00 */            push 0
        /* 16: 68 00 00 80 3F */   push 3F800000h
        /* 1B: 6A 00 */            push 0
        /* 1D: 68 00 00 00 40 */   push 40000000h
        /* 22: A1 00 00 00 00 */   mov eax, dword ptr color_blue
        /* 27: 50 */               push eax
        /* 28: A1 00 00 00 00 */   mov eax, dword ptr color_green
        /* 2D: 50 */               push eax
        /* 2E: A1 00 00 00 00 */   mov eax, dword ptr color_red
        /* 33: 50 */               push eax
        /* 34: 68 FF 00 00 00 */   push 0FFh
        /* 39: 8B 46 14 */         mov eax, [esi+14h]
        /* 3C: D9 40 04 */         fld dword ptr [eax+4]
        /* 3F: B8 00 00 00 00 */   mov eax, dword ptr dimension_corner_b_x
        /* 44: D8 08 */            fmul dword ptr [eax]
        /* 46: B8 00 00 00 00 */   mov eax, dword ptr tmp_dimension
        /* 4B: D9 18 */            fstp dword ptr [eax]
        /* 4D: 8B 00 */            mov eax, [eax]
        /* 4F: 50 */               push eax
        /* 50:  */    store_shadow:
        /* 50: A1 00 00 00 00 */   mov eax, dword ptr active_vehicle
        /* 55: 3B F0 */            cmp esi, eax
        /* 57: 75 65 */            jnz short call_default
        /* 59: 8B 46 14 */         mov eax, [esi+14h]
        /* 5C: D9 40 00 */         fld dword ptr [eax+0]
        /* 5F: B8 00 00 00 00 */   mov eax, dimension_corner_b_x
        /* 64: D8 08 */            fmul dword ptr [eax]
        /* 66: B8 00 00 00 00 */   mov eax, tmp_dimension
        /* 6B: D9 18 */            fstp dword ptr [eax]
        /* 6D: 8B 00 */            mov eax, [eax]
        /* 6F: 50 */               push eax
        /* 70: 8B 46 14 */         mov eax, [esi+14h]
        /* 73: D9 40 14 */         fld dword ptr [eax+14h]
        /* 76: B8 00 00 00 00 */   mov eax, dimension_corner_b_y
        /* 7B: D8 08 */            fmul dword ptr [eax]
        /* 7D: B8 00 00 00 00 */   mov eax, tmp_dimension
        /* 82: D9 18 */            fstp dword ptr [eax]
        /* 84: 8B 00 */            mov eax, [eax]
        /* 86: 50 */               push eax
        /* 87: 8B 46 14 */         mov eax, [esi+14h]
        /* 8A: D9 40 10 */         fld dword ptr [eax+10h]
        /* 8D: B8 00 00 00 00 */   mov eax, dimension_corner_b_y
        /* 92: D8 08 */            fmul dword ptr [eax]
        /* 94: B8 00 00 00 00 */   mov eax, tmp_dimension
        /* 99: D9 18 */            fstp dword ptr [eax]
        /* 9B: 8B 00 */            mov eax, [eax]
        /* 9D: 50 */               push eax
        /* 9E: 8B 46 14 */         mov eax, [esi+14h]
        /* A1: 83 C0 30 */         add eax, 30h
        /* A4: 50 */               push eax
        /* A5: A1 F4 03 C4 00 */   mov eax, ds:0C403F4h
        /* AA: 50 */               push eax
        /* AB: 6A 02 */            push 2
        /* AD: B8 90 73 70 00 */   mov eax, 707390h
        /* B2: FF D0 */            call eax
        /* B4: 83 C4 40 */         add esp, 40h
        /* B7: A1 00 00 00 00 */   mov eax, dword ptr tmp
        /* BC: 89 C6 */            mov esi, eax
        /* BE: */     call_default:
        /* BE: 8B 46 14 */         mov eax, [esi+14h]
        /* C1: 89 F1 */            mov ecx, esi
        /* C3: 50 */               push eax
        /* C4: B8 60 1A 6E 00 */   mov eax, 6E1A60h
        /* C9: FF D0 */            call eax
        /* CB: B8 BE BC 6A 00 */   mov eax, 6ABCBEh
        /* D0: FF E0 */            jmp eax
    }
}

C++:
static void alternate_patch_point(/* CVehicle* vehicle<esi> */) {
    if (vehicle == active_vehicle) {
        // m_pMatrix:     CAutomobile -> CVehicle -> CPhysical -> CEntity -> CPlaceable -> CMatrixLink   
        CShadows::StoreShadowToBeRendered(
            2,                                                       // type
            (void*)0xC403F4,                                         // texture (gpShadowExplosionTex)
            &vehicle->m_pMatrix->pos,                                // pos
            vehicle->m_pMatrix->up.x    * dimension_corner_b_y,      // x1
            vehicle->m_pMatrix->up.y    * dimension_corner_b_y,      // y1
            vehicle->m_pMatrix->right.x * dimension_corner_b_x,      // x2
            vehicle->m_pMatrix->right.y * dimension_corner_b_x,      // y2
            255,                                                     // intensity
            color_red,                                               // r
            color_green,                                             // g
            color_blue,                                              // b
            2.0f,                                                    // distance
            0,                                                       // draw on water
            1.0f,                                                    // scale
            0x0,                                                     // shadow data
            1                                                        // draw on buildings
        );
    }
    
    CVehicle::DoVehicleLights(vehicle, vehicle->m_pMatrix);
    
    // прыжок на 0x6ABCBE
}

P.S. мог где-то проебаться, названия из plugin sdk, и безусловно это прототип и нужно нормальный код с константами, векторами, и отсутствием магических чисел
 

Lobber

Известный
178
57
Приветствую всех. Имеется код, который в теории должен выдавать из структуры чата текст, но на выходе я получаю просто оффсет, который без понятия как читать...
Код:
{$CLEO .cs}

0000: NOP

WAIT 3000

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
    THEN   
        0AC8: 1@ = allocate_memory_size 1024
        0AC8: 2@ = allocate_memory_size 1024
        0AB1: @getChatString 2 SampVersionID 4 ChatID 99 _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@       
        0AC8: 5@ = allocate_memory_size 1024
        0AB1: @DeleteColorCodeFromText 2 text 1@ memory_to_store_characters_as_text 5@               
    END   
END


:getChatString
{
    0AC8: 1@ = allocate_memory_size 1024
    0AC8: 2@ = allocate_memory_size 1024
    0AB1: @getChatString 2 SampVersionID 0@ ChatID 99 _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 4 // 0.3.7 R3
        THEN
            31@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END

        IF 0@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            31@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x132
            1@ *= 0xFC
            005A: 31@ += 1@
            0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
            0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
            0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
            0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
            0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
            0A8D: 25@ readMem 26@ sz 1 vp 0
            IF NOT 25@ > 0
            THEN 24@ = 0
            ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
            END
        END
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

Ранее, когда я читал текст из ракнета, использовал опкод 0BE8

Код:
0BE7: raknet 20@ = bit_stream_read 15@ type BS_TYPE_INT //Размер строки
alloc 21@ 2048

if and
8029: not 20@ >= 2048
0029: 20@ >= 1
then

0C11: memset destination 21@ value 0 size 2048
0BE8: raknet bit_stream 15@ read_array 21@ size 20@ //Строка

Для чтения текста из структуры не нашел метода, есть у кого-то мысли?