コード例 #1
0
ファイル: Gcf.cs プロジェクト: bonomali/Ibasa
            public GcfFileInfo(Gcf gcf, uint index)
            {
                Gcf   = gcf;
                Index = index;

                if (Index == 0xFFFFFFFF)
                {
                    ParentIndex = 0xFFFFFFFF;
                    Path        = null;
                    ItemSize    = 0;
                    return;
                }

                List <string> path = new List <string>();

                DirectoryEntry entry, parent;

                entry = parent = Gcf.GetDirectoryEntry(Index);

                do
                {
                    path.Add(gcf.GetDirectoryName(parent.NameOffset));
                    if (parent.ParentIndex != 0xFFFFFFFF)
                    {
                        parent = gcf.GetDirectoryEntry(parent.ParentIndex);
                    }
                } while (parent.ParentIndex != 0xFFFFFFFF);

                path.Reverse();
                Path = string.Join(Gcf.Path.DirectorySeparatorChars[0].ToString(), path);

                ParentIndex = entry.ParentIndex;
                ItemSize    = entry.ItemSize;
            }
コード例 #2
0
ファイル: Gcf.cs プロジェクト: bonomali/Ibasa
            public GcfFileInfo(Gcf gcf, string path)
            {
                Gcf  = gcf;
                Path = path;

                path = Gcf.Path.GetFullPath(path);

                string[] names = path.Split(Gcf.Path.DirectorySeparatorChars);

                Packaging.DirectoryInfo dir = Gcf.Root;

                for (int i = 0; i < names.Length - 1; ++i)
                {
                    var children = dir.GetDirectories(names[i]);

                    if (children.Length != 1)
                    {
                        dir = null;
                        break;
                    }

                    dir = children[0];
                }

                if (dir != null)
                {
                    var children = dir.GetFiles(names[names.Length - 1]);

                    if (children.Length != 1)
                    {
                        Index       = 0xFFFFFFFF;
                        ParentIndex = 0xFFFFFFFF;
                        ItemSize    = 0;
                    }
                    else
                    {
                        GcfFileInfo gcffile = children[0] as GcfFileInfo;

                        Index       = gcffile.Index;
                        ParentIndex = gcffile.ParentIndex;
                        ItemSize    = gcffile.ItemSize;
                    }
                }
                else
                {
                    Index       = 0xFFFFFFFF;
                    ParentIndex = 0xFFFFFFFF;
                    ItemSize    = 0;
                }
            }
コード例 #3
0
ファイル: Gcf.cs プロジェクト: bonomali/Ibasa
            public GcfStream(Gcf gcf, uint index)
            {
                Gcf   = gcf;
                Index = index;

                Size     = Gcf.GetDirectoryEntry(Index).ItemSize;
                Position = 0;

                FAT = new List <uint>();

                var  block = Gcf.GetBlockEntry(Gcf.GetDirectoryMapEntry(Index));
                uint data  = block.FirstDataBlockIndex;

                while (data != Gcf.Terminator)
                {
                    FAT.Add(data);
                    data = Gcf.GetFragmentationMapEntry(data);
                }
            }
コード例 #4
0
ファイル: Gcf.cs プロジェクト: bonomali/Ibasa
            public GcfDirectoryInfo(Gcf gcf, string path)
            {
                Gcf  = gcf;
                Path = path;

                path = Gcf.Path.GetFullPath(path);

                string[] names = path.Split(Gcf.Path.DirectorySeparatorChars);

                Packaging.DirectoryInfo dir = Gcf.Root;

                for (int i = 0; i < names.Length; ++i)
                {
                    var children = dir.GetDirectories(names[i]);

                    if (children.Length != 1)
                    {
                        dir = null;
                        break;
                    }

                    dir = children[0];
                }

                GcfDirectoryInfo gcfdir = dir as GcfDirectoryInfo;

                if (gcfdir != null)
                {
                    Index       = gcfdir.Index;
                    ParentIndex = gcfdir.ParentIndex;
                }
                else
                {
                    Index       = 0xFFFFFFFF;
                    ParentIndex = 0xFFFFFFFF;
                }
            }
コード例 #5
0
ファイル: Gcf.cs プロジェクト: Frassle/Ibasa
            public GcfStream(Gcf gcf, uint index)
            {
                Gcf = gcf;
                Index = index;

                Size = Gcf.GetDirectoryEntry(Index).ItemSize;
                Position = 0;

                FAT = new List<uint>();

                var block = Gcf.GetBlockEntry(Gcf.GetDirectoryMapEntry(Index));
                uint data = block.FirstDataBlockIndex;

                while (data != Gcf.Terminator)
                {
                    FAT.Add(data);
                    data = Gcf.GetFragmentationMapEntry(data);
                }
            }
コード例 #6
0
ファイル: Gcf.cs プロジェクト: Frassle/Ibasa
            public GcfFileInfo(Gcf gcf, string path)
            {
                Gcf = gcf;
                Path = path;

                path = Gcf.Path.GetFullPath(path);

                string[] names = path.Split(Gcf.Path.DirectorySeparatorChars);

                Packaging.DirectoryInfo dir = Gcf.Root;

                for (int i = 0; i < names.Length - 1; ++i)
                {
                    var children = dir.GetDirectories(names[i]);

                    if (children.Length != 1)
                    {
                        dir = null;
                        break;
                    }

                    dir = children[0];
                }

                if (dir != null)
                {
                    var children = dir.GetFiles(names[names.Length - 1]);

                    if (children.Length != 1)
                    {
                        Index = 0xFFFFFFFF;
                        ParentIndex = 0xFFFFFFFF;
                        ItemSize = 0;
                    }
                    else
                    {
                        GcfFileInfo gcffile = children[0] as GcfFileInfo;

                        Index = gcffile.Index;
                        ParentIndex = gcffile.ParentIndex;
                        ItemSize = gcffile.ItemSize;
                    }
                }
                else
                {
                    Index = 0xFFFFFFFF;
                    ParentIndex = 0xFFFFFFFF;
                    ItemSize = 0;
                }
            }
コード例 #7
0
ファイル: Gcf.cs プロジェクト: Frassle/Ibasa
            public GcfFileInfo(Gcf gcf, uint index)
            {
                Gcf = gcf;
                Index = index;

                if (Index == 0xFFFFFFFF)
                {
                    ParentIndex = 0xFFFFFFFF;
                    Path = null;
                    ItemSize = 0;
                    return;
                }

                List<string> path = new List<string>();

                DirectoryEntry entry, parent;
                entry = parent = Gcf.GetDirectoryEntry(Index);

                do
                {
                    path.Add(gcf.GetDirectoryName(parent.NameOffset));
                    if (parent.ParentIndex != 0xFFFFFFFF)
                        parent = gcf.GetDirectoryEntry(parent.ParentIndex);
                } while (parent.ParentIndex != 0xFFFFFFFF);

                path.Reverse();
                Path = string.Join(Gcf.Path.DirectorySeparatorChars[0].ToString(), path);

                ParentIndex = entry.ParentIndex;
                ItemSize = entry.ItemSize;
            }
コード例 #8
0
ファイル: Gcf.cs プロジェクト: Frassle/Ibasa
            public GcfDirectoryInfo(Gcf gcf, string path)
            {
                Gcf = gcf;
                Path = path;

                path = Gcf.Path.GetFullPath(path);

                string[] names = path.Split(Gcf.Path.DirectorySeparatorChars);

                Packaging.DirectoryInfo dir = Gcf.Root;

                for (int i = 0; i < names.Length; ++i)
                {
                    var children = dir.GetDirectories(names[i]);

                    if (children.Length != 1)
                    {
                        dir = null;
                        break;
                    }
                    
                    dir = children[0];
                }

                GcfDirectoryInfo gcfdir = dir as GcfDirectoryInfo;

                if (gcfdir != null)
                {
                    Index = gcfdir.Index;
                    ParentIndex = gcfdir.ParentIndex;
                }
                else
                {
                    Index = 0xFFFFFFFF;
                    ParentIndex = 0xFFFFFFFF;
                }
            }