You are viewing our Forum Archives. To view or take place in current topics click here.
[C#] Adding aimbot for MW3, MW2, and/or BO2 Help!
Posted:

[C#] Adding aimbot for MW3, MW2, and/or BO2 Help!Posted:

Psychonauts
  • Christmas!
Status: Offline
Joined: Feb 05, 201311Year Member
Posts: 2,216
Reputation Power: 98
Status: Offline
Joined: Feb 05, 201311Year Member
Posts: 2,216
Reputation Power: 98
Hi everyone, I'm new when it comes to C# and just coding in general, I've gotten a couple things working in my tool, however I can't find the function/offset to add to make an aimbot... Does anyone know the functions/offsets for any of these games? Any help will be greatly appreciated.

PS: I did do a through google/bing search
#2. Posted:
ip
  • 2 Million
Status: Offline
Joined: Dec 30, 201211Year Member
Posts: 3,778
Reputation Power: 3016
Status: Offline
Joined: Dec 30, 201211Year Member
Posts: 3,778
Reputation Power: 3016
Well, you would have to sit there and reverse a ton and even then I don't think it would be possible. But, then again I am sure it is.
#3. Posted:
Psychonauts
  • TTG Addict
Status: Offline
Joined: Feb 05, 201311Year Member
Posts: 2,216
Reputation Power: 98
Status: Offline
Joined: Feb 05, 201311Year Member
Posts: 2,216
Reputation Power: 98
Liability wrote Well, you would have to sit there and reverse a ton and even then I don't think it would be possible. But, then again I am sure it is.

Oh, I thought it was a simple function or DVAR... oh well.
#4. Posted:
IDA
  • Powerhouse
Status: Offline
Joined: Sep 21, 201310Year Member
Posts: 454
Reputation Power: 26
Status: Offline
Joined: Sep 21, 201310Year Member
Posts: 454
Reputation Power: 26
Distantly wrote Hi everyone, I'm new when it comes to C# and just coding in general, I've gotten a couple things working in my tool, however I can't find the function/offset to add to make an aimbot... Does anyone know the functions/offsets for any of these games? Any help will be greatly appreciated.

PS: I did do a through google/bing search




Mehhhhh when I get home tomorrow I'll help you with it, it's AimBot but yanno not a Unfair one....
#5. Posted:
Psychonauts
  • TTG Addict
Status: Offline
Joined: Feb 05, 201311Year Member
Posts: 2,216
Reputation Power: 98
Status: Offline
Joined: Feb 05, 201311Year Member
Posts: 2,216
Reputation Power: 98
Well then. I'll still try, I'm eager to learn. However I'm VERY nooby, so you'd probably get frustrated helping
#6. Posted:
ProJimmyRustler
  • Summer 2018
Status: Offline
Joined: Jul 14, 20149Year Member
Posts: 1,720
Reputation Power: 71
Status: Offline
Joined: Jul 14, 20149Year Member
Posts: 1,720
Reputation Power: 71
In order to get aimbot in most of the games you have to actually "make" the Aimbot. By this you'll have to code something that auto aims on to the players head. Another issue is that you will end up aiming at your players heads too. If you are interested at seeing an example of what I mean dudeitsbrian has a source of his rape tool v3.
namespace CoD_Public_Rape_Tool_v3
{
    public static class Aimbot
    {

        public static void setAngles(uint client, float pitch, float yaw, float roll)
        {
            byte[] angles = new byte[12];
            Buffer.BlockCopy(Utility.ReverseBytes(BitConverter.GetBytes(pitch)), 0, angles, 0, 4);
            Buffer.BlockCopy(Utility.ReverseBytes(BitConverter.GetBytes(yaw)), 0, angles, 4, 4);
            Buffer.BlockCopy(Utility.ReverseBytes(BitConverter.GetBytes(roll)), 0, angles, 8, 4);

            Main.Call(0x8222FC90, Player.Entity[client], angles);
        }

        public static bool closer(float[] myOrigin, float[] referenceOrigin, float[] newOrigin)
        {
            float onex = myOrigin[0] - referenceOrigin[0];
            float twox = myOrigin[1] - referenceOrigin[1];
            float threex = myOrigin[2] - referenceOrigin[2];
            double orig = Math.Sqrt((onex * onex) + (twox * twox) + (threex + threex));
            float myx = myOrigin[0] - newOrigin[0];
            float myx2 = myOrigin[1] - newOrigin[1];
            float myxx = myOrigin[2] - newOrigin[2];
            double newo = Math.Sqrt((myx * myx) + (myx2 * myx2) + (myxx + myxx));

            if (newo < orig)
                return true;
            else
                return false;
        }

        public static float[] vectoangles(float[] value1)
        {
            float forward;
            float yaw, pitch;
            float[] angles = new float[3];
            if (value1[1] == 0 && value1[0] == 0)
            {
                yaw = 0;
                if (value1[2] > 0) pitch = 90f;
                else pitch = 270f;
            }
            else
            {
                if (value1[0] != -1) yaw = (float)(Math.Atan2((double)value1[1], (double)value1[0]) * 180f / Math.PI);
                else if (value1[1] > 0) yaw = 90f;
                else yaw = 270;
                if (yaw < 0) yaw += 360f;

                forward = (float)Math.Sqrt((double)(value1[0] * value1[0] + value1[1] * value1[1]));
                pitch = (float)(Math.Atan2((double)value1[2], (double)forward) * 180f / Math.PI);
                if (pitch < 0) pitch += 360f;
            }
            angles[0] = -pitch;
            angles[1] = yaw;
            angles[2] = 0;

            return angles;
        }

        public static bool isAlive(uint client)
        {
            if (Main.GetMem(Player.Entity[client] + 0x9, 1).SequenceEqual(new byte[] { 0x04 })) return false;
            else return true;
        }

        public static float[] getOrigin(uint client)
        {
            byte[] xyz = Main.GetMem(Player.Pstate[client] + 0x1c, 12);
            byte[] x = new byte[4], y = new byte[4], z = new byte[4];
            Buffer.BlockCopy(xyz, 0, x, 0, 4);
            Buffer.BlockCopy(xyz, 4, y, 0, 4);
            Buffer.BlockCopy(xyz, 8, z, 0, 4);

            float[] origin = new float[3];
            origin[0] = BitConverter.ToSingle(Utility.ReverseBytes(x), 0);
            origin[1] = BitConverter.ToSingle(Utility.ReverseBytes(y), 0);
            origin[2] = BitConverter.ToSingle(Utility.ReverseBytes(z), 0);
            return origin;
        }

        public static bool checkTeam(uint client)
        {
            if (AttackerTeam == 0) return true;
            int team = (int)Main.GetMem(Player.Pstate[client] + 0x33d7, 1)[0];
            if (AttackerTeam != team) return true;
            else return false;
        }

        public static Players Player;
        public static int AttackerTeam;
        public static void aimAtClient(uint attacker, Players P)
        {
            Player = P;
            float[] myOrigin = getOrigin(attacker);
            AttackerTeam = (int)Main.GetMem(Player.Pstate[attacker] + 0x33d7, 1)[0];
            float[] refOrigin = new float[] { 99999999f, 99999999f, 99999999f };
            float[] testOrigin;
            int numAlivePlayers = 0;
            for (uint i = 0; i < 18; i++)
            {
                if (Player.Active[i])
                    if (Player.Status[i] != "VIP" && Player.Status[i] != "Host" && i != attacker)
                        if (checkTeam(i))
                            if (isAlive(i))
                            {
                                numAlivePlayers++;
                                testOrigin = getOrigin(i);
                                if (closer(myOrigin, refOrigin, testOrigin))
                                {
                                    refOrigin = testOrigin;
                                }
                            }
            }
            if (numAlivePlayers > 0)
            {
                float[] test = vectoangles(new float[] { (refOrigin[0] - myOrigin[0]), (refOrigin[1] - myOrigin[1]), (refOrigin[2] - myOrigin[2]) });
                setAngles(attacker, test[0], test[1], test[2]);
            }
        }
    }
}


This is the code from his source. I've been told that it will work with other game, but I haven't tried.
#7. Posted:
IDA
  • Powerhouse
Status: Offline
Joined: Sep 21, 201310Year Member
Posts: 454
Reputation Power: 26
Status: Offline
Joined: Sep 21, 201310Year Member
Posts: 454
Reputation Power: 26
ProJimmyRustler wrote In order to get aimbot in most of the games you have to actually "make" the Aimbot. By this you'll have to code something that auto aims on to the players head. Another issue is that you will end up aiming at your players heads too. If you are interested at seeing an example of what I mean dudeitsbrian has a source of his **** tool v3.
namespace CoD_Public_Rape_Tool_v3
{
    public static class Aimbot
    {

        public static void setAngles(uint client, float pitch, float yaw, float roll)
        {
            byte[] angles = new byte[12];
            Buffer.BlockCopy(Utility.ReverseBytes(BitConverter.GetBytes(pitch)), 0, angles, 0, 4);
            Buffer.BlockCopy(Utility.ReverseBytes(BitConverter.GetBytes(yaw)), 0, angles, 4, 4);
            Buffer.BlockCopy(Utility.ReverseBytes(BitConverter.GetBytes(roll)), 0, angles, 8, 4);

            Main.Call(0x8222FC90, Player.Entity[client], angles);
        }

        public static bool closer(float[] myOrigin, float[] referenceOrigin, float[] newOrigin)
        {
            float onex = myOrigin[0] - referenceOrigin[0];
            float twox = myOrigin[1] - referenceOrigin[1];
            float threex = myOrigin[2] - referenceOrigin[2];
            double orig = Math.Sqrt((onex * onex) + (twox * twox) + (threex + threex));
            float myx = myOrigin[0] - newOrigin[0];
            float myx2 = myOrigin[1] - newOrigin[1];
            float myxx = myOrigin[2] - newOrigin[2];
            double newo = Math.Sqrt((myx * myx) + (myx2 * myx2) + (myxx + myxx));

            if (newo < orig)
                return true;
            else
                return false;
        }

        public static float[] vectoangles(float[] value1)
        {
            float forward;
            float yaw, pitch;
            float[] angles = new float[3];
            if (value1[1] == 0 && value1[0] == 0)
            {
                yaw = 0;
                if (value1[2] > 0) pitch = 90f;
                else pitch = 270f;
            }
            else
            {
                if (value1[0] != -1) yaw = (float)(Math.Atan2((double)value1[1], (double)value1[0]) * 180f / Math.PI);
                else if (value1[1] > 0) yaw = 90f;
                else yaw = 270;
                if (yaw < 0) yaw += 360f;

                forward = (float)Math.Sqrt((double)(value1[0] * value1[0] + value1[1] * value1[1]));
                pitch = (float)(Math.Atan2((double)value1[2], (double)forward) * 180f / Math.PI);
                if (pitch < 0) pitch += 360f;
            }
            angles[0] = -pitch;
            angles[1] = yaw;
            angles[2] = 0;

            return angles;
        }

        public static bool isAlive(uint client)
        {
            if (Main.GetMem(Player.Entity[client] + 0x9, 1).SequenceEqual(new byte[] { 0x04 })) return false;
            else return true;
        }

        public static float[] getOrigin(uint client)
        {
            byte[] xyz = Main.GetMem(Player.Pstate[client] + 0x1c, 12);
            byte[] x = new byte[4], y = new byte[4], z = new byte[4];
            Buffer.BlockCopy(xyz, 0, x, 0, 4);
            Buffer.BlockCopy(xyz, 4, y, 0, 4);
            Buffer.BlockCopy(xyz, 8, z, 0, 4);

            float[] origin = new float[3];
            origin[0] = BitConverter.ToSingle(Utility.ReverseBytes(x), 0);
            origin[1] = BitConverter.ToSingle(Utility.ReverseBytes(y), 0);
            origin[2] = BitConverter.ToSingle(Utility.ReverseBytes(z), 0);
            return origin;
        }

        public static bool checkTeam(uint client)
        {
            if (AttackerTeam == 0) return true;
            int team = (int)Main.GetMem(Player.Pstate[client] + 0x33d7, 1)[0];
            if (AttackerTeam != team) return true;
            else return false;
        }

        public static Players Player;
        public static int AttackerTeam;
        public static void aimAtClient(uint attacker, Players P)
        {
            Player = P;
            float[] myOrigin = getOrigin(attacker);
            AttackerTeam = (int)Main.GetMem(Player.Pstate[attacker] + 0x33d7, 1)[0];
            float[] refOrigin = new float[] { 99999999f, 99999999f, 99999999f };
            float[] testOrigin;
            int numAlivePlayers = 0;
            for (uint i = 0; i < 18; i++)
            {
                if (Player.Active[i])
                    if (Player.Status[i] != "VIP" && Player.Status[i] != "Host" && i != attacker)
                        if (checkTeam(i))
                            if (isAlive(i))
                            {
                                numAlivePlayers++;
                                testOrigin = getOrigin(i);
                                if (closer(myOrigin, refOrigin, testOrigin))
                                {
                                    refOrigin = testOrigin;
                                }
                            }
            }
            if (numAlivePlayers > 0)
            {
                float[] test = vectoangles(new float[] { (refOrigin[0] - myOrigin[0]), (refOrigin[1] - myOrigin[1]), (refOrigin[2] - myOrigin[2]) });
                setAngles(attacker, test[0], test[1], test[2]);
            }
        }
    }
}


This is the code from his source. I've been told that it will work with other game, but I haven't tried.


Yes that's works, doesn't need to change much between games, just the setAngles offset
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.