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; }
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)); }
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(); }