public class Lib
{
public static SelectAPI CurrentAPI;
public static void And_Int32(uint address, int input)
{
int num = ReadInt32(address) & input;
WriteInt32(address, num);
}
public static string char_to_wchar(string text)
{
string str = text;
for (int i = 0; i < text.Length; i++)
{
str = str.Insert(i * 2, "\0");
}
return str;
}
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(uint address, int input)
{
int num = ReadInt32(address) | input;
WriteInt32(address, num);
}
public static bool ReadBool(uint address)
{
return (PS3.GetMemory(address, 1)[0] != 0);
}
public static byte ReadByte(uint address)
{
return PS3.GetMemory(address, 1)[0];
}
public static byte[] ReadBytes(uint address, int length)
{
return PS3.GetMemory(address, length);
}
public static double ReadDouble(uint address)
{
byte[] memory = PS3.GetMemory(address, ;
Array.Reverse(memory, 0, ;
return BitConverter.ToDouble(memory, 0);
}
public static double[] ReadDouble(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * ;
ReverseBytes(memory);
double[] numArray = new double[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * ;
}
return numArray;
}
public static short ReadInt16(uint address)
{
byte[] memory = PS3.GetMemory(address, 2);
Array.Reverse(memory, 0, 2);
return BitConverter.ToInt16(memory, 0);
}
public static short[] ReadInt16(uint 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(uint address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToInt32(memory, 0);
}
public static int[] ReadInt32(uint 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(uint address)
{
byte[] memory = PS3.GetMemory(address, ;
Array.Reverse(memory, 0, ;
return BitConverter.ToInt64(memory, 0);
}
public static long[] ReadInt64(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * ;
ReverseBytes(memory);
long[] numArray = new long[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToInt64(memory, ((length - 1) - i) * ;
}
return numArray;
}
public static sbyte ReadSByte(uint address)
{
return (sbyte)PS3.GetMemory(address, 1)[0];
}
public static sbyte[] ReadSBytes(uint 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(uint address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToSingle(memory, 0);
}
public static float[] ReadSingle(uint 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(uint address)
{
int length = 40;
int num2 = 0;
string source = "";
do
{
byte[] memory = PS3.GetMemory(address + ((uint)num2), length);
source = source + Encoding.UTF8.GetString(memory);
num2 += length;
}
while (!source.Contains<char>('\0');
int index = source.IndexOf('\0';
string str2 = source.Substring(0, index);
source = string.Empty;
return str2;
}
public static void SetMemory(UInt32 Address, Byte[] Bytes)
{
Form1.PS3.SetMemory(Address, Bytes);
}
public static void WriteFloat(UInt32 offset, float input)
{
Byte[] buff = new Byte[4];
BitConverter.GetBytes(input).CopyTo(buff, 0);
Array.Reverse(buff, 0, 4);
SetMemory(offset, buff);
}
public static void GetMemoryR(UInt32 Address, ref Byte[] Bytes)
{
Form1.PS3.GetMemory(Address, Bytes);
}
public static float ReadFloat(UInt32 offset, Boolean Reverse = true)
{
Byte[] array = GetBytes(offset, 4, CurrentAPI);
if (Reverse == true) { Array.Reverse(array, 0, 4); }
return BitConverter.ToSingle(array, 0);
}
public static Byte[] GetMemoryL(UInt32 address, Int32 length)
{
Byte[] buffer = new Byte[length];
Form1.PS3.GetMemory(address, buffer);
return buffer;
}
public static Byte[] GetBytes(UInt32 Offset, Int32 Length)
{
return Form1.PS3.GetBytes(Offset, Length);
}
private static Byte[] GetBytes(UInt32 offset, Int32 length, SelectAPI API)
{
Byte[] Bytes = new Byte[length];
if (API == SelectAPI.ControlConsole)
{
CurrentAPI = Form1.PS3.GetCurrentAPI();
return Form1.PS3.GetBytes(offset, length);
}
if (API == SelectAPI.TargetManager)
{
CurrentAPI = Form1.PS3.GetCurrentAPI();
Bytes = Form1.PS3.GetBytes(offset, length);
}
return Bytes;
}
private static void SetMem(UInt32 Address, Byte[] buffer, SelectAPI API)
{
Form1.PS3.SetMemory(Address, buffer);
}
public static ushort ReadUInt16(uint address)
{
byte[] memory = PS3.GetMemory(address, 2);
Array.Reverse(memory, 0, 2);
return BitConverter.ToUInt16(memory, 0);
}
public static ushort[] ReadUInt16(uint 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 uint ReadUInt32(uint address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToUInt32(memory, 0);
}
public static uint[] ReadUInt32(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
uint[] numArray = new uint[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt32(memory, ((length - 1) - i) * 4);
}
return numArray;
}
public static ulong ReadUInt64(uint address)
{
byte[] memory = PS3.GetMemory(address, ;
Array.Reverse(memory, 0, ;
return BitConverter.ToUInt64(memory, 0);
}
public static ulong[] ReadUInt64(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * ;
ReverseBytes(memory);
ulong[] numArray = new ulong[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt64(memory, ((length - 1) - i) * ;
}
return numArray;
}
public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}
public static void WriteBool(uint address, bool input)
{
byte[] bytes = new byte[] { input ? ((byte)1) : ((byte)0) };
PS3.SetMemory(address, bytes);
}
public static void WriteByte(uint address, byte input)
{
PS3.SetMemory(address, new byte[] { input });
}
public static void WriteBytes(uint address, byte[] input)
{
PS3.SetMemory(address, input);
}
public static bool WriteBytesToggle(uint Offset, byte[] On, byte[] Off)
{
bool flag = ReadByte(Offset) == On[0];
WriteBytes(Offset, !flag ? On : Off);
return flag;
}
public static void WriteDouble(uint address, double input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, ;
PS3.SetMemory(address, array);
}
public static void WriteDouble(uint 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 * );
}
PS3.SetMemory(address, array);
}
public static void WriteInt16(uint address, short input)
{
byte[] array = new byte[2];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}
public static void WriteInt16(uint 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(uint address, int input)
{
byte[] array = new byte[4];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}
public static void WriteInt32(uint 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(uint address, long input)
{
byte[] array = new byte[8];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}
public static void WriteInt64(uint 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 * );
}
PS3.SetMemory(address, array);
}
public static void WriteSByte(uint address, sbyte input)
{
byte[] bytes = new byte[] { (byte)input };
PS3.SetMemory(address, bytes);
}
public static void WriteSBytes(uint 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(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 WriteSingle(uint 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(uint 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(uint 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(uint 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(uint address, uint 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(uint address, uint[] 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(uint address, ulong input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, ;
PS3.SetMemory(address, array);
}
public static void WriteUInt64(uint 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 * );
}
PS3.SetMemory(address, array);
}
}
}
public class Lib
{
public static SelectAPI CurrentAPI;
public static void And_Int32(uint address, int input)
{
int num = ReadInt32(address) & input;
WriteInt32(address, num);
}
public static string char_to_wchar(string text)
{
string str = text;
for (int i = 0; i < text.Length; i++)
{
str = str.Insert(i * 2, "\0");
}
return str;
}
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(uint address, int input)
{
int num = ReadInt32(address) | input;
WriteInt32(address, num);
}
public static bool ReadBool(uint address)
{
return (PS3.GetMemory(address, 1)[0] != 0);
}
public static byte ReadByte(uint address)
{
return PS3.GetMemory(address, 1)[0];
}
public static byte[] ReadBytes(uint address, int length)
{
return PS3.GetMemory(address, length);
}
public static double ReadDouble(uint address)
{
byte[] memory = PS3.GetMemory(address, ;
Array.Reverse(memory, 0, ;
return BitConverter.ToDouble(memory, 0);
}
public static double[] ReadDouble(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * ;
ReverseBytes(memory);
double[] numArray = new double[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * ;
}
return numArray;
}
public static short ReadInt16(uint address)
{
byte[] memory = PS3.GetMemory(address, 2);
Array.Reverse(memory, 0, 2);
return BitConverter.ToInt16(memory, 0);
}
public static short[] ReadInt16(uint 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(uint address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToInt32(memory, 0);
}
public static int[] ReadInt32(uint 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(uint address)
{
byte[] memory = PS3.GetMemory(address, ;
Array.Reverse(memory, 0, ;
return BitConverter.ToInt64(memory, 0);
}
public static long[] ReadInt64(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * ;
ReverseBytes(memory);
long[] numArray = new long[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToInt64(memory, ((length - 1) - i) * ;
}
return numArray;
}
public static sbyte ReadSByte(uint address)
{
return (sbyte)PS3.GetMemory(address, 1)[0];
}
public static sbyte[] ReadSBytes(uint 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(uint address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToSingle(memory, 0);
}
public static float[] ReadSingle(uint 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(uint address)
{
int length = 40;
int num2 = 0;
string source = "";
do
{
byte[] memory = PS3.GetMemory(address + ((uint)num2), length);
source = source + Encoding.UTF8.GetString(memory);
num2 += length;
}
while (!source.Contains('\0');
int index = source.IndexOf('\0';
string str2 = source.Substring(0, index);
source = string.Empty;
return str2;
}
public static void SetMemory(UInt32 Address, Byte[] Bytes)
{
Form1.PS3.SetMemory(Address, Bytes);
}
public static void WriteFloat(UInt32 offset, float input)
{
Byte[] buff = new Byte[4];
BitConverter.GetBytes(input).CopyTo(buff, 0);
Array.Reverse(buff, 0, 4);
SetMemory(offset, buff);
}
public static void GetMemoryR(UInt32 Address, ref Byte[] Bytes)
{
Form1.PS3.GetMemory(Address, Bytes);
}
public static float ReadFloat(UInt32 offset, Boolean Reverse = true)
{
Byte[] array = GetBytes(offset, 4, CurrentAPI);
if (Reverse == true) { Array.Reverse(array, 0, 4); }
return BitConverter.ToSingle(array, 0);
}
public static Byte[] GetMemoryL(UInt32 address, Int32 length)
{
Byte[] buffer = new Byte[length];
Form1.PS3.GetMemory(address, buffer);
return buffer;
}
public static Byte[] GetBytes(UInt32 Offset, Int32 Length)
{
return Form1.PS3.GetBytes(Offset, Length);
}
private static Byte[] GetBytes(UInt32 offset, Int32 length, SelectAPI API)
{
Byte[] Bytes = new Byte[length];
if (API == SelectAPI.ControlConsole)
{
CurrentAPI = Form1.PS3.GetCurrentAPI();
return Form1.PS3.GetBytes(offset, length);
}
if (API == SelectAPI.TargetManager)
{
CurrentAPI = Form1.PS3.GetCurrentAPI();
Bytes = Form1.PS3.GetBytes(offset, length);
}
return Bytes;
}
private static void SetMem(UInt32 Address, Byte[] buffer, SelectAPI API)
{
Form1.PS3.SetMemory(Address, buffer);
}
public static ushort ReadUInt16(uint address)
{
byte[] memory = PS3.GetMemory(address, 2);
Array.Reverse(memory, 0, 2);
return BitConverter.ToUInt16(memory, 0);
}
public static ushort[] ReadUInt16(uint 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 uint ReadUInt32(uint address)
{
byte[] memory = PS3.GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToUInt32(memory, 0);
}
public static uint[] ReadUInt32(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
uint[] numArray = new uint[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt32(memory, ((length - 1) - i) * 4);
}
return numArray;
}
public static ulong ReadUInt64(uint address)
{
byte[] memory = PS3.GetMemory(address, ;
Array.Reverse(memory, 0, ;
return BitConverter.ToUInt64(memory, 0);
}
public static ulong[] ReadUInt64(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * ;
ReverseBytes(memory);
ulong[] numArray = new ulong[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToUInt64(memory, ((length - 1) - i) * ;
}
return numArray;
}
public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}
public static void WriteBool(uint address, bool input)
{
byte[] bytes = new byte[] { input ? ((byte)1) : ((byte)0) };
PS3.SetMemory(address, bytes);
}
public static void WriteByte(uint address, byte input)
{
PS3.SetMemory(address, new byte[] { input });
}
public static void WriteBytes(uint address, byte[] input)
{
PS3.SetMemory(address, input);
}
public static bool WriteBytesToggle(uint Offset, byte[] On, byte[] Off)
{
bool flag = ReadByte(Offset) == On[0];
WriteBytes(Offset, !flag ? On : Off);
return flag;
}
public static void WriteDouble(uint address, double input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, ;
PS3.SetMemory(address, array);
}
public static void WriteDouble(uint 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 * );
}
PS3.SetMemory(address, array);
}
public static void WriteInt16(uint address, short input)
{
byte[] array = new byte[2];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}
public static void WriteInt16(uint 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(uint address, int input)
{
byte[] array = new byte[4];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}
public static void WriteInt32(uint 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(uint address, long input)
{
byte[] array = new byte[8];
ReverseBytes(BitConverter.GetBytes(input)).CopyTo(array, 0);
PS3.SetMemory(address, array);
}
public static void WriteInt64(uint 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 * );
}
PS3.SetMemory(address, array);
}
public static void WriteSByte(uint address, sbyte input)
{
byte[] bytes = new byte[] { (byte)input };
PS3.SetMemory(address, bytes);
}
public static void WriteSBytes(uint 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(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 WriteSingle(uint 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(uint address, string input)
{
byte[] bytes = Encoding.UTF8.GetBytes(input);
Array.Resize(ref bytes, bytes.Length + 1);
PS3.SetMemory(address, bytes);
}
public static void WriteUInt16(uint 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(uint 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(uint address, uint 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(uint address, uint[] 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(uint address, ulong input)
{
byte[] array = new byte[8];
BitConverter.GetBytes(input).CopyTo(array, 0);
Array.Reverse(array, 0, ;
PS3.SetMemory(address, array);
}
public static void WriteUInt64(uint 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 * );
}
PS3.SetMemory(address, array);
}
}
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.