public frmStrongName(IHost mainForm, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = mainForm;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            if (!String.IsNullOrEmpty(Config.SNOutputDir))
            {
                txtOutputDir.Text = Config.SNOutputDir;
            }
            else
            {
                txtOutputDir.Text = _sourceDir;
            }

            if (!String.IsNullOrEmpty(Config.StrongKeyFile))
            {
                txtKeyFile.Text = Config.StrongKeyFile;
            }

            txtAdditionalOptions.Text = Config.SNAdditionalOptions;

            OptionChanged();
        }
        private void cmDeleteFile_Click(object sender, EventArgs e)
        {
            if (dgvData.SelectedRows.Count < 1)
            {
                SimpleMessage.ShowInfo("Please select file.");
                return;
            }

            try
            {
                if (SimpleMessage.Confirm("Are you sure to delete selected file(s)?") == DialogResult.Yes)
                {
                    string path = SimplePath.GetFullPath(treeView1.SelectedNode.FullPath);
                    for (int i = 0; i < dgvData.SelectedRows.Count; i++)
                    {
                        string file = PathUtils.GetFileName(dgvData.SelectedRows[i], path);
                        File.Delete(file);
                    }

                    TreeViewHandler.RefreshNode(treeView1.SelectedNode);
                }
            }
            catch (Exception ex)
            {
                SimpleMessage.ShowException(ex);
            }
        }
Example #3
0
        public frmDe4dot(IHost host, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = host;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            InitForm();
        }
        public frmVerify(IHost mainForm, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = mainForm;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            txtAdditionalOptions.Text = Config.PEVerifyAdditionalOptions;
        }
Example #5
0
        private void InitForm(ClassEditParams p)
        {
            try
            {
                //this.SuspendLayout();

                Host             = p.Host;
                Rows             = p.Rows;
                SourceDir        = SimplePath.GetFullPath(p.SourceDir);
                ShowStaticOnly   = p.ShowStaticOnly;
                ShowSelectButton = p.ShowSelectButton;

                tbSelect.Visible = ShowSelectButton;
                tbSave.Visible   = !ShowSelectButton;

                //dgBody.Visible = false;
                //dgResource.Visible = false;
                //panelResource.Visible = false;

                dgBody.Dock     = DockStyle.Fill;
                dgResource.Dock = DockStyle.Fill;

                panelResource.Dock = DockStyle.Fill;
                txtResource.Dock   = DockStyle.Fill;
                //pbResource.Dock = DockStyle.Fill;
                pbResource.Left = 0; pbResource.Top = 0;
                lvResource.Dock = DockStyle.Fill;
                hbResource.Dock = DockStyle.Fill;

                rtbText.Font      = Config.ClassEditorRichTextBoxFont;
                rtbILSpyText.Font = Config.ClassEditorRichTextBoxFont;

                LogHandler          = new ClassEditLogHandler(this);
                BodyGridHandler     = new ClassEditBodyGridHandler(this);
                VariableGridHandler = new ClassEditVariableGridHandler(this);
                ResourceHandler     = new ClassEditResourceHandler(this);
                SearchHandler       = new ClassEditSearchHandler(this);
                ReflectorHandler    = new ClassEditReflectorHandler(this);
                ILSpyHandler        = new ClassEditILSpyHandler(this);
                BookmarkHandler     = new ClassEditBookmarkHandler(this);
                TreeViewHandler     = new ClassEditTreeViewHandler(this);
                BinaryViewHandler   = new ClassEditBinaryViewHandler(this);
                TextViewHandler     = new ClassEditTextViewHandler(this);

                TreeViewHandler.ObjectType = p.ObjectType;
            }
            catch
            {
                throw;
            }
            finally
            {
                //this.ResumeLayout();
            }
        }
Example #6
0
        public frmMethodSearcher(IHost host, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = host;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            cboSearchFor.Items.Add("// This item is obfuscated and can not be translated.");
            cboSearchFor.Items.Add("// This item appears to be generated and can not be translated.");
            cboSearchFor.Items.Add("using (enumerator =");
            if (!String.IsNullOrEmpty(this.LastSearchFor))
            {
                cboSearchFor.Text = this.LastSearchFor;
            }
            else
            {
                cboSearchFor.SelectedIndex = 0;
            }
            switch (this.LogTo)
            {
            case "Screen":
                rbToScreen.Checked = true;
                break;

            case "File":
                rbToFile.Checked = true;
                break;

            default:
                break;
            }

            _reflector = SimpleReflector.Default;
            //_reflector.FormatterType = typeof(TextFormatter);
            _reflector.FormatterTypeName = "SimpleAssemblyExplorer.LutzReflector.TextFormatter";

            foreach (string l in _reflector.Languages)
            {
                int index = cboLanguage.Items.Add(l);
                if (l == "C#")
                {
                    cboLanguage.SelectedIndex = index;
                }
            }
            //foreach (string op in SimpleReflector.OptimizationList)
            //{
            //    int index = cboOptimization.Items.Add(op);
            //    if (op == "2.0")
            //    {
            //        cboOptimization.SelectedIndex = index;
            //    }
            //}
        }
        public frmRunMethod(IHost mainForm, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = mainForm;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            _parameters = new DataTable();
            _parameters.Columns.Add("name", typeof(String));
            _parameters.Columns.Add("type", typeof(String));
            _parameters.Columns.Add("value", typeof(String));
        }
 private void cmFolderDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string path = SimplePath.GetFullPath(treeView1.SelectedNode.FullPath);
         if (SimpleMessage.Confirm(String.Format("Are you sure to delete selected folder:\n{0}?", path)) == DialogResult.Yes)
         {
             Directory.Delete(path, true);
             treeView1.SelectedNode.Remove();
         }
     }
     catch (Exception ex)
     {
         SimpleMessage.ShowException(ex);
     }
 }
Example #9
0
        public frmDasm(IHost mainForm, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = mainForm;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            if (!String.IsNullOrEmpty(Config.DasmOutputDir))
            {
                txtOutputDir.Text = Config.DasmOutputDir;
            }
            else
            {
                txtOutputDir.Text = _sourceDir;
            }
            txtAdditionalOptions.Text = Config.DasmAdditionalOptions;
        }
        public frmILMerge(IHost host, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = host;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            if (!String.IsNullOrEmpty(OutputDir))
            {
                txtOutputDir.Text = OutputDir;
            }
            else
            {
                txtOutputDir.Text = _sourceDir;
            }
            if (!String.IsNullOrEmpty(StrongKeyFile))
            {
                txtKeyFile.Text = StrongKeyFile;
            }

            lbAssemblies.Items.Clear();
            int selected = -1;

            for (int i = 0; i < _rows.Length; i++)
            {
                string file = _rows[i];
                if (!String.IsNullOrEmpty(file))
                {
                    int index = lbAssemblies.Items.Add(file);
                    if (Path.GetExtension(file).ToLower() == ".exe")
                    {
                        lbAssemblies.SelectedIndex = index;
                        selected = index;
                    }
                }
            }
            if (selected < 0)
            {
                lbAssemblies.SelectedIndex = 0;
            }
        }
Example #11
0
        public frmFileDisassembler(IHost host, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = host;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            cboLanguage.SelectedIndex = 0;

            foreach (string op in SimpleReflector.OptimizationList)
            {
                int index = cboOptimization.Items.Add(op);
                if (op == "2.0")
                {
                    cboOptimization.SelectedIndex = index;
                }
            }

            if (!String.IsNullOrEmpty(OutputDir))
            {
                txtOutputDir.Text = OutputDir;
            }
            else
            {
                txtOutputDir.Text = _sourceDir;
            }

            lbAssemblies.Items.Clear();
            for (int i = 0; i < _rows.Length; i++)
            {
                string file = _rows[i];
                if (!String.IsNullOrEmpty(file))
                {
                    int index = lbAssemblies.Items.Add(file);
                }
            }
        }
        public void InitForm(IHost mainForm, string[] rows, string sourceDir)
        {
            _host      = mainForm;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            if (_rows.Length != 1)
            {
                txtMethod.Enabled       = false;
                btnSelectMethod.Enabled = false;
            }

            if (!String.IsNullOrEmpty(Config.DeobfOutputDir))
            {
                txtOutputDir.Text = Config.DeobfOutputDir;
            }
            else
            {
                txtOutputDir.Text = _sourceDir;
            }

            txtInfo.Clear();
        }
        public frmAsm(IHost mainForm, string[] rows, string sourceDir)
        {
            InitializeComponent();

            _host      = mainForm;
            _rows      = rows;
            _sourceDir = SimplePath.GetFullPath(sourceDir);

            if (!String.IsNullOrEmpty(Config.AsmOutputDir))
            {
                txtOutputDir.Text = Config.AsmOutputDir;
            }
            else
            {
                txtOutputDir.Text = _sourceDir;
            }
            if (!String.IsNullOrEmpty(Config.StrongKeyFile))
            {
                txtKeyFile.Text = Config.StrongKeyFile;
                SetReplFile(Config.StrongKeyFile, false);
            }

            txtAdditionalOptions.Text = Config.AsmAdditionalOptions;
        }
 private void cmOpenFolder_Click(object sender, EventArgs e)
 {
     Process.Start(SimplePath.GetFullPath(treeView1.SelectedNode.FullPath));
 }
Example #15
0
 public static string GetFileName(DataGridViewRow row, string sourceDir)
 {
     return(Path.Combine(SimplePath.GetFullPath(sourceDir), GetFileName(row)));
 }