Example #1
0
        public void Test_ProcessingAllO2AssembliesFromDirectory(ICirData cirData, string targetDirectory, bool verify,
                                                                bool verbose)
        {
            O2Timer checkTimer =
                new O2Timer("Test_ProcessingAllAssembliesFromDirectory " + targetDirectory + " took ").start();
            List <string> targetAssemblies = Files.getFilesFromDir_returnFullPath(targetDirectory, "*.exe");

            targetAssemblies.AddRange(Files.getFilesFromDir_returnFullPath(targetDirectory, "*.dll"));
            //targetAssemblies.AddRange();
            DI.log.debug("Testing processing of {0} dlls and exes directory {1}", targetAssemblies.Count,
                         targetDirectory);
            if (!verify)
            {
                DI.log.debug("Note, verification is disabled");
            }
            foreach (string targetDll in targetAssemblies)
            {
                if (CecilUtils.isDotNetAssembly(targetDll, false))
                {
                    Test_LoadingAssembly(cirData, targetDll, verify, verbose);
                }
            }
            CirFactoryUtils.showCirDataStats(cirData);
            checkTimer.stop();
        }
Example #2
0
        public void Test_ProcessingO2Kernel()
        {
            DI.log.info("Testing with O2Kernel");
            ICirData cirData     = new CirData();
            string   O2KernelExe = DI.config.ExecutingAssembly; // this gets O2_Kernel.Exe

            Test_LoadingAssembly(cirData, O2KernelExe, true /*verify*/, false /*verbose*/);
            CirFactoryUtils.showCirDataStats(cirData);
        }
Example #3
0
        public void createCirDataObject()
        {
            cirData = new CirData();
            DI.log.info("using assembly:{0} and O2_Kernel.dll", Assembly.GetExecutingAssembly().Location);
            cirFactory.processAssemblyDefinition(cirData, Assembly.GetExecutingAssembly().Location);
            cirFactory.processAssemblyDefinition(cirData, DI.config.ExecutingAssembly);

            /* // this will load all dlls in the O2 dir
             * foreach(var file in Files.getFilesFromDir_returnFullPath(DI.hardCodedO2DeploymentDir,"*.dll"))
             *  cirFactory.processAssemblyDefinition(cirData, CecilUtils.getAssembly(file));*/

            Assert.That(cirData.dClasses_bySignature.Count > 0, "There were no classes in cirData object");
            Assert.That(cirData.dFunctions_bySignature.Count > 0, "There were no function in cirData object");
            CirFactoryUtils.showCirDataStats(cirData);
        }