Exemplo n.º 1
0
        private void ExtractCurrentFsDoWork(object sender, DoWorkEventArgs doWorkEventArgs)
        {
            var reader = new NANDReader(doWorkEventArgs.Argument as string);

            try {
                AddOutput("Scanning for RootFS... {0}", Environment.NewLine);
                reader.ScanForFsRootAndMobile();
                AddOutput("Parsing RootFS @ 0x{0:X}...{1}", reader.FsRoot.Offset, Environment.NewLine);
                var fs      = new NANDFileSystem();
                var entries = fs.ParseFileSystem(ref reader);
                AddOutput("FSEntries found: {0}{1}", entries.Length, Environment.NewLine);
                var dir = (doWorkEventArgs.Argument as string) + "_ExtractedFS";
                Directory.CreateDirectory(dir);
                foreach (var fileSystemEntry in entries)
                {
                    AddOutput("Extracting: {0}...{1}", fileSystemEntry.Filename, Environment.NewLine);
                    fileSystemEntry.ExtractToFile(ref reader, Path.Combine(dir, fileSystemEntry.Filename));
                    //File.WriteAllBytes(Path.Combine(dir, fileSystemEntry.Filename), fileSystemEntry.GetData(ref reader));
                }
            }
            catch (Exception ex) {
                AddException(ex.ToString());
            }
            finally {
                reader.Close();
            }
            AddDone();
        }
Exemplo n.º 2
0
 private void Form1_DragDrop(object sender, DragEventArgs e)
 {
     try {
         var file = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0];
         if (reader != null)
         {
             reader.Close();
         }
         reader        = new NANDReader(file);
         textBox1.Text = file;
         var smc = _nand.GetSmc(reader, true);
         textBox2.Text = _smc.GetVersion(ref smc);
     }
     catch { }
 }
Exemplo n.º 3
0
        private void TestFsParserDoWork(object sender, DoWorkEventArgs doWorkEventArgs)
        {
            var reader = new NANDReader(doWorkEventArgs.Argument as string);

            try {
                AddOutput("Parsing RootFS @ 0x{0:X}...{1}", reader.FsRoot.Offset, Environment.NewLine);
                var fs      = new NANDFileSystem();
                var entries = fs.ParseFileSystem(ref reader);
                AddOutput("FSEntries found:{0}", Environment.NewLine);
                foreach (var fileSystemEntry in entries)
                {
                    AddOutput("{0}{1}", fileSystemEntry, Environment.NewLine);
                }
            }
            catch (Exception ex) {
                AddException(ex.ToString());
            }
            finally {
                reader.Close();
            }
            AddDone();
        }
Exemplo n.º 4
0
        private void TestFsRootScanDoWork(object sender, DoWorkEventArgs doWorkEventArgs)
        {
            var reader = new NANDReader(doWorkEventArgs.Argument as string);

            AddOutput("Testing FSRootScanner... {0}", Environment.NewLine);
            try {
                AddOutput("FSRoot found:{0}", Environment.NewLine);
                AddOutput("{0}{1}", reader.FsRoot, Environment.NewLine);
                AddOutput("Mobiles found:{0}", Environment.NewLine);
                foreach (var mobileEntry in reader.MobileEntries)
                {
                    AddOutput("{0}{1}", mobileEntry, Environment.NewLine);
                }
            }
            catch (Exception ex) {
                AddException(ex.ToString());
            }
            finally {
                reader.Close();
            }
            AddDone();
        }