private static SparcInstruction Disassemble(MemoryArea img) { var arch = new SparcArchitecture("sparc", PrimitiveType.Word32); var dasm = new SparcDisassembler(arch, img.CreateBeReader(0U)); return(dasm.First()); }
private IEnumerator <M68kInstruction> CreateDasm(byte[] bytes, uint address) { Address addr = Address.Ptr32(address); MemoryArea img = new MemoryArea(addr, bytes); return(M68kDisassembler.Create68020(img.CreateBeReader(addr)).GetEnumerator()); }
public MacsBugSymbolScanner(IProcessorArchitecture arch, MemoryArea mem) { this.arch = arch; this.rdr = mem.CreateBeReader(0); this.reValidVariableLengthProcedureName = new Regex( "[a-zA-Z%_]([a-zA-Z0-9%_.])*"); }
private static SparcInstruction Disassemble(MemoryArea img) { var sc = new ServiceContainer(); var arch = new SparcArchitecture32(sc, "sparc"); var dasm = new SparcDisassembler(arch, arch.Decoder, img.CreateBeReader(0U)); return(dasm.First()); }
protected override IEnumerable <RtlInstructionCluster> GetRtlStream(MemoryArea mem, IStorageBinder binder, IRewriterHost host) { return(arch.CreateRewriter( mem.CreateBeReader(0), arch.CreateProcessorState(), binder, host)); }
protected override IEnumerable <RtlInstructionCluster> GetInstructionStream(IStorageBinder binder, IRewriterHost host) { return(new PaRiscRewriter( arch, mem.CreateBeReader(0), arch.CreateProcessorState(), binder, host)); }
public void A5Relocator_One() { Given_Relocator(); var w = new BeImageWriter(mem.Bytes, 0); w.WriteByte(0x80); // Skip 0. w.WriteByte(0x00); w = new BeImageWriter(mem.Bytes, 1024); w.WriteBeUInt32(0x00123400); relocator.Relocate(); var r = mem.CreateBeReader(1024); var uRelocated = r.ReadBeUInt32(); Assert.AreEqual(0x00223C00u, uRelocated); }
protected override MemoryArea RewriteCode(string hexBytes) { var bytes = PlatformDefinition.LoadHexBytes(hexBytes) .ToArray(); var image = new MemoryArea(LoadAddress, bytes); this.rdr = image.CreateBeReader(0); this.dasm = mkDasm(rdr); return(image); }
// [Test] public void Cr16Dasm_Gen() { var mem = new MemoryArea(Address.Ptr16(0x8000), new byte[1024]); var rnd = new Random(0x4711); rnd.NextBytes(mem.Bytes); var rdr = mem.CreateBeReader(0); var dasm = arch.CreateDisassembler(rdr); dasm.Take(100).ToArray(); }
protected override MemoryArea RewriteCode(uint[] words) { byte[] bytes = words.SelectMany(w => new byte[] { (byte)w, (byte)(w >> 8), (byte)(w >> 16), (byte)(w >> 24), }).ToArray(); this.image = new MemoryArea(LoadAddress, bytes); dasm = new AlphaDisassembler(arch, image.CreateBeReader(LoadAddress)); return(image); }
protected override MemoryArea RewriteCode(uint[] words) { byte[] bytes = words.SelectMany(w => new byte[] { (byte)(w >> 24), (byte)(w >> 16), (byte)(w >> 8), (byte)w }).ToArray(); var image = new MemoryArea(LoadAddress, bytes); ppcInstrs = new PowerPcDisassembler(arch, image.CreateBeReader(LoadAddress), arch.WordWidth); return(image); }
protected override MemoryArea RewriteCode(uint[] words) { byte[] bytes = words.SelectMany(w => new byte[] { (byte)(w >> 24), (byte)(w >> 16), (byte)(w >> 8), (byte)w }).ToArray(); var image = new MemoryArea(LoadAddress, bytes); this.rdr = image.CreateBeReader(LoadAddress); dasm = mkDasm(rdr); return(image); }
private JumpTable ProcessJumpTable(MemoryArea memJt, IDictionary <Address, ImageSymbol> symbols) { var j = new JumpTable(); var ir = memJt.CreateBeReader(0); j.AboveA5Size = ir.ReadBeUInt32(); j.BelowA5Size = ir.ReadBeUInt32(); j.JumpTableSize = ir.ReadBeUInt32(); j.JumpTableOffset = ir.ReadBeUInt32(); uint size = j.JumpTableSize; while (size > 0) { JumpTableEntry jte = new JumpTableEntry(); var addr = ir.Address; jte.RoutineOffsetFromSegmentStart = ir.ReadBeUInt16(); jte.Instruction = ir.ReadBeUInt32(); jte.LoadSegTrapNumber = ir.ReadBeUInt16(); j.Entries.Add(jte); Debug.Print("{0}", jte); size -= 8; } return(j); }
protected override IEnumerable <RtlInstructionCluster> GetRtlStream(MemoryArea mem, IStorageBinder binder, IRewriterHost host) { var state = new MicroBlazeState(arch); return(arch.CreateRewriter(mem.CreateBeReader(0), state, binder, host)); }
protected override IEnumerable <RtlInstructionCluster> GetRtlStream(MemoryArea mem, IStorageBinder binder, IRewriterHost host) { return(new i8051Rewriter(arch, mem.CreateBeReader(0), new i8051State(arch), binder, host)); }
private MemoryArea RewriteBytes(params byte[] bytes) { this.image = new MemoryArea(LoadAddress, bytes); this.dasm = new Tms7000Disassembler(arch, image.CreateBeReader(LoadAddress)); return(image); }