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); }
/// <summary> /// Disconnect from PS3 console /// </summary> private void DisconnectPS3() { try { PS3.DisconnectTarget(); IsConsoleConnected = false; ConsoleType = ""; SetStatusConsole(null); EnableConsoleActions(); MenuItemConnectPS3CCAPI.Visible = true; MenuItemConnectPS3TMAPI.Visible = true; MenuItemConnectPS3Disconnect.Visible = false; MenuItemConnectXBOX.Enabled = true; MenuItemXBOXConnect.Visible = true; MenuItemXBOXDisconnect.Visible = false; SetStatus("Successfully disconnected from console."); XtraMessageBox.Show(this, "Successfully disconnected from console", "Disconnected", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { SetStatus("Unable to disconnect from console - Error: " + ex.Message, ex); XtraMessageBox.Show(this, "Unable to disconnect from console.\\n\nError Message:\n " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void WriteByte(uint address, byte input) { PS3.SetMemory(address, new byte[1] { input }); }
private async void Connection() { if (PS3.ConnectTarget()) { if (PS3.AttachProcess()) { if (PS3.GetCurrentGame() == "Modern Warfare® 3") { await Dialog.ShowMessageAsync(this, Resources["success"].ToString(), $"{Resources["successAttached"]} \"{PS3.CurrentGame}\"."); IsAttached = true; return; } else { await Dialog.ShowMessageAsync(this, Resources["wrongProcess"].ToString(), $"{Resources["currentProcess"]} \"{PS3.CurrentGame}\"."); } } else { await Dialog.ShowMessageAsync(this, Resources["attachFailed"].ToString(), Resources["unableAttach"].ToString()); } } else { await Dialog.ShowMessageAsync(this, Resources["connectFailed"].ToString(), Resources["unableConnect"].ToString()); } IsAttached = false; }
private async Task <bool[]> CanExecuteFunction() { if (PS3.GetAttached()) { IsAttached = true; if (PS3.Extension.ReadBool(Addresses.IsInGame_a)) { bool isHost = ImHost(); if (isHost) { return new bool[] { true, true } } ; else if (!isHost && PS3.Extension.ReadByte(0xDE810) != 0xF8) { return new bool[] { true, false } } ; else { await Dialog.ShowMessageAsync(this, Resources["functionsFailed"].ToString(), Resources["installRCE"].ToString()); } } else { await Dialog.ShowMessageAsync(this, Resources["functionsFailed"].ToString(), Resources["mustBeInGame"].ToString()); } } IsAttached = false; Players?.Clear(); SelectedPlayer = null; return(new bool[] { false, false }); }
private void startBtn_Click(object sender, EventArgs e) { if (gameCombo.SelectedIndex == 2) { int loadingGM = 12; Cbuf_AddText(0, "gametype_setting playerNumlives 1;wait 10;fast_restart"); Delay(2); while (loadingGM > 0) { loadingGM--; iPrintln(-1, "Reading & Setting Up The Game Mode : ^2" + loadingGM); Delay(1); } for (int i = 0; i < 12; i++) { PS3.SetMemory(0x1781170 + (0x5808 * (uint)i), new byte[0x188]); } } for (int i = 0; i < 12; i++) { Freeze(i, false); } if (startBtn.Text == "Start Game Mode") { startBtn.Text = "Stop"; StartGameMode((int)sINum.Value + 1, (int)endNum.Value + 1); } else if (startBtn.Text == "Stop") { Start = false; startBtn.Text = "Start Game Mode"; } }
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 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 WriteUInt64(uint address, ulong input) { byte[] array = new byte[8]; BitConverter.GetBytes(input).CopyTo(array, 0); Array.Reverse(array, 0, 8); PS3.SetMemory(address, array); }
private void PS3MAPI() { IsAttached = false; PS3.ChangeAPI(new PS3MAPI()); Settings.Default.API = "PS3MAPI"; Settings.Default.Save(); }
public static void WriteSByte(uint address, sbyte input) { byte[] bytes = new byte[1] { (byte)input }; PS3.SetMemory(address, bytes); }
public void ChangeName(string name) { foreach (uint nameA in Addresses.LocalName_a) { PS3.SetMemory(nameA, new byte[32]); PS3.Extension.WriteString(nameA, name); } RPC.CBuf_AddText($"name {name}"); }
public static Int64 Read8Bytes(uint Offset, bool Reverse) { Bytes = PS3.GetBytes(Offset, 8); if (Reverse) { Array.Reverse(Bytes); } return(BitConverter.ToInt64(Bytes, 0)); }
public static int Read4Bytes(uint Offset, bool Reverse) { Bytes = PS3.GetBytes(Offset, 4); if (Reverse) { Array.Reverse(Bytes); } return(BitConverter.ToInt32(Bytes, 0)); }
public GimxMaps() { ps3Map = new PS3(); mapSize = Marshal.SizeOf(ps3Map); buffer = new byte[PACKETSIZE]; // set the packet header buffer[0] = 0xff; buffer[1] = 0x80; }
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); }
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); }
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); }
public static void WriteUInt64(uint address, ulong[] input) { int num = input.Length; byte[] array = new byte[num * 8]; for (int i = 0; i < num; i++) { ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, i * 8); } PS3.SetMemory(address, array); }
public static void WriteSingle(uint address, float[] input) { int num = input.Length; byte[] array = new byte[num * 4]; for (int i = 0; i < num; i++) { ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, i * 4); } PS3.SetMemory(address, array); }
public static void WriteSBytes(uint address, sbyte[] input) { int num = input.Length; byte[] array = new byte[num]; for (int i = 0; i < num; i++) { array[i] = (byte)input[i]; } PS3.SetMemory(address, array); }
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); }
private void TimerNotifyOff_Tick(object sender, EventArgs e) { try { PS3.SetMemory(0x1C1FF66, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); PS3.Extension.WriteString(0x1C1FD65, ""); } catch { } TimerNotifyOff.Enabled = false; }
void Enable_RPC() { if (PS3.Extension.ReadBytes(functionAddress + 3, 1)[0] != 0x91) { PS3.SetMemory(functionAddress, 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(functionAddress + 0x4, func); PS3.SetMemory(0x10050000, new byte[0x2854]); PS3.SetMemory(functionAddress, new byte[] { 0xF8, 0x21, 0xFF, 0x91 }); } }
public void ChangeXUID(string xuid) { byte[] xuidB = xuid.HexStringToByteArray(); string xuidL = xuid.ToLower(); foreach (uint xuidA in Addresses.LocalXUID_a) { PS3.SetMemory(xuidA, xuidB); } PS3.Extension.WriteString(Addresses.LocalXUIDString_a, xuidL); RPC.CBuf_AddText($"xuid {xuidL}"); }
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!"; }
private void SetStats() { if (!GetAttached()) { return; } Stats.SetStats(UnlockAll); PS3.SetMemory(Addresses.StatsEntry[(uint)StatsType], Stats.Extension.Dump); Stats = null; SelectedClass = null; StatsEnabled = false; UnlockAll = false; StatsTypeEnabled = true; Status = $"Stats setted {(UnlockAll ? "with" : "without")} unlock all!"; }
/// <summary> /// Display a custom notification in-game (Credits to NotMyFaultv2 - https://cabconmodding.com/threads/c-c-bo2-notification.3013/). /// </summary> /// <param name="title"></param> /// <param name="caption"></param> /// <param name="shader"></param> public void NotifyMessagePS3(string title, string caption, string shader) { try { TimerNotifyOff.Enabled = false; PS3.SetMemory(0x1C1FE73, new byte[] { 0x28 }); PS3.Extension.WriteString(0x01C1FC65, title); PS3.Extension.WriteString(0x01C1FE65, shader); PS3.Extension.WriteString(0x1C1FD65, caption); PS3.SetMemory(0x1C1FF66, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); PS3.SetMemory(0x0D50025, new byte[] { 0x20 }); TimerNotifyOff.Enabled = true; } catch { } }
public static void SetUInt32(uint offset, uint Value, bool Reverse = false) { if (!Reverse) { PS3.SetMemory(offset, BitConverter.GetBytes(Value).Reverse <byte>().ToArray <byte>()); PS3.TMAPI.SetMemory(offset, BitConverter.GetBytes(Value).Reverse <byte>().ToArray <byte>()); PS3.CCAPI.SetMemory(offset, BitConverter.GetBytes(Value).Reverse <byte>().ToArray <byte>()); } else { PS3.SetMemory(offset, BitConverter.GetBytes(Value)); PS3.TMAPI.SetMemory(offset, BitConverter.GetBytes(Value)); PS3.CCAPI.SetMemory(offset, BitConverter.GetBytes(Value)); } }
void StartGameMode(int Time, int endTime) { Start = true; while (Start == true) { while (Time > 0) { Time--; iPrintlnBold(-1, "Hide Yourself before : ^2" + Time); Delay(1.0); } SelectedClient = random.Next(0, 11); Start = false; while (GetName(SelectedClient) == "") { SelectedClient = random.Next(0, 11); } for (int i = 0; i < 12; i++) { Freeze(i, true); } Freeze(SelectedClient, false); if (gameCombo.SelectedIndex == 2) { byte[] buffer = new byte[4]; buffer[3] = 0x60; PS3.Extension.WriteBytes(0x17811e0 + 0x5808 * (uint)SelectedClient, buffer); PS3.SetMemory(0x1781327 + 0x5808 * (uint)SelectedClient, new byte[] { 0x20 }); PS3.SetMemory(0x1781363 + 0x5808 * (uint)SelectedClient, new byte[] { 0x10 }); } iPrintlnBold(-1, "^2Freeze !! || ^1" + GetName(SelectedClient) + " ^7 Trying To Kill You "); iPrintlnBold(SelectedClient, " ^ 2 You Are Free Go Find & Kill Them "); Delay(2.0); while (endTime > 0) { endTime--; iPrintln(-1, "Game Ending In : ^1" + endTime); Delay(1.0); } startBtn.Text = "Start Game Mode"; startBtn.Refresh(); for (int i = 0; i < 12; i++) { Freeze(i, false); } } }
public void mapToPS3(Input.GamePadState state) { ps3Map = default(PS3); ps3Map.leftStickX = state.RawSate.Gamepad.sThumbLX >> 8; ps3Map.leftStickY = (state.RawSate.Gamepad.sThumbLY >> 8) * -1; ps3Map.rightStickX = state.RawSate.Gamepad.sThumbRX >> 8; ps3Map.rightStickY = (state.RawSate.Gamepad.sThumbRY >> 8) * -1; if (state.Buttons.Back) { if (state.Buttons.B) { ps3Map.ps = 1; } else { ps3Map.select = 1; } }; if (state.Buttons.Start) { ps3Map.start = 1; }; if (state.Buttons.Guide) { ps3Map.ps = 1; }; if (state.DPad.Up) { ps3Map.up = 255; }; if (state.DPad.Right) { ps3Map.right = 255; }; if (state.DPad.Down) { ps3Map.down = 255; }; if (state.DPad.Left) { ps3Map.left = 255; }; if (state.Buttons.Y) { ps3Map.triangle = 255; }; if (state.Buttons.B) { ps3Map.circle = 255; }; if (state.Buttons.A) { ps3Map.cross = 255; }; if (state.Buttons.X) { ps3Map.square = 255; }; if (state.Buttons.LeftShoulder) { ps3Map.l1 = 255; }; if (state.Buttons.RightShoulder) { ps3Map.r1 = 255; }; ps3Map.r2 = state.RawSate.Gamepad.bLeftTrigger; ps3Map.l2 = state.RawSate.Gamepad.bRightTrigger; if (state.Buttons.LeftStick) { ps3Map.l3 = 1; }; if (state.Buttons.RightStick) { ps3Map.r3 = 1; }; // Convert to byte array IntPtr ptr = Marshal.AllocHGlobal(mapSize); Marshal.StructureToPtr(ps3Map, ptr, true); Marshal.Copy(ptr, buffer, 2, mapSize); Marshal.FreeHGlobal(ptr); }