private void buttonADDAOB_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.textBox4.Text) && !string.IsNullOrWhiteSpace(this.textBox4.Text)) { DialogResult Message = MessageBox.Show("Add this AOB to the List?", "Mika Cybertron", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (Message == DialogResult.OK) { this.listBox1.Items.Add(this.InsertSpaces(AOB.Format(this.textBox4.Text))); this.textBox4.Text = string.Empty; } } else { MessageBox.Show("The TextBox is Empty!", "Mika Cybertron", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void PatternScan(string fileName, string ScanAOB) { try { this.RealOffsets = 0; this.OriginalHex = null; this.NewOffset = string.Empty; this.NewHexCode = string.Empty; this.OriginalHex = this.ReadFile(fileName); var signatures = new[] { new AOBSignature("New Offsets", ScanAOB.Replace(" ", "")), }; var result = AOB.Scan(this.ReadFile(fileName), signatures); //foreach(var Signature in result) for (int i = 0; i < result.Length; i++) { // New Offsets this.RealOffsets = result[i].FoundOffset; // New Hex Code StringBuilder originalBytes = new StringBuilder(); if (this.OriginalHex != null) { if (this.RealOffsets > 0) { string array = ScanAOB.Replace(" ", ""); int InitArray = array.Length / 2; for (int k = (int)this.RealOffsets; k < (int)this.RealOffsets + InitArray; k++) { originalBytes.Append(this.OriginalHex[k].ToString("X2") + " "); } } } this.NewOffset = "0x" + result[i].FoundOffset.ToString("X"); this.NewHexCode = originalBytes.ToString().TrimEnd(' '); } } catch (Exception Error) { MessageBox.Show(Error.Message, "Mika Cybertron", MessageBoxButtons.OK, MessageBoxIcon.Error); this.richTextBox2.AppendText(Error.Message + "\n"); } }
public AOBSignature(string name, string pattern) { Name = name; Pattern1 = AOB.Transform(pattern); FoundOffset = -1; }