예제 #1
0
        public ObservableCollection <Player> GetPlayers(int party)
        {
            string name, xuid;
            uint   interval;
            ObservableCollection <Player> clients = new ObservableCollection <Player>();

            PS3.GetMemory(Addresses.GrabberEntry[party], Extension.Dump);
            for (uint i = 0; i < Functions.MaxClients; i++)
            {
                interval = Addresses.GrabberInterval * i;
                name     = Extension.ReadString((uint)Addresses.Grabber.PlaystationName2 + interval);
                xuid     = ReadXUID((uint)Addresses.Grabber.XUID + interval);
                if (!string.IsNullOrEmpty(name) && !string.IsNullOrWhiteSpace(name) && Regex.IsMatch(name, @"^[a-zA-Z]{1}([\w\-]){3,15}((\([1-3]\))?)$") &&
                    !string.IsNullOrEmpty(xuid) && !string.IsNullOrWhiteSpace(xuid) && Regex.IsMatch(xuid, @"^[a-fA-F0-9]{16}$"))
                {
                    clients.Add(new Player()
                    {
                        Id         = i,
                        Name       = name,
                        ExternalIp = ReadIPAddress((uint)Addresses.Grabber.ExternalIP + interval),
                        XUID       = xuid,
                        Zipcode    = Extension.ReadString((uint)Addresses.Grabber.Zipcode + interval)
                    });
                }
            }
            return(clients);
        }
예제 #2
0
 public static sbyte[] ReadSBytes(uint address, int length)
 {
     byte[]  memory = PS3.GetMemory(address, length);
     sbyte[] array  = new sbyte[length];
     for (int i = 0; i < length; i++)
     {
         array[i] = (sbyte)memory[i];
     }
     return(array);
 }
예제 #3
0
 public static double[] ReadDouble(uint address, int length)
 {
     byte[] memory = PS3.GetMemory(address, length * 8);
     ReverseBytes(memory);
     double[] array = new double[length];
     for (int i = 0; i < length; i++)
     {
         array[i] = BitConverter.ToSingle(memory, (length - 1 - i) * 8);
     }
     return(array);
 }
예제 #4
0
 public static short[] ReadInt16(uint address, int length)
 {
     byte[] memory = PS3.GetMemory(address, length * 2);
     ReverseBytes(memory);
     short[] array = new short[length];
     for (int i = 0; i < length; i++)
     {
         array[i] = BitConverter.ToInt16(memory, (length - 1 - i) * 2);
     }
     return(array);
 }
예제 #5
0
 public static ulong[] ReadUInt64(uint address, int length)
 {
     byte[] memory = PS3.GetMemory(address, length * 8);
     ReverseBytes(memory);
     ulong[] array = new ulong[length];
     for (int i = 0; i < length; i++)
     {
         array[i] = BitConverter.ToUInt64(memory, (length - 1 - i) * 8);
     }
     return(array);
 }
예제 #6
0
 private void GetStats()
 {
     if (!GetAttached())
     {
         return;
     }
     Stats = new Stats(PS3, Extension);
     PS3.GetMemory(Addresses.StatsEntry[(uint)StatsType], Stats.Extension.Dump);
     Stats            = Stats.GetStats();
     SelectedClass    = Stats.Classes.FirstOrDefault();
     StatsEnabled     = true;
     StatsTypeEnabled = false;
     Status           = "Stats getted!";
 }
예제 #7
0
        public static string ReadString(uint address)
        {
            int    num  = 40;
            int    num2 = 0;
            string text = "";

            do
            {
                byte[] memory = PS3.GetMemory((uint)((int)address + num2), num);
                text += Encoding.UTF8.GetString(memory);
                num2 += num;
            }while (!text.Contains('\0'));
            int length = text.IndexOf('\0');

            return(text.Substring(0, length));
        }
예제 #8
0
            public static uint Call(uint func_address, params object[] parameters)
            {
                int  length = parameters.Length;
                uint num2   = 0;

                for (uint i = 0; i < length; i++)
                {
                    if (parameters[i] is int)
                    {
                        byte[] array = BitConverter.GetBytes((int)parameters[i]);
                        Array.Reverse(array);
                        PS3.SetMemory(0x10050000 + ((i + num2) * 4), array);
                    }
                    else if (parameters[i] is uint)
                    {
                        byte[] buffer2 = BitConverter.GetBytes((uint)parameters[i]);
                        Array.Reverse(buffer2);
                        PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer2);
                    }
                    else if (parameters[i] is string)
                    {
                        byte[] buffer = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
                        PS3.SetMemory(0x10050054 + (i * 0x400), buffer);
                        uint   num4    = 0x10050054 + (i * 0x400);
                        byte[] buffer4 = BitConverter.GetBytes(num4);
                        Array.Reverse(buffer4);
                        PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer4);
                    }
                    else if (parameters[i] is float)
                    {
                        num2++;
                        byte[] buffer5 = BitConverter.GetBytes((float)parameters[i]);
                        Array.Reverse(buffer5);
                        PS3.SetMemory(0x10050024 + ((num2 - 1) * 4), buffer5);
                    }
                }
                byte[] bytes = BitConverter.GetBytes(func_address);
                Array.Reverse(bytes);
                PS3.SetMemory(0x1005004c, bytes);
                Thread.Sleep(20);
                byte[] buffer7 = new byte[4];
                PS3.GetMemory(0x10050050, buffer7);
                Array.Reverse(buffer7);
                return(BitConverter.ToUInt32(buffer7, 0));
            }
예제 #9
0
 public static sbyte ReadSByte(uint address)
 {
     return((sbyte)PS3.GetMemory(address, 1)[0]);
 }
예제 #10
0
 public static short ReadInt16(uint address)
 {
     byte[] memory = PS3.GetMemory(address, 2);
     Array.Reverse(memory, 0, 2);
     return(BitConverter.ToInt16(memory, 0));
 }
예제 #11
0
 public static float ReadSingle(uint address)
 {
     byte[] memory = PS3.GetMemory(address, 4);
     Array.Reverse(memory, 0, 4);
     return(BitConverter.ToSingle(memory, 0));
 }
예제 #12
0
 public static double ReadDouble(uint address)
 {
     byte[] memory = PS3.GetMemory(address, 8);
     Array.Reverse(memory, 0, 8);
     return(BitConverter.ToDouble(memory, 0));
 }
예제 #13
0
 public static byte[] ReadBytes(uint address, int length)
 {
     return(PS3.GetMemory(address, length));
 }
예제 #14
0
 public static byte ReadByte(uint address)
 {
     return(PS3.GetMemory(address, 1)[0]);
 }
예제 #15
0
 public static bool ReadBool(uint address)
 {
     return(PS3.GetMemory(address, 1)[0] > 0);
 }
예제 #16
0
 public static ulong ReadUInt64(uint address)
 {
     byte[] memory = PS3.GetMemory(address, 8);
     Array.Reverse(memory, 0, 8);
     return(BitConverter.ToUInt64(memory, 0));
 }
예제 #17
0
 public static uint ReadUInt32(uint address)
 {
     byte[] memory = PS3.GetMemory(address, 4);
     Array.Reverse(memory, 0, 4);
     return(BitConverter.ToUInt32(memory, 0));
 }