Пример #1
0
        private void FatTableBtn_Click(object sender, EventArgs e)
        {
            ParseBootSector();
            if (bootSectors.Count == 0)
            {
                aLogger.LogMessage($"{System.Reflection.MethodBase.GetCurrentMethod().Name.ToString()}:: Empty bootSectors list, operation terminated! ", LogMsgType.Error);
                return;
            }
            foreach (var bs in bootSectors)
            {
                int dataAreaStartLoc = bs.GetRootDirectoryStartByte();
                aLogger.LogMessage($"{System.Reflection.MethodBase.GetCurrentMethod().Name}:: Data Area starts at 0x{dataAreaStartLoc:X8} ", LogMsgType.Verbose);
                while (true)
                {
                    //var directory= Filesystems.FatDirectoryArea.ParseDirectoryArea(dataAreaStartLoc, fileName, bs, ref aLogger);
                    var directory = Common.Common.GetUnit <FatDirectoryArea>(fileName, ref aLogger, dataAreaStartLoc,
                                                                             "DirectoryArea-" + bs.Description, null);
                    //printing hex table
                    HexPrinter aHexPrinter = new HexPrinter(ref richTextBox1, 32, dataAreaStartLoc, ref aLogger);
                    aHexPrinter.PrintColoredStructure(directory);
                    //printing values
                    Printer.PrintStructureValues(directory.Structure, ref richTextBox1, ref aLogger);

                    richTextBox1.AppendText("\n\n\n");
                    dataAreaStartLoc += Common.Common.FatDirectoryAreaSizeBytes;
                    if (directory.IsEmpty)
                    {
                        break;
                    }
                }
            }
        }
Пример #2
0
        private void FatTableBtn_Click(object sender, EventArgs e)
        {
            ParseBootSector();
            if (bootSectors.Count == 0)
            {
                aLogger.LogMessage($"{System.Reflection.MethodBase.GetCurrentMethod().Name.ToString()}:: Empty bootSectors list, operation terminated! ", LogMsgType.Error);
                return;
            }
            ParseRootDirectoryEntries();

            foreach (var directory in RootDirectoryEntries)
            {
                if (directory.IsThisEntryaDirectory())
                {
                    richTextBox1.AppendText("\n[DIRECTORY]\n");
                }
                else if (directory.IsThisEntryanArchive())
                {
                    richTextBox1.AppendText("\n[NORMAL FILE]\n");
                }

                //printing hex table
                HexPrinter aHexPrinter = new HexPrinter(ref richTextBox1, 32, directory.StartAddress, ref aLogger);
                aHexPrinter.PrintColoredStructure(directory);


                //printing values
                Printer.PrintStructureValues(directory.Structure, ref richTextBox1, ref aLogger);



                aLogger.LogMessage($"DATA IS LOCATED @{directory.GetDataLocation().ToString("X8")}", LogMsgType.Debug);


                if (directory.LongFileNames?.Count > 0)
                {
                    richTextBox1.AppendText($"\n [START]******************** Printing long file name entries for the previous one ************ \n", Color.Red);
                    int counter = 1;
                    foreach (var longNameEntry in directory.LongFileNames)
                    {
                        richTextBox1.AppendText($"|---- Printing Long Name Entry [{counter}] \n");
                        //printing hex table
                        HexPrinter aHexPrinter2 = new HexPrinter(ref richTextBox1, 32, longNameEntry.StartAddress, ref aLogger);
                        aHexPrinter2.PrintColoredStructure(longNameEntry);

                        //printing values
                        Printer.PrintStructureValues(longNameEntry.Structure, ref richTextBox1, ref aLogger);
                        richTextBox1.AppendText($"|---- [DONE] Printing Long Name Entry [{counter}] \n");
                        counter++;
                    }
                    richTextBox1.AppendText($"\n [END]******************** Printing long file name entries  ************ \n", Color.Red);
                }


                if (directory.ChildrenList?.Count > 0)
                {
                    richTextBox1.AppendText($"\n [START]******************** Printing subfolder entries ************ \n", Color.Violet);
                    int counter = 1;
                    foreach (var child in directory.ChildrenList)
                    {
                        richTextBox1.AppendText($"|---- Printing subfolder Entry [{counter}] \n");
                        //printing hex table
                        HexPrinter aHexPrinter2 = new HexPrinter(ref richTextBox1, 32, child.StartAddress, ref aLogger);
                        aHexPrinter2.PrintColoredStructure(child);

                        //printing values
                        Printer.PrintStructureValues(child.Structure, ref richTextBox1, ref aLogger);

                        aLogger.LogMessage($"DATA IS LOCATED @{child.GetDataLocation().ToString("X8")}", LogMsgType.Debug);


                        richTextBox1.AppendText($"|---- [DONE] Printing subfolder Entry [{counter}] \n");
                        counter++;
                    }
                    richTextBox1.AppendText($"\n [END]******************** Printing long file name entries  ************ \n", Color.Violet);
                }
                richTextBox1.AppendText("\n\n\n");
            }
        }