public void IncrementInstructionAddressTest()
        {
            //arrange
            byte[] code        = new byte[] { 0xeb, 0xe9 }; //jmp 0xe9
            var    instruction = new DisassemblerFactory().Create(code).Disassemble().First();
            IAssemblyInstructionForTransformation newInstruction = null;

            //act
            try
            {
                newInstruction = m_jumpTransform.IncrementJumpInstructionTargetAddress(instruction, 5);
            }
            catch (Exception ex)
            {
                Assert.Fail("IncrementInstructionAddressTest. Details:" + ex.ToString());
            }


            //assert
            Assert.IsTrue(ArrayEquals(newInstruction.Bytes, new byte[] { 0xeb, 0xee }));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Architecture86_64" /> class.
 /// </summary>
 public Architecture86_64()
 {
     this.Assembler    = AssemblerFactory.GetAssembler(ArchitectureType.x86_64);
     this.Disassembler = DisassemblerFactory.GetDisassembler(ArchitectureType.x86_64);
 }
Beispiel #3
0
 public DisassemblerFactoryShould()
 {
     _assemblyDefinitionResolver = Substitute.For <IAssemblyDefinitionResolver>();
     _assemblyDecompiler         = Substitute.For <IAssemblyDecompiler>();
     _disassemblerFactory        = new DisassemblerFactory(_assemblyDefinitionResolver, _assemblyDecompiler);
 }