예제 #1
0
 public FileProp(FATXFileEntry xin, string stfsname)
 {
     InitializeComponent();
     xfile = xin;
     textBoxX1.Text = xin.Name;
     textBoxX2.Text = stfsname;
     textBoxX3.Text = xin.Size.ToString() + " bytes";
 }
        public FATXReadContents xRead()
        {
            FATXReadContents xreturn = new FATXReadContents();
            try
            {
                xDrive.GetIO();

                if (!Partition.xTable.xAllocTable.Accessed)
                {
                    return null;
                }
                List<FATXEntry> xEntries = new List<FATXEntry>();
                uint[] xBlocks = Partition.xTable.GetBlocks(xStartBlock);

                for (int i = 0; i < xBlocks.Length; i++)
                {
                    long xCurrent = Partition.BlockToOffset(xBlocks[i]);
                    if (xCurrent == -1)
                        break;

                    for (int x = 0; x < Partition.xEntryCount; x++)
                    {
                        xDrive.xIO.Position = xCurrent + (0x40 * x);
                        FATXEntry z = new FATXEntry(Partition.FatType,
                            (xCurrent + (0x40 * x)),
                            xDrive.xIO.ReadBytes(0x40),
                            ref xDrive);

                        z.SetAtts(Partition);

                        if (z.xIsValid)
                        {
                            xEntries.Add(z);
                        }
                        else
                        {
                            if (z.xNLen != 0xE5)
                                break;
                        }
                    }
                }
                xreturn.xfolds = new List<FATXFolderEntry>();
                xreturn.xfiles = new List<FATXFileEntry>();
                for (int i = 0; i < xEntries.Count; i++)
                {
                    if (xEntries[i].IsFolder)
                    {
                        if (string.Compare(xEntries[i].Name, this.Name, true) != 0)
                        {
                            var f = new FATXFolderEntry(this, xEntries[i], Path + "/" + xEntries[i].Name);

                            xreturn.xfolds.Add(f);
                        }
                    }
                    else
                    {
                        var f = new FATXFileEntry(this, xEntries[i]);

                        xreturn.xfiles.Add(f);
                    }
                }
                return xreturn;
            }
            catch { return (xreturn = null); }
        }
예제 #3
0
 ListViewItem GetItem(FATXFileEntry tag)
 {
     ListViewItem x = new ListViewItem(tag.Name);
     x.Tag = tag;
     x.SubItems.Add("");
     x.SubItems.Add(tag.Size.ToString());
     return x;
 }
        public bool LoadPackageIntoTree(Package package, FATXFileEntry file)
        {
            bool ret = false;

            treePackageContentsIsLocal = false;
            treePackageContentsFilePath = "";
            treePackageContentsIsFATXFileEntry = true;
            treePackageContentsFATXFileEntry = file;

            treePackageContents.SuspendLayout();
            treePackageContents.Nodes.Clear();
            treePackageContents.Tag = package;
            try
            {
                ret = AddPackageTreeNodes(treePackageContents.Nodes, package.RootFolder);
            }
            catch { }
            treePackageContents.ExpandAll();
            treePackageContents.ResumeLayout();

            return ret;
        }