private void DoLoadFile() { if (!File.Exists(fileName) && !fileName.Equals("-")) { r2pw.Show(string.Format("Wops!\n{0}\nfile not found...", fileName), "LoadFile"); return; } r2pw.open(fileName); r2pw.setText("version ( ?V )", "?V", r2pw.r2.RunCommand("?V")); r2pw.run_script("openfile_post.txt"); }
private void DoLoadFile() { if (!File.Exists(fileName)) { r2pw.Show(string.Format("Wops!\n{0}\nfile not found...", fileName), "LoadFile"); return; } r2pw.open(fileName); r2pw.run("aaa;aflj", "functions_listview", false, new List <string> { "name", "offset" }); r2pw.run("pd 100", "dissasembly"); r2pw.run("izj", "strings_listview", false, new List <string> { "vaddr", "section", "type", "string" }); r2pw.run("iij", "imports_listview", false, new List <string> { "name", "plt" }); r2pw.run("iSj", "sections_listview", false, new List <string> { "name", "size", "flags", "paddr", "vaddr" }); r2pw.run("px 2000", "hexview"); r2pw.run("?", "r2help"); }
public string readFile(string fileName, bool use_guiPath = true) { if (use_guiPath) { if (r2pw.rconfig.dataPath == null) { string datapath = r2pw.Prompt("gui data path?", "Please, locate your data path..."); r2pw.rconfig.save("gui.datapath", datapath); } fileName = string.Format(@"{0}\{1}", r2pw.rconfig.dataPath, fileName); } if (!File.Exists(fileName)) { r2pw.Show(string.Format("Wops!\nr2html: readFile():\nfileName='{0}'\nnot found in data path...", fileName), "readfile"); return("file not found..."); } return(System.IO.File.ReadAllText(fileName)); }
public GuiControl add_control(string name, object control, string tabTitle = null, string cmds = null, string pre_cmd = null, string pos_cmd = null, int tab_index = -1, webbrowser_container_form wcf = null) { GuiControl gui_control = null; if (name == null || name.Length == 0) { return(null); } /* * if (control == null) * { * Console.WriteLine("warning: GuiControl: add_control(): control name='" + name + "' is null", "control is null"); * //return null; * }*/ gui_control = findControlBy_name(name); if (gui_control != null) { gui_control.closed = false; gui_control.cmds = cmds; return(gui_control); } try { string sName = name; if (sName.Contains("_")) { int pos = sName.IndexOf("_"); sName = sName.Substring(0, pos); } gui_control = new GuiControl( control, name, sName, cmds, tabTitle, null, pre_cmd, pos_cmd, tab_index, wcf); controls.Add(gui_control); } catch (Exception e) { r2pw.Show(e.ToString(), "GuiControls: add_control()"); } return(gui_control); }