public TInstruction DisassembleWord(uint instr) { var img = new ByteMemoryArea(LoadAddress, new byte[256]); Architecture.CreateImageWriter(img, img.BaseAddress).WriteUInt32(0, instr); return(Disassemble(img)); }
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)); }
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)); }
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; }