Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- namespace Advanced_IDC_Script_Creator___By_Sticky
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- public int IDCFuncAmount = 0;
- public string AddToIDC()
- {
- return " UpdateAddress(\"" + textBox6.Text + "\", " + "\"" + textBox7.Text + "\", " + textBox9.Text + ", " + textBox8.Text + ");" + Environment.NewLine;
- }
- public static byte[] GetBytesFromFile(string fullFilePath)
- {
- FileStream fs = null;
- try
- {
- fs = File.OpenRead(fullFilePath);
- byte[] bytes = new byte[fs.Length];
- fs.Read(bytes, 0, Convert.ToInt32(fs.Length));
- return bytes;
- }
- finally
- {
- if (fs != null)
- {
- fs.Close();
- fs.Dispose();
- }
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (textBox6.Text != "" && textBox7.Text != "" && textBox8.Text != "" && textBox9.Text != "")
- {
- label9.Text = "Functions Added: " + IDCFuncAmount.ToString();
- if (IDCFuncAmount < 1)
- textBox10.Text += "static UpdateOffsets()" + Environment.NewLine + "{" + Environment.NewLine + AddToIDC();
- else
- textBox10.Text += AddToIDC();
- IDCFuncAmount++;
- MessageBox.Show(textBox6.Text + " has been added to the IDC script!", "Function Added", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- textBox6.Text = "";
- textBox7.Text = "";
- textBox9.Text = "";
- }
- else
- MessageBox.Show("Please make sure to fill in all inquiries before adding function to the IDC!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- MessageBox.Show("Function name is how the updated offset will be output when the IDC is loaded into IDA... So if the function name is SetClientViewAngles, the offset that is found will be labled as SetClientViewAngles!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- MessageBox.Show("These bytes are completely unique to this address, you should not be able to find a reoccurance of these bytes. If there are reoccurances of the bytes it will not find the correct offset!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- MessageBox.Show("This is the length of the bytes default is 0x1B8. So 0x1B8 bytes would be like this 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- MessageBox.Show("The offset is the difference from the address where the unique bytes were found from where the address is. So if the address is 0x120040E5, and the bytes were found at 0x120040F5, the offset would be 0x10!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- private void howToUseToolStripMenuItem_Click(object sender, EventArgs e)
- {
- MessageBox.Show("To use these load the .elf of the game you want to update offsets for in IDA, then click File > Script File, and select the .idc file you wish to load, the address's or whatever should print to the output window if done correctly.", "How to Use", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- textBox10.ReadOnly = true;
- textBox10.BackColor = Color.White;
- }
- private void creditsToolStripMenuItem_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Sticky - Creating the tool\nNotorious - Teaching me stuff\nGodly - Original IDC script", "Credits", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- private void saveIDCToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- DialogResult dialogResult = saveFileDialog.ShowDialog();
- textBox10.Text += Environment.NewLine + "}" + Environment.NewLine + "static main()" + Environment.NewLine + "{" + Environment.NewLine + " UpdateOffsets();" + Environment.NewLine + " return 0;" + Environment.NewLine + "}";
- if (dialogResult == DialogResult.OK)
- {
- File.WriteAllText(saveFileDialog.FileName + ".idc", textBox10.Text);
- }
- MessageBox.Show("Your IDC has been saved, go to the information tab to see how to use it!", "File Saved", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- private void contactToolStripMenuItem_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Skype: live:formerlymalicious", "Contact Info", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement