Advertisement
Guest User

Untitled

a guest
Jan 9th, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 26.09 KB | None | 0 0
  1. {$CLEO .cs}
  2.  
  3. const
  4.     Key_1 = 0xA4 // Left Alt
  5.     Key_2 = 0x31 // 1
  6.     Key_Aim = 0x02 // Right mouse button
  7.     Key_Misc_1 = 0x31 // 1 - Previous bone
  8.     Key_Misc_2 = 0x32 // 2 - Next bone
  9.     Key_Misc_3 = 0xA0 // Left Shift - Change Aim Mode
  10.     Key_Misc_4 = 0x51 // Q - Change to left nearest actor
  11.     Key_Misc_5 = 0x45 // E - Change to right nearest actor  
  12. end
  13.  
  14. 03A4: name_thread 'Aimbot'
  15. 0006: 30@ = 0 // 0 - Normal, 1 - Aim Wheels
  16. 0006: 31@ = 8 // Bone ID - 8: BONE_HEAD
  17. 0006: 32@ = 600
  18.    
  19. :Start
  20.     0001: wait 0 ms
  21.     00D6: if
  22.     0050: gosub @KeyCheck
  23.     004D: jump_if_false @Start
  24.     0ACD: show_text_highpriority "~r~[~w~~h~Aimbot~r~] ~w~~h~:: Activated" time 3000
  25.     0A9F: $popf = current_thread_pointer
  26.     0008: $popf += 0x10 // CScriptThread.m_iBaseAddress
  27.     0A8D: $popf = read_memory $popf size 4 virtual_protect 0
  28.     000C: $popf -= @popFloat
  29.  
  30. :Search
  31.     0001: wait 0 ms
  32.     if
  33.         0AB0:   key_pressed Key_Aim
  34.     then
  35.         0050: gosub @Find_Target
  36.         00D6: if
  37.         056D:   actor $ACTOR_TARGET defined
  38.         004D: jump_if_false @Search
  39.         0A96: 28@ = actor $ACTOR_TARGET struct
  40.         0085: 29@ = 31@ // (int)
  41.         goto @Main
  42.     end
  43.     00D6: if
  44.     0050: gosub @KeyCheck
  45.     004D: jump_if_false @Search
  46. 0002: jump @Stop
  47.  
  48. :Main
  49.     0001: wait 0 ms
  50.     00D6: if and
  51.     056D:   actor $ACTOR_TARGET defined
  52.     8118:   not actor $ACTOR_TARGET dead
  53.     0AB0:   key_pressed Key_Aim
  54.     004D: jump_if_false @Aim_Lock_Off
  55.     if
  56.         0449:   actor $ACTOR_TARGET in_a_car
  57.     then
  58.         if
  59.             0039:   30@ == 1
  60.         then
  61.             03C0: 0@ = actor $ACTOR_TARGET car
  62.             0A97: 1@ = car 0@ struct
  63.             000A: 1@ += 0x590 // [byte] The class of transport
  64.             0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
  65.             if or
  66.                 0039:   1@ == 0 // CAutomobile
  67.                 0039:   1@ == 9 // CBike
  68.             then
  69.                 if or
  70.                     8496:   not tire 0 on_car 0@ deflated
  71.                     8496:   not tire 1 on_car 0@ deflated
  72.                     8496:   not tire 2 on_car 0@ deflated
  73.                     8496:   not tire 3 on_car 0@ deflated
  74.                 then
  75.                     goto @Main_Wheel
  76.                 end  
  77.             end                
  78.         end
  79.        
  80.         if
  81.             8039:   not 31@ == 8
  82.         then
  83.             0006: 31@ = 8
  84.         end
  85.     else
  86.         if
  87.             803B:   not 31@ == 29@  // (int)
  88.         then
  89.             0085: 31@ = 29@ // (int)
  90.         end    
  91.     end
  92.    
  93.     0AA6: call_method 0x5E4280 struct 28@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 31@ vPosition 0@v // CPed__getBonePosition
  94.     0AB1: call_scm_func @AimAtPosition 3 coords_XYZ 0@ 1@ 2@
  95.     0050: gosub @KeyMiscCheck
  96. 0002: jump @Main
  97.  
  98. :Main_Wheel
  99.     0001: wait 0 ms
  100.     00D6: if and
  101.     056D:   actor $ACTOR_TARGET defined
  102.     8118:   not actor $ACTOR_TARGET dead
  103.     0AB0:   key_pressed Key_Aim
  104.     004D: jump_if_false @Aim_Lock_Off
  105.     00D6: if and
  106.     0039:   30@ == 1
  107.     0449:   actor $ACTOR_TARGET in_a_car
  108.     004D: jump_if_false @Main
  109.     03C0: 0@ = actor $ACTOR_TARGET car
  110.     00D6: if or  
  111.     8496:   not tire 0 on_car 0@ deflated
  112.     8496:   not tire 1 on_car 0@ deflated
  113.     8496:   not tire 2 on_car 0@ deflated
  114.     8496:   not tire 3 on_car 0@ deflated
  115.     004D: jump_if_false @Main
  116.     0050: gosub @GetNearestWheel
  117.     0407: store_coords_to 0@ 1@ 2@ from_car 0@ with_offset $X_OFFS $Y_OFFS $Z_OFFS
  118.     0AB1: call_scm_func @AimAtPosition 3 coords_XYZ 0@ 1@ 2@
  119.     0050: gosub @KeyMiscCheck
  120. 0002: jump @Main_Wheel
  121.  
  122. :Find_Target
  123.     0001: wait 0 ms
  124.     0AB1: call_scm_func @GetPlayerTargetedEntity 0 vehicle 0@ actor $ACTOR_TARGET
  125.     if
  126.         056E:   car 0@ defined
  127.     then
  128.         03C0: 1@ = actor $PLAYER_ACTOR car
  129.         if                                                        
  130.             803B:   not 1@ == 0@  // (int)
  131.         then
  132.             046C: $ACTOR_TARGET = car 0@ driver
  133.             if
  134.                 856D:   not actor $ACTOR_TARGET defined
  135.             then
  136.                 01E9: 2@ = car 0@ num_passengers
  137.                 if
  138.                     0019:   2@ > 0
  139.                 then
  140.                     01EA: 3@ = car 0@ max_passengers
  141.                     for 4@ = 0 to 3@
  142.                         if
  143.                             8431:   not car 0@ passenger_seat_free 4@
  144.                         then
  145.                             0432: $ACTOR_TARGET = get_actor_handle_from_car 0@ passenger_seat 4@
  146.                             Break
  147.                         end
  148.                     end
  149.                 end
  150.             end
  151.         end
  152.     end
  153. 0051: return
  154.  
  155. :Aim_Lock_Off
  156.     0001: wait 0 ms
  157.     018C: play_sound 1058 at 0.0 0.0 0.0
  158.     0004: $ACTOR_TARGET = 0
  159.     0085: 31@ = 29@ // (int)    
  160.     0001: wait 100 ms
  161. 0002: jump @Search
  162.  
  163. :Stop
  164.     0001: wait 0 ms
  165.     0ACD: show_text_highpriority "~r~[~w~~h~Aimbot~r~] ~w~~h~:: Deactivated" time 3000    
  166. 0002: jump @Start
  167.  
  168. const
  169.     fDist = 300.0
  170. end
  171.  
  172. :GetPlayerTargetedEntity
  173.     0A96: 0@ = actor $PLAYER_ACTOR struct
  174.     0A8D: 1@ = read_memory 0xB6F1A8 size 2 virtual_protect 0 // TheCamera.m_aCams.m_wCamMode
  175.     0AA6: call_method 0x5E4280 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 25 vPosition 2@v // CPed__getBonePosition
  176.     000B: 4@ += 0.3
  177.     if or
  178.         0039:   1@ == 53
  179.         0039:   1@ == 55
  180.     then
  181.         0AA6: call_method 0x514970 struct 0xB6F028 num_params 6 pop 0 _targetOut 5@v _cameraOut 8@v _z 4@ _y 3@ _x 2@ _range fDist // CCamera::Find3rdPersonCamTargetVector
  182.     else
  183.         068E: get_camera_target_point_to 5@ 6@ 7@
  184.         068D: get_camera_position_to 8@ 9@ 10@
  185.         0087: 11@ = 8@ // (float)
  186.         0087: 12@ = 9@ // (float)
  187.         0087: 13@ = 10@ // (float)
  188.        
  189.         0063: 11@ -= 5@  // (float)
  190.         0063: 12@ -= 6@  // (float)
  191.         0063: 13@ -= 7@  // (float)
  192.        
  193.         0087: 14@ = 11@ // (float)
  194.         0087: 15@ = 12@ // (float)
  195.         0087: 16@ = 13@ // (float)
  196.        
  197.         0013: 11@ *= fDist
  198.         0013: 12@ *= fDist
  199.         0013: 13@ *= fDist
  200.        
  201.         0087: 5@ = 8@ // (float)
  202.         0087: 6@ = 9@ // (float)
  203.         0087: 7@ = 10@ // (float)
  204.  
  205.         0063: 5@ -= 11@  // (float)
  206.         0063: 6@ -= 12@  // (float)
  207.         0063: 7@ -= 13@  // (float)
  208.        
  209.         0063: 8@ -= 14@ // (float)
  210.         0063: 9@ -= 15@ // (float)
  211.         0063: 10@ -= 16@ // (float)
  212.  
  213.     end
  214.     0006: 1@ = 0 // entity = NULL
  215.     0AA7: call_function 0x56BA00 num_params 12 pop 12 0 0 0 0 _objects 1 _peds 1 _vehicles 1 _buildings 1 _pEntity 1@v _colPoint 8@v _end 5@v _start 2@v _result: 13@ // CWorld::ProcessLineOfSight
  216.     0006: 14@ = 0
  217.     0006: 15@ = 0
  218.     if
  219.         1@ <> 0
  220.     then
  221.         0A8E: 2@ = 1@ + 0x36
  222.         0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0 // entity->m_nStatusType
  223.         0B10: 2@ = 2@ AND 7
  224.         if
  225.             2@ == 2 // ENTITY_TYPE_VEHICLE
  226.         then
  227.             0AEB: 14@ = car_struct 1@ handle
  228.         else if
  229.             2@ == 3 // ENTITY_TYPE_PED
  230.         then
  231.             if
  232.                 803B:   not 1@ == 0@  // (int)
  233.             then
  234.                 0AEA: 15@ = actor_struct 1@ handle
  235.             end
  236.         end
  237.         end
  238.     end
  239. 0AB2: ret 2 14@ 15@
  240.  
  241. const
  242.     M_PI = 3.1415926535897932384626433832795
  243. end
  244.  
  245. :AimAtPosition
  246.     // aim formula code taken & converted from m0d_sa
  247.     068D: get_camera_position_to 3@ 4@ 5@
  248.    
  249.     0509: 11@ = distance_between_XY 0@ 1@ and_XY 3@ 4@
  250.  
  251.     0063: 3@ -= 0@  // (float)
  252.     0063: 4@ -= 1@  // (float)
  253.     0063: 5@ -= 2@  // (float)
  254.  
  255.     0A8D: 6@ = read_memory 0xB6F1A8 size 2 virtual_protect 0 // TheCamera.m_aCams.m_wCamMode
  256.    
  257.     if or
  258.         0039:   6@ == 53
  259.         0039:   6@ == 55
  260.     then // 3rd person mode
  261.    
  262.         // multiplier
  263.         0A8D: 7@ = read_memory 0x8D5038 size 4 virtual_protect 0 // FOV
  264.         0007: 6@ = 0.5
  265.         006B: 7@ *= 6@  // (float)
  266.         02F6: 6@ = sine 7@ // (float)
  267.         02F7: 8@ = cosine 7@ // (float)
  268.         0073: 6@ /= 8@ // (float)
  269.  
  270.         // fx
  271.         0A8D: 9@ = read_memory 0xB6EC10 size 4 virtual_protect 0 // crosshairOffset.x                
  272.         0007: 8@ = 0.5
  273.         0063: 8@ -= 9@  // (float)
  274.         000B: 8@ += 0.5
  275.         0063: 8@ -= 9@  // (float)
  276.        
  277.         0A8D: 9@ = read_memory 0xC3EFA4 size 4 virtual_protect 0 // screenAspectRatio
  278.         0007: 7@ = 1.0
  279.         0073: 7@ /= 9@ // (float)
  280.        
  281.         006B: 8@ *= 7@  // (float)
  282.         006B: 8@ *= 6@  // (float)
  283.        
  284.         0AA5: call 0x4207C0 num_params 2 pop 2 _x 8@ _y 1.0 // atan2
  285.         0AA7: call_function $popf num_params 0 pop 0 fValue 8@
  286.        
  287.         0007: 7@ = M_PI
  288.         0063: 7@ -= 8@  // (float)
  289.        
  290.         // fz
  291.         0A8D: 10@ = read_memory 0xB6EC14 size 4 virtual_protect 0 // crosshairOffset.y
  292.         0087: 9@ = 10@ // (float)
  293.         0007: 8@ = 0.5
  294.         0063: 9@ -= 8@  // (float)
  295.         005B: 9@ += 10@  // (float)
  296.         0063: 9@ -= 8@  // (float)
  297.         006B: 9@ *= 6@  // (float)
  298.        
  299.         0AA5: call 0x4207C0 num_params 2 pop 2 _x 9@ _y 1.0 // atan2
  300.         0AA7: call_function $popf num_params 0 pop 0 fValue 9@
  301.        
  302.         0007: 8@ = M_PI
  303.         0063: 8@ -= 9@  // (float)
  304.     else
  305.         0007: 7@ = M_PI
  306.         0017: 7@ /= 2.0
  307.         0087: 8@ = 7@ // (float)
  308.     end
  309.    
  310.     // x angle 
  311.     0AA5: call 0x4207C0 num_params 2 pop 2 _x 5@ _y 11@ // atan2
  312.     0AA7: call_function $popf num_params 0 pop 0 fValue 9@
  313.  
  314.     // z angle
  315.     0013: 3@ *= -1.0
  316.     0AA5: call 0x4207C0 num_params 2 pop 2 _x 3@ _y 4@ // atan2
  317.     0AA7: call_function $popf num_params 0 pop 0 fValue 10@
  318.    
  319.     0007: 11@ = M_PI
  320.     0017: 11@ /= 2.0
  321.     0063: 10@ -= 11@  // (float)
  322.  
  323.     0063: 9@ -= 7@  // (float)    
  324.     0063: 10@ -= 8@  // (float)
  325.     0013: 10@ *= -1.0
  326.            
  327.     0A25: set_camera_on_players_X_angle 9@ Z_angle 10@
  328. 0AB2: ret 0
  329.  
  330. :GetNearestWheel
  331.     0A97: 1@ = car 0@ struct
  332.     000A: 1@ += 0x590 // [byte] The class of transport
  333.     0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
  334.     if
  335.         0039:   1@ == 0 // CAutomobile
  336.     then
  337.         0AB1: call_scm_func @GetCarWheelOffset 2 car 0@ componentId 5 store_to 10@ 11@ 12@ // tire 0 - wheel_lf_dumm
  338.         0AB1: call_scm_func @GetCarWheelOffset 2 car 0@ componentId 7 store_to 13@ 14@ 15@ // tire 1 - wheel_lb_dummy
  339.         0AB1: call_scm_func @GetCarWheelOffset 2 car 0@ componentId 2 store_to 16@ 17@ 18@ // tire 2 - wheel_rf_dummy
  340.         0AB1: call_scm_func @GetCarWheelOffset 2 car 0@ componentId 4 store_to 19@ 20@ 21@ // tire 3 - wheel_rb_dummy
  341.         0006: 2@ = 3
  342.     else
  343.         0AB1: call_scm_func @GetBikeWheelOffset 2 bike 0@ componentId 4 store_to 10@ 11@ 12@ // tire 0 - BIKE_WHEEL_FRONT
  344.         0AB1: call_scm_func @GetBikeWheelOffset 2 bike 0@ componentId 5 store_to 13@ 14@ 15@ // tire 1 - BIKE_WHEEL_REAR
  345.         0006: 2@ = 1    
  346.     end
  347.    
  348.     0005: $SEARCH_RADIUS = 1000000.0
  349.     00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 6@
  350.     for 3@ = 0 to 2@
  351.         if
  352.             8496:   not tire 3@ on_car 0@ deflated
  353.         then
  354.             0006: 7@ = 3
  355.             006A: 7@ *= 3@  // (int)
  356.             0006: 8@ = 1
  357.             0006: 9@ = 2
  358.             005A: 8@ += 7@  // (int)
  359.             005A: 9@ += 7@  // (int)
  360.             0407: store_coords_to 24@ 25@ 26@ from_car 0@ with_offset 10@(7@,12i) 10@(8@,12i) 10@(9@,12i)
  361.             050A: 1@ = distance_between_XYZ 24@ 25@ 26@ and_XYZ 4@ 5@ 6@
  362.             if
  363.                 0026:   $SEARCH_RADIUS > 1@  // (float)
  364.             then
  365.                 0088: $SEARCH_RADIUS = 1@ // (float)
  366.                 0088: $X_OFFS = 10@(7@,12i) // (float)
  367.                 0088: $Y_OFFS = 10@(8@,12i) // (float)
  368.                 0088: $Z_OFFS = 10@(9@,12i) // (float)
  369.             end
  370.         end
  371.     end
  372. 0051: return
  373.  
  374. :GetCarWheelOffset
  375.     {
  376.      Example:
  377.        0AB1: call_scm_func @GetCarWheelOffset 2 car 0@ componentId 1@ store_to 2@ 3@ 4@
  378.     }
  379.     0006: 2@ = 4
  380.     006A: 2@ *= 1@  // (int)
  381.     0A97: 1@ = car 0@ struct
  382.     000A: 1@ += 0x648  
  383.     005A: 1@ += 2@  // (int)
  384.     0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
  385.     000A: 1@ += 0x40
  386.     0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0 // x
  387.     000A: 1@ += 0x4
  388.     0A8D: 3@ = read_memory 1@ size 4 virtual_protect 0 // y
  389.     000A: 1@ += 0x4
  390.     0A8D: 4@ = read_memory 1@ size 4 virtual_protect 0 // z
  391. 0AB2: ret 3 2@ 3@ 4@
  392.  
  393. :GetBikeWheelOffset
  394.     {
  395.      Example:
  396.        0AB1: call_scm_func @GetBikeWheelPosition 2 bike 0@ componentId 1@ store_to 2@ 3@ 4@
  397.     }
  398.     0006: 2@ = 4
  399.     006A: 2@ *= 1@  // (int)  
  400.     0A97: 1@ = car 0@ struct
  401.     000A: 1@ += 0x5A0  
  402.     005A: 1@ += 2@  // (int)
  403.     0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
  404.    
  405.     0085: 2@ = 1@ // (int)
  406.     000A: 2@ += 0x40
  407.     0A8D: 5@ = read_memory 2@ size 4 virtual_protect 0
  408.     000A: 2@ += 0x4
  409.     0A8D: 6@ = read_memory 2@ size 4 virtual_protect 0
  410.     000A: 2@ += 0x4
  411.     0A8D: 7@ = read_memory 2@ size 4 virtual_protect 0
  412.            
  413.     000A: 1@ += 0x4
  414.     0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
  415.     000A: 1@ += 0x10
  416.    
  417.     0AA5: call_method 0x7EDD60 num_params 3 pop 3 1@ 5@v 2@v
  418. 0AB2: ret 3 2@ 3@ 4@
  419.  
  420. :KeyCheck
  421.     if and
  422.         0019:   32@ > 600
  423.         0AB0:   key_pressed Key_1
  424.         0AB0:   key_pressed Key_2        
  425.     then
  426.         0006: 32@ = 0
  427.         018C: play_sound 1057 at 0.0 0.0 0.0
  428.         0485:  return_true
  429.     else
  430.         059A:  return_false
  431.     end
  432. 0051: return
  433.  
  434. :KeyMiscCheck
  435.     if
  436.         0019:   32@ > 200
  437.     then
  438.         if
  439.             0AB0:   key_pressed Key_Misc_1 // previous bone
  440.         then                        
  441.             if
  442.                 0039:   29@ == 1
  443.             then
  444.                 0006: 29@ = 54
  445.             else if
  446.                 0039:   29@ == 21
  447.             then
  448.                 0006: 29@ = 8
  449.             else if
  450.                 0039:   29@ == 31
  451.             then
  452.                 0006: 29@ = 26
  453.             else if
  454.                 0039:   29@ == 41
  455.             then
  456.                 0006: 29@ = 36
  457.             else if
  458.                 0039:   29@ == 51
  459.             then
  460.                 0006: 29@ = 44
  461.             else
  462.                 000E: 29@ -= 1    
  463.             end
  464.             end
  465.             end
  466.             end
  467.             end
  468.                        
  469.             0050: gosub @UpdateBone
  470.             0006: 32@ = 0
  471.             if
  472.                 8449:   not actor $ACTOR_TARGET in_a_car
  473.             then
  474.                 0085: 31@ = 29@ // (int)
  475.             end
  476.         else if
  477.             0AB0:   key_pressed Key_Misc_2 // next bone
  478.         then
  479.        
  480.             if
  481.                 0039:   29@ == 8
  482.             then
  483.                 0006: 29@ = 21
  484.             else if
  485.                 0039:   29@ == 26
  486.             then
  487.                 0006: 29@ = 31
  488.             else if
  489.                 0039:   29@ == 36
  490.             then
  491.                 0006: 29@ = 41
  492.             else if
  493.                 0039:   29@ == 44
  494.             then
  495.                 0006: 29@ = 51
  496.             else if
  497.                 0039:   29@ == 54
  498.             then
  499.                 0006: 29@ = 1
  500.             else
  501.                 000A: 29@ += 1
  502.             end
  503.             end
  504.             end
  505.             end
  506.             end
  507.  
  508.             0050: gosub @UpdateBone
  509.             0006: 32@ = 0
  510.             if
  511.                 8449:   not actor $ACTOR_TARGET in_a_car
  512.             then
  513.                 0085: 31@ = 29@ // (int)
  514.             end
  515.         else if
  516.             0AB0:   key_pressed Key_Misc_3
  517.         then
  518.             0AC8: 22@ = allocate_memory_size 10
  519.             if
  520.                 0039:   30@ == 1
  521.             then
  522.                 0006: 30@ = 0
  523.                 0AD3: 22@ = format "Normal"
  524.             else
  525.                 0006: 30@ = 1
  526.                 0AD3: 22@ = format "Wheel"
  527.             end
  528.             0006: 32@ = 0
  529.             0AD1: show_formatted_text_highpriority "~r~[~w~~h~Aimbot~r~] ~w~~h~:: %s aim mode." time 4000 22@
  530.             0AC9: free_allocated_memory 22@
  531.         else if or
  532.             0AB0:   key_pressed Key_Misc_4
  533.             0AB0:   key_pressed Key_Misc_5
  534.         then
  535.             if
  536.                 0AB0:   key_pressed Key_Misc_4
  537.             then    
  538.                 0004: $SEARCH_MODE = 0
  539.             else
  540.                 0004: $SEARCH_MODE = 1
  541.             end
  542.             0005: $SEARCH_RADIUS = 320.0
  543.             0004: $ACTOR_TARGET_TMP = 0    
  544.             0AB1: call_scm_func @LoopThroughPool 2 pool_ptr 0xB74490 gosub_loop @ActorLoop
  545.             if
  546.                 056D:   actor $ACTOR_TARGET_TMP defined
  547.             then
  548.                 0084: $ACTOR_TARGET = $ACTOR_TARGET_TMP // (int)
  549.                 0A96: 28@ = actor $ACTOR_TARGET struct
  550.            
  551.                 0006: 32@ = 0
  552.                 018C: play_sound 1057 at 0.0 0.0 0.0
  553.             end                
  554.         end                      
  555.         end            
  556.         end
  557.         end
  558.     end
  559. 0051: return
  560.  
  561. :UpdateBone
  562.     0AC8: 22@ = allocate_memory_size 25  
  563.     if          
  564.         0039:   29@ == 1
  565.     then
  566.         0AD3: 22@ = format "BONE_PELVIS1"
  567.     else if
  568.         0039:   29@ == 2
  569.     then
  570.         0AD3: 22@ = format "BONE_PELVIS"
  571.     else if
  572.         0039:   29@ == 3
  573.     then
  574.         0AD3: 22@ = format "BONE_SPINE1"
  575.     else if
  576.         0039:   29@ == 4
  577.     then
  578.         0AD3: 22@ = format "BONE_UPPERTORSO"
  579.     else if
  580.         0039:   29@ == 5
  581.     then
  582.         0AD3: 22@ = format "BONE_NECK"
  583.     else if
  584.         0039:   29@ == 6
  585.     then
  586.         0AD3: 22@ = format "BONE_HEAD2"
  587.     else if
  588.         0039:   29@ == 7
  589.     then
  590.         0AD3: 22@ = format "BONE_HEAD1"
  591.     else if
  592.         0039:   29@ == 8
  593.     then
  594.         0AD3: 22@ = format "BONE_HEAD"
  595.     else if
  596.         0039:   29@ == 21
  597.     then
  598.         0AD3: 22@ = format "BONE_RIGHTUPPERTORSO"
  599.     else if
  600.         0039:   29@ == 22
  601.     then
  602.         0AD3: 22@ = format "BONE_RIGHTSHOULDER"
  603.     else if
  604.         0039:   29@ == 23
  605.     then
  606.         0AD3: 22@ = format "BONE_RIGHTELBOW"
  607.     else if
  608.         0039:   29@ == 24
  609.     then
  610.         0AD3: 22@ = format "BONE_RIGHTWRIST"
  611.     else if
  612.         0039:   29@ == 25
  613.     then
  614.         0AD3: 22@ = format "BONE_RIGHTHAND"
  615.     else if
  616.         0039:   29@ == 26
  617.     then
  618.         0AD3: 22@ = format "BONE_RIGHTTHUMB"
  619.     else if
  620.         0039:   29@ == 31
  621.     then
  622.         0AD3: 22@ = format "BONE_LEFTUPPERTORSO"
  623.     else if
  624.         0039:   29@ == 32
  625.     then
  626.         0AD3: 22@ = format "BONE_LEFTSHOULDER"
  627.     else if
  628.         0039:   29@ == 33
  629.     then
  630.         0AD3: 22@ = format "BONE_LEFTELBOW"
  631.     else if
  632.         0039:   29@ == 34
  633.     then
  634.         0AD3: 22@ = format "BONE_LEFTWRIST"
  635.     else if
  636.         0039:   29@ == 35
  637.     then
  638.         0AD3: 22@ = format "BONE_LEFTHAND"
  639.     else if
  640.         0039:   29@ == 36
  641.     then
  642.         0AD3: 22@ = format "BONE_LEFTTHUMB"
  643.     else if
  644.         0039:   29@ == 41
  645.     then
  646.         0AD3: 22@ = format "BONE_LEFTHIP"
  647.     else if
  648.         0039:   29@ == 42
  649.     then
  650.         0AD3: 22@ = format "BONE_LEFTKNEE"
  651.     else if
  652.         0039:   29@ == 43
  653.     then
  654.         0AD3: 22@ = format "BONE_LEFTANKLE"
  655.     else if
  656.         0039:   29@ == 44
  657.     then
  658.         0AD3: 22@ = format "BONE_LEFTFOOT"
  659.     else if
  660.         0039:   29@ == 51
  661.     then
  662.         0AD3: 22@ = format "BONE_RIGHTHIP"
  663.     else if
  664.         0039:   29@ == 52
  665.     then
  666.         0AD3: 22@ = format "BONE_RIGHTKNEE"
  667.     else if
  668.         0039:   29@ == 53
  669.     then
  670.         0AD3: 22@ = format "BONE_RIGHTANKLE"
  671.     else if
  672.         0039:   29@ == 54
  673.     then
  674.         0AD3: 22@ = format "BONE_RIGHTFOOT"
  675.     else if
  676.     end        
  677.     end        
  678.     end        
  679.     end        
  680.     end        
  681.     end        
  682.     end        
  683.     end        
  684.     end        
  685.     end        
  686.     end        
  687.     end        
  688.     end        
  689.     end        
  690.     end        
  691.     end        
  692.     end        
  693.     end        
  694.     end        
  695.     end        
  696.     end        
  697.     end        
  698.     end        
  699.     end        
  700.     end        
  701.     end        
  702.     end        
  703.     end
  704.     0AD1: show_formatted_text_highpriority "~r~[~w~~h~Aimbot~r~] ~w~~h~:: %d: %s" time 4000 29@ 22@
  705.     0AC9: free_allocated_memory 22@
  706. 0051: return
  707.  
  708. :LoopThroughPool
  709.     0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 // CPool
  710.     0@ += 0x4
  711.     0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0 // pByteMap
  712.     0@ += 0x4
  713.     0A8D: 3@ = read_memory 0@ size 4 virtual_protect 0 // nItems
  714.     3@ -= 1
  715.     for 4@ = 0 to 3@
  716.         0A8D: 0@ = read_memory 2@ size 1 virtual_protect 0
  717.         2@ += 0x1
  718.         if and
  719.             0@ > 0x0
  720.             0@ < 0x80
  721.         then
  722.             0085: 5@ = 4@
  723.             5@ *= 0x100
  724.             005A: 0@ += 5@
  725.             gosub 1@
  726.         end
  727.     end
  728. 0AB2: ret 0
  729.  
  730. :ActorLoop
  731.     if and
  732.         02CB:   actor 0@ bounding_sphere_visible
  733.         87D6:   not 0@ == $PLAYER_ACTOR // @ == $ (int)
  734.         8118:   not actor 0@ dead      
  735.     then
  736.         00A0: store_actor 0@ position_to 5@ 6@ 7@
  737.         068D: get_camera_position_to 8@ 9@ 10@
  738.         if
  739.             06BD:   no_obstacles_between 5@ 6@ 7@ and 8@ 9@ 10@ solid 1 car 0 actor 0 object 0 particle 0
  740.         then            
  741.             if
  742.                 87D6:   not 0@ == $ACTOR_TARGET // @ == $ (int)
  743.             then
  744.                 if
  745.                     0038:   $SEARCH_MODE == 0
  746.                 then
  747.                     0007: 11@ = 0.0
  748.                     0007: 12@ = 320.0
  749.                 else
  750.                     0007: 11@ = 320.0
  751.                     0007: 12@ = 640.0
  752.                 end                
  753.                 0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 5@ 6@ 7@ store_to 8@ 9@                    
  754.                 if and
  755.                     0035:   8@ >= 11@  // (float)
  756.                     0035:   12@ >= 8@  // (float)
  757.                 then
  758.                     0509: 10@ = distance_between_XY 320.0 9@ and_XY 8@ 9@
  759.                     if
  760.                         0036:   $SEARCH_RADIUS >= 10@ // (float)
  761.                     then    
  762.                         0088: $SEARCH_RADIUS = 10@ // (float)
  763.                         008A: $ACTOR_TARGET_TMP = 0@ // (int)
  764.                     end
  765.                 end
  766.             end
  767.         end    
  768.     end
  769. return
  770.  
  771. const
  772.     WIDTH       = 640.0
  773.     HEIGHT      = 448.0
  774.     HALF_WIDTH  = 320.0
  775.     HALF_HEIGHT = 224.0
  776. end
  777.  
  778. :getScreenXYFrom3DCoords
  779.     {
  780.      Parameters:
  781.        Passed:
  782.          0@ - position X
  783.          1@ - position Y
  784.          2@ - position Z
  785.        Result:
  786.          3@ - screen X
  787.          4@ - screen Y
  788.    
  789.      Example:
  790.        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 2488.562 -1666.865 12.8757 store_to 1@ 2@
  791.     }
  792.     0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to 12@
  793.     0AB1: call_scm_func @getLocalVarOffset 1 var 3 store_to 13@
  794.     0AB1: call_scm_func @getLocalVarOffset 1 var 6 store_to 14@
  795.     0AB1: call_scm_func @getLocalVarOffset 1 var 9 store_to 15@
  796.     0AA5: call 0x70CE30 num_params 6 pop 6 bNearClip 0 bFarClip 0 pMultY 15@ pMultX 14@ pScreen 13@ pCoords 12@
  797.     0AB1: call_scm_func @getFullScreenXY 2 coords_XY 3@ 4@ store_to 3@ 4@
  798. 0AB2: ret 2 3@ 4@
  799.  
  800. :get3DCoordsFromScreenXY
  801.     {
  802.      Parameters:
  803.        Passed:
  804.          0@ - screen X
  805.          1@ - screen Y
  806.          2@ - distance
  807.        Result:
  808.          14@ - position X
  809.          15@ - position Y
  810.          16@ - position Z
  811.    
  812.      Example:
  813.        0AB1: call_scm_func @get3DCoordsFromScreenXY 3 coords_XY 320.0 224.0 distance 1.0 store_to 1@ 2@ 3@
  814.     }
  815.     0A8D: 3@ = read_memory 0x8D5038 size 4 virtual_protect 0 // field of view
  816.     3@ *= 0.5
  817.     02F6: 4@ = sine 3@
  818.     02F7: 5@ = cosine 3@
  819.     0073: 4@ /= 5@
  820.     6@ = 1.0
  821.     0@ /= HALF_WIDTH // half screen X
  822.     0063: 6@ -= 0@
  823.     006B: 6@ *= 4@
  824.     7@ = 1.0
  825.     1@ /= HALF_HEIGHT // half screen Y
  826.     0063: 7@ -= 1@
  827.     006B: 7@ *= 4@
  828.     0A8D: 8@ = read_memory 0xC3EFA4 size 4 virtual_protect 0 // screen aspect ratio
  829.     0073: 7@ /= 8@
  830.     006B: 6@ *= 2@
  831.     006B: 7@ *= 2@
  832.     0087: 9@ = 6@
  833.     0087: 10@ = 2@
  834.     0087: 11@ = 7@
  835.     0A8D: 12@ = read_memory 0xB6F03C size 4 virtual_protect 0 // camera matrix
  836.     0AB1: call_scm_func @getLocalVarOffset 1 var 9 store_to 13@
  837.     0AA5: call 0x59C790 num_params 3 pop 3 pOffsets 13@ pMatrix 12@ pResult 13@ // CPlaceable__getMatrixAbsOffsets
  838.     12@ += 0x30
  839.     0A8D: 14@ = read_memory 12@ size 4 virtual_protect 0 // camera X position
  840.     12@ += 0x4
  841.     0A8D: 15@ = read_memory 12@ size 4 virtual_protect 0 // camera Y position
  842.     12@ += 0x4
  843.     0A8D: 16@ = read_memory 12@ size 4 virtual_protect 0 // camera Z position
  844.     005B: 14@ += 9@
  845.     005B: 15@ += 10@
  846.     005B: 16@ += 11@
  847. 0AB2: ret 3 14@ 15@ 16@
  848.  
  849. :getFullScreenXY
  850.     {
  851.      Parameters:
  852.        Passed:
  853.          0@ - full screen X
  854.          1@ - full screen Y
  855.        Result:
  856.          0@ - screen X
  857.          1@ - screen Y
  858.    
  859.      Example:
  860.        0AB1: call_scm_func @getFullScreenXY 2 coords_XY 320.0 224.0 store_to 1@ 2@
  861.     }
  862.     2@ = WIDTH // screen X
  863.     0A8D: 4@ = read_memory 0xC17044 size 4 virtual_protect 0 // full screen X
  864.     0093: 4@ = integer 4@ to_float
  865.     0073: 2@ /= 4@
  866.     006B: 0@ *= 2@
  867.     3@ = HEIGHT // screen Y
  868.     0A8D: 5@ = read_memory 0xC17048 size 4 virtual_protect 0 // full screen Y
  869.     0093: 5@ = integer 5@ to_float
  870.     0073: 3@ /= 5@
  871.     006B: 1@ *= 3@
  872. 0AB2: ret 2 0@ 1@
  873.  
  874. :getLocalVarOffset
  875.     {
  876.      Parameters:
  877.        Passed:
  878.          0@ - thread pointer (offset)
  879.        Result:
  880.          0@ - var pointer (offset)
  881.    
  882.      Example:
  883.        0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to 1@
  884.     }
  885.     0A9F: 1@ = current_thread_pointer
  886.     0@ *= 0x4
  887.     0A8E: 2@ = 1@ + 0xDC // mission flag
  888.     if
  889.         2@ == 1
  890.     then
  891.         0@ += 0xA48960
  892.     else
  893.         005A: 0@ += 1@
  894.         0@ += 0x3C
  895.     end
  896. 0AB2: ret 1 0@
  897.  
  898. :popFloat
  899. hex
  900.    83EC 04   // sub     esp, 4
  901.    D95C24 00 // fstp    [esp+4-4]
  902.    8B4424 00 // mov     eax, [esp+4-4]
  903.    83C4 04   // add     esp, 4
  904.    C3        // retn
  905. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement