Post: Advanced Warfare C# Script Thread [ Aimbot / ForgeMods & More! ]
07-21-2015, 11:40 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hi guys, today I will release some scripts you can add to your tool.
The topic brings a maximum scripts.
If you need help ask me.


All Scripts:



Spawn Entity:

    
public static uint spawnEntity(string ModelName, float[] Origin, float[] Angles)
{
uint Entity = (uint)Call(Adresses.G_Spawn);
WriteSingle(Entity + 0x138, Origin);
WriteSingle(Entity + 0x148, Angles);
RPC.Call(Adresses.G_SetModel, Entity, ModelName);
RPC.Call(Adresses.ScriptModels, Entity);
return Entity;
}



Spawn Turret:

    
public static uint SpawnTurret(string turrettype, string ModelName, float[] Origin, float[] Angles)
{
uint Entity = (uint)Call(Adresses.G_Spawn);
WriteSingle(Entity + 0x138, Origin);
WriteSingle(Entity + 0x148, Angles);
RPC.Call(Adresses.G_SetModel, Entity, ModelName);
RPC.Call(Adresses.G_SpawnTurret, Entity);
return Entity;
}



G_GivePlayerWeapon:

    
public static void G_GivePlayerWeapon(int client, int Weapon, int ammo)
{
RPC.Call(Adresses.G_GivePlayerWeapon, Adresses.G_Client + 0x3980 * (uint)client, Weapon, 0);
RPC.Call(Adresses.AddAmmo, Adresses.G_Client + (client * 0x3980), Weapon, 0, ammo, 1);
}



SetModels:

    
public static void SetModels(int client, string Models)
{
RPC.Call(Adresses.G_SetModel, Adresses.G_Entity + 0x280 * (uint)client, Models);
}



Clone Player:

    
public static void ClonePlayer(int Client)
{
RPC.Call(Adresses.ClonePlayer, new object[] { Client });
}



Set Vision:

    
public static void SetVision(int Client, string Vision)
{
SV_GameSendServerCommand(Client, "J \"" + Vision + "\" ");
}



Set Blur:

    
public static void SetBlur(int Client, Int32 TransitionTime)
{
SV_GameSendServerCommand(Client, "i _ \"" + TransitionTime + " ");
}



Spining Mods:

    
public static void setViewAngles(int Client, float[] Angles)
{
WriteSingle(0x10040000, Angles);
RPC.Call(Adresses.SetClientViewAngles, Adresses.G_Entity + 0x280 * (uint)Client, 0x10040000);
}

public static float[] getViewAngles(int Client)
{
return ReadSingle(Adresses.Angles + 0x3980 * (uint)Client, 3);
}


For use (On Timer):
    
Single[] Angles = getViewAngles((int)this.numericUpDownX.Value);
Angles[1] += 15;
setViewAngles((int)this.numericUpDownX.Value, Angles);
System.Threading.Thread.Sleep(100);



JetPack:

    
public void JetPack(int client)
{
float jH = PS3.Extension.ReadFloat(Adresses.G_Client + 0x8C + ((uint)client * 0x3980));
jH += 100;
PS3.Extension.WriteFloat(Adresses.G_Client + 0x8C + ((uint)client * 0x3980), jH);
}


For use ( On Timer ):
    
if (ButtonPressed(Client, Buttonz.Cross))
{
JetPack(Client);
}



Button Monitoring:

    
public static class Buttonz
{
public static Int32
Cross = 67108864,
Crouch = 33554432,
Prone = 16777216,
Start = 128,
L1 = 134217736,
L2 = -2147483648,
L1andR1 = L1 + R1,
L3 = 537001984,
R1 = 65536,
R2 = 1073741824,
R3 = 263168,
Square = 3145728;
}

public static bool ButtonPressed(int client, int Buttons)
{
if (PS3.Extension.ReadInt32(G_Client(client, 0x35B6)) == Buttons)
return true;
else return false;
}



Key_IsDown:

    
public enum Key : uint
{
Cross = 0,
Circle = 1,
Square = 2,
Triangle = 3,
L1 = 4,
R1 = 5,
Start = 13,
Select = 14,
L3 = 15,
R3 = 16,
DPAD_UP = 19,
DPAD_DOWN = 20,
DPAD_LEFT = 21,
DPAD_RIGHT = 22,
}

public static Boolean LocalKeyIsDown(Key k)
{
return PS3.Extension.ReadBool((Offsets.KeyIsDown + 0x0F) + ((UInt32)k * 0xC));
}



G_Client:

    
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (Adresses.G_Client + Mod) + ((uint)clientIndex * 0x3980);
}



G_Entity:

    
public static uint G_Entity(int Client, uint Mod = 0)
{
return (Adresses.G_Entity + (0x280 * (uint)Client) + (uint)Mod);
}



FastRestart:

    
public static void FastRestart()
{
RPC.Call(Adresses.SV_FastRestart_f);
}



Unlock Trophies:

    
public static void Unlock_Trophies()
{
string[] Achievements = new string[90];
Achievements[0] = "4 CARMA";
Achievements[1] = "4 CAMPAIGN_COMPLETE";
Achievements[2] = "4 CAMPAIGN_HARDENED";
Achievements[3] = "4 CAMPAIGN_VETERAN";
Achievements[4] = "4 BOOST_DASH_STOMP";
Achievements[5] = "4 GRENADE_DODGE";
Achievements[6] = "4 SONIC_KILL";
Achievements[7] = "4 OVERDRIVE_KILL";
Achievements[8] = "4 SMART_GRENADE_KILL";
Achievements[9] = "4 THREAT_GRENADE_KILL";
Achievements[10] = "4 EMP_DRONE";
Achievements[11] = "4 EMP_AST";
Achievements[12] = "4 INTEL_HALF";
Achievements[13] = "4 INTEL_ALL";
Achievements[14] = "4 COVER_DRONE_KILL";
Achievements[15] = "4 EXO_UPGRADE";
Achievements[16] = "4 EXO_UPGRADE_10";
Achievements[17] = "4 EXO_UPGRADE_20";
Achievements[18] = "4 EXO_UPGRADE_FULL";
Achievements[19] = "4 LEVEL_1";
Achievements[20] = "4 LEVEL_1A";
Achievements[21] = "4 LEVEL_2A";
Achievements[22] = "4 LEVEL_2B";
Achievements[23] = "4 LEVEL_2";
Achievements[24] = "4 LEVEL_3A";
Achievements[25] = "4 LEVEL_3";
Achievements[26] = "4 LEVEL_4A";
Achievements[27] = "4 LEVEL_4";
Achievements[28] = "4 LEVEL_5";
Achievements[29] = "4 LEVEL_5A";
Achievements[30] = "4 LEVEL_6A";
Achievements[31] = "4 LEVEL_6";
Achievements[32] = "4 LEVEL_7";
Achievements[33] = "4 LEVEL_8A";
Achievements[34] = "4 LEVEL_8";
Achievements[35] = "4 LEVEL_9";
Achievements[36] = "4 LEVEL_10A";
Achievements[37] = "4 LEVEL_10";
Achievements[38] = "4 LEVEL_11";
Achievements[39] = "4 LEVEL_12A";
Achievements[40] = "4 LEVEL_12";
Achievements[41] = "4 LEVEL_13A";
Achievements[42] = "4 LEVEL_13";
Achievements[43] = "4 LEVEL_14A";
Achievements[44] = "4 LEVEL_14";
Achievements[45] = "4 COOP_VETERAN";
Achievements[46] = "4 COOP_WARFARE";
Achievements[47] = "4 COOP_UNDEAD_SURVIVOR";
Achievements[48] = "4 COOP_EXO_SURVIVOR";
Achievements[49] = "4 COOP_FLIP_FLOP";
Achievements[50] = "4 DLC1_ZOMBIE_ROUND10";
Achievements[51] = "4 DLC1_ZOMBIE_ROUND30";
Achievements[52] = "4 DLC1_ZOMBIE_2020";
Achievements[53] = "4 DLC1_ZOMBIE_MONEYBAGS";
Achievements[54] = "4 DLC1_ZOMBIE_CHEAPSKATE";
Achievements[55] = "4 DLC1_ZOMBIE_BURGLE";
Achievements[56] = "4 DLC1_ZOMBIE_GAMEOVERMAN";
Achievements[57] = "4 DLC1_ZOMBIE_COMEONANDSLAM";
Achievements[58] = "4 DLC1_ZOMBIE_PCLOADLETTER";
Achievements[59] = "4 DLC1_ZOMBIE_DOYOUEVENEXO";
Achievements[60] = "4 DLC2_ZOMBIE_ROUND10";
Achievements[61] = "4 DLC2_ZOMBIE_ROUND25";
Achievements[62] = "4 DLC2_ZOMBIE_ONEMANSPOISON";
Achievements[63] = "4 DLC2_ZOMBIE_INDIRECTFIRE";
Achievements[64] = "4 DLC2_ZOMBIE_RESCUE1";
Achievements[65] = "4 DLC2_ZOMBIE_RESCUE4";
Achievements[66] = "4 DLC2_ZOMBIE_RESCUE20";
Achievements[67] = "4 DLC2_ZOMBIE_LOVETAP";
Achievements[68] = "4 DLC2_ZOMBIE_POPCORN";
Achievements[69] = "4 DLC2_ZOMBIE_MEATISMURDER";
Achievements[70] = "4 DLC3_ZOMBIE_ROUND10";
Achievements[71] = "4 DLC3_ZOMBIE_ROUND30";
Achievements[72] = "4 DLC3_ZOMBIE_EASTEREGG";
Achievements[73] = "4 DLC3_ZOMBIE_PLINKO";
Achievements[74] = "4 DLC3_ZOMBIE_DEFUSEBOMBS";
Achievements[75] = "4 DLC3_ZOMBIE_ZOMBONI";
Achievements[76] = "4 DLC3_ZOMBIE_TELEFRAG";
Achievements[77] = "4 DLC3_ZOMBIE_LIMBO";
Achievements[78] = "4 DLC3_ZOMBIE_OVERCHARGE";
Achievements[79] = "4 DLC3_ZOMBIE_JUMPTHESHARK";
Achievements[80] = "4 DLC4_ZOMBIE_DEFEATBOSS1";
Achievements[81] = "4 DLC4_ZOMBIE_DEFEATBOSS2";
Achievements[82] = "4 DLC4_ZOMBIE_EASTEREG";
Achievements[83] = "4 DLC4_ZOMBIE_DEFEATBOSS3";
Achievements[84] = "4 DLC4_ZOMBIE_BIGGAME";
Achievements[85] = "4 DLC4_ZOMBIE_COAST2COAST";
Achievements[86] = "4 DLC4_ZOMBIE_GOTOSLEEP";
Achievements[87] = "4 DLC4_ZOMBIE_REALSTEEL";
Achievements[88] = "4 DLC4_ZOMBIE_NODOORS";
Achievements[89] = "4 DLC4_ZOMBIE_TRICKSHOT";

for (int i = 0; i < 90; i++)
{
RPC.Call(Adresses.SV_GameSendServerCommand, -1, 1, Achievements[i]);
Thread.Sleep(25);
RPC.Call(Adresses.SV_GameSendServerCommand, -1, 1, Achievements[i]);
}
}



SetTrophy:

    
public static void SetTrophy(Int32 Client, String Trophy)
{
RPC.Call(Adresses.SV_GameSendServerCommand, Client, 1, "4 " + Trophy);
}



Advanced NoClip:

    
public static void WriteSingle1(uint address, float input)
{
byte[] array = new byte[4];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 4);
PS3.SetMemory(address, array);
}

public static void AdvancedNoclip(int Client)
{
SetVelocity(Client, new float[] { ReturnVelocity(Client)[0], ReturnVelocity(Client)[1], 42.5f });

if (ButtonPressed(Client, Buttonz.L3))
{
SetOrigin(Client, PlayerAnglesToForward(Client, 85));
}
}

public static void SetVelocity(Int32 clientIndex, Single[] Velocity)
{
WriteSingle1(G_Client(clientIndex, 0x34), 3);
}

public static float[] ReturnVelocity(int Client)
{
return ReadSingle(G_Client(Client, Adresses.ClientVelocity), 3);
}


For use ( On Timer ):
     
AdvancedNoclip(Client);



Kick Player:

    
public static void KickPlayer(int Client, string Message)
{
SV_GameSendServerCommand(Client, "r \"" + Message + "\"");
}



Cbuf_AddText:

    
public static void Cbuf_AddText(string command)
{
RPC.Call(Adresses.Cbuf_AddText, new object[] { 0, command });
}



SV_GameSendServerCommand:

    
public static void SV_GameSendServerCommand(int client, string command)
{
RPC.Call(Adresses.SV_GameSendServerCommand, client, 0, command + "\"");
}



iPrintln & iPrintlnBold:

    
public static void iPrintlnBold(int client, string text)
{
SV_GameSendServerCommand(client, "c \"" + text + "\"");
}


public static void iPrintln(int client, string text)
{
SV_GameSendServerCommand(client, "e \"" + text + "\"");
}



ForgeMods:

    
public static UInt32
G_Client = Adresses.G_Client,
G_ClientSize = 0x3980,
Client_mFlag = G_Client + 0x3da7,
Client_Angles = G_Client + 0x1B0,
Client_Origin = G_Client + 0x78;

public static float[] distances = new float[18];
public static PS3API PS3 = new PS3API();

public static void ChangeCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}

public static void ChangeDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static void ForgeMode(uint Client, uint Target, uint Distance_in_Meters = 6)
{
float[] Angles = ReadFloatLength(Client_Angles + (Client * G_ClientSize), 2);
float[] Origin = ReadFloatLength(Client_Origin + (Client * G_ClientSize), 3);

float diff = Distance_in_Meters * 40;

float num = ((float)Math.Sin((Angles[0] * Math.PI) / 180)) * diff;
float num1 = (float)Math.Sqrt(((diff * diff) - (num * num)));
float num2 = ((float)Math.Sin((Angles[1] * Math.PI) / 180)) * num1;
float num3 = ((float)Math.Cos((Angles[1] * Math.PI) / 180)) * num1;
float[] forward = new float[] { Origin[0] + num3, Origin[1] + num2, Origin[2] - num };

Freeze(Target, true);
WriteFloatArray(Client_Origin + (Target * G_ClientSize), forward);
}

public static uint FindClosestEnemy(uint Attacker)
{
for (uint i = 0; i < 18; i++)
{
if (IsClientAlive(i))
{
float[] O1 = ReadFloatLength(Client_Origin + (Attacker * G_ClientSize), 3);
float[] O2 = ReadFloatLength(Client_Origin + (i * G_ClientSize), 3);
distances[i] = (float)(Math.Sqrt(((O2[0] - O1[0]) * (O2[0] - O1[0])) + ((O2[1] - O1[1]) * (O2[1] - O1[1])) + ((O2[2] - O1[2]) * (O2[2] - O1[2]))));

}
else
{
distances[i] = float.MaxValue;
}
}

float[] newDistances = new float[18];
Array.Copy(distances, newDistances, distances.Length);

Array.Sort(newDistances);
for (uint i = 0; i < 18; i++)
{
if (distances[i] == newDistances[1])
{
return i;
}
}
int Failed = -1;
return (uint)Failed;
}

public static void WriteFloatArray(uint Offset, float[] Array)
{
byte[] buffer = new byte[Array.Length * 4];
for (int Lenght = 0; Lenght < Array.Length; Lenght++)
{
ReverseBytes(BitConverter.GetBytes(Array[Lenght])).CopyTo(buffer, Lenght * 4);
}
PS3.SetMemory(Offset, buffer);
}

public static float[] ReadFloatLength(uint Offset, int Length)
{
byte[] buffer = new byte[Length * 4];
PS3.GetMemory(Offset, buffer);
ReverseBytes(buffer);
float[] Array = new float[Length];
for (int i = 0; i < Length; i++)
{
Array[i] = BitConverter.ToSingle(buffer, (Length - 1 - i) * 4);
}
return Array;
}

public static void Freeze(uint Client, bool State)
{
if (State == true)
PS3.Extension.WriteByte(Client_mFlag + (Client * G_ClientSize), 0x05);
else
PS3.Extension.WriteByte(Client_mFlag + (Client * G_ClientSize), 0x00);
}

private static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}

public static bool IsClientAlive(uint Client)
{
byte Alive = PS3.Extension.ReadByte(Adresses.G_Entity + (Client * 0x280) + 0x1AF);
if (Alive != 0)
return true;
else
return false;

}


//For Use: ( Call monitorForgemods((int)this.numericUpDownX.Value) on timer )
     
public static void monitorForgemods(int client)
{
if (ButtonPressed(client, Buttonz.L1))
{
uint Enemy = ForgeMods.FindClosestEnemy((uint)client);
if (ButtonPressed(client, Buttonz.L1))
{
ForgeMods.Freeze(Enemy, true);
ForgeMods.ForgeMode((uint)client, Enemy);
}
else
{
ForgeMods.Freeze(Enemy, false);
}
}
}



Aimbot:

    
public static uint G_Client = Adresses.G_Client;
public static uint Client_Stance = G_Client + 0x5B;
public static uint Client_Alive = G_Client + 0x33A; //0x08 = dead 0x00 = alive
public static uint Client_Team = G_Client + 0x5B;
public static uint Client_SetClientViewAngles = Adresses.SetClientViewAngles;
public static uint Client_IsInGame = G_Client + 0x00;
public static uint Client_Angles = G_Client + 0x1b4;
public static uint Client_Origin = G_Client + 0x78;
public static uint ClientInterval = 0x3980;

public static float[] getPlayerPosition(int clientIndex)
{
return ReadSingle(Client_Origin + (0x3980 * (uint)clientIndex));
}

public static void ChangeCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}

public static void ChangeDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static bool ClientIsSameTeam(int clientIndex, int otherPlayer)
{
return (PS3.Extension.ReadInt32(Client_Team + ((uint)clientIndex * 0x3980)) == PS3.Extension.ReadInt32(Client_Team + ((uint)otherPlayer * 0x3980)));
}

public static bool ClientIsInGame(int clientIndex)
{
return (PS3.Extension.ReadInt32(Client_IsInGame + ((uint)clientIndex * 0x3980)) != 0);
}

public static bool ClientIsAlive(int clientIndex)
{
return (PS3.Extension.ReadInt32(Client_Alive + ((uint)clientIndex * 0x3980)) == 0);
}

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

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

return angles;
}

public static float[] getVector(float[] point1, float[] point2)
{
return new float[] { (point2[0] - point1[0]), (point2[1] - point1[1]), (point2[2] - point1[2]) };
}

public static float Distance3D(float[] point1, float[] point2)
{
float deltax = point2[0] - point1[0];
float deltay = point2[1] - point1[1];
float deltaz = point2[2] - point1[2];
return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltay * deltay) + (deltaz * deltaz)));
}

public static float Distance2D(float[] point1, float[] point2)
{
float deltax = point2[0] - point1[0];
float deltaz = point2[1] - point1[1];
return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltaz * deltaz)));
}

public static void vec_scale(float[] vec, float scale, out float[] Forward)
{
Forward = new float[] { vec[0] * scale, vec[1] * scale, vec[2] * scale };
}

public static int GetNearestPlayer(Int32 clientIndex, Boolean EnemyOnly = false)
{
int nearestClient = 0;
float nearestDistance = 99999999;
for (int i = 0; i < 12; i++)
{
if (i != clientIndex)
{
if ((ClientIsInGame(i)) && ClientIsAlive(i))
{
if (PS3.Extension.ReadInt32(Client_Team + ((uint)clientIndex * 0x3980)) != 0 && EnemyOnly)
{
if (!ClientIsSameTeam(clientIndex, i))
{
float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
if (Distance < nearestDistance)
{
nearestDistance = Distance;
nearestClient = i;
}
}
}
else
{
float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
if (Distance < nearestDistance)
{
nearestDistance = Distance;
nearestClient = i;
}
}
}
}
}
return nearestClient;
}

public static bool[] AimbotStatus = new bool[12];
public static Thread[] AimbotThread = new Thread[12];

private static float CheckStance(int clientIndex)
{
Int32 CurrentStance = PS3.Extension.ReadByte(Client_Stance + ((uint)clientIndex * 0x3980));
if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
{ return 44f; }
if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
{ return 14f; }
return 0f;
}
private static float CheckStanceAttacker(int clientIndex)
{
Int32 CurrentStance = PS3.Extension.ReadByte(Client_Stance + ((uint)clientIndex * 0x3980));
if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
{ return 46f; }
if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
{ return 18f; }
return 0f;
}

public static void InitializeAimbot(int clientIndex)
{
PS3.ConnectTarget();
while (AimbotStatus[clientIndex])
{
int nearestPlayer = GetNearestPlayer(clientIndex);
if (nearestPlayer != clientIndex)
{
SetClientViewAngles(clientIndex, nearestPlayer);
}
}
}

public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = ReadSingle(Client_Angles + ((uint)clientIndex + 0x3980));
float[] Position = ReadSingle(Client_Origin + ((uint)clientIndex * 0x3980));
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}

public static float[] AnglesToForward(float[] Angles, float Distance = 200f)
{
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance), (cp * sy * Distance), (-sp * Distance) };
return Forward;
}

public static void SetClientViewAngles(int clientIndex, int Victim)
{
float[] Vec = getVector(getPlayerPosition(clientIndex), getPlayerPosition(Victim));
Vec[2] -= CheckStance(Victim);
Vec[2] += CheckStanceAttacker(clientIndex);
float[] Angles = vectoangles(Vec);
setViewAngles((UInt32)clientIndex, Angles);
}

public static uint G_Entity(int Client, uint Mod = 0)
{
return (Adresses.G_Entity + (0x280 * (uint)Client) + (uint)Mod);
}

public static void setViewAngles(UInt32 clientIndex, float[] Angles)
{
WriteSingle(0x10040000, Angles);
RPC.Call(Client_SetClientViewAngles, new object[] { G_Entity((int)clientIndex, 0), 0x10040000 });
}

public static float[] getViewAngles(int clientIndex)
{
return ReadSingle(Client_Angles + ((uint)clientIndex + 0x3980));
}

public static float[] ReadSingle(uint Address)
{
float[] FloatArr = new float[3];
FloatArr[0] = PS3.Extension.ReadFloat(Address);
FloatArr[1] = PS3.Extension.ReadFloat(Address + 0x04);
FloatArr[2] = PS3.Extension.ReadFloat(Address + 0x0Cool Man (aka Tustin);
return FloatArr;
}

public static void WriteSingle(uint Address, float[] FloatArr)
{
PS3.Extension.WriteFloat(Address, FloatArr[0]);
PS3.Extension.WriteFloat(Address + 0x04, FloatArr[1]);
PS3.Extension.WriteFloat(Address + 0x08, FloatArr[2]);
}


//For use on Timer:
    
int nearestPlayer = Aimbot.GetNearestPlayer((int)this.numericUpDownX.Value);
Aimbot.SetClientViewAngles((int)this.numericUpDownX.Value, nearestPlayer);



RPC:

    
class RPC
{
#region RPC
public static uint function_address = Adresses.R_SetFrameFrog;
public static PS3API PS3 = new PS3API();

public static int Init()
{
if (function_address == 0) return -1;
Enable_RPC();
return 0;
}

public static void Enable_RPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 0x4, func);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}

public static int 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)
{
byte[] val = BitConverter.GetBytes((int)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is uint)
{
byte[] val = BitConverter.GetBytes((uint)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is string)
{
byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
PS3.SetMemory(0x10050054 + i * 0x400, str);
uint addr = 0x10050054 + i * 0x400;
byte[] address = BitConverter.GetBytes(addr);
Array.Reverse(address);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
}
else if (parameters[i] is float)
{
num_floats++;
byte[] val = BitConverter.GetBytes((float)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
}
}
byte[] fadd = BitConverter.GetBytes(func_address);
Array.Reverse(fadd);
PS3.SetMemory(0x1005004C, fadd);
System.Threading.Thread.Sleep(20);
byte[] ret = PS3.Extension.ReadBytes(0x10050050, 4);
Array.Reverse(ret);
return BitConverter.ToInt32(ret, 0);
}

public static void ChangeDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static void ChangeCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}

#endregion
}



SetXP kill:

    
public static void SetXP(int value)
{
Cbuf_AddText("set scr_war_score_kill " + value);
Cbuf_AddText("set scr_dom_score_kill " + value);
Cbuf_AddText("set scr_sd_score_kill " + value);
Cbuf_AddText("set scr_dem_score_kill " + value);
Cbuf_AddText("set scr_tdm_score_kill " + value);
Cbuf_AddText("set scr_ctf_score_kill " + value);
Cbuf_AddText("set scr_hd_score_kill " + value);
Cbuf_AddText("set scr_kc_score_kill " + value);
Cbuf_AddText("set scr_sab_score_kill " + value);
Cbuf_AddText("set scr_hq_score_kill " + value);
Cbuf_AddText("set scr_tdef_score_kill " + value);
Cbuf_AddText("set scr_conf_score_kill " + value);
Cbuf_AddText("set scr_oic_score_kill " + value);
Cbuf_AddText("set scr_sas_score_kill " + value);
Cbuf_AddText("set scr_gun_score_kill " + value);
Cbuf_AddText("set scr_shrp_score_kill " + value);
}



SendChatMessage:

    
public static void SendChatMessage(uint Client)
{
string Name = PS3.Read.String(Adresses.Name_InGame + (Client * 0x3980));
iPrintln(-1,"^:" + Name + " says's: " + KeyBoard("Send a Chat Message", "", 50));
}



FPS:

    
public static void FPS(bool True)
{
if (tru)
{
PS3.SetMemory(Adresses.FPS_Enable, new byte[] { 0x2C, 0x03, 0x00, 0x01 });
}
else
{
PS3.SetMemory(Adresses.FPS_Enable, new byte[] { 0x2C, 0x03, 0x00, 0x00 });
}
}

public static void SetFPS(string txt, float Size, float X, float Y)
{
PS3.Extension.WriteString(Adresses.FPS_Text, txt);
PS3.Extension.WriteFloat(Adresses.FPS_Size, Size);
PS3.Extension.WriteFloat(Adresses.FPS_X, X);
PS3.Extension.WriteFloat(Adresses.FPS_Y, Y);
}


For Use:
    

FPS(true); //On
//Or
FPS(false); //Off

SetFPS("Your Text here", 90,100) // Change the valeur Smile



G_AddEvent:

    
public static void G_AddEvent(Int32 Client, int Event, int EventParam = 0)
{
RPC.Call(Adresses.Add_Event, Adresses.G_Entity + (0x280 * Client), Event, EventParam);
}



Set Origin:

    
public static void SetOrigin(int Client, float[] Origin)
{
WriteSingle(G_Client(Client, 0x7Cool Man (aka Tustin), Origin);
}



GetOrigin:

    
public static float[] GetOrigin(int Client)
{
float[] Position = ReadSingle((uint)Adresses.Origin + ((uint)Client * 0x3980), 3);
return Position;
}



PlayerAnglesToForward:

    
public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = ReadSingle(G_Client(clientIndex, 0x1B0), 3);
float[] Position = ReadSingle(G_Client(clientIndex, 0x7Cool Man (aka Tustin), 3);
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}






Credits:
- Me & AlexS for some functions.
- LBK.
- RGaming.
- Shark.
- SC58.
- oStankyModz.
- Sticky.
- and the others.

Last edited by gsrclans ; 07-22-2015 at 07:32 PM.

The following 3 users say thank you to gsrclans for this useful post:

Antonio96C, EM|T AlexS, xbold
07-21-2015, 11:50 PM #2
LBK
Little One
Just 4 script d'ont in my thead .. ^^ why not release just 4 script in my thread ? is not very utils ^^
And your script not by you ^^ is just update by you ^^

Credits : SHARK SC58 , OStanKyModz , Stycky , etc etc ^^
07-22-2015, 12:41 AM #3
hey! With the give weapon script is possible to buy a Single Weapon Now? Instead of Getting weapons on Prestige Masters
Example: Can i buy a Bal Inferno now or a Speakeasy instead of buying Prestiges?
08-06-2015, 02:32 PM #4
Originally posted by gsrclans View Post
Hi guys, today I will release some scripts you can add to your tool.
The topic brings a maximum scripts.
If you need help ask me.


All Scripts:



Spawn Entity:

    
public static uint spawnEntity(string ModelName, float[] Origin, float[] Angles)
{
uint Entity = (uint)Call(Adresses.G_Spawn);
WriteSingle(Entity + 0x138, Origin);
WriteSingle(Entity + 0x148, Angles);
RPC.Call(Adresses.G_SetModel, Entity, ModelName);
RPC.Call(Adresses.ScriptModels, Entity);
return Entity;
}



Spawn Turret:

    
public static uint SpawnTurret(string turrettype, string ModelName, float[] Origin, float[] Angles)
{
uint Entity = (uint)Call(Adresses.G_Spawn);
WriteSingle(Entity + 0x138, Origin);
WriteSingle(Entity + 0x148, Angles);
RPC.Call(Adresses.G_SetModel, Entity, ModelName);
RPC.Call(Adresses.G_SpawnTurret, Entity);
return Entity;
}



G_GivePlayerWeapon:

    
public static void G_GivePlayerWeapon(int client, int Weapon, int ammo)
{
RPC.Call(Adresses.G_GivePlayerWeapon, Adresses.G_Client + 0x3980 * (uint)client, Weapon, 0);
RPC.Call(Adresses.AddAmmo, Adresses.G_Client + (client * 0x3980), Weapon, 0, ammo, 1);
}



SetModels:

    
public static void SetModels(int client, string Models)
{
RPC.Call(Adresses.G_SetModel, Adresses.G_Entity + 0x280 * (uint)client, Models);
}



Clone Player:

    
public static void ClonePlayer(int Client)
{
RPC.Call(Adresses.ClonePlayer, new object[] { Client });
}



Set Vision:

    
public static void SetVision(int Client, string Vision)
{
SV_GameSendServerCommand(Client, "J \"" + Vision + "\" ");
}



Set Blur:

    
public static void SetBlur(int Client, Int32 TransitionTime)
{
SV_GameSendServerCommand(Client, "i _ \"" + TransitionTime + " ");
}



Spining Mods:

    
public static void setViewAngles(int Client, float[] Angles)
{
WriteSingle(0x10040000, Angles);
RPC.Call(Adresses.SetClientViewAngles, Adresses.G_Entity + 0x280 * (uint)Client, 0x10040000);
}

public static float[] getViewAngles(int Client)
{
return ReadSingle(Adresses.Angles + 0x3980 * (uint)Client, 3);
}


For use (On Timer):
    
Single[] Angles = getViewAngles((int)this.numericUpDownX.Value);
Angles[1] += 15;
setViewAngles((int)this.numericUpDownX.Value, Angles);
System.Threading.Thread.Sleep(100);



JetPack:

    
public void JetPack(int client)
{
float jH = PS3.Extension.ReadFloat(Adresses.G_Client + 0x8C + ((uint)client * 0x3980));
jH += 100;
PS3.Extension.WriteFloat(Adresses.G_Client + 0x8C + ((uint)client * 0x3980), jH);
}


For use ( On Timer ):
    
if (ButtonPressed(Client, Buttonz.Cross))
{
JetPack(Client);
}



Button Monitoring:

    
public static class Buttonz
{
public static Int32
Cross = 67108864,
Crouch = 33554432,
Prone = 16777216,
Start = 128,
L1 = 134217736,
L2 = -2147483648,
L1andR1 = L1 + R1,
L3 = 537001984,
R1 = 65536,
R2 = 1073741824,
R3 = 263168,
Square = 3145728;
}

public static bool ButtonPressed(int client, int Buttons)
{
if (PS3.Extension.ReadInt32(G_Client(client, 0x35B6)) == Buttons)
return true;
else return false;
}



Key_IsDown:

    
public enum Key : uint
{
Cross = 0,
Circle = 1,
Square = 2,
Triangle = 3,
L1 = 4,
R1 = 5,
Start = 13,
Select = 14,
L3 = 15,
R3 = 16,
DPAD_UP = 19,
DPAD_DOWN = 20,
DPAD_LEFT = 21,
DPAD_RIGHT = 22,
}

public static Boolean LocalKeyIsDown(Key k)
{
return PS3.Extension.ReadBool((Offsets.KeyIsDown + 0x0F) + ((UInt32)k * 0xC));
}



G_Client:

    
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (Adresses.G_Client + Mod) + ((uint)clientIndex * 0x3980);
}



G_Entity:

    
public static uint G_Entity(int Client, uint Mod = 0)
{
return (Adresses.G_Entity + (0x280 * (uint)Client) + (uint)Mod);
}



FastRestart:

    
public static void FastRestart()
{
RPC.Call(Adresses.SV_FastRestart_f);
}



Unlock Trophies:

    
public static void Unlock_Trophies()
{
string[] Achievements = new string[90];
Achievements[0] = "4 CARMA";
Achievements[1] = "4 CAMPAIGN_COMPLETE";
Achievements[2] = "4 CAMPAIGN_HARDENED";
Achievements[3] = "4 CAMPAIGN_VETERAN";
Achievements[4] = "4 BOOST_DASH_STOMP";
Achievements[5] = "4 GRENADE_DODGE";
Achievements[6] = "4 SONIC_KILL";
Achievements[7] = "4 OVERDRIVE_KILL";
Achievements[8] = "4 SMART_GRENADE_KILL";
Achievements[9] = "4 THREAT_GRENADE_KILL";
Achievements[10] = "4 EMP_DRONE";
Achievements[11] = "4 EMP_AST";
Achievements[12] = "4 INTEL_HALF";
Achievements[13] = "4 INTEL_ALL";
Achievements[14] = "4 COVER_DRONE_KILL";
Achievements[15] = "4 EXO_UPGRADE";
Achievements[16] = "4 EXO_UPGRADE_10";
Achievements[17] = "4 EXO_UPGRADE_20";
Achievements[18] = "4 EXO_UPGRADE_FULL";
Achievements[19] = "4 LEVEL_1";
Achievements[20] = "4 LEVEL_1A";
Achievements[21] = "4 LEVEL_2A";
Achievements[22] = "4 LEVEL_2B";
Achievements[23] = "4 LEVEL_2";
Achievements[24] = "4 LEVEL_3A";
Achievements[25] = "4 LEVEL_3";
Achievements[26] = "4 LEVEL_4A";
Achievements[27] = "4 LEVEL_4";
Achievements[28] = "4 LEVEL_5";
Achievements[29] = "4 LEVEL_5A";
Achievements[30] = "4 LEVEL_6A";
Achievements[31] = "4 LEVEL_6";
Achievements[32] = "4 LEVEL_7";
Achievements[33] = "4 LEVEL_8A";
Achievements[34] = "4 LEVEL_8";
Achievements[35] = "4 LEVEL_9";
Achievements[36] = "4 LEVEL_10A";
Achievements[37] = "4 LEVEL_10";
Achievements[38] = "4 LEVEL_11";
Achievements[39] = "4 LEVEL_12A";
Achievements[40] = "4 LEVEL_12";
Achievements[41] = "4 LEVEL_13A";
Achievements[42] = "4 LEVEL_13";
Achievements[43] = "4 LEVEL_14A";
Achievements[44] = "4 LEVEL_14";
Achievements[45] = "4 COOP_VETERAN";
Achievements[46] = "4 COOP_WARFARE";
Achievements[47] = "4 COOP_UNDEAD_SURVIVOR";
Achievements[48] = "4 COOP_EXO_SURVIVOR";
Achievements[49] = "4 COOP_FLIP_FLOP";
Achievements[50] = "4 DLC1_ZOMBIE_ROUND10";
Achievements[51] = "4 DLC1_ZOMBIE_ROUND30";
Achievements[52] = "4 DLC1_ZOMBIE_2020";
Achievements[53] = "4 DLC1_ZOMBIE_MONEYBAGS";
Achievements[54] = "4 DLC1_ZOMBIE_CHEAPSKATE";
Achievements[55] = "4 DLC1_ZOMBIE_BURGLE";
Achievements[56] = "4 DLC1_ZOMBIE_GAMEOVERMAN";
Achievements[57] = "4 DLC1_ZOMBIE_COMEONANDSLAM";
Achievements[58] = "4 DLC1_ZOMBIE_PCLOADLETTER";
Achievements[59] = "4 DLC1_ZOMBIE_DOYOUEVENEXO";
Achievements[60] = "4 DLC2_ZOMBIE_ROUND10";
Achievements[61] = "4 DLC2_ZOMBIE_ROUND25";
Achievements[62] = "4 DLC2_ZOMBIE_ONEMANSPOISON";
Achievements[63] = "4 DLC2_ZOMBIE_INDIRECTFIRE";
Achievements[64] = "4 DLC2_ZOMBIE_RESCUE1";
Achievements[65] = "4 DLC2_ZOMBIE_RESCUE4";
Achievements[66] = "4 DLC2_ZOMBIE_RESCUE20";
Achievements[67] = "4 DLC2_ZOMBIE_LOVETAP";
Achievements[68] = "4 DLC2_ZOMBIE_POPCORN";
Achievements[69] = "4 DLC2_ZOMBIE_MEATISMURDER";
Achievements[70] = "4 DLC3_ZOMBIE_ROUND10";
Achievements[71] = "4 DLC3_ZOMBIE_ROUND30";
Achievements[72] = "4 DLC3_ZOMBIE_EASTEREGG";
Achievements[73] = "4 DLC3_ZOMBIE_PLINKO";
Achievements[74] = "4 DLC3_ZOMBIE_DEFUSEBOMBS";
Achievements[75] = "4 DLC3_ZOMBIE_ZOMBONI";
Achievements[76] = "4 DLC3_ZOMBIE_TELEFRAG";
Achievements[77] = "4 DLC3_ZOMBIE_LIMBO";
Achievements[78] = "4 DLC3_ZOMBIE_OVERCHARGE";
Achievements[79] = "4 DLC3_ZOMBIE_JUMPTHESHARK";
Achievements[80] = "4 DLC4_ZOMBIE_DEFEATBOSS1";
Achievements[81] = "4 DLC4_ZOMBIE_DEFEATBOSS2";
Achievements[82] = "4 DLC4_ZOMBIE_EASTEREG";
Achievements[83] = "4 DLC4_ZOMBIE_DEFEATBOSS3";
Achievements[84] = "4 DLC4_ZOMBIE_BIGGAME";
Achievements[85] = "4 DLC4_ZOMBIE_COAST2COAST";
Achievements[86] = "4 DLC4_ZOMBIE_GOTOSLEEP";
Achievements[87] = "4 DLC4_ZOMBIE_REALSTEEL";
Achievements[88] = "4 DLC4_ZOMBIE_NODOORS";
Achievements[89] = "4 DLC4_ZOMBIE_TRICKSHOT";

for (int i = 0; i < 90; i++)
{
RPC.Call(Adresses.SV_GameSendServerCommand, -1, 1, Achievements[i]);
Thread.Sleep(25);
RPC.Call(Adresses.SV_GameSendServerCommand, -1, 1, Achievements[i]);
}
}



SetTrophy:

    
public static void SetTrophy(Int32 Client, String Trophy)
{
RPC.Call(Adresses.SV_GameSendServerCommand, Client, 1, "4 " + Trophy);
}



Advanced NoClip:

    
public static void WriteSingle1(uint address, float input)
{
byte[] array = new byte[4];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 4);
PS3.SetMemory(address, array);
}

public static void AdvancedNoclip(int Client)
{
SetVelocity(Client, new float[] { ReturnVelocity(Client)[0], ReturnVelocity(Client)[1], 42.5f });

if (ButtonPressed(Client, Buttonz.L3))
{
SetOrigin(Client, PlayerAnglesToForward(Client, 85));
}
}

public static void SetVelocity(Int32 clientIndex, Single[] Velocity)
{
WriteSingle1(G_Client(clientIndex, 0x34), 3);
}

public static float[] ReturnVelocity(int Client)
{
return ReadSingle(G_Client(Client, Adresses.ClientVelocity), 3);
}


For use ( On Timer ):
     
AdvancedNoclip(Client);



Kick Player:

    
public static void KickPlayer(int Client, string Message)
{
SV_GameSendServerCommand(Client, "r \"" + Message + "\"");
}



Cbuf_AddText:

    
public static void Cbuf_AddText(string command)
{
RPC.Call(Adresses.Cbuf_AddText, new object[] { 0, command });
}



SV_GameSendServerCommand:

    
public static void SV_GameSendServerCommand(int client, string command)
{
RPC.Call(Adresses.SV_GameSendServerCommand, client, 0, command + "\"");
}



iPrintln & iPrintlnBold:

    
public static void iPrintlnBold(int client, string text)
{
SV_GameSendServerCommand(client, "c \"" + text + "\"");
}


public static void iPrintln(int client, string text)
{
SV_GameSendServerCommand(client, "e \"" + text + "\"");
}



ForgeMods:

    
public static UInt32
G_Client = Adresses.G_Client,
G_ClientSize = 0x3980,
Client_mFlag = G_Client + 0x3da7,
Client_Angles = G_Client + 0x1B0,
Client_Origin = G_Client + 0x78;

public static float[] distances = new float[18];
public static PS3API PS3 = new PS3API();

public static void ChangeCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}

public static void ChangeDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static void ForgeMode(uint Client, uint Target, uint Distance_in_Meters = 6)
{
float[] Angles = ReadFloatLength(Client_Angles + (Client * G_ClientSize), 2);
float[] Origin = ReadFloatLength(Client_Origin + (Client * G_ClientSize), 3);

float diff = Distance_in_Meters * 40;

float num = ((float)Math.Sin((Angles[0] * Math.PI) / 180)) * diff;
float num1 = (float)Math.Sqrt(((diff * diff) - (num * num)));
float num2 = ((float)Math.Sin((Angles[1] * Math.PI) / 180)) * num1;
float num3 = ((float)Math.Cos((Angles[1] * Math.PI) / 180)) * num1;
float[] forward = new float[] { Origin[0] + num3, Origin[1] + num2, Origin[2] - num };

Freeze(Target, true);
WriteFloatArray(Client_Origin + (Target * G_ClientSize), forward);
}

public static uint FindClosestEnemy(uint Attacker)
{
for (uint i = 0; i < 18; i++)
{
if (IsClientAlive(i))
{
float[] O1 = ReadFloatLength(Client_Origin + (Attacker * G_ClientSize), 3);
float[] O2 = ReadFloatLength(Client_Origin + (i * G_ClientSize), 3);
distances[i] = (float)(Math.Sqrt(((O2[0] - O1[0]) * (O2[0] - O1[0])) + ((O2[1] - O1[1]) * (O2[1] - O1[1])) + ((O2[2] - O1[2]) * (O2[2] - O1[2]))));

}
else
{
distances[i] = float.MaxValue;
}
}

float[] newDistances = new float[18];
Array.Copy(distances, newDistances, distances.Length);

Array.Sort(newDistances);
for (uint i = 0; i < 18; i++)
{
if (distances[i] == newDistances[1])
{
return i;
}
}
int Failed = -1;
return (uint)Failed;
}

public static void WriteFloatArray(uint Offset, float[] Array)
{
byte[] buffer = new byte[Array.Length * 4];
for (int Lenght = 0; Lenght < Array.Length; Lenght++)
{
ReverseBytes(BitConverter.GetBytes(Array[Lenght])).CopyTo(buffer, Lenght * 4);
}
PS3.SetMemory(Offset, buffer);
}

public static float[] ReadFloatLength(uint Offset, int Length)
{
byte[] buffer = new byte[Length * 4];
PS3.GetMemory(Offset, buffer);
ReverseBytes(buffer);
float[] Array = new float[Length];
for (int i = 0; i < Length; i++)
{
Array[i] = BitConverter.ToSingle(buffer, (Length - 1 - i) * 4);
}
return Array;
}

public static void Freeze(uint Client, bool State)
{
if (State == true)
PS3.Extension.WriteByte(Client_mFlag + (Client * G_ClientSize), 0x05);
else
PS3.Extension.WriteByte(Client_mFlag + (Client * G_ClientSize), 0x00);
}

private static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}

public static bool IsClientAlive(uint Client)
{
byte Alive = PS3.Extension.ReadByte(Adresses.G_Entity + (Client * 0x280) + 0x1AF);
if (Alive != 0)
return true;
else
return false;

}


//For Use: ( Call monitorForgemods((int)this.numericUpDownX.Value) on timer )
     
public static void monitorForgemods(int client)
{
if (ButtonPressed(client, Buttonz.L1))
{
uint Enemy = ForgeMods.FindClosestEnemy((uint)client);
if (ButtonPressed(client, Buttonz.L1))
{
ForgeMods.Freeze(Enemy, true);
ForgeMods.ForgeMode((uint)client, Enemy);
}
else
{
ForgeMods.Freeze(Enemy, false);
}
}
}



Aimbot:

    
public static uint G_Client = Adresses.G_Client;
public static uint Client_Stance = G_Client + 0x5B;
public static uint Client_Alive = G_Client + 0x33A; //0x08 = dead 0x00 = alive
public static uint Client_Team = G_Client + 0x5B;
public static uint Client_SetClientViewAngles = Adresses.SetClientViewAngles;
public static uint Client_IsInGame = G_Client + 0x00;
public static uint Client_Angles = G_Client + 0x1b4;
public static uint Client_Origin = G_Client + 0x78;
public static uint ClientInterval = 0x3980;

public static float[] getPlayerPosition(int clientIndex)
{
return ReadSingle(Client_Origin + (0x3980 * (uint)clientIndex));
}

public static void ChangeCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}

public static void ChangeDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static bool ClientIsSameTeam(int clientIndex, int otherPlayer)
{
return (PS3.Extension.ReadInt32(Client_Team + ((uint)clientIndex * 0x3980)) == PS3.Extension.ReadInt32(Client_Team + ((uint)otherPlayer * 0x3980)));
}

public static bool ClientIsInGame(int clientIndex)
{
return (PS3.Extension.ReadInt32(Client_IsInGame + ((uint)clientIndex * 0x3980)) != 0);
}

public static bool ClientIsAlive(int clientIndex)
{
return (PS3.Extension.ReadInt32(Client_Alive + ((uint)clientIndex * 0x3980)) == 0);
}

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

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

return angles;
}

public static float[] getVector(float[] point1, float[] point2)
{
return new float[] { (point2[0] - point1[0]), (point2[1] - point1[1]), (point2[2] - point1[2]) };
}

public static float Distance3D(float[] point1, float[] point2)
{
float deltax = point2[0] - point1[0];
float deltay = point2[1] - point1[1];
float deltaz = point2[2] - point1[2];
return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltay * deltay) + (deltaz * deltaz)));
}

public static float Distance2D(float[] point1, float[] point2)
{
float deltax = point2[0] - point1[0];
float deltaz = point2[1] - point1[1];
return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltaz * deltaz)));
}

public static void vec_scale(float[] vec, float scale, out float[] Forward)
{
Forward = new float[] { vec[0] * scale, vec[1] * scale, vec[2] * scale };
}

public static int GetNearestPlayer(Int32 clientIndex, Boolean EnemyOnly = false)
{
int nearestClient = 0;
float nearestDistance = 99999999;
for (int i = 0; i < 12; i++)
{
if (i != clientIndex)
{
if ((ClientIsInGame(i)) && ClientIsAlive(i))
{
if (PS3.Extension.ReadInt32(Client_Team + ((uint)clientIndex * 0x3980)) != 0 && EnemyOnly)
{
if (!ClientIsSameTeam(clientIndex, i))
{
float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
if (Distance < nearestDistance)
{
nearestDistance = Distance;
nearestClient = i;
}
}
}
else
{
float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
if (Distance < nearestDistance)
{
nearestDistance = Distance;
nearestClient = i;
}
}
}
}
}
return nearestClient;
}

public static bool[] AimbotStatus = new bool[12];
public static Thread[] AimbotThread = new Thread[12];

private static float CheckStance(int clientIndex)
{
Int32 CurrentStance = PS3.Extension.ReadByte(Client_Stance + ((uint)clientIndex * 0x3980));
if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
{ return 44f; }
if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
{ return 14f; }
return 0f;
}
private static float CheckStanceAttacker(int clientIndex)
{
Int32 CurrentStance = PS3.Extension.ReadByte(Client_Stance + ((uint)clientIndex * 0x3980));
if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
{ return 46f; }
if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
{ return 18f; }
return 0f;
}

public static void InitializeAimbot(int clientIndex)
{
PS3.ConnectTarget();
while (AimbotStatus[clientIndex])
{
int nearestPlayer = GetNearestPlayer(clientIndex);
if (nearestPlayer != clientIndex)
{
SetClientViewAngles(clientIndex, nearestPlayer);
}
}
}

public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = ReadSingle(Client_Angles + ((uint)clientIndex + 0x3980));
float[] Position = ReadSingle(Client_Origin + ((uint)clientIndex * 0x3980));
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}

public static float[] AnglesToForward(float[] Angles, float Distance = 200f)
{
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance), (cp * sy * Distance), (-sp * Distance) };
return Forward;
}

public static void SetClientViewAngles(int clientIndex, int Victim)
{
float[] Vec = getVector(getPlayerPosition(clientIndex), getPlayerPosition(Victim));
Vec[2] -= CheckStance(Victim);
Vec[2] += CheckStanceAttacker(clientIndex);
float[] Angles = vectoangles(Vec);
setViewAngles((UInt32)clientIndex, Angles);
}

public static uint G_Entity(int Client, uint Mod = 0)
{
return (Adresses.G_Entity + (0x280 * (uint)Client) + (uint)Mod);
}

public static void setViewAngles(UInt32 clientIndex, float[] Angles)
{
WriteSingle(0x10040000, Angles);
RPC.Call(Client_SetClientViewAngles, new object[] { G_Entity((int)clientIndex, 0), 0x10040000 });
}

public static float[] getViewAngles(int clientIndex)
{
return ReadSingle(Client_Angles + ((uint)clientIndex + 0x3980));
}

public static float[] ReadSingle(uint Address)
{
float[] FloatArr = new float[3];
FloatArr[0] = PS3.Extension.ReadFloat(Address);
FloatArr[1] = PS3.Extension.ReadFloat(Address + 0x04);
FloatArr[2] = PS3.Extension.ReadFloat(Address + 0x0Cool Man (aka Tustin);
return FloatArr;
}

public static void WriteSingle(uint Address, float[] FloatArr)
{
PS3.Extension.WriteFloat(Address, FloatArr[0]);
PS3.Extension.WriteFloat(Address + 0x04, FloatArr[1]);
PS3.Extension.WriteFloat(Address + 0x08, FloatArr[2]);
}


//For use on Timer:
    
int nearestPlayer = Aimbot.GetNearestPlayer((int)this.numericUpDownX.Value);
Aimbot.SetClientViewAngles((int)this.numericUpDownX.Value, nearestPlayer);



RPC:

    
class RPC
{
#region RPC
public static uint function_address = Adresses.R_SetFrameFrog;
public static PS3API PS3 = new PS3API();

public static int Init()
{
if (function_address == 0) return -1;
Enable_RPC();
return 0;
}

public static void Enable_RPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 0x4, func);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}

public static int 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)
{
byte[] val = BitConverter.GetBytes((int)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is uint)
{
byte[] val = BitConverter.GetBytes((uint)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is string)
{
byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
PS3.SetMemory(0x10050054 + i * 0x400, str);
uint addr = 0x10050054 + i * 0x400;
byte[] address = BitConverter.GetBytes(addr);
Array.Reverse(address);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
}
else if (parameters[i] is float)
{
num_floats++;
byte[] val = BitConverter.GetBytes((float)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
}
}
byte[] fadd = BitConverter.GetBytes(func_address);
Array.Reverse(fadd);
PS3.SetMemory(0x1005004C, fadd);
System.Threading.Thread.Sleep(20);
byte[] ret = PS3.Extension.ReadBytes(0x10050050, 4);
Array.Reverse(ret);
return BitConverter.ToInt32(ret, 0);
}

public static void ChangeDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static void ChangeCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}

#endregion
}



SetXP kill:

    
public static void SetXP(int value)
{
Cbuf_AddText("set scr_war_score_kill " + value);
Cbuf_AddText("set scr_dom_score_kill " + value);
Cbuf_AddText("set scr_sd_score_kill " + value);
Cbuf_AddText("set scr_dem_score_kill " + value);
Cbuf_AddText("set scr_tdm_score_kill " + value);
Cbuf_AddText("set scr_ctf_score_kill " + value);
Cbuf_AddText("set scr_hd_score_kill " + value);
Cbuf_AddText("set scr_kc_score_kill " + value);
Cbuf_AddText("set scr_sab_score_kill " + value);
Cbuf_AddText("set scr_hq_score_kill " + value);
Cbuf_AddText("set scr_tdef_score_kill " + value);
Cbuf_AddText("set scr_conf_score_kill " + value);
Cbuf_AddText("set scr_oic_score_kill " + value);
Cbuf_AddText("set scr_sas_score_kill " + value);
Cbuf_AddText("set scr_gun_score_kill " + value);
Cbuf_AddText("set scr_shrp_score_kill " + value);
}



SendChatMessage:

    
public static void SendChatMessage(uint Client)
{
string Name = PS3.Read.String(Adresses.Name_InGame + (Client * 0x3980));
iPrintln(-1,"^:" + Name + " says's: " + KeyBoard("Send a Chat Message", "", 50));
}



FPS:

    
public static void FPS(bool True)
{
if (tru)
{
PS3.SetMemory(Adresses.FPS_Enable, new byte[] { 0x2C, 0x03, 0x00, 0x01 });
}
else
{
PS3.SetMemory(Adresses.FPS_Enable, new byte[] { 0x2C, 0x03, 0x00, 0x00 });
}
}

public static void SetFPS(string txt, float Size, float X, float Y)
{
PS3.Extension.WriteString(Adresses.FPS_Text, txt);
PS3.Extension.WriteFloat(Adresses.FPS_Size, Size);
PS3.Extension.WriteFloat(Adresses.FPS_X, X);
PS3.Extension.WriteFloat(Adresses.FPS_Y, Y);
}


For Use:
    

FPS(true); //On
//Or
FPS(false); //Off

SetFPS("Your Text here", 90,100) // Change the valeur Smile



G_AddEvent:

    
public static void G_AddEvent(Int32 Client, int Event, int EventParam = 0)
{
RPC.Call(Adresses.Add_Event, Adresses.G_Entity + (0x280 * Client), Event, EventParam);
}



Set Origin:

    
public static void SetOrigin(int Client, float[] Origin)
{
WriteSingle(G_Client(Client, 0x7Cool Man (aka Tustin), Origin);
}



GetOrigin:

    
public static float[] GetOrigin(int Client)
{
float[] Position = ReadSingle((uint)Adresses.Origin + ((uint)Client * 0x3980), 3);
return Position;
}



PlayerAnglesToForward:

    
public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = ReadSingle(G_Client(clientIndex, 0x1B0), 3);
float[] Position = ReadSingle(G_Client(clientIndex, 0x7Cool Man (aka Tustin), 3);
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}






Credits:
- Me & AlexS for some functions.
- LBK.
- RGaming.
- Shark.
- SC58.
- oStankyModz.
- Sticky.
- and the others.



RPC pls
08-07-2015, 01:10 PM #5
xbold
Haxor!
Originally posted by VadRe View Post
RPC pls


Sorry i dont remember credit but thanks LBK ^^

      public static class RPC
{
public static PS3API PS3 = new PS3API();
private static UInt32 function_address = 0x6271B0;
public static bool InUse = false;
public static void ChangeapiDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static void ChangeapiCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}
public static int Init()
{
if (function_address == 0) return -1;
Enable_RPC();
return 0;
}

public static void Enable_RPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 0x4, func);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}
public static void SV_GameSendServerCommand(int client, string command)
{
RPC.Call(Offsets.Sv_GameSendServerCommand, client, 0, command + "\"");
}

public static void iPrintlnBold(int client, string text)
{
SV_GameSendServerCommand(client, "c \"" + text + "\"");
}

public static void iPrintln(int client, string text)
{
SV_GameSendServerCommand(client, "e \"" + text + "\"");
}

public static void Cbuf_AddText(int client, string text)
{
RPC.Call(0x3AEA6C, client, text);
}
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (AW.Offsets.G_Client + Mod) + ((uint)clientIndex * 0x3980);
}
public static int Call(uint func_address, params object[] parameters)
{
InUse = true;
int num_params = parameters.Length;
uint num_floats = 0;
for (uint i = 0; i < num_params; i++)
{
if (parameters[i] is int)
{
byte[] val = BitConverter.GetBytes((int)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x629ED0 + (i + num_floats) * 4, val);
}
else if (parameters[i] is uint)
{
byte[] val = BitConverter.GetBytes((uint)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is string)
{
byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
PS3.SetMemory(0x10050054 + i * 0x400, str);
uint addr = 0x10050054 + i * 0x400;
byte[] address = BitConverter.GetBytes(addr);
Array.Reverse(address);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
}
else if (parameters[i] is float)
{
num_floats++;
byte[] val = BitConverter.GetBytes((float)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
}
}
byte[] fadd = BitConverter.GetBytes(func_address);
Array.Reverse(fadd);
PS3.SetMemory(0x1005004C, fadd);
System.Threading.Thread.Sleep(20);
byte[] ret = PS3.GetBytes(0x10050050, 4);
Array.Reverse(ret);
InUse = false;
return BitConverter.ToInt32(ret, 0);
}
}
08-07-2015, 08:55 PM #6
LBK
Little One
Originally posted by xbold View Post
Sorry i dont remember credit but thanks LBK ^^

      public static class RPC
{
public static PS3API PS3 = new PS3API();
private static UInt32 function_address = 0x6271B0;
public static bool InUse = false;
public static void ChangeapiDEX()
{
PS3.ChangeAPI(SelectAPI.TargetManager);
}

public static void ChangeapiCEX()
{
PS3.ChangeAPI(SelectAPI.ControlConsole);
}
public static int Init()
{
if (function_address == 0) return -1;
Enable_RPC();
return 0;
}

public static void Enable_RPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 0x4, func);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}
public static void SV_GameSendServerCommand(int client, string command)
{
RPC.Call(Offsets.Sv_GameSendServerCommand, client, 0, command + "\"");
}

public static void iPrintlnBold(int client, string text)
{
SV_GameSendServerCommand(client, "c \"" + text + "\"");
}

public static void iPrintln(int client, string text)
{
SV_GameSendServerCommand(client, "e \"" + text + "\"");
}

public static void Cbuf_AddText(int client, string text)
{
RPC.Call(0x3AEA6C, client, text);
}
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (AW.Offsets.G_Client + Mod) + ((uint)clientIndex * 0x3980);
}
public static int Call(uint func_address, params object[] parameters)
{
InUse = true;
int num_params = parameters.Length;
uint num_floats = 0;
for (uint i = 0; i < num_params; i++)
{
if (parameters[i] is int)
{
byte[] val = BitConverter.GetBytes((int)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x629ED0 + (i + num_floats) * 4, val);
}
else if (parameters[i] is uint)
{
byte[] val = BitConverter.GetBytes((uint)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is string)
{
byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
PS3.SetMemory(0x10050054 + i * 0x400, str);
uint addr = 0x10050054 + i * 0x400;
byte[] address = BitConverter.GetBytes(addr);
Array.Reverse(address);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
}
else if (parameters[i] is float)
{
num_floats++;
byte[] val = BitConverter.GetBytes((float)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
}
}
byte[] fadd = BitConverter.GetBytes(func_address);
Array.Reverse(fadd);
PS3.SetMemory(0x1005004C, fadd);
System.Threading.Thread.Sleep(20);
byte[] ret = PS3.GetBytes(0x10050050, 4);
Array.Reverse(ret);
InUse = false;
return BitConverter.ToInt32(ret, 0);
}
}


Thx choco for original rpc And Thx to sc58 And shark for fixed it for aw Winky Winky

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo