Exemplo n.º 1
0
        private void _analyzeBootBlock()
        {
            byte[] bytBootBlock = _adfFile.GetSectors(0, 2);

            _adfFile.FileMemoryStream.Seek(0, SeekOrigin.Begin);
            using (var br = new BinaryReader(_adfFile.FileMemoryStream))
            {
                BootBlock bb = new BootBlock(br, _adfFile.Blocksize * 2);
            }
        }
Exemplo n.º 2
0
        private string _getDirectory()
        {
            /* The directory is contained in the first 10 sectors
             * starting at byte 42 with an entry siz eof 46 bytes */
            var           bytDir = _adfFile.GetSectors(0, 10);
            var           intStartOfDirectory = 42;
            var           intEntrySize        = 46;
            StringBuilder sbText = new StringBuilder();

            //read directory
            int idx = intStartOfDirectory; //first directory entry

            while (bytDir[idx] != 0)
            {
                //get entry
                byte[] bytEntry = new byte[intEntrySize];
                Buffer.BlockCopy(bytDir, idx, bytEntry, 0, intEntrySize);

                if (HlsDosDirEntry.TryParse(bytEntry, out var hdde))
                {
                    //output to trace
                    Trace.WriteLine(hdde.GetHexLine());

                    //collect dir entries
                    sbText.Append(hdde.GetTextLine());
                    sbText.Append(Environment.NewLine);
                }

                //goto next entry
                idx += intEntrySize;
            }

            //output to trace
            Trace.WriteLine(sbText.ToString());

            return(sbText.ToString());
        }