Exemple #1
0
        public TInstruction DisassembleWord(uint instr)
        {
            var img = new ByteMemoryArea(LoadAddress, new byte[256]);

            Architecture.CreateImageWriter(img, img.BaseAddress).WriteUInt32(0, instr);
            return(Disassemble(img));
        }
Exemple #2
0
 public ImageWriter CreateImageWriter(Address addr)
 {
     if (!SegmentMap.TryFindSegment(addr, out var segment))
     {
         throw new ArgumentException(string.Format("The address {0} is invalid.", addr));
     }
     return(Architecture.CreateImageWriter(segment.MemoryArea, addr));
 }
Exemple #3
0
        protected TInstruction DisassembleBits(string bitPattern)
        {
            var  mem   = new ByteMemoryArea(LoadAddress, new byte[256]);
            uint instr = BitStringToUInt32(bitPattern);

            Architecture.CreateImageWriter(mem, mem.BaseAddress).WriteUInt32(0, instr);
            return(Disassemble(mem));
        }
Exemple #4
0
        public void Given_UInt32s(params uint[] opcodes)
        {
            byte[] bytes  = new byte[opcodes.Length * 4];
            var    mem    = Architecture.CreateMemoryArea(LoadAddress, bytes);
            var    writer = Architecture.CreateImageWriter(mem, mem.BaseAddress);

            foreach (uint opcode in opcodes)
            {
                writer.WriteUInt32(opcode);
            }
            this.mem = mem;
        }