예제 #1
0
 public EmulatorShell(IDisassembler disassembler, ICpu cpu, IFileHandler fileHandler, IDisplay display)
 {
     _disassembler = disassembler;
     _cpu          = cpu;
     _fileHandler  = fileHandler;
     _display      = display;
 }
예제 #2
0
        public AppCore(Config config)
        {
            _config = config;

            var initialSourceCode = "";

            {
                try
                {
                    initialSourceCode = _config.LoadCodeTemplate();
                }
                catch
                {
                    _config.IsFileMonitoring   = false;
                    _config.MonitoringFilePath = "";
                }
            }

            Compiler     = new Compiler();
            Disassembler = new JitDisassembler("JitDasm/JitDasm.exe");

            BuildingUnit = new BuildingUnit(_config, Compiler, Disassembler)
            {
                SourceCode = initialSourceCode
            }
            .AddTo(_Trashes);

            var fileMonitor = new FileMonitor(_config).AddTo(_Trashes);

            fileMonitor.MonitoringFileChanged += (_, __) => LoadMonitoringFile();

            _config.ObserveProperty(x => x.MonitoringFilePath)
            .Subscribe(_ => LoadMonitoringFile())
            .AddTo(_Trashes);
        }
 public JavaCompileDisassemblePlagiarismDetector(
     ICompiler compiler,
     string compilerPath,
     IDisassembler disassembler,
     ISimilarityFinder similarityFinder)
     : base(compiler, compilerPath, disassembler, similarityFinder)
 {
 }
 public JavaCompileDisassemblePlagiarismDetector(
     ICompiler compiler,
     string compilerPath,
     IDisassembler disassembler,
     ISimilarityFinder similarityFinder)
     : base(compiler, compilerPath, disassembler, similarityFinder)
 {
 }
예제 #5
0
 public CSharpDotNetCoreCompileDisasaemblePlagiarismDetector(
     ICompiler compiler,
     string compilerPath,
     IDisassembler disassembler,
     ISimilarityFinder similarityFinder)
     : base(compiler, compilerPath, disassembler, similarityFinder)
 {
 }
        public DissasembleViewModel(BreakpointsViewModel breakpoints, IGameBoy gameBoy)
        {
            _breakpoints = breakpoints;
              _gameBoy = gameBoy;
              _cpu = gameBoy.CPU;
              _disassembler = gameBoy.Disassembler;

              _breakpoints.BreakpointChanged += _breakpoints_BreakpointChanged;
        }
예제 #7
0
        public DissasembleViewModel(BreakpointsViewModel breakpoints, IGameBoy gameBoy)
        {
            _breakpoints  = breakpoints;
            _gameBoy      = gameBoy;
            _cpu          = gameBoy.CPU;
            _disassembler = gameBoy.Disassembler;

            _breakpoints.BreakpointChanged += _breakpoints_BreakpointChanged;
        }
예제 #8
0
 public EmulatorShell(IDisassembler disassembler, ICpu cpu, IFileHandler fileHandler, IDisplay display, IRegisterBank registerBank)
 {
     _disassembler          = disassembler;
     _cpu                   = cpu;
     _fileHandler           = fileHandler;
     _display               = display;
     _registerBank          = registerBank;
     CycleDelay             = 10;
     CycleTickEventInterval = 1;
 }
 protected CompileDisassemblePlagiarismDetector(
     ICompiler compiler,
     string compilerPath,
     IDisassembler disassembler,
     ISimilarityFinder similarityFinder)
 {
     this.Compiler = compiler;
     this.CompilerPath = compilerPath;
     this.Disassembler = disassembler;
     this.similarityFinder = similarityFinder;
     this.sourcesCache = new Dictionary<string, string>();
 }
 protected CompileDisassemblePlagiarismDetector(
     ICompiler compiler,
     string compilerPath,
     IDisassembler disassembler,
     ISimilarityFinder similarityFinder)
 {
     this.Compiler         = compiler;
     this.CompilerPath     = compilerPath;
     this.Disassembler     = disassembler;
     this.similarityFinder = similarityFinder;
     this.sourcesCache     = new Dictionary <string, string>();
 }
        /// <summary>
        /// Find the first instrucion index that is not affected by the junk insertion in the new block.
        /// In other words: it Finds the first instruction in the new block which is identical to instruction
        /// in the original basic block. the identical instruction start an identical sequence of instructions
        /// untill the end of the two blocks.
        /// </summary>
        /// <param name="newBasicBlockBytes">new basic block bytes</param>
        /// <param name="basicBlock">original basic block</param>
        /// <param name="disassemblerFactory">diassembler factory</param>
        /// <returns>the first index of unaffected instruction in the original basic block, or not o value otherwise</returns>
        private uint?CompareDisassembleToOriginal(byte[] newBasicBlockBytes, IBasicBlock basicBlock,
                                                  IDisassemblerFactory disassemblerFactory)
        {
            //disassemble new bytes after junk have been inserted
            var           newAssemblyInstructions = new List <IAssemblyInstructionForTransformation>();
            IDisassembler disasm = disassemblerFactory.Create(newBasicBlockBytes);

            foreach (var instruction in disasm.Disassemble())
            {
                newAssemblyInstructions.Add(instruction);
            }

            //not enought instruction have been decoded right in this block!
            if (newAssemblyInstructions.Count <= 1)
            {
                return(null);
            }

            //compare to original basic block instructions
            //start from index 1 because first instruction is the inserted junk...
            for (int i = 1; i < newAssemblyInstructions.Count(); i++)
            {
                for (int j = 0; j < basicBlock.AssemblyInstructions.Count; j++)
                {
                    //compare instruction until the end if they are equal
                    if (newAssemblyInstructions[i].BytesEquals(basicBlock.AssemblyInstructions[j]))
                    {
                        if (instructionAreIdenticalUntilTheEnd(newAssemblyInstructions, i + 1, basicBlock.AssemblyInstructions, j + 1))
                        {
                            return((uint?)j);
                        }
                    }
                }
            }

            return(null);
        }
 public CortexMDisassemblerWrapper(IDisassembler actualDisassembler)
 {
     underlyingDisassembler = actualDisassembler;
 }
예제 #13
0
 public Decompiler(IDisassembler disassembler, IDecompilationPipeline pipeline)
 {
     this.disassembler = disassembler;
     this.pipeline     = pipeline;
 }
 public bool SetDisassembler(IDisassembler dis)
 {
     disassembler = dis;
     return(true);
 }
예제 #15
0
 public StaticAnalyzer(IDisassembler disassembler)
 {
     _disassembler = disassembler;
 }
예제 #16
0
 public bool SetDisassembler(IDisassembler dis)
 {
     disassembler = dis;
     return true;
 }
예제 #17
0
 public MainViewVM()
 {
     _disassembler = new Disassembler();
     _parser       = new InputParser();
 }
예제 #18
0
 public static IEnumerable <Instruction> Disassemble(this IDisassembler disassembler, MethodBase method)
 {
     return(disassembler.Disassemble(new MethodBaseAdapter(method)));
 }
예제 #19
0
 public Decompiler(IDisassembler disassembler, IDecompilationPipeline pipeline)
 {
     this.disassembler = disassembler;
     this.pipeline = pipeline;
 }