Esempio n. 1
0
        private Dictionary <int, SystemService> LoadLibraryDef(string lib_name, int version, TypeLibrary libDst)
        {
            var tlSvc = Services.RequireService <ITypeLibraryLoaderService>();
            var fsSvc = Services.RequireService <IFileSystemService>();
            var tser  = new TypeLibraryDeserializer(this, true, libDst);
            var sser  = new ProcedureSerializer(this, tser, DefaultCallingConvention);

            using (var rdr = new StreamReader(fsSvc.CreateFileStream(tlSvc.InstalledFileLocation(lib_name + ".funcs"), FileMode.Open, FileAccess.Read)))
            {
                var fpp = new FuncsFileParser((M68kArchitecture)this.Architecture, rdr);
                fpp.Parse();
                return(fpp.FunctionsByLibBaseOffset.Values
                       .Select(amiSvc => new SystemService
                {
                    Name = amiSvc.Name,
                    SyscallInfo = new SyscallInfo
                    {
                        Vector = amiSvc.Offset,
                    },
                    Signature = sser.Deserialize(amiSvc.Signature, Architecture.CreateFrame()),       //$BUGBUG: catch dupes?
                    Characteristics = new ProcedureCharacteristics {
                    }
                })
                       .ToDictionary(de => de.SyscallInfo.Vector, de => de));
            };
        }
Esempio n. 2
0
        private Dictionary <int, SystemService> LoadFuncs()
        {
            var fsSvc = Services.RequireService <IFileSystemService>();
            var sser  = Architecture.CreateProcedureSerializer(
                new TypeLibraryLoader(Architecture, true),
                DefaultCallingConvention);

            using (var rdr = new StreamReader(fsSvc.CreateFileStream("exec.funcs", FileMode.Open, FileAccess.Read)))
            {
                var fpp = new FuncsFileParser((M68kArchitecture)this.Architecture, rdr);
                fpp.Parse();
                return(fpp.FunctionsByA6Offset.Values
                       .Select(amiSvc => new SystemService
                {
                    Name = amiSvc.Name,
                    SyscallInfo = new SyscallInfo
                    {
                        Vector = amiSvc.Offset,
                    },
                    Signature = sser.Deserialize(amiSvc.Signature, Architecture.CreateFrame()),       //$BUGBUG: catch dupes?
                    Characteristics = new ProcedureCharacteristics {
                    }
                })
                       .ToDictionary(de => de.SyscallInfo.Vector, de => de));
            };
        }
Esempio n. 3
0
        private Dictionary<int, SystemService> LoadFuncs()
        {
            var fsSvc = Services.RequireService<IFileSystemService>();
            var sser = Architecture.CreateProcedureSerializer(
                new TypeLibraryLoader(Architecture,true),
                DefaultCallingConvention);

            using (var rdr = new StreamReader(fsSvc.CreateFileStream("exec.funcs", FileMode.Open, FileAccess.Read)))
            {
                var fpp = new FuncsFileParser((M68kArchitecture) this.Architecture, rdr);
                fpp.Parse();
                return fpp.FunctionsByA6Offset.Values
                    .Select(amiSvc => new SystemService
                    {
                        Name = amiSvc.Name,
                        SyscallInfo = new SyscallInfo
                        {
                            Vector = amiSvc.Offset,
                        },
                        Signature = sser.Deserialize(amiSvc.Signature, Architecture.CreateFrame()),   //$BUGBUG: catch dupes?   
                        Characteristics = new ProcedureCharacteristics { }
                    })
                    .ToDictionary(de => de.SyscallInfo.Vector, de => de);
            };
        }
Esempio n. 4
0
        private Dictionary<int, SystemService> LoadLibraryDef(string lib_name, int version, TypeLibrary libDst)
        {
            var tlSvc = Services.RequireService<ITypeLibraryLoaderService>();
            var fsSvc = Services.RequireService<IFileSystemService>();
            var sser = new M68kProcedureSerializer(
                (M68kArchitecture)Architecture,
                new TypeLibraryDeserializer(this, true, libDst),
                DefaultCallingConvention);

            using (var rdr = new StreamReader(fsSvc.CreateFileStream(tlSvc.InstalledFileLocation( lib_name + ".funcs"), FileMode.Open, FileAccess.Read)))
            {
                var fpp = new FuncsFileParser((M68kArchitecture)this.Architecture, rdr);
                fpp.Parse();
                return fpp.FunctionsByLibBaseOffset.Values
                    .Select(amiSvc => new SystemService
                    {
                        Name = amiSvc.Name,
                        SyscallInfo = new SyscallInfo
                        {
                            Vector = amiSvc.Offset,
                        },
                        Signature = sser.Deserialize(amiSvc.Signature, Architecture.CreateFrame()),   //$BUGBUG: catch dupes?   
                        Characteristics = new ProcedureCharacteristics { }
                    })
                    .ToDictionary(de => de.SyscallInfo.Vector, de => de);
            };
        }