Пример #1
0
 /// <summary>
 /// Main entry point
 /// </summary>
 /// <param name="args">path to il code</param>
 public static void Main(string[] args)
 {
     if (args.Length != 1)
     {
         Usage();
         return;
     }
     try
     {
         var settings = new ICSharpCode.Decompiler.DecompilerSettings();
         settings.UsingStatement = false;
         settings.ObjectOrCollectionInitializers = false;
         GetPathToAssembly(args);
         CppTraceListener.AddListener(pathToAssemble);
         CppVisitorBase.TypeVisitor.LoadValidTypes();
         compiler = new CSharpDecompiler(args[0], settings);
         formatter.EmitToConsole = false;
         ProcessModules(prototypeVisitor, pathToAssemble + "Protos.h");
         ProcessModules(headerVisitor, pathToAssemble + "Header.h");
         ProcessModules(visitor, pathToAssemble + ".cpp");
         CppTraceListener.RemoveListener();
     }
     catch (Exception ex)
     {
         Trace.TraceError("Exception: " + ex.ToString());
         Trace.TraceError("StackTrace: " + ex.StackTrace);
     }
 }
Пример #2
0
 /// <summary>
 /// Remove listener
 /// </summary>
 public static void RemoveListener()
 {
     foreach (TraceListener listener in Trace.Listeners)
     {
         CppTraceListener myListener = listener as CppTraceListener;
         if (myListener != null)
         {
             Trace.Listeners.Remove(myListener);
             break;
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Add listener
 /// </summary>
 /// <param name="pathToOutput">path to output</param>
 public static void AddListener(String pathToOutput)
 {
     foreach (TraceListener listener in Trace.Listeners)
     {
         CppTraceListener myListener = listener as CppTraceListener;
         if (myListener != null)
         {
             return;
         }
     }
     Trace.Listeners.Add(new CppTraceListener(pathToOutput + ".err"));
     Trace.AutoFlush = true;
 }