예제 #1
0
        public IDecompiledFileService CreateDecompiledFileService()
        {
            var fsSvc = services.RequireService <IFileSystemService>();
            var svc   = new DecompiledFileService(fsSvc);

            return(svc);
        }
예제 #2
0
        public IDecompiledFileService CreateDecompiledFileService()
        {
            var fsSvc    = services.RequireService <IFileSystemService>();
            var listener = services.RequireService <DecompilerEventListener>();
            var svc      = new DecompiledFileService(fsSvc, listener);

            return(svc);
        }
예제 #3
0
        public void Setup()
        {
            this.program            = new Program();
            program.Filename        = Path.Combine("bar", "foo.exe");
            program.SourceDirectory = "bar";

            this.fsSvc = new Mock <IFileSystemService>();

            this.dfSvc = new DecompiledFileService(fsSvc.Object);

            var arch = new Mock <IProcessorArchitecture>();

            this.proc1 = Procedure.Create(arch.Object, Address.Ptr32(0x00123400), new Frame(PrimitiveType.Ptr32));
        }
        private Reko.Decompiler CreateRekoInstance(CefV8Context context)
        {
            var fsSvc    = new FileSystemServiceImpl();
            var listener = new ListenerService(context, eventListeners);
            var dfSvc    = new DecompiledFileService(fsSvc, listener);

            services.AddService(typeof(IFileSystemService), fsSvc);
            services.AddService(typeof(DecompilerEventListener), listener);
            var configSvc = RekoConfigurationService.Load(services, "reko/reko.config");

            services.AddService(typeof(IConfigurationService), configSvc);
            services.AddService(typeof(IDecompiledFileService), dfSvc);
            services.AddService(typeof(ITypeLibraryLoaderService), new TypeLibraryLoaderServiceImpl(services));
            services.AddService(typeof(IPluginLoaderService), new PluginLoaderService());
            var loader = new Reko.Loading.Loader(services);

            return(new Reko.Decompiler(loader, services));
        }
예제 #5
0
        public void Setup()
        {
            var arch = new Mock <IProcessorArchitecture>();

            arch.Setup(a => a.Name).Returns("FakeArch");
            arch.Setup(a => a.PointerType).Returns(PrimitiveType.Ptr32);
            this.program = new Program(
                new SegmentMap(Address.Ptr32(0x00100000)),
                arch.Object,
                new DefaultPlatform(new ServiceContainer(), arch.Object));
            program.Filename        = Path.Combine("bar", "foo.exe");
            program.Name            = "foo.exe";
            program.SourceDirectory = "bar";

            this.fsSvc = new Mock <IFileSystemService>();

            this.dfSvc = new DecompiledFileService(fsSvc.Object, new FakeDecompilerEventListener());

            this.proc1 = Procedure.Create(arch.Object, Address.Ptr32(0x00123400), new Frame(PrimitiveType.Ptr32));
        }