PDA

View Full Version : [TUT] aimbot in vb6 ( i do not take credit)



CptM0rg@n
05-09-2008, 10:41 PM
****///***/// I DO NOT TAKE CREDIT FOR THIS GOT IT FROM A WEBSITE\\\\****

Memory AimBot Tutorial

by : zeroc0de/ByTeKiLLER

Introduction to the tutorial

Introduction 1.1
Getting started 1.2
What's Required 1.3

The AimMath Function

The use of the function 2.1
Learning the function 2.2
Using the function 2.3

For Loop and Snap Square

How to make a for loop 3.1
Using snap square 3.2

Finalizing your aimbot

Finalizing your project 4.1

Credits / Misc. Informations

Credits 5.1
Misc. Informations 5.2

Have fun learning !

-zC.
---------------------------------------------------------------------------------------------------------------------------------------------

Introduction to the tutorial

Introduction 1.1

Hello. Welcome to my Memory AimBot Tutorial. First of all, excuse me for my poor english. I will
do my possible to make it readable, as far as I can do it. You will learn important things today.
If you are willing to learn and understand, then you should learn alot from this tutorial. If you are
here to copy and paste, then it's your problem. I mixed all my knowledge into one tutorial about
aimbots so I think it's a very good gift for christmas. I sincerely hope you will enjoy this and make
yourself smarter than you were before double-clicking this file.

Well... Have fun learning. I hope you understand this is my lastest public release for the Delta-H.
Enjoy, sir.

-zC / ByTeKiLLER.

Getting started 1.2

Okay, so here we go. First of all, this tutorial was written for Visual Basic 6.0, but if you have some
knowledge in another language, then you can use this if well converted. The point of this tutorial
is having a good aimbot done in Visual Basic, as it never been done for the public. (In VB, for sure.)

So I advise you, before starting learning, to have some knowledge in Visual Basic. You have to
be sure that I will NOT help you fixing your aimbot if you get any problems. You have to do it by
yourself, that's the point of a tutorial. So now that you know what you're up to, we can start the big deal.

What's Required 1.3

First of all, you need Visual Basic 6.0. If you can't be arsed to download or pay for it, then you can use
Visual Basic 6.0 Portable Edition, which is around 5MB. Use google to find it. It does the same crap
as the full ISO, except allowing some components to be used in your project.

Again, this is required for you to have a good knowledge of game-hacking and Visual Basic.
You will also need the game we are coding this aimbot for, which is Delta Force : Black Hawk Down.
The supported version is 1.5.0.5, so make sure you have this version before attempting anything.

If you fit all the requirements, then we can start right now.

The AimMath Function

The use of the function 2.1

The principal use of the AimMath function is converting the world coordinates (X, Y, Z) to your view
facing angles. The AimMath function I will be explaining is based on Shatter's AimBot Tutorial.
Why it is called "AimMath" ? Because it uses alot of mathematical formulas and sincerely very hard
to understand. I will not explain them all, but I will focus on some important ones.

I advise you to be skilled in maths (having grade 2 or 3 of math) before attempting to understand this.

Learning the function 2.2

The AimMath function has to be included has a public sub in your project. You will start by creating
a sub called "AimMath", like this :

Public Sub AimMath(PlayerPointer As Long, TargetPointer As Long,)

End Sub

Our AimMath function will be included between the sub and the End Sub.
Let's start by declaring our variables. Very important.

Dim XDiff As Double, YDiff As Double, ZDiff As Double, XDouble As Double
Dim Angle As Double, Ratio As Double, Dist As Double

Dim XFacing As Long
Dim YFacing As Long
Dim PX As Long, PY As Long, PZ As Long
Dim EX As Long, EY As Long, EZ As Long

Okay. So now let's start to the first part of the AimMath Function, collecting the informations.

On Error Resume Next (In case one of all the values used overflows)

'Collecting Informations

EX = ReadMemory(TargetPointer + 8, 4)
EY = ReadMemory(TargetPointer + 12, 4)
EZ = ReadMemory(TargetPointer + 16, 4)

PX = ReadMemory(PlayerPointer + 8, 4)
PY = ReadMemory(PlayerPointer + 12, 4)
PZ = ReadMemory(PlayerPointer + 16, 4)

Don't worry about these undeclared pointers. We will fill them later. Remember, this is a function.
Okay, so virtually, we should have collected the required informations to make an aimbot. Now,
this is math time. Let's go for the second part.

'SE // Checking if our target is at South-East :

If EY < PY And EX > PX Then 'If enemy is at south-east from us ...
YDiff = PY - EY 'Y Difference.
XDiff = EX - PX 'X Difference.
Angle = Atn(YDiff / XDiff) * 57.29578 'Get the angle of our screen by getting the arctangent of our X/Y Difference.
Ratio = Angle / 90 'Get the ratio by dividing our angle by 90.
XDouble = -1073741824 * Ratio
XFacing = XDouble
End If

Allright. This part was for checking if our target was at South-East from our position. As you can see,
I commented all the lines I could understand so far. Let's go for South-West.

'SW // Checking if our target is at South-West :

If EY < PY And EX < PX Then 'If target is at South-West from us ...
YDiff = PY - EY 'Y Difference.
XDiff = PX - EX 'X Difference
Angle = Atn(YDiff / XDiff) * 57.29578 'Get the angle by getting the arctangent of our X/Y Difference.
Ratio = Angle / 90 'Get the Ratio by dividing the angle by 90.
XDouble = -2147483647 + (1073741824 * Ratio) 'Facing calculations.

If XDouble < -2147483647 Then
XDouble = -2147483647 - (XDouble - -2147483647) 'Facing calculations.
End If
XFacing = XDouble
End If

So now we can know if our target is at South-West. We got two left.

'NW // Checking if our target is at North-West :

If EY > PY And EX < PX Then
YDiff = EY - PY
XDiff = PX - EX
Angle = Atn(YDiff / XDiff) * 57.29578
Ratio = Angle / 90
XDouble = 2147483647 - (1073741824 * Ratio)

If XDouble > 2147483647 Then
XDouble = -2147483647 + (XDouble - 2147483647)
End If

XFacing = XDouble
End If

Same thing as above, but for North-West. Last one of the X Facing :

'NE // Checking if our target is at North-East :

If EY > PY And EX > PX Then
YDiff = EY - PY
XDiff = EX - PX
Angle = Atn(YDiff / XDiff) * 57.29578
Ratio = Angle / 90
XDouble = 1073741824 * Ratio
XFacing = XDouble
End If

There we go. Now we got our calculations for our X facing. We need also our Y facing, in-case the
target is higher or lower than us. Basically the same thing as above.

If PZ > EZ Then
ZDiff = PZ - EZ
Dist = Sqr((XDiff * XDiff) + (YDiff * YDiff))
Angle = Atn(ZDiff / Dist) * 57.29578
Ratio = Angle / 90
YFacing = -1073741824 * Ratio
End If

The other one..

If PZ < EZ Then
ZDiff = EZ - PZ
Dist = Sqr((XDiff * XDiff) + (YDiff * YDiff))
Angle = Atn(ZDiff / Dist) * 57.29578
Ratio = Angle / 90
YFacing = 1073741824 * Ratio
End If

And if our target is at the same height as us, then apply a little protection for overflow..

If PZ = EZ Then
YFacing = 0
End If

Are you still alive ? Yes ? Good, then let's go to the other part, sir.

Using the function 2.3

Now we are going to learn how to use the function we just made and included to our project.
You can make a timer and detect if user is pressing a certain key to enable the AimMath function.

Now, to use our function we will have to do this :

'Setting our pointers

PlayerPointer = ReadMemory(&HPPointer, 4)
TargetPointer = ReadMemory(&HHPointer, 4) + (668 * PlayerSlot)

This is basically setting our pointers for collecting the information. The principal
aim is the TargetPointer. The TargetPointer is pointing to the FIRST address
in the player structure of the PlayerSlot we defined. So now, if we want the X, Y and Z position
of the defined PlayerSlot, we can simply do :

EnemyX = ReadMemory(TargetPointer + 8, 4)
EnemyY = ReadMemory(TargetPointer + 12, 4)
EnemyZ = ReadMemory(TargetPointer + 16, 4).

This was an example. Here what you should include to your project...

'Collecting informations

EX = ReadMemory(TargetPointer + 8, 4) 'Enemy X
EY = ReadMemory(TargetPointer + 12, 4) 'Enemy Y
EZ = ReadMemory(TargetPointer + 16, 4) 'Enemy Z

PX = ReadMemory(PlayerPointer + 8, 4) 'Our X
PY = ReadMemory(PlayerPointer + 12, 4) 'Our Y
PZ = ReadMemory(PlayerPointer + 16, 4) 'Our Z

PFacingX = ReadMemory(PlayerPointer + 20, 4) 'Our facing X
PFacingY = ReadMemory(PlayerPointer + 24, 4) 'Our facing Y..

'Calling our function

Call AimMath(PlayerPointer, TargetPointer)

Now, we just called the function we created a few minutes ago.
Basically, IT should be aiming at the designed playerslot. But an aimbot
that works with Playerslot kinda sucks, right ? We are going to fix that...

But first of all, what is a player slot? The player slot is a number used by bhd
to allocate to a certain place in the memory information about a player in the game.
So if you join the game with only one Host, you will be on the second PlayerSlot.
To get our own information, you will remplace "PlayerSlot" by "2". The variable will
point to the first address of your player structure, and you just need to apply the appropriate
offset to get the required informations. Is that clear, now ? Now, to the next part, sir.

For Loop and Snap Square

How to make a for loop 3.1

Making a For Loop is basically simple but it is VERY useful if well used. You can do a lot of things
with this kind of loop, just need to be creative. In BHD, you can load players with it, you can load
all the informations about players in the game and also make a better aimbot.

First of all, you need to declare the variable you will use to store your loop number. Depending
on how big you are going to make it count, it can be an integer or a long. For making an aimbot,
I advise you to make it go until 50, since there can be only 50 players in a game. It will be an integer.

Dim intPlayerSlot As Integer

For intPlayerSlot = 1 To 50

There we go, we just created our for loop. Basically, the use of the for loop is looping the code
inserted into the loop until the end. Usually, the variable is required for the code, since the code
probably need a number to be increased. So this is exactly what we need. We are going to look
through EVERY players in the game and see, depending of their world position (X, Y, Z) if we are
aiming at them before enabling the aimbot. So here is a basic, complete For Loop with dummy
code inside it.

Dim intPlayerSlot As Integer

For intPlayerSlot = 1 To 50

Label1.Caption = "Loop number is " & intPlayerSlot

Next intPlayerSlot

What is Next intPlayerSlot ? This is actually increasing the variable to its current value plus one.
So make sure this code isn't inside an If statement. It will not work. Note : when you are using
a For Loop, your project is freezing at the run-time, depending on how big is your variable
number. So your code has to be the smallest possible in the loop to prevent from big-ass freezing.

Now, we are going to put the code we made for calling our AimMath Function. It should look like that :

For intPlayerSlot = 1 To 50

PlayerPointer = ReadMemory(&HPPointer, 4)
TargetPointer = ReadMemory(&HHPointer, 4) + (668 * intPlayerSlot)

'Collecting informations

EX = ReadMemory(TargetPointer + 8, 4)
EY = ReadMemory(TargetPointer + 12, 4)
EZ = ReadMemory(TargetPointer + 16, 4)

PX = ReadMemory(PlayerPointer + 8, 4)
PY = ReadMemory(PlayerPointer + 12, 4)
PZ = ReadMemory(PlayerPointer + 16, 4)

PFacingX = ReadMemory(PlayerPointer + 20, 4) 'Our facing X
PFacingY = ReadMemory(PlayerPointer + 24, 4) 'Our facing Y..

'Calling our function

Call AimMath(PlayerPointer, TargetPointer)

Next intPlayerSlot

We are almost done. Now we are going to learn what is Snap Square and how to use it in an aimbot.

Using snap square 3.2

Snap Square is a technic mainly used in aimbots to check if our target is inside an invisible box. If so,
our code checks who is inside the box and start aimboting to the identified target. The box can be any size,
but if its too big the aimbot will be inacurrate. So now, if you understand what is a snap square, then we can
continue....

For intPlayerSlot = 1 To 50

PlayerPointer = ReadMemory(&HPPointer, 4)
TargetPointer = ReadMemory(&HHPointer, 4) + (668 * intPlayerSlot)

'Collecting informations

EX = ReadMemory(TargetPointer + 8, 4)
EY = ReadMemory(TargetPointer + 12, 4)
EZ = ReadMemory(TargetPointer + 16, 4)

PX = ReadMemory(PlayerPointer + 8, 4)
PY = ReadMemory(PlayerPointer + 12, 4)
PZ = ReadMemory(PlayerPointer + 16, 4)

PFacingX = ReadMemory(PlayerPointer + 20, 4) 'Our facing X
PFacingY = ReadMemory(PlayerPointer + 24, 4) 'Our facing Y..

'Calling our function

Call AimMath(PlayerPointer, TargetPointer)

Next intPlayerSlot

This is our code. Logically, we need the snap square method so we can know if a player is in our crosshair if
the key is pressed (E.G. shift). We are going to create our box by defining the variable "SquareSize".

The box size is VERY important. If it's too big, you probably won't lock to the person you were aiming to and
if too small, you will not lock to anyone. So let's create our variable INSIDE the loop. Put the Dim out of the
loop.

Dim SnapSquare As Long

Call AimMath(PlayerPointer, TargetPointer)
SquareSize = 45000000

As you can see, the box have a pretty big value. It is only required to increase it if the player you are targeting
is near you. If the enemy is 50m or lower near you, then just increase the square size to 65000000. Simple.

Okay now we defined our Square Size. Now this is VERY important to understand the next part, its the principal
code of our snap square. I will explain a bit before. Now that we got our facing, the facing we should get to aimbot
to the target and our snap square, there is a method to check if the target is inside the box. It's some math but you
will probably understand it better than the AimMath.

If PFacingX < (XFacing + SquareSize) And PFacingX > (XFacing - SquareSize) And PFacingY < (YFacing + SquareSize) And PFacingY > (YFacing - SquareSize) Then

If you look closer to the code, you can notice it makes an invisible box by using the size of your variable SquareSize.
It is almost the same thing as if you made a GUI button and wanted to know if the user mouse were inside your button square.

There we go! Now, we can add a key check in-case we don't want it to auto-target everyone through walls.

If PFacingX < (XFacing + SquareSize) And PFacingX > (XFacing - SquareSize) And PFacingY < (YFacing + SquareSize) And PFacingY > (YFacing - SquareSize) Then
If GetKeyPress(vbKeyShift) Then 'If user pressed shift key..

Call WriteMemory(PlayerPointer + 20, XFacing, 4) 'Write to our current facing, the out-put of AimMath, XFacing.
Call WriteMemory(PlayerPointer + 24, YFacing, 4) 'Write to our current facing, the out-put of AimMath, YFacing.

End If
End If

Next intPlayerSlot 'Increase the variable plus one.

That's it ! Now basically, it checks if our target is inside the SnapSquare box. If he's in the box, check if user is pressing the
Shift Key. If GetKeyPress returns true, then we're using the outputs of our AimMath, which is XFacing and YFacing and write
them to our current facing. If we are not pressing shift, or the target is not inside the box, then the For Loop increase the
variable and check for another target.

That's how is called a proper Memory AimBot.

Finalizing your aimbot

Finalizing your project 4.1

Ok, this part is useful for those who went confused to the lastest parts. Let's re-do everything :

1 : We created our AimMath function
2 : We learned how to use the AimMath function
3 : We learned to do the for loop.
4 : We learned to do the SnapSquare.

Now we have to put them all together.

For a reason of noobying i will not put the whole code there, so you should be able to finish it up.
Make sure you have included Memory Module V6, the LASTEST version.

Credits / Misc. Informations

Credits 5.1

Thanks to all the following people who I have learned all my shit from ...

Mr.A
Shatter
Kryptech
VIPs

... and all the friends I made over that community and shared codes with them ...

Knifie Knifie!
Ghost
StevePwns
Kryptech
Mr.A
Shatter
zsw007

Thanks buddies.

---

This memory aimbot tutorial is based on Shatter's AimBot Tutorial.

Chris
05-10-2008, 11:56 AM
you do know this is for BHD

CptM0rg@n
05-10-2008, 01:02 PM
you do know this is for BHD

i really wasnt paying attetion that much but it prolly can be edited a lil to make 1 for warrock but it dont matter just wanted to help a few ppl out maybe some1 wants to make an aimbot for bhd, o well lol

Chris
05-10-2008, 01:17 PM
you would need to change the offsets, player and enemy pointers, and some other things.

zezima
05-15-2008, 08:45 PM
nice thanks for the tut! if i make the aimbot, should i post public?