Exemple #1
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));
            };
        }