public TextHunk ParseText(Action <Hunk> fn) { var hunk = new TextHunk(); fn(hunk); var num_longs = this.read_long(); if (num_longs < 0) { throw new BadImageFormatException(string.Format("{0} has invalid size.", hunk.HunkType)); } // Read in the hunk data var size = num_longs * 4; hunk.alloc_size = size & ~Hunk.HUNKF_ALL; var flags = size & Hunk.HUNKF_ALL; hunk.memf = this.SetMemoryFlags(flags, 30); hunk.data_file_offset = (uint)f.Offset; hunk.Data = f.ReadBytes(hunk.alloc_size); Debug.WriteLineIf(trace.TraceVerbose, string.Format(" alloc_size: {0:X8}", hunk.alloc_size)); Debug.WriteLineIf(trace.TraceVerbose, string.Format(" file_offset: {0:X8}", hunk.data_file_offset)); return(hunk); }
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 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 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)); }
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))); }
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); }
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 mem = new MemoryArea(addrLoad, RelocateBytes(addrLoad)); return(new Program( new ImageMap( mem.BaseAddress, new ImageSegment( "code", mem, AccessMode.ReadWriteExecute)), arch, cfgSvc.GetEnvironment("amigaOS").Load(Services, arch))); }
public TextHunk ParseText(Action<Hunk> fn) { var hunk = new TextHunk(); fn(hunk); var num_longs = this.read_long(); if (num_longs < 0) throw new BadImageFormatException(string.Format("{0} has invalid size.", hunk.HunkType)); // Read in the hunk data var size = num_longs * 4; hunk.alloc_size = size & ~Hunk.HUNKF_ALL; var flags = size & Hunk.HUNKF_ALL; hunk.memf = this.SetMemoryFlags(flags, 30); hunk.data_file_offset = (uint)f.Offset; hunk.Data = f.ReadBytes(hunk.alloc_size); Debug.WriteLineIf(trace.TraceVerbose, string.Format(" alloc_size: {0:X8}", hunk.alloc_size)); Debug.WriteLineIf(trace.TraceVerbose, string.Format(" file_offset: {0:X8}", hunk.data_file_offset)); return hunk; }