Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1.04 Thanks to Bad Luck Brian
- //Note: As you can tell, I have not updated 3 addresses. They are not important, and the aimbot will work without them all you need to do is Aimbot.Run();
- public static class AW
- {
- /*general addresses*/
- static uint RPC_func = 0x5FCBF0,//1.04
- playerstate_s = 0x1950880,//1.04
- gentity_s = 0x1860880,//1.04
- button_s = playerstate_s + 0xA64,//1.04
- redBoxes = 0x0019610b,//1.04
- setClientViewAngles = 0x2F4530,//1.04
- ESP = 0x05CEE74,//1.02
- sv_hostname = 0x02555e58 + 0xC,//1.02
- g_gamemode = 0x02555c24; //1.02
- /*offsets related to playerstate_s*/
- static uint origins = 0x78,
- stance = 0x3A66,
- team = 0x3AF0,
- name = 0x3AA8;
- /*offsets related to gentity_s*/
- static uint spawned = 0x172;
- public static class Game {
- public enum buttons {
- CROSS = 0x10,
- CIRCLE = 0x18,
- SQUARE = 0x24,
- TRIANGLE = 0x30,
- L1 = 0x40,
- R1 = 0x48,
- DPAD_UP = 0xF0,
- DPAD_DOWN = 0xFC,
- DPAD_LEFT = 0x108,
- DPAD_RIGHT = 0x114
- }
- public enum ESPMODES {
- OFF,
- LOW,
- HIGH
- }
- public static uint getPS(int client, uint offset = 0) { return playerstate_s + (uint)client * 0x4180 + offset; }
- public static uint getGent(int client, uint offset = 0) { return gentity_s + (uint)client * 0x280 + offset; }
- public static bool isPressed(buttons key) { return (PS3.ReadInt(button_s+(uint)key) == 1);}
- public static void enableESP(ESPMODES state)
- {
- switch (state)
- {
- case ESPMODES.OFF:
- byte[] ESP = new byte[] { 0x3B, 0xC0, 0x25, 0x00 }; PS3.SetMemory(AW.ESP, ESP, 4);
- break;
- case ESPMODES.LOW:
- byte[] ESP1 = new byte[] { 0x3B, 0xC0, 0xA1, 0x05 }; PS3.SetMemory(AW.ESP, ESP1, 4);
- break;
- case ESPMODES.HIGH:
- byte[] ESP2 = new byte[] { 0x3B, 0xC0, 0xA1, 0x15 }; PS3.SetMemory(AW.ESP, ESP2, 4);
- break;
- }
- }
- public static void enableWALLHACK(bool state = true){ if (state)PS3.WriteByte(AW.redBoxes, 1); else PS3.WriteByte(AW.redBoxes, 0); }
- public static bool isAlive(int client){ return (PS3.ReadShort(getGent(client, spawned)) == 1); }
- public static bool sameTeam(int p1, int p2){ return (PS3.ReadInt(getPS(p1, team)) == PS3.ReadInt(getPS(p2, team))); }
- public static bool isFFA() { return (PS3.ReadString(PS3.ReadUInt(g_gamemode)) == "dm");}
- public static int findHost() {
- string hostname = PS3.ReadString(PS3.ReadUInt(sv_hostname));
- for (int i = 0; i < 18; i++) {
- if (PS3.ReadString(Game.getPS(i, name)) == hostname) {
- return i;
- }
- }
- return 0;
- }
- }
- public static class RPC {
- public static void enableRPC(){
- byte[] RPC = new byte[] { 0x3D, 0x80, 0x02, 0x10, 0x80, 0x8C, 0x00, 0x00, 0x2C, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x70, 0x80, 0x6C, 0x00, 0x04, 0x80, 0x8C, 0x00, 0x08, 0x80, 0xAC, 0x00, 0x0C, 0x80, 0xCC, 0x00, 0x10, 0x80, 0xEC, 0x00, 0x14, 0x81, 0x0C, 0x00, 0x18, 0x81, 0x2C, 0x00, 0x1C, 0x81, 0x4C, 0x00, 0x20, 0x81, 0x6C, 0x00, 0x24, 0xC0, 0x2C, 0x00, 0x28, 0xC0, 0x4C, 0x00, 0x2C, 0xC0, 0x6C, 0x00, 0x30, 0xC0, 0x8C, 0x00, 0x34, 0xC0, 0xAC, 0x00, 0x38, 0xC0, 0xCC, 0x00, 0x3C, 0xC0, 0xEC, 0x00, 0x40, 0xC1, 0x0C, 0x00, 0x44, 0xC1, 0x2C, 0x00, 0x48, 0x81, 0x8C, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x39, 0x80, 0x00, 0x00, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x00, 0x4C, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x04, 0xE8, 0x01, 0x05, 0x20, 0x7C, 0x08, 0x03, 0xA6, 0xCB, 0xC1, 0x05, 0x00, 0xCB, 0xE1, 0x05, 0x08, 0xEA, 0xE1, 0x04, 0xB8, 0xEB, 0x01, 0x04, 0xC0, 0xEB, 0x21, 0x04, 0xC8, 0xEB, 0x41, 0x04, 0xD0, 0xEB, 0x61, 0x04, 0xD8, 0xEB, 0x81, 0x04, 0xE0, 0xEB, 0xA1, 0x04, 0xE8, 0xEB, 0xC1, 0x04, 0xF0, 0xEB, 0xE1, 0x04, 0xF8, 0x38, 0x21, 0x05, 0x10, 0x4E, 0x80, 0x00, 0x20, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00 };
- byte[] PAUSE = new byte[] { 0x4E, 0x80, 0x00, 0x20 };
- byte[] UNPAUSE = new byte[] { 0xF8, 0x21, 0xFA, 0xF1 };
- PS3.SetMemory(RPC_func, PAUSE);
- PS3.SetMemory(RPC_func + 0x50, RPC);
- System.Threading.Thread.Sleep(10);
- PS3.SetMemory(RPC_func, UNPAUSE, 4);
- }
- public static uint Call(uint func_address, params object[] parameters)
- {
- int num_params = parameters.Length;
- uint num_floats = 0;
- for (uint i = 0; i < num_params; i++)
- {
- if (parameters[i] is int)
- {
- PS3.WriteInt(0x2100004 + (i + num_floats) * 4, (int)parameters[i] );
- }
- else if (parameters[i] is uint)
- {
- PS3.WriteUInt(0x2100004 + (i + num_floats) * 4, (uint)parameters[i]);
- }
- else if (parameters[i] is string)
- {
- for (int ii = 0; ii < 10 * 0x400; ii += 0x400)
- {
- if (PS3.ReadByte(0x2101000 + (uint)ii) == 0x00)
- {
- PS3.WriteString(0x2101000 + (uint)ii, (string)parameters[i]);
- PS3.WriteUInt(0x2100004 + (i + num_floats) * 4, 0x2101000 + (uint)ii);
- }
- else
- {
- byte[] eraser = new byte[0x400*10];
- PS3.SetMemory(0x2101000, eraser);
- PS3.WriteString(0x2101000, (string)parameters[i]);
- PS3.WriteUInt(0x2100004 + (i + num_floats) * 4, 0x2101000);
- }
- }
- }
- else if (parameters[i] is float)
- {
- PS3.WriteFloat(0x2100004 + (uint)i * 0x4, (float)parameters[i]);
- }
- }
- PS3.WriteUInt(0x2100000, func_address);
- System.Threading.Thread.Sleep(10);
- return PS3.ReadUInt(0x210004C);
- }
- }
- public static class Aimbot {
- public static int host = 0;
- static float[] getOrigins(int client)
- {
- return new float[] { PS3.ReadFloat(Game.getPS(client, origins)), PS3.ReadFloat(Game.getPS(client, origins + 4)), PS3.ReadFloat(Game.getPS(client, origins + 8)) };
- }
- static float[] posToVec(float[] attacker, float[] victim)
- {
- return new float[] { (victim[0] - attacker[0]),(victim[1] - attacker[1]),(victim[2] - attacker[2])};
- }
- static float[] vecToAngles(float[] vec)
- {
- float M_PI = 3.14159265358979323846f;
- float forward;
- float yaw, pitch;
- if (vec[1] == 0 && vec[0] == 0)
- {
- yaw = 0;
- if (vec[2] > 0)
- {
- pitch = 90f;
- }
- else
- {
- pitch = 270f;
- }
- }
- else
- {
- if (vec[0] != 0)
- {
- yaw = ((float)Math.Atan2(Convert.ToDouble(vec[1]), Convert.ToDouble(vec[0])) * 180f / M_PI);
- }
- else if (vec[1] > 0)
- {
- yaw = 90f;
- }
- else
- {
- yaw = 270f;
- }
- if (yaw < 0)
- {
- yaw += 360f;
- }
- forward = (float)Math.Sqrt(Convert.ToDouble(vec[0] * vec[0] + vec[1] * vec[1]));
- pitch = ((float)Math.Atan2(Convert.ToDouble(vec[2]), Convert.ToDouble(forward))) * 180f / M_PI;
- if (pitch < 0)
- {
- pitch += 360f;
- }
- }
- return new float[] { -pitch, yaw, 0 };
- }
- static void doMyStance(int client, float[] vec)
- {
- byte stance = PS3.ReadByte(Game.getPS(client, AW.stance));
- if (stance == 2 || stance == 0x42 || stance == 0x82 || stance == 0x0A || stance == 0x22){
- vec[2] += 44f;
- }
- else if (stance == 1 || stance == 0x41 || stance == 0x81 || stance == 0x09 || stance == 0x21){
- vec[2] += 14f;
- }
- else{
- vec[2] += 0f;
- }
- }
- static void doHisStance(int client, float[] vec)
- {
- byte stance = PS3.ReadByte(Game.getPS(client, AW.stance));
- if (stance == 2 || stance == 0x42 || stance == 0x82 || stance == 0x0A || stance == 0x22){
- vec[2] -= 46f;
- }
- else if (stance == 1 || stance == 0x41 || stance == 0x81 || stance == 0x09 || stance == 0x21){
- vec[2] -= 18f;
- }
- else{
- vec[2] -= 0f;
- }
- }
- static void setclientAngles(int client, float[] angles)
- {
- PS3.WriteFloat(0x2100100, angles[0]);
- PS3.WriteFloat(0x2100104, angles[1]);
- PS3.WriteFloat(0x2100108, angles[2]);
- RPC.Call(setClientViewAngles, new object[] { Game.getGent(client), 0x2100100 });
- }
- static float getDistance(float[] p1, float[] p2)
- {
- float xSqr = (p1[0] - p2[0]) * (p1[0] - p2[0]);
- float ySqr = (p1[1] - p2[1]) * (p1[1] - p2[1]);
- float zSqr = (p1[2] - p2[2]) * (p1[2] - p2[2]);
- float mySqr = xSqr + ySqr + zSqr;
- return (float)Math.Sqrt(Convert.ToDouble(mySqr));
- }
- static int getNearestPlayer(int attacker)
- {
- int curClient = 0;
- float curDistance = float.MaxValue;
- for (int i = 0; i < 18; i++)
- {
- if (!Game.isFFA())
- {
- if (attacker != i && Game.isAlive(i) && !Game.sameTeam(attacker, i))
- {
- float[] myOrigins = getOrigins(attacker), hisOrigins = getOrigins(i);
- float dist = getDistance(myOrigins, hisOrigins);
- if (dist < curDistance)
- {
- curDistance = dist;
- curClient = i;
- }
- }
- }
- else {
- if (attacker != i && Game.isAlive(i))
- {
- float[] myOrigins = getOrigins(attacker), hisOrigins = getOrigins(i);
- float dist = getDistance(myOrigins, hisOrigins);
- if (dist < curDistance)
- {
- curDistance = dist;
- curClient = i;
- }
- }
- }
- }
- return curClient;
- }
- public static void RUN(){
- if (Game.isPressed(Game.buttons.L1)){
- int vic = getNearestPlayer(host);
- float[] vec = posToVec(getOrigins(host), getOrigins(vic));
- doMyStance(host, vec);
- doHisStance(vic, vec);
- float[] angles = vecToAngles(vec);
- setclientAngles(host, angles);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement