Beispiel #1
0
 public OperandRewriter(M68kArchitecture arch, RtlEmitter emitter, Frame frame, PrimitiveType dataWidth)
 {
     this.arch = arch;
     this.m = emitter;
     this.frame = frame;
     this.DataWidth = dataWidth;
 }
Beispiel #2
0
        public override Program Load(Address addrLoad)
        {
            BinHexDecoder dec = new BinHexDecoder(new StringReader(Encoding.ASCII.GetString(RawImage)));
            IEnumerator<byte> stm = dec.GetBytes().GetEnumerator();
            BinHexHeader hdr = LoadBinHexHeader(stm);
            byte[] dataFork = LoadFork(hdr.DataForkLength, stm);
            byte[] rsrcFork = LoadFork(hdr.ResourceForkLength, stm);

            var arch = new M68kArchitecture();
            var platform = new MacOSClassic(Services, arch);
            if (hdr.FileType == "PACT")
            {
                Cpt.CompactProArchive archive = new Cpt.CompactProArchive();
                List<ArchiveDirectoryEntry> items = archive.Load(new MemoryStream(dataFork));
                IArchiveBrowserService abSvc = Services.GetService<IArchiveBrowserService>();
                if (abSvc != null)
                {
                    var selectedFile = abSvc.UserSelectFileFromArchive(items);
                    if (selectedFile != null)
                    {
                        var image = selectedFile.GetBytes();
                        this.rsrcFork = new ResourceFork(image, arch);
                        this.image = new LoadedImage(addrLoad, image);
                        this.imageMap = new ImageMap(addrLoad, image.Length);
                        return new Program(this.image, this.imageMap, arch, platform);
                    }
                }
            }

            var li = new LoadedImage(addrLoad, dataFork);
            return new Program(li, li.CreateImageMap(), arch, platform);
        }
Beispiel #3
0
 private void BuildTest32(Address addrBase, params byte[] bytes)
 {
     arch = new M68kArchitecture();
     var image = new LoadedImage(addrBase, bytes);
     program = new Program(
         image,
         image.CreateImageMap(),
         arch,
         new DefaultPlatform(null, arch));
     RunTest(addrBase);
 }
Beispiel #4
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));
        }
Beispiel #5
0
 private void BuildTest32(Action<M68kAssembler> asmProg)
 {
     arch = new M68kArchitecture();
     BuildTest(Address.Ptr32(0x00100000), new DefaultPlatform(null, arch), asmProg);
 }
Beispiel #6
0
 public void Setup()
 {
     arch = new M68kArchitecture();
     state = new M68kState(arch);
 }
Beispiel #7
0
 public M68kState(M68kState orig) : base(orig)
 {
     this.arch = orig.arch;
     this.values = (uint[]) orig.values.Clone();
     this.isValid = (bool[]) orig.isValid.Clone();
 }
Beispiel #8
0
 public M68kState(M68kArchitecture arch)
 {
     this.arch = arch;
     this.values = new uint[16];
     this.isValid = new bool[16];
 }
Beispiel #9
0
 public void Setup()
 {
     arch = new M68kArchitecture();
     asm = new M68kAssembler(arch, Address.Ptr32(0x00010000), new List<EntryPoint>());
 }
Beispiel #10
0
 public FuncsFileParser(M68kArchitecture arch, TextReader streamReader)
 { 
     this.arch = arch;
     this.streamReader = streamReader;
     this.FunctionsByA6Offset = new Dictionary<int, AmigaSystemFunction>();
 }
 public void Setup()
 {
     this.arch = new M68kArchitecture();
     this.rw = new Rewriter(this.arch, null, new M68kState(arch), new Frame(arch.FramePointerType), null);
     this.addrInstr = Address.Ptr32(0x0012340C);
 }