public void update_proclist(List <string> data) { procList.BeginUpdate(); foreach (string name in data) { ProcEntry proc = new ProcEntry(); proc.name = name; proc.disassembly = null; procNames.Add(name); procList.Items.Add(name); procInfos.Add(name, proc); //MessageBox.Show(procInfos[proc.procName].ToString()); } procList.EndUpdate(); }
public void receive_data() { while (true) { string strMsg = reader.ReadLine(); if (string.IsNullOrEmpty(strMsg)) { continue; } //MessageBox.Show("Reading"); //writer.Write("ignore\n"); //writer.Flush(); Message msg = JsonConvert.DeserializeObject <Message>(strMsg); //MessageBox.Show(line); if (msg.type == "disassembly") { f**k = JsonConvert.DeserializeObject <List <ProcInfoRow> >(msg.content); oSignalEvent.Set(); } else if (msg.type == "debugger current") { Shit shit = JsonConvert.DeserializeObject <Shit>(msg.content); ProcInfoRow pir = disassembly.CurrentRow.DataBoundItem as ProcInfoRow; if (pir != null) { pir.isCurrent = ""; } int currentStep; ProcEntry fuckass = procInfos[shit.procname]; for (int i = 0; i < fuckass.disassembly.Count; i++) { procInfos[shit.procname].disassembly[i].isCurrent = ""; if (procInfos[shit.procname].disassembly[i].Offset == shit.offset) { procInfos[shit.procname].disassembly[i].isCurrent = ">"; currentStep = i; } } Invoke(new Action(() => { int hack = disassembly.FirstDisplayedScrollingRowIndex; int current = disassembly.CurrentRow.Index; BindingSource bs = new BindingSource(); bs.DataSource = procInfos[shit.procname].disassembly; disassembly.DataSource = bs; disassembly.Rows[current].Selected = true; disassembly.FirstDisplayedScrollingRowIndex = hack; })); } else if (msg.type == "local variables" && msg.content != null) { //MessageBox.Show(msg.content); List <LocalVariable> locals = JsonConvert.DeserializeObject <List <LocalVariable> >(msg.content); Invoke(new Action(() => { BindingSource bs = new BindingSource(); if (locals != null) { bs.DataSource = locals; } else { bs.DataSource = new List <LocalVariable>(); } localVariables.DataSource = bs; })); } else if (msg.type == "arguments" && msg.content != null) { //MessageBox.Show(msg.content); List <Argument> args = JsonConvert.DeserializeObject <List <Argument> >(msg.content); Invoke(new Action(() => { BindingSource bs = new BindingSource(); if (args != null) { bs.DataSource = args; } else { bs.DataSource = new List <Argument>(); } arguments.DataSource = bs; })); } else if (msg.type == "stack" && msg.content != null) { //MessageBox.Show(msg.content); List <Argument> args = JsonConvert.DeserializeObject <List <Argument> >(msg.content); Invoke(new Action(() => { BindingSource bs = new BindingSource(); if (args != null) { bs.DataSource = args; } else { bs.DataSource = new List <Argument>(); } procStack.DataSource = bs; })); } else if (msg.type == "callstack" && msg.content != null) { //MessageBox.Show(msg.content); List <string> procs = JsonConvert.DeserializeObject <List <string> >(msg.content); Invoke(new Action(() => { BindingSource bs = new BindingSource(); if (procs != null) { bs.DataSource = procs; } else { bs.DataSource = new List <Argument>(); } callStack.DataSource = bs; })); } } }