Beispiel #1
0
        public static void Main(string [] args)
        {
            var services = new ServiceContainer();

            if (args.Length == 0)
            {
                services.AddService(typeof(IServiceFactory), new ServiceFactory(services));
                services.AddService(typeof(IDialogFactory), new WindowsFormsDialogFactory(services));
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(ISettingsService), new WindowsFormsSettingsService(services));
                var interactor = new MainFormInteractor(services);
                interactor.Run();
            }
            else
            {
                var listener = NullDecompilerEventListener.Instance;

                services.AddService(typeof(DecompilerEventListener), listener);
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(IConfigurationService), RekoConfigurationService.Load());
                var ldr = new Loader(services);
                var dec = new DecompilerDriver(ldr, services);
                dec.Decompile(args[0]);
            }
        }
Beispiel #2
0
		public static void Main(string [] args)
		{
            var services = new ServiceContainer();
            if (args.Length == 0)
			{
                services.AddService(typeof(IServiceFactory), new ServiceFactory(services));
                services.AddService(typeof(IDialogFactory), new WindowsFormsDialogFactory(services));
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(ISettingsService), new WindowsFormsSettingsService(services));
                var interactor = new MainFormInteractor(services);
                interactor.Run();
            }
			else
			{
                var host = NullDecompilerHost.Instance;
                var listener = NullDecompilerEventListener.Instance;

                services.AddService(typeof (DecompilerEventListener), listener);
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(IConfigurationService), new DecompilerConfiguration());
                var ldr = new Loader(services);
				var dec = new DecompilerDriver(ldr, services);
				dec.Decompile(args[0]);
			}
		}
Beispiel #3
0
        public void Execute(string[] args)
        {
            var pArgs = ProcessArguments(Console.Out, args);
            if (pArgs == null)
                return;

            var ldr = new Loader(services);
            object defaultTo;
            if (pArgs.TryGetValue("--default-to", out defaultTo))
            {
                ldr.DefaultToFormat = (string)defaultTo;
            }
            var dec = new DecompilerDriver(ldr, services);

            if (OverridesRequested(pArgs))
            {
                DecompileRawImage(dec, pArgs);
            }
            else if (pArgs.ContainsKey("filename"))
            {
                dec.Decompile((string)pArgs["filename"]);
            }
            else
            {
                Usage(Console.Out);
            }
        }
Beispiel #4
0
        public void Execute(string[] args)
        {
            var pArgs = ProcessArguments(Console.Out, args);

            if (pArgs == null)
            {
                return;
            }

            var    ldr = new Loader(services);
            object defaultTo;

            if (pArgs.TryGetValue("--default-to", out defaultTo))
            {
                ldr.DefaultToFormat = (string)defaultTo;
            }
            var dec = new DecompilerDriver(ldr, services);

            if (OverridesRequested(pArgs))
            {
                DecompileRawImage(dec, pArgs);
            }
            else if (pArgs.ContainsKey("filename"))
            {
                dec.Decompile((string)pArgs["filename"]);
            }
            else
            {
                Usage(Console.Out);
            }
        }