private void connectCex_Click(object sender, EventArgs e) { PS3.ChangeAPI(SelectAPI.ControlConsole); if (connectCex.Text == "Connect [ CEX ]") { if (PS3.ConnectTarget()) { flatLabel2.ForeColor = Color.White; flatLabel2.Text = "Connected"; connectCex.Text = "Attach"; } else { flatLabel2.Text = "Can't Connect"; flatLabel2.ForeColor = Color.Red; } } else if (connectCex.Text == "Attach") { if (PS3.AttachProcess()) { flatLabel3.ForeColor = Color.White; flatLabel3.Text = "Attached"; RPC.Enable(); } else { flatLabel3.Text = "Can't Attach"; flatLabel3.ForeColor = Color.Red; } } }
public static void AttachProcess() { PS3TMAPI.GetProcessList(0, out ProcessIDs); ulong num = ProcessIDs[0]; ProcessID = Convert.ToUInt32(num); PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID); PS3TMAPI.ProcessContinue(0, ProcessID); DEX.AttachProcess(); DEX.AttachProcess(); }
private void AttachButton_Click(object sender, EventArgs e) { if (PS3.AttachProcess()) { MessageBox.Show("Attached to process", "Attached", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); groupBox2.Enabled = true; } else { MessageBox.Show("Could not attach to process", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
static PS3API ConnectAndAttach(SelectAPI api) { PS3API PS3 = new PS3API(api); try { if (!PS3.ConnectTarget()) { PrintWithColor("[ERROR] Could not connect and attach.", ConsoleColor.Red); return(null); } if (!PS3.AttachProcess()) { PrintWithColor("[ERROR] Could not attach to process.", ConsoleColor.Red); return(null); } string message = string.Format("[INFO] Connected and attached to {0}.", PS3.GetConsoleName()); PrintWithColor(message, ConsoleColor.Blue); return(PS3); } catch { PrintWithColor("[ERROR] Could not connect or attach. Check internet connection.", ConsoleColor.Red); return(null); } }
private void button8_Click(object sender, EventArgs e) { try { if (!label2.Text.Contains("Not Connected")) { if (!PS3.AttachProcess()) { label2.Text = "Status: Connected || Not Attached"; } else { label2.Text = "Status: Connected || Attached"; PS3.SetMemory(0x31d9ab91, Encoding.ASCII.GetBytes(fixText("Menu Base\0\0\0"))); } } else { label2.Text = "Status: Not Connected || Not Attached"; } } catch (Exception) { label2.Text = "Status: Connected || Not Attached"; } }
private void flatButton2_Click(object sender, EventArgs e) { string API = PS3.GetCurrentAPIName(); string Check = flatTextBox1.Text; if (PS3.AttachProcess()) { int MsgC = (int)MessageBox.Show("Black Ops 2 Has been attached", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); if (API == "Control Console") { PS3.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Double); PS3.CCAPI.Notify(CCAPI.NotifyIcon.INFO, "Thanks For Using My Tool <3"); } flatStatusBar1.Text = "Welcome To The Tool - " + PS3.Extension.ReadString(0x26c067f); nameBox.Text = PS3.Extension.ReadString(0x26c067f); storedName = nameBox.Text; PS3.SetMemory(0x8E3590, new byte[] { 0x94, 50, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32 }); PS3.SetMemory(0x37FEC, new byte[] { 0x60, 0x00, 0x00, 0x00 }); if (Check == "Custom Text") { WriteFPS("TehMerkMods Menu"); } else { WriteFPS(Check); } CallInjector(); } else { int MsgE = (int)MessageBox.Show("No Game Process Found", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
bool Connection(SelectAPI API) { PS3.ChangeAPI(API); bool state = PS3.ConnectTarget(); if (state) { ctext.Text = state ? "Connected" : "Not Connected"; ctext.ForeColor = state ? Color.Blue : Color.Red; state = PS3.AttachProcess(); if (state) { atext.Text = state ? "Attached" : "Not Attached"; atext.ForeColor = state ? Color.Blue : Color.Red; MLevel.Enabled = true; MMoney.Enabled = true; GOD.Enabled = true; speed.Enabled = true; weapons.Enabled = true; physics.Enabled = true; clip.Enabled = true; } } return(state); }
private void simpleButton4_Click(object sender, EventArgs e) { try { if (PS3.AttachProcess()) { byte[] buffer = new byte[] { 0x41, 0x00 }; PS3.SetMemory(0x00262b38, buffer); PS3.Extension.WriteString(0x004eb39c, "Menu Closed"); groupControl2.Enabled = true; label1.Text = "PS3 Connected | Attached"; label1.ForeColor = Color.Lime; simpleButton4.Enabled = false; simpleButton1.Enabled = false; } else { groupControl2.Enabled = false; XtraMessageBox.Show("Failed to Attach Process !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception) { XtraMessageBox.Show("Failed to Attach Process !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void metroButton2_Click(object sender, EventArgs e) { PS3.AttachProcess(); PS3.CCAPI.Notify(CCAPI.NotifyIcon.INFO, "PsToolPro est connecter"); PS3.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Single); MessageBox.Show("PSToolPro est attacher avec succès.", "Attacher avec succès."); metroLabel2.Text = "Attacher: Oui"; }
private void monoFlat_Button1_Click(object sender, EventArgs e) { PS3.ChangeAPI(SelectAPI.ControlConsole); PS3.ConnectTarget(); PS3.AttachProcess(); MessageBox.Show("Vous éte connecter & attacher ;)"); monoFlat_Button1.Text = "PS3 connecter"; }
private void monoFlat_Button1_Click(object sender, EventArgs e) { try { if (PS3.ConnectTarget() && PS3.AttachProcess()) { RPC.Enable_RPC(); byte[] buffer = new byte[0x530]; byte[] buffer2 = buffer; byte[] buffer3 = new byte[] { 0x38, 0x60, 0, 0, 60, 0x80, 2, 0, 0x30, 0x84, 80, 0, 0x4b, 0xf3, 0x35, 9, 0x4b, 0xff, 0xfb, 0x7c }; byte[] buffer4 = new byte[] { 130, 0xb9, 0, 0, 60, 0xe0, 0, 0xd7, 0x3d, 0x80, 0, 0x92, 0x56, 0xa4, 0x38, 0x30, 0x56, 0xbb, 0x18, 0x38 }; byte[] buffer5 = new byte[] { 0x73, 0x65, 0x74, 0x20, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x20, 0x31, 0x3b, 0x6f, 110, 0x6c, 0x69, 110, 0x65, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x31, 0x3b, 0x6f, 110, 0x6c, 0x69, 110, 0x65, 0x67, 0x61, 0x6d, 0x65, 0x61, 110, 100, 0x68, 0x6f, 0x73, 0x74, 0x20, 0x31, 0x3b, 0x6f, 110, 0x6c, 0x69, 110, 0x65, 0x75, 110, 0x72, 0x61, 110, 0x6b, 0x65, 100, 0x67, 0x61, 0x6d, 0x65, 0x61, 110, 100, 0x68, 0x6f, 0x73, 0x74, 0x20, 0x30, 0x3b, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 110, 0x5f, 0x6d, 0x73, 0x67, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x30, 0x3b, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 110, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x65, 0x74, 0x77, 0x65, 0x65, 110, 0x20, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x3b, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 110, 80, 0x69, 110, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x30, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x6d, 0x69, 110, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x31, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 100, 80, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x6f, 0x75, 110, 0x74, 0x20, 0x30, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x63, 0x6f, 110, 110, 0x65, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x31, 0x30, 0x30, 0x30, 0x3b, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x63, 0x6f, 110, 110, 0x65, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x31, 0x22, 0 }; buffer = new byte[] { 0x41 }; byte[] buffer6 = buffer; buffer = new byte[] { 0x40 }; byte[] buffer7 = buffer; PS3.SetMemory(0x2005000, buffer5); PS3.SetMemory(0x466298, buffer6); PS3.SetMemory(0x4667b4, buffer3); Thread.Sleep(15); PS3.SetMemory(0x466298, buffer7); PS3.SetMemory(0x4667b4, buffer4); PS3.SetMemory(0x2005000, buffer2); MessageBox.Show("Connected !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Not Connected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception) { MessageBox.Show("Not Connected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAttach_Click(object sender, EventArgs e) { if (PS3.AttachProcess()) { MessageBox.Show("Current game is attached successfully.", "Success.", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("No game process found!", "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button2_Click(object sender, EventArgs e) { if (PS3.AttachProcess()) { MessageBox.Show("Process Attached"); } else { string Message = "Impossible to attach"; MessageBox.Show(Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnConnect_ClickButtonArea(object Sender, MouseEventArgs e) { if (PS3.ConnectTarget(0)) { useCCAPI.Enabled = false; useTMAPI.Enabled = false; if (PS3.AttachProcess()) { notifyBlackOps2("^2Hooked to Atomic", "Successfully connected and attached", "party_ready"); PopupBox.lblStatus.Text = "Successfully connected and attached \nGsc mods restored"; PopupBox.Text = "Success"; PopupBox.ShowDialog(this); btnConnectAttach.Text = "Connected && Attached to Black Ops II"; btnConnectAttach.Enabled = false; btnSetName.Enabled = true; txtChangeName.Enabled = true; btnConnectAttach.ForeColor = Color.DarkGray; btnSetName.ForeColor = Color.White; lblTitleModMenu.ForeColor = Color.White; cmboItemsGscMenus.Enabled = true; lblTitleGameMode.ForeColor = Color.White; cmboItemsGscModes.Enabled = true; lblTitleModMenuZM.ForeColor = Color.White; cmboItemsGscMenusZM.Enabled = true; Original = 0x3045E820; New = 0x10040000; Pointer = 0x140C2D0; OriginalByte = new byte[] { 0x30, 0x45, 0xE8, 0x20 }; NewByte = new byte[] { 0x10, 0x04, 0x00, 0x00 }; PS3.Extension.WriteUInt32(Pointer, Original); } else { PopupBox.lblStatus.Text = "Unable to attach to game process"; PopupBox.Text = "Error"; PopupBox.ShowDialog(this); } } else { PopupBox.lblStatus.Text = "Unable to connect to PS3"; PopupBox.Text = "Error"; PopupBox.ShowDialog(this); } }
private bool processAttach() { if (PS3API.AttachProcess()) { MessageBox.Show("Attached to process"); return(true); } else { MessageBox.Show("Could not attach to process"); } return(false); }
//Attaches to the game process (PS3 or PC). If using the PS3 API, make sure the target is connected first. public bool AttachProcess() { if (CurrentAPI == SelectAPI.PS3Lib) { return(PS3API.AttachProcess()); } else { try { RPCS3 = new ProcessMemoryAccessor("rpcs3", 0x100000000); } catch { return(false); } return(true); } }
private void Attach_Click(object sender, EventArgs e) { try { if (PS3.AttachProcess()) //If the PS3 is successfully connected to the computer and Warhawk { MessageBox.Show("Attached To Process! Have Fun Modding!", "Successful", MessageBoxButtons.OK); } } catch (Exception) //Handles the exception if the PS3 was not able to attach to Warhawk { MessageBox.Show("Unable To Attach To Process", "Unsuccessful", MessageBoxButtons.OK); } }
private void toolStripButton1_Click(object sender, EventArgs e) { // Select API SelectAPI API; if (tMAPIToolStripMenuItem.Checked) { API = SelectAPI.TargetManager; } else if (cCAPIToolStripMenuItem.Checked) { API = SelectAPI.ControlConsole; } else { API = SelectAPI.TargetManager; } PS3.ChangeAPI(API); // Attempt to connect to target if (!PS3.ConnectTarget()) { DialogResult dialogResult = MessageBox.Show("Could not connect to target", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); // If the user clicks the retry button if (dialogResult == DialogResult.Retry) { toolStripButton1_Click(sender, e); } return; } // Attempt to attach to process if (!PS3.AttachProcess()) { DialogResult dialogResult = MessageBox.Show("Could not attach to process", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); // If the user clicks the retry button if (dialogResult == DialogResult.Retry) { toolStripButton1_Click(sender, e); } return; } // If the user successfully connects and attaches tabControl1.Enabled = true; // Enable features of the program statusPrint("Successfully connected and attached", Color.Green); // Print success at the bottom of the screen }
private void button2_Click(object sender, EventArgs e) { try { PS3.AttachProcess(); label18.Text = "Attached!"; label18.ForeColor = Color.Green; } catch { MessageBox.Show("Could not attach to the process! Is the process active?", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); label18.Text = "Failed!"; label18.ForeColor = Color.Gold; } }
private void button1_Click(object sender, EventArgs e) { try { if (PS3.ConnectTarget(0)) { PS3.AttachProcess(); MessageBox.Show($"Connected and Attached with {PS3.GetCurrentAPIName()} "); } else { MessageBox.Show("Could not Connect/attach"); } } catch { MessageBox.Show(e.ToString()); } }
private void attach_button_Click(object sender, EventArgs e) { if (PS3.AttachProcess()) { MessageBox.Show("Process attached!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); attach_button.Text = "Attached"; attach_button.ForeColor = Color.HotPink; startmenu_button.Enabled = true; } else { MessageBox.Show("Could not attach to process", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void firefoxButton2_Click(object sender, EventArgs e) { try { if (PS3.AttachProcess()) { MessageBox.Show("Process Attached !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("An Error As Occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception) { MessageBox.Show("An Error As Occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void skyDarkButton1_Click(object sender, EventArgs e) { try { if (PS3.ConnectTarget() && PS3.AttachProcess()) { if (skyDarkCheck1.Checked) { PS3.SetMemory(0x5bc86c, new byte[1]); PS3.Extension.ReadUInt32(0x5bedc4); PS3.Extension.ReadUInt32(0x5bcdbc); PS3.Extension.ReadUInt32(0x668960); PS3.Extension.ReadUInt32(0x668fa0); PS3.Extension.ReadUInt32(0x7ec434); PS3.Extension.ReadUInt32(0x678f68); PS3.Extension.ReadUInt32(0x5bcd24); PS3.Extension.ReadUInt32(0x79542c); PS3.Extension.ReadUInt32(0x795444); toolStripStatusLabel5.Text = "Enable !"; toolStripStatusLabel5.ForeColor = Color.Lime; } toolStripStatusLabel2.Text = "Linked !"; toolStripStatusLabel2.ForeColor = Color.Lime; byte[] FPSOn = new byte[] { 0x2C, 0x03, 0x01 }; PS3.SetMemory(FPSEnable, FPSOn); byte[] FPSXs = new byte[] { 0x43, 0x62 }; PS3.SetMemory(FPSX, FPSXs); byte[] FPSYs = new byte[] { 0x41, 0xD8 }; PS3.SetMemory(FPSY, FPSYs); WriteText("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n^1-- ^5P^7ress ^2Start Menu ^5T^7o ^5I^7nitialise ^5M^7enu ^1--"); } else { toolStripStatusLabel2.Text = "Failed to link PS3 !"; toolStripStatusLabel2.ForeColor = Color.Red; } } catch (Exception) { toolStripStatusLabel2.Text = "Failed to link PS3 !"; toolStripStatusLabel2.ForeColor = Color.Red; } }
private void MetroButton3_Click(object sender, EventArgs e) { try { PS3.AttachProcess(); MessageBox.Show("Successfully Attached to Proccess!", "Attached", MessageBoxButtons.OK, MessageBoxIcon.Information); PS3.CCAPI.Notify(CCAPI.NotifyIcon.WRONGWAY, "Attached"); metroLabel2.Text = PS3.Extension.ReadString(0x3000ABE4); } catch { MessageBox.Show("Failed to Attach", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); PS3.CCAPI.Notify(CCAPI.NotifyIcon.WRONGWAY, "Failed To Attach"); PS3.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Double); } }
private void attachProcessToolStripMenuItem_Click(object sender, EventArgs e) { if (PS3.AttachProcess()) { /* Enable RemoteProcedureCalls */ MW3_BOT.RPCEnable_124(); /* Enable ForceHost (minpartyplayer = 1) */ //MW3_BOT.ForceHost_124(); MessageBox.Show("Current game is attached successfully.", "MW3Guard", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); attachProcessToolStripMenuItem.Enabled = false; initializeGuarderToolStripMenuItem.Enabled = true; enableForceHostToolStripMenuItem.Enabled = true; } else { MessageBox.Show("No game process found!", "MW3Guard", MessageBoxButtons.OK, MessageBoxIcon.Error); initializeGuarderToolStripMenuItem.Enabled = false; enableForceHostToolStripMenuItem.Enabled = false; } }
/// <summary> /// Connect and attach to your PlayStation 3. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConnectAndAttachButton_Click(object sender, RoutedEventArgs e) { clickSound.Play(); if (mainPS3.ConnectTarget()) { if (mainPS3.AttachProcess()) { isConnected = true; } // Failed to attach. else { if (currentAPI == SelectAPI.ControlConsole) { MessageBox.Show("Connected, but failed to attach with: \"Control Console API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); } else if (currentAPI == SelectAPI.TargetManager) { MessageBox.Show("Connected, but failed to attach with: \"Target Manager API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); } } } // Failed to connect. else { if (currentAPI == SelectAPI.ControlConsole) { MessageBox.Show("Failed to connect & attach with: \"Control Console API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); } else if (currentAPI == SelectAPI.TargetManager) { MessageBox.Show("Failed to connect & attach with: \"Target Manager API\"", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void elegantThemeButton1_Click(object sender, EventArgs e) { try { if (PS3.ConnectTarget() && PS3.AttachProcess()) { toolStripStatusLabel2.Text = "Linked !"; toolStripStatusLabel2.ForeColor = Color.Lime; WritePPC(); } else { toolStripStatusLabel2.Text = "Not Linked !"; toolStripStatusLabel2.ForeColor = Color.Red; } } catch (Exception) { toolStripStatusLabel2.Text = "Not Linked !"; toolStripStatusLabel2.ForeColor = Color.Red; } }
public static void Attach() { DEX.AttachProcess(); }
public static void Attach1() { CEX.AttachProcess(); }
static void Main(string[] args) { /* * Check and create default files */ // Create _cheat.gsc in working directory if it doesnt exist if (!File.Exists("_cheat.gsc")) { byte[] cheat_buffer = Properties.Resources._cheat; File.WriteAllBytes("_cheat.gsc", cheat_buffer); } // Create config.json in working directory if it doesnt exist if (!File.Exists("config.json")) { Config config = new Config(); config.API = 0; // 0 = TMAPI, 1 = CCAPI config.Hook.Path = "_cheat.gsc"; config.Hook.Pointer = 0x00E92738; // _cheat.gsc pointer address in rawfile table config.Hook.Default.Buffer = 0x30368E40; // Default _cheat.gsc buffer address stored at the pointer config.Hook.Default.Length = 0x0000092E; // Default _cheat.gsc length, not the modified one config.Hook.Custom.Buffer = 0x02000000; // Modified _cheat.gsc buffer address to be set at the pointer config.Injection.Pointer = 0x00E9281C; // _dev.gsc pointer address in rawfile table config.Injection.Default.Buffer = 0x3037A8C0; // Default _dev.gsc buffer address stored at the pointer config.Injection.Default.Length = 0x00000040; // Default _dev.gsc length, not the modified one /*NOTE: There is no custom injection buffer address because we just grab the one for the hook and add the length of the hook script to it*/ // Write config.json to disk WriteConfig(config); } // Load config and set it for the current session _config = JsonConvert.DeserializeObject <Config>(File.ReadAllText("config.json")); /* * Parameter parsing */ if (args.Length > 0) { switch (args[0]) { default: // Inject project dir _project_dir = args[0]; // Check if project dir exists if (!Directory.Exists(_project_dir)) { Console.WriteLine("ERROR: Directory doesn't exist"); return; } // Check if 'main.gsc' exists in dir if (!File.Exists(_project_dir + @"\main.gsc")) { Console.WriteLine("ERROR: 'main.gsc' does not exist in root of project directory"); return; } break; case "change-api": case "api": _config.API = (_config.API == 0) ? 1 : 0; WriteConfig(_config); Console.WriteLine("Changed active API to " + ((_config.API == 0) ? "TMAPI" : "CCAPI")); return; case "reset": case "r": UpdateRawfileTable(_config.Hook.Pointer, _config.Hook.Default.Buffer, _config.Hook.Default.Length); UpdateRawfileTable(_config.Injection.Pointer, _config.Injection.Default.Buffer, _config.Injection.Default.Length); break; } } else { Console.WriteLine("ERROR: No project directory defined"); return; } /* * Connect and attach PS3 */ _PS3 = new PS3API(_config.API == 0 ? SelectAPI.TargetManager : SelectAPI.ControlConsole); if (!_PS3.ConnectTarget()) { Console.WriteLine("ERROR: Could not connect to target"); return; } if (!_PS3.AttachProcess()) { Console.WriteLine("ERROR: Could not attach to process"); return; } /* * Project creation */ _project = Directory.GetFiles(_project_dir, "*.gsc", SearchOption.AllDirectories).ToList(); // Iterate through each file in project for (int i = 0; i < _project.Count; i++) { /*Syntax check*/ // File is not empty string data = File.ReadAllText(_project[i]); if (!string.IsNullOrWhiteSpace(data)) { // Check if any errors were returned string err = GSCGrammar.CheckSyntax(File.ReadAllText(_project[i])); if (!string.IsNullOrWhiteSpace(err)) { Console.WriteLine("ERROR: Syntax on line " + err + " in " + _project[i]); return; } } // Move 'main.gsc' to top of project list if (_project[i] == _project_dir + @"\main.gsc") { string pop = _project[i]; _project.RemoveAt(i); _project.Insert(0, pop); } } foreach (string element in _project) { Console.WriteLine(element.Replace(_project_dir, "")); } /* * Plaintext buffer creation */ string ptbuffer = string.Join("\n", _project.Select(x => File.ReadAllText(x))); /* * Compression and injection */ byte[] hook_buffer = CompileScript(File.ReadAllBytes(_config.Hook.Path)); byte[] inj_buffer = CompileScript(Encoding.ASCII.GetBytes(ptbuffer)); // Inject files InjectScript(_config.Hook.Pointer, _config.Hook.Custom.Buffer, hook_buffer); InjectScript(_config.Injection.Pointer, _config.Hook.Custom.Buffer + (uint)inj_buffer.Length, inj_buffer); /* * Done */ Console.WriteLine("Successfully injected scripts"); }