Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- using System.Diagnostics;
- namespace test
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- // private System.IO.BinaryWriter BW;
- OpenFileDialog OFD = new OpenFileDialog();
- #region Offsets
- public static class Offsets
- {
- public static uint
- AdvancedUav = 0x130a3a,
- RedBoxes = 0x139134,
- GlowPlayers = 0x15ab63,
- NoRecoil = 0x6b65c0,
- LaserSight = 0x51dde7,
- UAV = 0x23538f8,
- Antiban1 = 0x6f0adc,
- Antiban2 = 0x6ef4d8,
- Antiban3 = 0x6ef164,
- Antiban4 = 0x6f0ad4,
- Antiban5 = 0x6f0ad8,
- Antiban6 = 0x6e41e8;
- // need to do some more
- }
- #endregion
- #region Bytes
- public static class Bytes
- {
- public static byte[] AdvancedUav = new byte[] { 0x01 };
- public static byte[] RedBoxes = new byte[] { 0x60, 0x00, 0x00, 0x00 };
- public static byte[] GlowPlayers = new byte[] { 0xf7 };
- public static byte[] NoRecoil = new byte[] { 0x60, 0x00, 0x00, 0x00 };
- public static byte[] LaserSight = new byte[] { 0x01 };
- public static byte[] UAV = new byte[] { 0x01 };
- public static byte[] Antiban1 = new byte[] { 0x30, 0xA5 };
- public static byte[] Antiban2 = new byte[] { 0x39 };
- public static byte[] Antiban3 = new byte[] { 0x38, 0x60 };
- public static byte[] Antiban4 = new byte[] { 0x38, 0xC0 };
- public static byte[] Antiban5 = new byte[] { 0x30, 0xE7 };
- public static byte[] Antiban6 = new byte[] { 0x3B, 160 };
- // need to do more
- }
- #endregion
- #region Program
- private void openELFToolStripMenuItem_Click(object sender, EventArgs e)
- {
- OFD.Filter = ".ELF Files|* .elf";
- if (OFD.ShowDialog() == DialogResult.OK)
- {
- if (OFD.SafeFileName == "default_mp.elf")
- {
- MessageBox.Show("default_mp.elf Successfully loaded", "Notice", MessageBoxButtons.OK);
- toolStripLabel1.Text = ".elf loaded !";
- }
- else
- {
- MessageBox.Show("You're missing files needed to use this program !", "Error", MessageBoxButtons.OK);
- }
- }
- //
- }
- public void DoWork(uint offset, byte[] bytes)
- {
- BinaryWriter bw = new BinaryWriter(File.OpenWrite(OFD.FileName));
- // bw.Seek((int)(offset), System.IO.SeekOrigin.Begin);
- Array.Reverse(bytes);
- bw.BaseStream.Position = offset;
- bw.Write(bytes);
- bw.Close();
- }
- private void buildEBOOTToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Cursor.Current = Cursors.WaitCursor;
- if (File.Exists("default_mp.elf.backup"))
- {
- File.Delete("default_mp.elf.backup");
- }
- if (!File.Exists("default_mp.elf"))
- {
- MessageBox.Show("default_mp.elf not found!", "Error", MessageBoxButtons.OK);
- }
- else
- {
- File.Copy("default_mp.elf", "default_mp.elf.backup");
- }
- if (File.Exists("EBOOT.BIN"))
- {
- if (File.Exists("EBOOT.BIN.backup"))
- {
- File.Delete("EBOOT.BIN.backup");
- }
- else
- {
- File.Copy("EBOOT.BIN", "EBOOT.BIN.backup");
- }
- }
- if (AdvUavCheck.Checked)
- {
- DoWork(Offsets.AdvancedUav, Bytes.AdvancedUav);
- }
- if (NoRecoilCheck.Checked)
- {
- DoWork(Offsets.NoRecoil, Bytes.NoRecoil);
- }
- if (LaserSightCheck.Checked)
- {
- DoWork(Offsets.LaserSight, Bytes.LaserSight);
- }
- if (UavCheck.Checked)
- {
- DoWork(Offsets.UAV, Bytes.UAV);
- }
- if (AntibanCheck.Checked)
- {
- DoWork(Offsets.Antiban1, Bytes.Antiban1);
- DoWork(Offsets.Antiban2, Bytes.Antiban2);
- DoWork(Offsets.Antiban3, Bytes.Antiban3);
- DoWork(Offsets.Antiban4, Bytes.Antiban4);
- DoWork(Offsets.Antiban5, Bytes.Antiban5);
- DoWork(Offsets.Antiban6, Bytes.Antiban6);
- }
- if (GlowPlayersCheck.Checked)
- {
- DoWork(Offsets.GlowPlayers, Bytes.GlowPlayers);
- }
- // do more
- if (File.Exists("Debug.bat"))
- {
- System.Threading.Thread loading = new System.Threading.Thread(new System.Threading.ThreadStart(Thread));
- Process P = new Process();
- P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
- P.StartInfo.FileName = "Debug.bat";
- P.Start();
- MessageBox.Show("EBOOT successfully created", "Notice", MessageBoxButtons.OK);
- toolStripLabel1.Text = "EBOOT Built !";
- }
- else
- {
- MessageBox.Show("You're missing files needed to use this program !!", "Error", MessageBoxButtons.OK);
- }
- }
- public static void Thread() { }
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement