Announcement

Collapse
No announcement yet.

[Tutorial][PS2] - Creating a basic Aim Bot

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Tutorial][PS2] - Creating a basic Aim Bot

    Please note: This game no longer supports online play. The servers went offline in 2012.

    Game used for this tutorial: SOCOM 2 (NTSC)

    Difficulty: 7/10

    What you will learn:
    This tutorial will teach you how to take an aim assist function to turn it in to an aim bot. An aim bot automatically aims at the enemies and fires your weapon.

    How to create the code:
    - The game needs to support an aim assist function(as in your crosshairs moves towards the enemy without player input). Finding this function can be difficult. In SOCOM 2 you can simply search for the start menu command of "Auto Aim" and you will find an area of code that loads a boolean for auto aim. Get references for the boolean and you will eventually find the aim assist function.
    - You need to find a way to alter the aim assist function so it aims directly at the enemy instead of simply assisting you. This can be done by finding the value that determines how close an enemy has to be to the crosshairs to activate the aim assist.
    - You need a way to determine if the aim assist has locked on. This will be used to auto fire your weapon. [For SOCOM 2 there is a boolean located in the player pointer which was found by @Cronotrigga on this site]
    - You need a way to fire your weapon without player input. (I made another tutorial that explains how to force the gun to fire called auto shoot)
    - [For SOCOM 2 only] This game has two gun positions. One is known as standby where the gun points towards the ground. The other is known as the gun ready position where the gun points towards the center of the crosshairs. For this game we need to make it so the gun is always in the ready position or else the bullets will shoot in to the ground when the aim bot activates.

    Notes:
    - For the game in this tutorial you will notice that the weapon fires rapidly. I suggest using an infinite ammo code and a perfect shot code.

    PS2 Assembly Code
    Code:
    // force aim assist to lock closest target
    address $205AB368
    nop
    
    // hook to main function
    address $201BFC24
    j $000B8000
    
    // main function
    address $200b8000
    
    // get seal ptr
    setreg t0, $00440c38 // we check the seal pointer to check if our character exists, or else the game freezes.
    lw t1, $0000(t0)
    beq t1, zero :__end
    nop
    
    // auto shoot address
    setreg t2, $005C1118
    
    // gun hot address
    setreg t3, $00596114
    
    // check auto aim bool to see if aim assist is activated
    lb t4, $05E2(t1)
    beq t4, zero :__skip
    nop
    
    // aim assist is activated at this point
    
    // force gun hot
    setreg t5, $24030001
    sw t5, $0000(t3)
    
    // force gun to fire
    sw zero, $0000(t2)
    
    beq zero, zero :__end
    nop
    
    __skip:
    // reset auto shoot
    setreg t4, $0C1702B8
    sw t4, $0000(t2)
    
    // reset gun hot
    setreg t5, $38420079
    sw t5, $0000(t3)
    
    __end:
    jr ra
    nop
    Last edited by Harry62; 11-13-2015, 06:40:36 AM.

  • #2
    Originally posted by Harry62 View Post
    Please note: This game no longer supports online play. The servers went offline in 2012.

    Game used for this tutorial: SOCOM 2 (NTSC)

    Difficulty: 7/10

    What you will learn:
    This tutorial will teach you how to take an aim assist function to turn it in to an aim bot. An aim bot automatically aims at the enemies and fires your weapon.

    How to create the code:
    - The game needs to support an aim assist function(as in your crosshairs moves towards the enemy without player input). Finding this function can be difficult. In SOCOM 2 you can simply search for the start menu command of "Auto Aim" and you will find an area of code that loads a boolean for auto aim. Get references for the boolean and you will eventually find the aim assist function.
    - You need to find a way to alter the aim assist function so it aims directly at the enemy instead of simply assisting you. This can be done by finding the value that determines how close an enemy has to be to the crosshairs to activate the aim assist.
    - You need a way to determine if the aim assist has locked on. This will be used to auto fire your weapon. [For SOCOM 2 there is a boolean located in the player pointer which was found by @Cronotrigga on this site]
    - You need a way to fire your weapon without player input. (I made another tutorial that explains how to force the gun to fire called auto shoot)
    - [For SOCOM 2 only] This game has two gun positions. One is known as standby where the gun points towards the ground. The other is known as the gun ready position where the gun points towards the center of the crosshairs. For this game we need to make it so the gun is always in the ready position or else the bullets will shoot in to the ground when the aim bot activates.

    Notes:
    - For the game in this tutorial you will notice that the weapon fires rapidly. I suggest using an infinite ammo code and a perfect shot code.

    PS2 Assembly Code
    Code:
    // force aim assist to lock closest target
    address $205AB368
    nop
    
    // hook to main function
    address $201BFC24
    j $000B8000
    
    // main function
    address $200b8000
    
    // get seal ptr
    setreg t0, $00440c38 // we check the seal pointer to check if our character exists, or else the game freezes.
    lw t1, $0000(t0)
    beq t1, zero :__end
    nop
    
    // auto shoot address
    setreg t2, $005C1118
    
    // gun hot address
    setreg t3, $00596114
    
    // check auto aim bool to see if aim assist is activated
    lb t4, $05E2(t1)
    beq t4, zero :__skip
    nop
    
    // aim assist is activated at this point
    
    // force gun hot
    setreg t5, $24030001
    sw t5, $0000(t3)
    
    // force gun to fire
    sw zero, $0000(t2)
    
    beq zero, zero :__end
    nop
    
    __skip:
    // reset auto shoot
    setreg t4, $0C1702B8
    sw t4, $0000(t2)
    
    // reset gun hot
    setreg t5, $38420079
    sw t5, $0000(t3)
    
    __end:
    jr ra
    nop
    This is a good tutorial Harry good job. I do think you should add how to go about finding the requirements of this code. example the player pointer, autoshoot, gun hot etc.

    To anyone who is wondering how to go about finding a player pointer, the easiest way I have found how to do this,is to take an already existing code such as player health and use it as a reference. We know that player health will always refer to the player object and almost every game has a player health code laying around the internet. This should cut down your coding time drastically. From here, just look around that area for a storing operation. More then likely the data being stored will be set on the player object that the player pointer will point to. If you are using the emulator just set a breakpoint and look at the register. If you are using a console to hack use a simple routine and hook from the player health code and dump all registers to a place in memory where you can then take a memory trainer and take a look at it. You may be wondering why waste my time trying to find a player pointer? The reason is that this reference will be the player object and everything in the object will be useful. In most games you can find a bunch of codes such as perfect health/extended health, coordinates, character swaping, auto spawn, flash etc. SOCOM 2 in particular has coordinates of auto aim, an auto aim boolean, a fire identifier(auto fire), x hair coords, stats, weapon data etc.
    Last edited by Cronotrigga; 11-28-2015, 11:56:42 AM.

    Comment


    • #3

      Great Tutorial , Thanks.
      Thank you Chrono for further explaining the specifics of the player pointer
      Last edited by NightFyre; 04-29-2021, 07:43:32 PM.

      Comment


      • #4
        Hey guys! I am from https://worldpostalcode.com/united-s...linois/chicago. Who is in my area and can make me such a thing? I will pay a decent price. I think I can order it from other locations, but I am afraid that the delivery costs will be killing. So I am ready to pay more to someone as close to me as possible. Waiting for your offers to my private email box.
        Last edited by pooewisa; 05-25-2021, 03:26:26 PM.

        Comment

        Working...
        X