private void saveAsEbootButton_Click(object sender, EventArgs e)
        {
            ushort rowCount = PS3ELF.GetSegmentCount(ELF);

            for (int i = 1; i <= rowCount; i++)
            {
                ulong segFlags = 0;

                if ((bool)dataGridView1.Rows[i - 1].Cells[4].Value)
                {
                    segFlags |= PS3ELF.SEGMENT_FLAGS.PROT_READ;
                }

                if ((bool)dataGridView1.Rows[i - 1].Cells[5].Value)
                {
                    segFlags |= PS3ELF.SEGMENT_FLAGS.PROT_WRITE;
                }

                if ((bool)dataGridView1.Rows[i - 1].Cells[6].Value)
                {
                    segFlags |= PS3ELF.SEGMENT_FLAGS.PROT_EXEC;
                }

                PS3ELF.SetFlags(ELF, i, segFlags);
            }

            File.WriteAllBytes("EBOOT.ELF", ELF);

            System.Diagnostics.Process          process   = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
            startInfo.WindowStyle      = System.Diagnostics.ProcessWindowStyle.Hidden;
            startInfo.WorkingDirectory = System.IO.Directory.GetCurrentDirectory();
            startInfo.FileName         = @"C:\Windows\System32\cmd.exe";
            startInfo.Arguments        = "/c make_fself.exe EBOOT.ELF EBOOT.BIN";
            process.StartInfo          = startInfo;
            process.Start();

            System.Threading.Thread.Sleep(500);

            byte[] EBOOT = File.ReadAllBytes("EBOOT.BIN");

            SaveFileDialog savefile = new SaveFileDialog();

            savefile.FileName = "EBOOT.BIN";
            savefile.Filter   = "BIN Files|*.bin";

            if (savefile.ShowDialog() == DialogResult.OK)
            {
                File.WriteAllBytes(savefile.FileName, EBOOT);
            }

            File.Delete("EBOOT.BIN");
            File.Delete("EBOOT.ELF");
        }
        private void saveAsElfFileButton_Click(object sender, EventArgs e)
        {
            ushort rowCount = PS3ELF.GetSegmentCount(ELF);

            for (int i = 1; i <= rowCount; i++)
            {
                ulong segFlags = 0;

                if ((bool)dataGridView1.Rows[i - 1].Cells[4].Value)
                {
                    segFlags |= PS3ELF.SEGMENT_FLAGS.PROT_READ;
                }

                if ((bool)dataGridView1.Rows[i - 1].Cells[5].Value)
                {
                    segFlags |= PS3ELF.SEGMENT_FLAGS.PROT_WRITE;
                }

                if ((bool)dataGridView1.Rows[i - 1].Cells[6].Value)
                {
                    segFlags |= PS3ELF.SEGMENT_FLAGS.PROT_EXEC;
                }

                PS3ELF.SetFlags(ELF, i, segFlags);
            }

            SaveFileDialog savefile = new SaveFileDialog();

            savefile.FileName = "EBOOT.ELF";
            savefile.Filter   = "ELF Files|*.elf";

            if (savefile.ShowDialog() == DialogResult.OK)
            {
                File.WriteAllBytes(savefile.FileName, ELF);
            }
        }