static void FirmTest(string[] args)
 { 
   FwFile myfirm = new FwFile();
   myfirm.Test(args.Length >1 ? args[2] : Directory.GetCurrentDirectory() + @"\rofs3.fpsx");
   string binfile = Directory.GetFiles( Directory.GetCurrentDirectory() + @"\ROFS2", "?_code.bin" )[0];
   UseExternalTools.ExtractImage(Directory.GetCurrentDirectory(), Directory.GetCurrentDirectory() + @"\ROFS2"+binfile, Directory.GetCurrentDirectory() + @"\ROFSROOT");
   if ( File.Exists( "test.hex" ) )
     File.Delete( "test.hex" );
   BinaryWriter bw = new BinaryWriter( new FileStream( "test.hex", FileMode.CreateNew, FileAccess.Write ) );
   bw.Write( ( int ) 0x01020304 );
   bw.Dispose();
 }
    private void OpenFirmWare(object sender, EventArgs e)
    {
      FwFile myFirm = new FwFile();
      myFirm.outputDir = Application.StartupPath + @"\ROFSIMAGE";
      if (FirmOpenDialog.ShowDialog() == DialogResult.Cancel)
        return;
      string firmFile = FirmOpenDialog.FileName;
      myFirm.Test(firmFile);
      UseExternalTools.ExtractImage(Application.StartupPath + @"\Tools", Application.StartupPath + @"\ROFSIMAGE\rofsImage.bin", Application.StartupPath + @"\ROFSROOT");
      TreeNode rootNode = new TreeNode(Path.GetFileName(firmFile));
      strROFSDir = Application.StartupPath + @"\ROFSROOT";
      rootNode.Tag = strROFSDir;
      populateDirView(strROFSDir, rootNode);
      folderView.Nodes.Add(rootNode);
      folderView.SelectedNode = folderView.TopNode;
      DirectorySelect(null, null);

    }