public static void Main(string[] args) { ProcessStrategy processStrategy = null; #if LIVE_PID_DEBUG var pid = (int)Registry.CurrentUser.GetValue("my-ruthles-pid-key"); processStrategy = new LiveProcessStrategy((uint)pid); #else var parseResult = Parser.Default.ParseArguments<DumpVerb, LiveVerb>(args); processStrategy = parseResult.MapResult<DumpVerb, LiveVerb, ProcessStrategy>( (DumpVerb opts) => DumpFileSource(opts), (LiveVerb opts) => LiveProcessSource(opts), (IEnumerable<Error> opts) => null); #endif if (processStrategy != null) { var result = processStrategy.Run().Result; if (result.Error == null) { Console.WriteLine($"Is64BitProcess : {Environment.Is64BitProcess}"); SetPrintOptions(processStrategy.Options); PrintHandler.Print(result, true); } else { Console.WriteLine(result.Error.Description); } } Console.ReadKey(); }
private static ProcessStrategy LiveProcessSource(LiveVerb options) { ProcessStrategy result = null; if (options.LivePid != Constants.INVALID_PID) { result = new LiveProcessStrategy(options.LivePid); result.Options = (LiveVerb)options; } return result; }
public void RunTest() { LiveProcessStrategy strategy = new LiveProcessStrategy(1); // Assert.AreNotEqual<uint>(0, strategy.PID); }