static void Main(string[] args) { // Parse the command line arguments string config = ""; for (int i = 0; i < args.Length; i++) { // Unassigned variable if (config == "") { config = args[i]; } } // Request debug privelages MemoryFunctions.GetDebugPrivileges(); if (config != "" && System.IO.File.Exists(config)) { // Create a process instance using the input config Controller controller = new Controller(config, args); if (controller.Initialized) { // Carry out the security test according to the config controller.Begin(); } } else { if (config != "") Console.WriteLine("Error: Invalid python controller path '" + config + "'."); else Console.WriteLine("Error: Please specify a python controller to use for the attack. Eg 'meddle.exe \"controller.py\"."); } Console.WriteLine("FINISHED. Press any key to quit."); Console.Read(); }
public Process(PythonBoss pyBoss, Controller parent, dynamic pyProcess) { _targets = new Hashtable(10); _pyBoss = pyBoss; _parent = parent; _targetsToLoad = new List<object>(10); PyProcess = pyProcess; _name = PyProcess.get_name(); try { // Initialize the DotNet process class int pid = PyProcess.get_pid(); if (pid >= 0) { ProcessDotNet = System.Diagnostics.Process.GetProcessById(pid); // Start the debugger instance _debugger = new Debugger(pid, this); } else { Console.WriteLine(string.Format("ERROR: Constructor of dot net class 'Process' {0} failed. Python process class returned 'get_pid()' of -1, this is invalid.", _name)); return; } } catch (Exception e) { Console.WriteLine(string.Format("ERROR: Constructor of python class 'Process' {0} failed:", _name)); Console.WriteLine(e.ToString()); return; } Initialized = true; }