Use this reader when the processor is in Big-Endian mode to read multi- byte quantities from memory.
Inheritance: EndianImageReader
示例#1
0
 public HunkFileParser(BeImageReader f, bool? v37_compat = null)
 {
     this.f = f;
     this.v37_compat = v37_compat;
     // Commodore famously used ISO 8859-1 for the Amiga. Different
     // national variants may need to override this.
     this.textEncoding = Encoding.GetEncoding("ISO_8859-1");
     this.hunk_file = new HunkFile();
     this.hunks = hunk_file.hunks;
 }
示例#2
0
        public override Program Load(Address addrLoad)
        {
            arch = new M68kArchitecture();
            var imgReader = new BeImageReader(RawImage, 0);
            var parse = new HunkFileParser(imgReader, false);
            this.hunkFile = parse.Parse();
            BuildSegments();
            this.firstCodeHunk = parse.FindFirstCodeHunk();
            var image = new LoadedImage(addrLoad, RelocateBytes(addrLoad));

            return new Program(
                image,
                image.CreateImageMap(),
                arch,
                new AmigaOSPlatform(Services, arch));
        }
示例#3
0
        public override Program Load(Address addrLoad)
        {
            var cfgSvc = Services.RequireService<IConfigurationService>();
            arch = (M68kArchitecture) cfgSvc.GetArchitecture("m68k");
            var imgReader = new BeImageReader(RawImage, 0);
            var parse = new HunkFileParser(imgReader, false);
            this.hunkFile = parse.Parse();
            BuildSegments();
            this.firstCodeHunk = parse.FindFirstCodeHunk();
            var image = new LoadedImage(addrLoad, RelocateBytes(addrLoad));

            return new Program(
                image,
                image.CreateImageMap(),
                arch,
                cfgSvc.GetEnvironment("amigaOS").Load(Services, arch));
        }
示例#4
0
 public override Program Load(Address addrLoad)
 {
     var cfgSvc = Services.RequireService<IConfigurationService>();
     arch = (M68kArchitecture) cfgSvc.GetArchitecture("m68k");
     var imgReader = new BeImageReader(RawImage, 0);
     var parse = new HunkFileParser(imgReader, false);
     this.hunkFile = parse.Parse();
     BuildSegments();
     this.firstCodeHunk = parse.FindFirstCodeHunk();
     var platform = cfgSvc.GetEnvironment("amigaOS").Load(Services, arch);
     var imageMap = platform.CreateAbsoluteMemoryMap();
     var mem = new MemoryArea(addrLoad, RelocateBytes(addrLoad));
     return new Program(
         new SegmentMap(
             mem.BaseAddress,
             new ImageSegment(
                 "code", mem, AccessMode.ReadWriteExecute)),
         arch,
         platform);
 }
示例#5
0
 public void LoadElfIdentification()
 {
     var rdr = new BeImageReader(base.RawImage, 0);
     var elfMagic = rdr.ReadBeInt32();
     if (elfMagic != ELF_MAGIC)
         throw new BadImageFormatException("File is not in ELF format.");
     this.fileClass = rdr.ReadByte();
     this.endianness = rdr.ReadByte();
     this.fileVersion = rdr.ReadByte();
     this.osAbi = rdr.ReadByte();
 }