Post: Need help bo2 rpc c#
04-04-2015, 10:14 PM #1
Binerz
Banned
(adsbygoogle = window.adsbygoogle || []).push({}); Yop

The code of my rpc :

    public class RPC 
{
private static uint function_address;

public static int Call(uint func_address, params object[] parameters)
{
int length = parameters.Length;
int index = 0;
uint num3 = 0;
uint num4 = 0;
uint num5 = 0;
uint num6 = 0;
while (index < length)
{
if (parameters[index] is int)
{
PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
num3++;
}
else if (parameters[index] is uint)
{
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (uint)parameters[index]);
num3++;
}
else
{
uint num7;
if (parameters[index] is string)
{
num7 = 0x10022000 + (num4 * 0x400);
PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
num3++;
num4++;
}
else if (parameters[index] is float)
{
PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
num5++;
}
else if (parameters[index] is float[])
{
float[] input = (float[])parameters[index];
num7 = 0x10021000 + (num6 * 4);
Lib.WriteSingle(num7, input);
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
num3++;
num6 += (uint)input.Length;
}
}
index++;
}
PS3.Extension.WriteUInt32(0x1002004C, func_address);
Thread.Sleep(20);
return PS3.Extension.ReadInt32(0x10020050);
}

public static void Enable()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
Thread.Sleep(20);
byte[] memory = new byte[]
{ 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 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, 0x02, 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 + 4, memory);
PS3.SetMemory(0x10020000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}

public static int Init()
{
function_address = 0x007AA050;
Enable();
return 0;
}

public static void Cbuf_AddText(int client, string text)
{
RPC.Call(0x313E88, client, text);
}
public static void iPrintln(int Client, string Text)
{
SV_GameSendServerCommand(Client, "O \"" + Text + "\"");
}

public static void iPrintlnBold(int Client, string Text)
{
SV_GameSendServerCommand(Client, "< \"" + Text + "\"");
}
public static void CBuf_Addtext(string Command)
{
RPC.Call(00315938, 0, Command);
}

public static void SV_GameSendServerCommand(int Client, string Command)
{
RPC.Call(0x34A1DC, Client, 1, Command);
}


The code of my Lib.cs

Originally posted by another user
    namespace BO2_Menu_Base
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class Lib
{
public static void And_Int32(UInt32 address, int input)
{
int num = ReadInt32(address) & input;
WriteInt32(address, num);
}

public static bool CompareByteArray(byte[] a, byte[] b)
{
int num = 0;
for (int i = 0; i < a.Length; i++)
{
if (a[i] == b[i])
{
num++;
}
}
return (num == a.Length);
}

public static void Or_Int32(UInt32 address, int input)
{
int num = ReadInt32(address) | input;
WriteInt32(address, num);
}

public static bool ReadBool(UInt32 address)
{
return (PS3.GetMemory(address, 1)[0] != 0);
}

public static byte ReadByte(UInt32 address)
{
return PS3.GetMemory(address, 1)[0];
}

public static byte[] ReadBytes(UInt32 address, int length)
{
return PS3.GetMemory(address, length);
}

public static double ReadDouble(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, Cool Man (aka Tustin);
Array.Reverse(memory, 0, Cool Man (aka Tustin);
return BitConverter.ToDouble(memory, 0);
}

public static double[] ReadDouble(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * Cool Man (aka Tustin);
ReverseBytes(memory);
double[] numArray = new double[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * Cool Man (aka Tustin);
}
return numArray;
}

public static short ReadInt16(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, 2);
Array.Reverse(memory, 0, 2);
return BitConverter.ToInt16(memory, 0);
}

public static short[] ReadInt16(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 2);
ReverseBytes(memory);
short[] numArray = new short[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToInt16(memory, ((length - 1) - i) * 2);
}
return numArray;
}

public static int ReadInt32(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToInt32(memory, 0);
}

public static int[] ReadInt32(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
int[] numArray = new int[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToInt32(memory, ((length - 1) - i) * 4);
}
return numArray;
}

public static long ReadInt64(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, Cool Man (aka Tustin);
Array.Reverse(memory, 0, Cool Man (aka Tustin);
return BitConverter.ToInt64(memory, 0);
}

public static long[] ReadInt64(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * Cool Man (aka Tustin);
ReverseBytes(memory);
long[] numArray = new long[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToInt64(memory, ((length - 1) - i) * Cool Man (aka Tustin);
}
return numArray;
}

public static sbyte ReadSByte(UInt32 address)
{
return (sbyte) PS3.GetMemory(address, 1)[0];
}

public static sbyte[] ReadSBytes(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length);
sbyte[] numArray = new sbyte[length];
for (int i = 0; i < length; i++)
{
numArray[i] = (sbyte) memory[i];
}
return numArray;
}

public static float ReadSingle(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToSingle(memory, 0);
}

public static float[] ReadSingle(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
float[] numArray = new float[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * 4);
}
return numArray;
}

public static string ReadString(UInt32 address)
{
int length = 40;
int num2 = 0;
string source = "";
do
{
byte[] memory = PS3.GetMemory(address + ((UInt32) num2), length);
source = source + Encoding.UTF8.GetString(memory);
num2 += length;
}
while (!source.Contains<char>('\0'Winky Winky);
int index = source.IndexOf('\0'Winky Winky;
string str2 = source.Substring(0, index);
source = string.Empty;
return str2;
}

public static ushort ReadUInt16(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, 2);
Array.Reverse(memory, 0, 2);
return BitConverter.ToUInt16(memory, 0);
}

public static ushort[] ReadUInt16(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 2);
ReverseBytes(memory);
ushort[] numArray = new ushort[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt16(memory, ((length - 1) - i) * 2);
}
return numArray;
}

public static UInt32 ReadUInt32(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToUInt32(memory, 0);
}

public static UInt32[] ReadUInt32(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
UInt32[] numArray = new UInt32[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt32(memory, ((length - 1) - i) * 4);
}
return numArray;
}

public static ulong ReadUInt64(UInt32 address)
{
byte[] memory = PS3.GetMemory(address, Cool Man (aka Tustin);
Array.Reverse(memory, 0, Cool Man (aka Tustin);
return BitConverter.ToUInt64(memory, 0);
}

public static ulong[] ReadUInt64(UInt32 address, int length)
{
byte[] memory = PS3.GetMemory(address, length * Cool Man (aka Tustin);
ReverseBytes(memory);
ulong[] numArray = new ulong[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt64(memory, ((length - 1) - i) * Cool Man (aka Tustin);
}
return numArray;
}

public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}

public static void WriteBool(UInt32 address, bool input)
{
byte[] bytes = new byte[] { input ? ((byte) 1) : ((byte) 0) };
PS3.SetMemory(address, bytes);
}

public static void WriteByte(UInt32 address, byte input)
{
PS3.SetMemory(address, new byte[] { input });
}

public static void WriteBytes(UInt32 address, byte[] input)
{
PS3.SetMemory(address, input);
}

public static bool WriteBytesToggle(UInt32 Offset, byte[] On, byte[] Off)
{
bool flag = ReadByte(Offset) == On[0];
WriteBytes(Offset, !flag ? On : Off);
return flag;
}

public static void WriteDouble(UInt32 address, double input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, Cool Man (aka Tustin);
PS3.SetMemory(address, array);
}

public static void WriteDouble(UInt32 address, double[] input)
{
int length = input.Length;
byte[] array = new byte[length * 8];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * Cool Man (aka Tustin));
}
PS3.SetMemory(address, array);
}

public static void WriteInt16(UInt32 address, short input)
{
byte[] array = new byte[2];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}

public static void WriteInt16(UInt32 address, short[] input)
{
int length = input.Length;
byte[] array = new byte[length * 2];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 2));
}
PS3.SetMemory(address, array);
}

public static void WriteInt32(UInt32 address, int input)
{
byte[] array = new byte[4];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}

public static void WriteInt32(UInt32 address, int[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 4));
}
PS3.SetMemory(address, array);
}

public static void WriteInt64(UInt32 address, long input)
{
byte[] array = new byte[8];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}

public static void WriteInt64(UInt32 address, long[] input)
{
int length = input.Length;
byte[] array = new byte[length * 8];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * Cool Man (aka Tustin));
}
PS3.SetMemory(address, array);
}

public static void WriteSByte(UInt32 address, sbyte input)
{
byte[] bytes = new byte[] { (byte) input };
PS3.SetMemory(address, bytes);
}

public static void WriteSBytes(UInt32 address, sbyte[] input)
{
int length = input.Length;
byte[] bytes = new byte[length];
for (int i = 0; i < length; i++)
{
bytes[i] = (byte) input[i];
}
PS3.SetMemory(address, bytes);
}

public static void WriteSingle(UInt32 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 WriteSingle(UInt32 address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 4));
}
PS3.SetMemory(address, array);
}

public static void WriteString(UInt32 address, string input)
{
byte[] bytes = Encoding.UTF8.GetBytes(input);
Array.Resize<byte>(ref bytes, bytes.Length + 1);
PS3.SetMemory(address, bytes);
}

public static void WriteUInt16(UInt32 address, ushort input)
{
byte[] array = new byte[2];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 2);
PS3.SetMemory(address, array);
}

public static void WriteUInt16(UInt32 address, ushort[] input)
{
int length = input.Length;
byte[] array = new byte[length * 2];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 2));
}
PS3.SetMemory(address, array);
}

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

public static void WriteUInt32(UInt32 address, UInt32[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 4));
}
PS3.SetMemory(address, array);
}

public static void WriteUInt64(UInt32 address, ulong input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, Cool Man (aka Tustin);
PS3.SetMemory(address, array);
}

public static void WriteUInt64(UInt32 address, ulong[] input)
{
int length = input.Length;
byte[] array = new byte[length * 8];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * Cool Man (aka Tustin));
}
PS3.SetMemory(address, array);
}

public static String char_to_wchar(String text)
{
String wchar = text;
for (Int32 i = 0; i < text.Length; i++)
{
wchar = wchar.Insert(i * 2, "\0");
}
return wchar;
}
}
}



The code of my PS3.cs :

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PS3Lib;
using System.Threading.Tasks;

namespace Pour_ryad
{
class PS3
{
#region Functions
private static PS3API DEX = new PS3API();
public static void Connect()
{
DEX.ConnectTarget();
DEX.AttachProcess();
}
public static void Reconnect()
{
DEX.ConnectTarget();
}
public static byte[] GetMemory(UInt32 offset, int length)
{
byte[] array = new byte[length];
DEX.GetMemory(offset, array);
return array;
}
public static void ChangeAPI(SelectAPI API)
{
DEX.ChangeAPI(API);
}
public static SelectAPI GetCurrentAPI()
{
return DEX.GetCurrentAPI();
}
public static byte[] GetMemoryL(UInt32 address, int length)
{
byte[] buffer = new byte[length];
DEX.GetMemory(address, buffer);
return buffer;
}
public static void SetMemory(UInt32 Address, byte[] Bytes)
{
DEX.SetMemory(Address, Bytes);
}
public static void GetMemoryR(UInt32 Address, ref byte[] Bytes)
{
DEX.GetMemory(Address, Bytes);
}

public class Extension
{
private static SelectAPI CurrentAPI;
private static byte[] GetBytes(UInt32 offset, int length, SelectAPI API)
{
byte[] bytes = new byte[length];
if (API == SelectAPI.ControlConsole)
{
CurrentAPI = GetCurrentAPI();
return DEX.GetBytes(offset, length);
}
if (API == SelectAPI.TargetManager)
{
CurrentAPI = GetCurrentAPI();
bytes = DEX.GetBytes(offset, length);
}
return bytes;
}

private static void GetMem(UInt32 offset, byte[] buffer, SelectAPI API)
{
if (API == SelectAPI.ControlConsole)
{
GetMemoryR(offset, ref buffer);
}
else if (API == SelectAPI.TargetManager)
{
GetMemoryR(offset, ref buffer);
}
}

public static bool ReadBool(UInt32 offset)
{
byte[] buffer = new byte[1];
GetMem(offset, buffer, CurrentAPI);
return (buffer[0] != 0);
}

public static byte ReadByte(UInt32 offset)
{
return GetBytes(offset, 1, CurrentAPI)[0];
}

public static byte[] ReadBytes(UInt32 offset, int length)
{
return GetBytes(offset, length, CurrentAPI);
}

public static float ReadFloat(UInt32 offset)
{
byte[] array = GetBytes(offset, 4, CurrentAPI);
Array.Reverse(array, 0, 4);
return BitConverter.ToSingle(array, 0);
}

public static short ReadInt16(UInt32 offset)
{
byte[] array = GetBytes(offset, 2, CurrentAPI);
Array.Reverse(array, 0, 2);
return BitConverter.ToInt16(array, 0);
}

public static int ReadInt32(UInt32 offset)
{
byte[] array = GetBytes(offset, 4, CurrentAPI);
Array.Reverse(array, 0, 4);
return BitConverter.ToInt32(array, 0);
}

public static void WriteSingle(UInt32 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 WriteSingle(UInt32 address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int)(i * 4));
}
PS3.SetMemory(address, array);
}

public static long ReadInt64(UInt32 offset)
{
byte[] array = GetBytes(offset, 8, CurrentAPI);
Array.Reverse(array, 0, Cool Man (aka Tustin);
return BitConverter.ToInt64(array, 0);
}

public static sbyte ReadSByte(UInt32 offset)
{
byte[] buffer = new byte[1];
GetMem(offset, buffer, CurrentAPI);
return (sbyte)buffer[0];
}

public static string ReadString(UInt32 offset)
{
int length = 40;
int num2 = 0;
string source = "";
do
{
byte[] bytes = ReadBytes(offset + ((UInt32)num2), length);
source = source + Encoding.UTF8.GetString(bytes);
num2 += length;
}
while (!source.Contains<char>('\0'Winky Winky);
int index = source.IndexOf('\0'Winky Winky;
string str2 = source.Substring(0, index);
source = string.Empty;
return str2;
}

public static byte[] ReverseArray(float float_0)
{
byte[] bytes = BitConverter.GetBytes(float_0);
Array.Reverse(bytes);
return bytes;
}

public static byte[] uintBytes(UInt32 input)
{
byte[] data = BitConverter.GetBytes(input);
Array.Reverse(data);
return data;
}
public static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}
public static byte[] ToHexFloat(float Axis)
{
byte[] bytes = BitConverter.GetBytes(Axis);
Array.Reverse(bytes);
return bytes;
}

public static ushort ReadUInt16(UInt32 offset)
{
byte[] array = GetBytes(offset, 2, CurrentAPI);
Array.Reverse(array, 0, 2);
return BitConverter.ToUInt16(array, 0);
}

public static UInt32 ReadUInt32(UInt32 offset)
{
byte[] array = GetBytes(offset, 4, CurrentAPI);
Array.Reverse(array, 0, 4);
return BitConverter.ToUInt32(array, 0);
}

public static ulong ReadUInt64(UInt32 offset)
{
byte[] array = GetBytes(offset, 8, CurrentAPI);
Array.Reverse(array, 0, Cool Man (aka Tustin);
return BitConverter.ToUInt64(array, 0);
}

private static void SetMem(UInt32 Address, byte[] buffer, SelectAPI API)
{
DEX.SetMemory(Address, buffer);
}

public static void WriteBool(UInt32 offset, bool input)
{
byte[] buffer = new byte[] { input ? ((byte)1) : ((byte)0) };
SetMem(offset, buffer, CurrentAPI);
}

public static void WriteByte(UInt32 offset, byte input)
{
byte[] buffer = new byte[] { input };
SetMem(offset, buffer, CurrentAPI);
}

public static void WriteBytes(UInt32 offset, byte[] input)
{
byte[] buffer = input;
SetMem(offset, buffer, CurrentAPI);
}

public static void WriteFloat(UInt32 offset, float input)
{
byte[] array = new byte[4];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 4);
SetMem(offset, array, CurrentAPI);
}

public static void WriteInt16(UInt32 offset, short input)
{
byte[] array = new byte[2];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 2);
SetMem(offset, array, CurrentAPI);
}

public static void WriteInt32(UInt32 offset, int input)
{
byte[] array = new byte[4];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 4);
SetMem(offset, array, CurrentAPI);
}

public static void WriteInt64(UInt32 offset, long input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, Cool Man (aka Tustin);
SetMem(offset, array, CurrentAPI);
}

public static void WriteSByte(UInt32 offset, sbyte input)
{
byte[] buffer = new byte[] { (byte)input };
SetMem(offset, buffer, CurrentAPI);
}

public static void WriteString(UInt32 offset, string input)
{
byte[] bytes = Encoding.UTF8.GetBytes(input);
Array.Resize<byte>(ref bytes, bytes.Length + 1);
SetMem(offset, bytes, CurrentAPI);
}

public static void WriteUInt16(UInt32 offset, ushort input)
{
byte[] array = new byte[2];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 2);
SetMem(offset, array, CurrentAPI);
}

public static void WriteUInt32(UInt32 offset, UInt32 input)
{
byte[] array = new byte[4];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, 4);
SetMem(offset, array, CurrentAPI);
}

public static void WriteUInt64(UInt32 offset, ulong input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, Cool Man (aka Tustin);
SetMem(offset, array, CurrentAPI);
}
}

class Conversions
{
public static byte[] ReverseBytes(byte[] input)
{
Array.Reverse(input);
return input;
}
public static byte[] RandomizeRGBA()
{
byte[] RGBA = new byte[4];
Random randomize = new Random();
RGBA[0] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
RGBA[1] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
RGBA[2] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
RGBA[3] = BitConverter.GetBytes(randomize.Next(0, 255))[0];
return RGBA;
}
}
#endregion
}
}


Screen of my tool :

You must login or register to view this content.

The problem is when i do RPC functions like iprint,cbufaddtext ect...
It's freeze or it's don't work. :/

iprint ect... don't work and my cbuffaddtext freeze. :/

Any help please ?
(adsbygoogle = window.adsbygoogle || []).push({});
04-05-2015, 08:18 AM #2
Adrian
Adrian is back!
u don't actually need Lib this is the code I use and I put it at the top of my tool and I edited it so it works 100% and u don't need the Lib in it, just wen u do RPC calls u need to call it differently like this as well ill show u
    public class RPC
{
public static int Call(uint func_address, params object[] parameters)
{
int length = parameters.Length;
int index = 0;
UInt32 num3 = 0;
UInt32 num4 = 0;
UInt32 num5 = 0;
UInt32 num6 = 0;
while (index < length)
{
if (parameters[index] is int)
{
PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
num3++;
}
else if (parameters[index] is UInt32)
{
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (UInt32)parameters[index]);
num3++;
}
else
{
UInt32 num7;
if (parameters[index] is string)
{
num7 = 0x10022000 + (num4 * 0x400);
PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
num3++;
num4++;
}
else if (parameters[index] is float)
{
PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
num5++;
}
else if (parameters[index] is float[])
{
float[] input = (float[])parameters[index];
num7 = 0x10021000 + (num6 * 4);
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
num3++;
num6 += (UInt32)input.Length;
}
}
index++;
}
PS3.Extension.WriteUInt32(0x1002004C, func_address);
Thread.Sleep(20);
return PS3.Extension.ReadInt32(0x10020050);
}
private static void Enable() {
uint function_address = 0x7AA050;
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
Thread.Sleep(20);
byte[] memory = new byte[]
{ 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 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, 0x02, 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 + 4, memory);
PS3.SetMemory(0x10020000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
//PS3.SetMemory(0x3DBF70, new byte[] { 0x60, 0x00, 0x00, 0x00 });
PS3.SetMemory(0x30010000, new byte[] { 0x01 });

}
public static void Init()
{
if (PS3.Extension.ReadByte(0x30010000) == 1)
Console.Write("RPC Already Enabled"); //RPC is enabled
else
Enable(); //Enable RPC
}

public static void iPrintln(int Client, string Text)
{
SV_GameSendServerCommand(Client, "O \"" + Text + "\"");
}

public static void iPrintlnBold(int Client, string Text)
{
SV_GameSendServerCommand(Client, "< \"" + Text + "\"");
}
public static void CBuf_Addtext(string Command)
{
RPC.Call(0x0313C18, 0, Command);
}

public static void SV_GameSendServerCommand(int Client, string Command)
{
RPC.Call(0x0349F6C, Client, 1, Command);
}
}
public static uint G_Entity(int Client, uint Mod = 0)
{
return (0x16B9F20 + (0x31C * (uint)Client) + Mod);
}


and also to call it I use
    RPC.Call(0x0349F6C, "client number goes here", 1, "O " + "make a label with a> " + "text here to print" + plus the label here);


where the client number goes u can also make it read from a numericUpDown and right the numericUpDown"number".Text... and u also have to make a label like I showed and right there label"number".Text

and the "O " in the speech marks is where u want it to print for instance the "O " means it will print in the killfeed

hopefully this helps thankyou Smile

The following user thanked Adrian for this useful post:

Binerz

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo