示例#1
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                txtLog.Clear();
                treeStructure.Nodes.Clear();

                Log("[i] Loading file...");

                try
                {
                    InFile = new InputFile(dlg.FileName);
                    Log("      Size: 0x" + InFile.Length.ToString("X8"));
                    AtomParser parser = new AtomParser();
                    Atoms = parser.ParseFile(InFile);
                    Log("      Atoms in root: " + Atoms.Count);

                    DisplayTree(Atoms);
                }
                catch (Exception ex)
                {
                    Log("");
                    Log("[E] " + ex.ToString());
                    InFile.Close();

                    btnLoad.Enabled  = true;
                    btnPatch.Enabled = false;
                    btnSave.Enabled  = false;
                    return;
                }

                btnLoad.Enabled  = false;
                btnPatch.Enabled = true;
                btnSave.Enabled  = false;
                Log("");
                Log("--------------------------------");
            }
        }
        private void btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if(dlg.ShowDialog() == DialogResult.OK)
            {
                txtLog.Clear();
                treeStructure.Nodes.Clear();

                Log("[i] Loading file...");

                try
                {
                    InFile = new InputFile(dlg.FileName);
                    Log("      Size: 0x" + InFile.Length.ToString("X8"));
                    AtomParser parser = new AtomParser();
                    Atoms = parser.ParseFile(InFile);
                    Log("      Atoms in root: " + Atoms.Count);

                    DisplayTree(Atoms);
                }
                catch (Exception ex)
                {
                    Log("");
                    Log("[E] " + ex.ToString());
                    InFile.Close();

                    btnLoad.Enabled = true;
                    btnPatch.Enabled = false;
                    btnSave.Enabled = false;
                    return;
                }

                btnLoad.Enabled = false;
                btnPatch.Enabled = true;
                btnSave.Enabled = false;
                Log("");
                Log("--------------------------------");
            }
        }