コード例 #1
0
        private static SparcInstruction Disassemble(MemoryArea img)
        {
            var arch = new SparcArchitecture("sparc", PrimitiveType.Word32);
            var dasm = new SparcDisassembler(arch, img.CreateBeReader(0U));

            return(dasm.First());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
 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%_.])*");
 }
コード例 #4
0
        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());
        }
コード例 #5
0
ファイル: M6809RewriterTests.cs プロジェクト: ghmole/reko
 protected override IEnumerable <RtlInstructionCluster> GetRtlStream(MemoryArea mem, IStorageBinder binder, IRewriterHost host)
 {
     return(arch.CreateRewriter(
                mem.CreateBeReader(0),
                arch.CreateProcessorState(),
                binder,
                host));
 }
コード例 #6
0
 protected override IEnumerable <RtlInstructionCluster> GetInstructionStream(IStorageBinder binder, IRewriterHost host)
 {
     return(new PaRiscRewriter(
                arch,
                mem.CreateBeReader(0),
                arch.CreateProcessorState(),
                binder,
                host));
 }
コード例 #7
0
ファイル: A5RelocatorTests.cs プロジェクト: erenes/reko
        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);
        }
コード例 #8
0
ファイル: MipsRewriterTests.cs プロジェクト: Seabreg/reko
        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);
        }
コード例 #9
0
        // [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();
        }
コード例 #10
0
 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);
 }
コード例 #11
0
        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);
        }
コード例 #12
0
ファイル: MipsRewriterTests.cs プロジェクト: Seabreg/reko
        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);
        }
コード例 #13
0
ファイル: ResourceFork.cs プロジェクト: heruix/reko
        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);
        }
コード例 #14
0
ファイル: MicroBlazeRewriterTests.cs プロジェクト: qcyb/reko
        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));
        }
コード例 #15
0
ファイル: i8051RewriterTests.cs プロジェクト: ghmole/reko
 protected override IEnumerable <RtlInstructionCluster> GetRtlStream(MemoryArea mem, IStorageBinder binder, IRewriterHost host)
 {
     return(new i8051Rewriter(arch, mem.CreateBeReader(0), new i8051State(arch), binder, host));
 }
コード例 #16
0
 private MemoryArea RewriteBytes(params byte[] bytes)
 {
     this.image = new MemoryArea(LoadAddress, bytes);
     this.dasm  = new Tms7000Disassembler(arch, image.CreateBeReader(LoadAddress));
     return(image);
 }