示例#1
0
        public static PK Load(string path)
        {
            FileInfo fi = new FileInfo(path);
            Logger.LogToFile(Logger.LogLevel.Info, "{0}", path);
            PK pk = new PK();

            pk.name = Path.GetFileNameWithoutExtension(path);
            pk.location = Path.GetDirectoryName(path) + "\\";

            using (BinaryReader brDir = new BinaryReader(fi.OpenRead()))
            {
                while (true)
                {
                    string name = brDir.ReadString(20);

                    if (name == "") { break; }

                    pk.contents.Add(
                        new PKEntry {
                            Name = name,
                            Unknown = brDir.ReadInt32(),
                            Offset = brDir.ReadInt32(),
                            Size = brDir.ReadInt32()
                        }
                    );
                }
            }

            return pk;
        }
示例#2
0
        public static PK Load(string path)
        {
            FileInfo fi = new FileInfo(path);

            Logger.LogToFile(Logger.LogLevel.Info, "{0}", path);

            PK pk = new PK()
            {
                name     = Path.GetFileNameWithoutExtension(path),
                location = Path.GetDirectoryName(path) + "\\"
            };

            using (BinaryReader brDir = new BinaryReader(fi.OpenRead()))
            {
                while (true)
                {
                    string name = brDir.ReadString(20);

                    if (name == "")
                    {
                        break;
                    }

                    pk.contents.Add(
                        new PKEntry
                    {
                        Name    = name,
                        Unknown = brDir.ReadInt32(),
                        Offset  = brDir.ReadInt32(),
                        Size    = brDir.ReadInt32()
                    }
                        );
                }
            }

            return(pk);
        }