private void findKnownFunctions() { string[] files = Directory.GetFiles("./KnownFunctions/"); ls.progressBar1.Maximum = spu.LocalStorageCommands.Length; ls.progressBar1.Value = 0; ls.Show(); foreach (string file in files) { ls.label1.Text = "Searching '" + file + "'..."; SPUKnownFunction func = new SPUKnownFunction(file); func.findYourself(spu, ls); ls.Refresh(); } ls.Hide(); updateUI(); }
public void buildLocalStorageCommands() { LoadingScreen ls = new LoadingScreen(); ls.progressBar1.Maximum = LocalStorage.Length; ls.progressBar1.Value = 0; ls.label1.Text = "Building SPU Commands out of LocalStorage..."; ls.Show(); for (int i = 0; i < LocalStorage.Length - 3; i += 4) { LocalStorageCommands[i >> 2] = new SPUCommand(LocalStorage, i); if ((i & 0xFF) == 0) { ls.progressBar1.Value = i; ls.Refresh(); } } ls.Hide(); }
public void findYourself(SPU spu, LoadingScreen ls) { for (int i = 0; i < spu.LocalStorageCommands.Length; i++) { if (spu.LocalStorageCommands[i].mnemonics == mnemonics[0]) { int end = findYourselfCheckDeeper(spu, i); if (end != -1) { SPUDumper.Instance.FunctionFoundDump(i<<2, end<<2, name); for (; i < end; i++) spu.LocalStorageCommands[i].functionName = name; } } if ((i & 0xFF) == 0) { ls.progressBar1.Value = i; ls.Refresh(); } } }
private void button1_Click(object sender, EventArgs e) { listBox1.Items.Clear(); LoadingScreen ls = new LoadingScreen(); ls.progressBar1.Maximum = spu.LocalStorage.Length; ls.progressBar1.Value = 0; ls.label1.Text = "Process Local Storage Watcher..."; ls.Show(); string MemString = ""; string offset = "00000000"; for (int i = 0; i < spu.LocalStorage.Length; i++) { if ((i & 0xF) == 0 && i != 0) { if (MemString != "") { listBox1.Items.Add(offset + ":" + MemString); } MemString = ""; offset = "00000000" + i.ToString("X"); offset = offset.Substring(offset.Length - 8); } string val = ("00" + spu.LocalStorage[i].ToString("X")); MemString += " 0x" + val.Substring(val.Length - 2); if ((i & 0xFFF) == 0) { ls.progressBar1.Value = i; ls.Refresh(); } } if (MemString != "") { listBox1.Items.Add(offset + ":" + MemString); } ls.Hide(); MessageBox.Show("Local Storage watcher Refreshed."); }
public void findYourself(SPU spu, LoadingScreen ls) { for (int i = 0; i < spu.LocalStorageCommands.Length; i++) { if (spu.LocalStorageCommands[i].mnemonics == mnemonics[0]) { int end = findYourselfCheckDeeper(spu, i); if (end != -1) { SPUDumper.Instance.FunctionFoundDump(i << 2, end << 2, name); for (; i < end; i++) { spu.LocalStorageCommands[i].functionName = name; } } } if ((i & 0xFF) == 0) { ls.progressBar1.Value = i; ls.Refresh(); } } }
private void button1_Click(object sender, EventArgs e) { ls.label1.Text = "Building Code Section of Local Storage..."; ls.progressBar1.Maximum = spu.LocalStorageCommands.Length; ls.progressBar1.Value = 0; ls.Show(); this.listBox1.Items.Clear(); for (int i = 0; i < spu.LocalStorageCommands.Length; i++) { int offset = i << 2; bool breakPoint = SPUBreakpoints.Instance.isBreakPoint(offset); string offsetString = ("00000000" + offset.ToString("X")); offsetString = offsetString.Substring(offsetString.Length - 8); this.listBox1.Items.Add(((breakPoint) ? "[B]0x" : "[-]0x") + offsetString + ": " + spu.LocalStorageCommands[i].fullCommand + "\t\t" + spu.LocalStorageCommands[i].functionName); if ((i & 0xFF) == 0) { ls.progressBar1.Value = i; ls.Refresh(); } } ls.Hide(); MessageBox.Show("CodeWatcher refreshed"); }