コード例 #1
0
        private static void ProcessFile(string inputFile)
        {
            Console.WriteLine("Processing  File : " + inputFile);

            if (Directory.Exists(inputFile))
            {
                string directoryName = Path.GetDirectoryName(inputFile);
                if (directoryName != null)
                {
                    Environment.CurrentDirectory = directoryName;
                }
            }


            PEFile file = PEFile.ReadPEFile(inputFile);

            Method startLogMethod, endLogMethod;

            if (!MethodLoggerUtil.LocateLoggerMethods(out startLogMethod, out endLogMethod))
            {
                ShowHelp("未成功获取注入内容!");
                return;
            }

            //Diag.DiagOn = true;
            ClassDef[] classes = file.GetClasses();

            System.Array.ForEach(classes, delegate(ClassDef classDef)
            {
                ProcessClass(classDef, startLogMethod, endLogMethod);
            });

            file.WritePEFile(false);
            //Console.WriteLine("Processe end ,any key exit");
            //Console.ReadKey();
        }