예제 #1
0
        private long PerformanceTest_A32Dasm(byte[] buf)
        {
            var       arch = new Reko.Arch.Arm.Arm32Architecture("arm32");
            var       mem  = new MemoryArea(Address.Ptr32(0x00100000), buf);
            var       rdr  = arch.CreateImageReader(mem, mem.BaseAddress);
            var       dasm = arch.CreateDisassembler(rdr);
            Stopwatch sw   = new Stopwatch();

            sw.Start();
            foreach (var instr in dasm)
            {
            }
            sw.Stop();
            var time = sw.ElapsedMilliseconds;

            return(time);
        }
예제 #2
0
        private long PerformanceTest_A32Rewriter(byte[] buf)
        {
            var arch = new Reko.Arch.Arm.Arm32Architecture("arm32");
            var mem  = new MemoryArea(Address.Ptr32(0x00100000), buf);
            var rdr  = arch.CreateImageReader(mem, mem.BaseAddress);
            var dasm = arch.CreateRewriter(rdr, arch.CreateProcessorState(), new StorageBinder(),
                                           new RewriterPerformanceDialog.RewriterHost(new Dictionary <Address, ImportReference>()));
            Stopwatch sw = new Stopwatch();

            sw.Start();
            foreach (var instr in dasm)
            {
            }
            sw.Stop();
            var time = sw.ElapsedMilliseconds;

            return(time);
        }