public DisassemblerShould()
        {
            _assemblyDefinitionResolver = Substitute.For <IAssemblyDefinitionResolver>();
            _assemblyProcessorMock      = Substitute.For <IAssemblyDecompiler>();

            var assemblyDefinition = Mono.Cecil.AssemblyDefinition.CreateAssembly(
                new AssemblyNameDefinition("test", Version.Parse("1.0.0")),
                "Module1", ModuleKind.Dll);

            _assemblyDefinitionResolver.Resolve(Arg.Any <string>()).Returns(assemblyDefinition);
        }
Example #2
0
        public Disassembler Create(CommandArgument argument)
        {
            var outputWriter = GetOutputWriter(argument);

            //HACK: Next step for refactoring.
            if (_assemblyDecompiler == null)
            {
                _assemblyDecompiler = new AssemblyDecompiler(argument.Assembly, outputWriter);
            }

            if (argument.HasOutputPathSet)
            {
                return(new FileOutputDisassembler(_assemblyDecompiler, _assemblyDefinitionResolver));
            }

            return(new ConsoleOutputDisassembler(_assemblyDecompiler, _assemblyDefinitionResolver));
        }
 public FileOutputDisassembler(IAssemblyDecompiler assemblyDataProcessor, IAssemblyDefinitionResolver assemblyResolver) : base(assemblyDataProcessor, assemblyResolver)
 {
 }
Example #4
0
 public Disassembler(IAssemblyDecompiler assemblyDataProcessor, IAssemblyDefinitionResolver assemblyResolver)
 {
     _assemblyDataProcessor = assemblyDataProcessor;
     _assemblyResolver      = assemblyResolver;
 }
Example #5
0
 public DisassemblerFactoryShould()
 {
     _assemblyDefinitionResolver = Substitute.For <IAssemblyDefinitionResolver>();
     _assemblyDecompiler         = Substitute.For <IAssemblyDecompiler>();
     _disassemblerFactory        = new DisassemblerFactory(_assemblyDefinitionResolver, _assemblyDecompiler);
 }
Example #6
0
 public DisassemblerFactory(IAssemblyDefinitionResolver assemblyDefinitionResolver, IAssemblyDecompiler assemblyDecompiler)
 {
     _assemblyDefinitionResolver = assemblyDefinitionResolver;
     _assemblyDecompiler         = assemblyDecompiler;
 }