コード例 #1
0
        public ClassEditBookmarkHandler(frmClassEdit form)
        {
            _form       = form;
            cboBookmark = _form.BookmarkComboBox;

            InitBookmarks();
        }
コード例 #2
0
        public ClassEditBookmarkHandler(frmClassEdit form)        
        {
            _form = form;
            cboBookmark = _form.BookmarkComboBox;

            InitBookmarks();
        }
コード例 #3
0
        public void cmClassEditor_Click(object sender, EventArgs e)
        {
            if (dgvData.SelectedRows.Count < 1)
            {
                SimpleMessage.ShowInfo("Please select assembly to edit.");
                return;
            }

            try
            {
                frmClassEdit frm = new frmClassEdit(
                    new ClassEditParams()
                {
                    Host             = this,
                    Rows             = PathUtils.GetFullFileNames(dgvData.SelectedRows, treeView1.SelectedNode.FullPath),
                    SourceDir        = treeView1.SelectedNode.FullPath,
                    ObjectType       = ObjectTypes.All,
                    ShowStaticOnly   = false,
                    ShowSelectButton = false
                }
                    );
                frm.Show();
            }
            catch (Exception ex)
            {
                SimpleMessage.ShowException(ex);
            }
        }
コード例 #4
0
        public ClassEditTreeViewHandler(frmClassEdit form)
        {
            _form = form;
            treeView1 = _form.TreeView;

            InitTreeView();
        }
コード例 #5
0
        private void btnSelectCalledMethod_Click(object sender, EventArgs e)
        {
            frmClassEdit f = new frmClassEdit(
                new ClassEditParams()
            {
                Host             = _host,
                Rows             = new string[0],
                SourceDir        = _sourceDir,
                ObjectType       = ObjectTypes.Method,
                ShowStaticOnly   = true,
                ShowSelectButton = true
            });

            f.ShowDialog();

            if (f.SelectedMethod != null)
            {
                txtCalledMethod.Text  = f.SelectedPath;
                _selectedCalledMethod = f.SelectedMethod;
            }
            else
            {
                txtCalledMethod.Text  = String.Empty;
                _selectedCalledMethod = null;
            }
        }
コード例 #6
0
        //Reflector.CodeModel.IAssembly

        public ClassEditReflectorHandler(frmClassEdit form)
            : base("Reflector", form)
        {
            cboLanguage = _form.LanguageComboBox;
            cboOptimization = _form.OptimizationComboBox;
            rtbText = _form.ReflectorTextBox;
            tabPage = _form.ReflectorTabPage;
        }
        //Reflector.CodeModel.IAssembly

        public ClassEditReflectorHandler(frmClassEdit form)
            : base("Reflector", form)
        {
            cboLanguage     = _form.LanguageComboBox;
            cboOptimization = _form.OptimizationComboBox;
            rtbText         = _form.ReflectorTextBox;
            tabPage         = _form.ReflectorTabPage;
        }
コード例 #8
0
        public ClassEditDecompilerHandler(string name, frmClassEdit form)
        {
            _form = form;
            _name = name;

            Initializing = false;
            Unloading = false;
        }
        public ClassEditDecompilerHandler(string name, frmClassEdit form)
        {
            _form = form;
            _name = name;

            Initializing = false;
            Unloading    = false;
        }
コード例 #10
0
 public ClassEditBinaryViewHandler(frmClassEdit form)
 {
     _form = form;
     _hexBox = form.ResourceBinary;
     
     _hexBox.ByteProviderChanged += _hexBox_ByteProviderChanged;
     //seems the context menu shortcut not always working if the context menu never shown?
     _hexBox.KeyUp += _hexBox_KeyUp; 
 }
コード例 #11
0
        public ClassEditSearchHandler(frmClassEdit form)
        {
            _form         = form;
            cboSearchType = _form.SearchTypeComboBox;
            cboSearch     = _form.SearchTextComboBox;

            cboSearch.Text = Config.ClassEditorLastSearch;
            InitSearchTypes();
        }
        public ClassEditBinaryViewHandler(frmClassEdit form)
        {
            _form   = form;
            _hexBox = form.ResourceBinary;

            _hexBox.ByteProviderChanged += _hexBox_ByteProviderChanged;
            //seems the context menu shortcut not always working if the context menu never shown?
            _hexBox.KeyUp += _hexBox_KeyUp;
        }
コード例 #13
0
        public ClassEditSearchHandler(frmClassEdit form)
        {
            _form = form;
            cboSearchType = _form.SearchTypeComboBox;
            cboSearch = _form.SearchTextComboBox;

            cboSearch.Text = Config.ClassEditorLastSearch;
            InitSearchTypes();
        }
コード例 #14
0
        public ClassEditBodyGridHandler(frmClassEdit form)        
        {
            _form = form;
            dgBody = _form.BodyDataGrid;
            dgGeneral = _form.GeneralDataGrid;
            dgVariable = _form.VariableDataGrid;
            tabDetails = _form.DetailsTabPage;

            Utils.LoadILHelp();
            CreateDataTable();

            _markBlocks = Config.MarkBlocks;
        }
コード例 #15
0
        public ClassEditResourceHandler(frmClassEdit form)
        {
            _form = form;

            detailsTabPage = _form.DetailsTabPage;

            txtResource = _form.ResourceText;
            pbResource = _form.ResourceImage;
            hbResource = _form.ResourceBinary;
            lvResource = _form.ResourceListView;
            panelResource = _form.ResourcePanel;

            dgBody = _form.BodyDataGrid;
            dgResource = _form.ResourceDataGrid;

            CreateDataTable();
        }
コード例 #16
0
        private void btnSelectMethod_Click(object sender, EventArgs e)
        {
            if (_frmClassView == null)
            {
                _frmClassView = new frmClassEdit(
                    new ClassEditParams()
                {
                    Host             = _mainForm.Host,
                    Rows             = _mainForm.Rows,
                    SourceDir        = _mainForm.SourceDir,
                    ObjectType       = ObjectTypes.Method,
                    ShowStaticOnly   = false,
                    ShowSelectButton = true
                });
            }
            _frmClassView.ShowDialog();

            if (_frmClassView.SelectedMethod != null)
            {
                MethodDefinition md = _frmClassView.SelectedMethod;

                MethodReference mr;
                if (md.DeclaringType.Module.FullyQualifiedName == _method.DeclaringType.Module.FullyQualifiedName)
                {
                    mr = md;
                }
                else
                {
                    mr = _method.DeclaringType.Module.Import(md);
                }

                if (!cboOperand.Items.Contains(mr))
                {
                    cboOperand.Items.Add(mr);
                }
                if (!_mainForm.SelectedMethodHistory.Contains(mr))
                {
                    _mainForm.SelectedMethodHistory.Add(mr);
                }
                cboOperand.SelectedItem = mr;
            }
        }
コード例 #17
0
        private void btnSelectMethod_Click(object sender, EventArgs e)
        {
            if (_frmClassView == null)
            {
                _frmClassView = new frmClassEdit(
                    new ClassEditParams()
                {
                    Host             = _host,
                    Rows             = _rows,
                    SourceDir        = _sourceDir,
                    ObjectType       = ObjectTypes.Method,
                    ShowStaticOnly   = true,
                    ShowSelectButton = true
                });
            }
            _frmClassView.ShowDialog();

            if (_frmClassView.SelectedMethod != null)
            {
                txtMethod.Text = _frmClassView.SelectedPath;

                _parameters.Clear();
                MethodDefinition md = _frmClassView.SelectedMethod;
                for (int i = 0; i < md.Parameters.Count; i++)
                {
                    ParameterDefinition pd = md.Parameters[i];
                    DataRow             dr = _parameters.NewRow();
                    dr["name"]  = pd.Name;
                    dr["type"]  = pd.ParameterType.FullName;
                    dr["value"] = String.Empty;
                    _parameters.Rows.Add(dr);
                }
                dgvParams.DataSource = _parameters;
            }
            else
            {
                txtMethod.Text       = String.Empty;
                dgvParams.DataSource = null;
            }
        }
コード例 #18
0
 private MethodDefinition SelectMethodFromAssembly()
 {
     frmClassEdit f = new frmClassEdit(
         new ClassEditParams() {
             Host = _form.Host,
             Rows = new string[0],
             SourceDir = _form.SourceDir,
             ObjectType = ObjectTypes.Method,
             ShowStaticOnly = false,
             ShowSelectButton = true
         });
     f.ShowDialog();
     return f.SelectedMethod;
 }
コード例 #19
0
        private void btnSelectCalledMethod_Click(object sender, EventArgs e)
        {            
            frmClassEdit f = new frmClassEdit(_host, new string[0], _sourceDir,
                    ClassEditTreeViewHandler.ObjectTypes.Method, true, true);
            f.ShowDialog();

            if (f.SelectedMethod != null)
            {
                txtCalledMethod.Text = f.SelectedPath;
                _selectedCalledMethod = f.SelectedMethod;
            }
            else
            {
                txtCalledMethod.Text = String.Empty;
                _selectedCalledMethod = null;
            }

        }
コード例 #20
0
        private void btnSelectMethod_Click(object sender, EventArgs e)
        {
            if (_frmClassView == null)
                _frmClassView = new frmClassEdit(_mainForm.Host, _mainForm.Rows, _mainForm.SourceDir, 
                    ClassEditTreeViewHandler.ObjectTypes.Method, false, true);
            _frmClassView.ShowDialog();

            if (_frmClassView.SelectedMethod != null)
            {                
                MethodDefinition md = _frmClassView.SelectedMethod;

                MethodReference mr;
                if(md.DeclaringType.Module.FullyQualifiedName == _method.DeclaringType.Module.FullyQualifiedName) 
                    mr = md;
                else
                    mr = _method.DeclaringType.Module.Import(md);
                
                if(!cboOperand.Items.Contains(mr))
                    cboOperand.Items.Add(mr);
                if (!_mainForm.SelectedMethodHistory.Contains(mr))
                    _mainForm.SelectedMethodHistory.Add(mr);
                cboOperand.SelectedItem = mr;
            }
        }
コード例 #21
0
        public void InitForm(frmClassEdit mainForm, MethodDefinition md, int insIndex, EditModes mode)
        {
            if (_method == md && _insIndex == insIndex) return;

            _mainForm = mainForm;
            _method = md;
            _ilp = md.Body.GetILProcessor();
            _insIndex = insIndex;
            _mode = mode;
            Collection<Instruction> ic = _method.Body.Instructions;

            switch (mode)
            {
                case EditModes.Edit:
                    _ins = ic[_insIndex];
                    if (_ins.Previous == null)
                    {
                        txtPrevIns.Text = String.Empty;
                    }
                    else
                    {
                        txtPrevIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(_ins.Previous));
                    }
                    if (_ins.Next == null)
                    {
                        txtNextIns.Text = String.Empty;
                    }
                    else
                    {
                        txtNextIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(_ins.Next));
                    }
                    break;
                case EditModes.InsertAfter:
                    _ins = _ilp.Create(OpCodes.Nop);
                    txtPrevIns.Text = InsUtils.GetInstructionText(ic, _insIndex);
                    if (ic[_insIndex].Next == null)
                    {
                        txtNextIns.Text = String.Empty;
                    }
                    else
                    {
                        txtNextIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(ic[_insIndex].Next));
                    }
                    break;
                case EditModes.InsertBefore:
                    _ins = _ilp.Create(OpCodes.Nop);
                    txtNextIns.Text = InsUtils.GetInstructionText(ic, _insIndex);
                    if (ic[_insIndex].Previous == null)
                    {
                        txtPrevIns.Text = String.Empty;
                    }
                    else
                    {
                        txtPrevIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(ic[_insIndex].Previous));
                    }
                    break;
            }


            InitOpCodes(cboOpCode);

        }
コード例 #22
0
        public frmClassEditInstruction(frmClassEdit mainForm, MethodDefinition md, int insIndex, EditModes mode)
        {
            InitializeComponent();

            InitForm(mainForm, md, insIndex, mode);
        }
コード例 #23
0
        public void cmClassEditor_Click(object sender, EventArgs e)
        {
            if (dgvData.SelectedRows.Count < 1)
            {
                SimpleMessage.ShowInfo("Please select assembly to edit.");
                return;
            }

            try
            {
                frmClassEdit frm = new frmClassEdit(this, PathUtils.GetFullFileNames(dgvData.SelectedRows, treeView1.SelectedNode.FullPath), treeView1.SelectedNode.FullPath);
                frm.Show();
            }
            catch (Exception ex)
            {
                SimpleMessage.ShowException(ex);
            }
        }
コード例 #24
0
 public ClassEditLogHandler(frmClassEdit form)        
 {
     _form = form;
     txtLog = _form.LogText;
 }
コード例 #25
0
        private void btnSelectMethod_Click(object sender, EventArgs e)
        {
            var type = (SAE.de4dot.de4dotOptions.StringDecrypterTypes)cboStringDecrypter.SelectedItem;
            bool showStaticOnly = (type == de4dotOptions.StringDecrypterTypes.Default ||
                type == de4dotOptions.StringDecrypterTypes.Static);

            frmClassEdit f = new frmClassEdit(_host, _rows, _sourceDir,
                   ClassEditTreeViewHandler.ObjectTypes.Method, showStaticOnly, true);
            f.ShowDialog();

            if (f.SelectedMethod != null)
            {
                txtStringDecrypterMethod.Text = TokenUtils.GetFullMetadataTokenString(f.SelectedMethod.MetadataToken);
            }
            else
            {
                txtStringDecrypterMethod.Text = String.Empty;
            }
        }
コード例 #26
0
 public ClassEditLogHandler(frmClassEdit form)
 {
     _form  = form;
     txtLog = _form.LogText;
 }
コード例 #27
0
 public ClassEditVariableGridHandler(frmClassEdit form)
 {
     _form      = form;
     dgVariable = _form.VariableDataGrid;
     cmVariable = _form.VariableContextMenuStrip;
 }
コード例 #28
0
        private void btnSelectMethod_Click(object sender, EventArgs e)
        {
            if(_frmClassView==null)
                _frmClassView = new frmClassEdit(_host, _rows, _sourceDir, 
                    ClassEditTreeViewHandler.ObjectTypes.Method, true, true);
            _frmClassView.ShowDialog();

            if (_frmClassView.SelectedMethod != null)
            {
                txtMethod.Text = _frmClassView.SelectedPath;

                _parameters.Clear();
                MethodDefinition md = _frmClassView.SelectedMethod;
                for (int i = 0; i < md.Parameters.Count; i++)
                {
                    ParameterDefinition pd = md.Parameters[i];
                    DataRow dr = _parameters.NewRow();
                    dr["name"] = pd.Name;
                    dr["type"] = pd.ParameterType.FullName;
                    dr["value"] = String.Empty;
                    _parameters.Rows.Add(dr);
                }
                dgvParams.DataSource = _parameters;
            }
            else
            {
                txtMethod.Text = String.Empty;
                dgvParams.DataSource = null;
            }
        }
コード例 #29
0
 public ClassEditTextViewHandler(frmClassEdit form)
 {
     _form           = form;
     _textbox        = form.ResourceText;
     _textbox.KeyUp += _textbox_KeyUp;
 }
コード例 #30
0
        public void cmClassEditor_Click(object sender, EventArgs e)
        {
            if (dgvData.SelectedRows.Count < 1)
            {
                SimpleMessage.ShowInfo("Please select assembly to edit.");
                return;
            }

            try
            {
                frmClassEdit frm = new frmClassEdit(
                    new ClassEditParams() {
                        Host = this,
                        Rows = PathUtils.GetFullFileNames(dgvData.SelectedRows, treeView1.SelectedNode.FullPath),
                        SourceDir = treeView1.SelectedNode.FullPath,
                        ObjectType = ObjectTypes.All,
                        ShowStaticOnly = false,
                        ShowSelectButton = false
                    }
                    );
                frm.Show();
            }
            catch (Exception ex)
            {
                SimpleMessage.ShowException(ex);
            }
        }
コード例 #31
0
        private void btnSelectMethod_Click(object sender, EventArgs e)
        {
            if (_frmClassView == null)
                _frmClassView = new frmClassEdit(
                    new ClassEditParams() {
                        Host = _mainForm.Host,
                        Rows = _mainForm.Rows,
                        SourceDir = _mainForm.SourceDir,
                        ObjectType = ObjectTypes.Method,
                        ShowStaticOnly = false,
                        ShowSelectButton = true
                    });
            _frmClassView.ShowDialog();

            if (_frmClassView.SelectedMethod != null)
            {                
                MethodDefinition md = _frmClassView.SelectedMethod;

                MethodReference mr;
                if(md.DeclaringType.Module.FullyQualifiedName == _method.DeclaringType.Module.FullyQualifiedName) 
                    mr = md;
                else
                    mr = _method.DeclaringType.Module.Import(md);
                
                if(!cboOperand.Items.Contains(mr))
                    cboOperand.Items.Add(mr);
                if (!_mainForm.SelectedMethodHistory.Contains(mr))
                    _mainForm.SelectedMethodHistory.Add(mr);
                cboOperand.SelectedItem = mr;
            }
        }
コード例 #32
0
        public void InitForm(frmClassEdit mainForm, MethodDefinition md, int insIndex, EditModes mode)
        {
            if (_method == md && _insIndex == insIndex)
            {
                return;
            }

            _mainForm = mainForm;
            _method   = md;
            _ilp      = md.Body.GetILProcessor();
            _insIndex = insIndex;
            _mode     = mode;
            Collection <Instruction> ic = _method.Body.Instructions;

            switch (mode)
            {
            case EditModes.Edit:
                _ins = ic[_insIndex];
                if (_ins.Previous == null)
                {
                    txtPrevIns.Text = String.Empty;
                }
                else
                {
                    txtPrevIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(_ins.Previous));
                }
                if (_ins.Next == null)
                {
                    txtNextIns.Text = String.Empty;
                }
                else
                {
                    txtNextIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(_ins.Next));
                }
                break;

            case EditModes.InsertAfter:
                _ins            = _ilp.Create(OpCodes.Nop);
                txtPrevIns.Text = InsUtils.GetInstructionText(ic, _insIndex);
                if (ic[_insIndex].Next == null)
                {
                    txtNextIns.Text = String.Empty;
                }
                else
                {
                    txtNextIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(ic[_insIndex].Next));
                }
                break;

            case EditModes.InsertBefore:
                _ins            = _ilp.Create(OpCodes.Nop);
                txtNextIns.Text = InsUtils.GetInstructionText(ic, _insIndex);
                if (ic[_insIndex].Previous == null)
                {
                    txtPrevIns.Text = String.Empty;
                }
                else
                {
                    txtPrevIns.Text = InsUtils.GetInstructionText(ic, ic.IndexOf(ic[_insIndex].Previous));
                }
                break;
            }


            InitOpCodes(cboOpCode);
        }
コード例 #33
0
 public ClassEditILSpyHandler(frmClassEdit form) : base("ILSpy", form)
 {
     cboLanguage = _form.ILSpyLanguageComboBox;
     rtbText = _form.ILSpyTextBox;
     tabPage = _form.ILSpyTabPage;
 }
コード例 #34
0
 public ClassEditILSpyHandler(frmClassEdit form) : base("ILSpy", form)
 {
     cboLanguage = _form.ILSpyLanguageComboBox;
     rtbText     = _form.ILSpyTextBox;
     tabPage     = _form.ILSpyTabPage;
 }
コード例 #35
0
 private MethodDefinition SelectMethodFromAssembly()
 {
     frmClassEdit f = new frmClassEdit(_form.Host, new string[0], _form.SourceDir,
             ClassEditTreeViewHandler.ObjectTypes.Method, false, true);
     f.ShowDialog();
     return f.SelectedMethod;
 }
コード例 #36
0
        private void btnSelectCalledMethod_Click(object sender, EventArgs e)
        {            
            frmClassEdit f = new frmClassEdit(
                new ClassEditParams() {
                        Host = _host,
                        Rows = new string[0],
                        SourceDir = _sourceDir,
                        ObjectType = ObjectTypes.Method,
                        ShowStaticOnly = true,
                        ShowSelectButton = true
                    });
            f.ShowDialog();

            if (f.SelectedMethod != null)
            {
                txtCalledMethod.Text = f.SelectedPath;
                _selectedCalledMethod = f.SelectedMethod;
            }
            else
            {
                txtCalledMethod.Text = String.Empty;
                _selectedCalledMethod = null;
            }

        }
コード例 #37
0
        public frmClassEditInstruction(frmClassEdit mainForm, MethodDefinition md, int insIndex, EditModes mode)
        {
            InitializeComponent();

            InitForm(mainForm, md, insIndex, mode);
        }
コード例 #38
0
 public ClassEditTextViewHandler(frmClassEdit form)
 {
     _form = form;
     _textbox = form.ResourceText;
     _textbox.KeyUp += _textbox_KeyUp;
 }
コード例 #39
0
 public ClassEditVariableGridHandler(frmClassEdit form)        
 {
     _form = form;
     dgVariable = _form.VariableDataGrid;
     cmVariable = _form.VariableContextMenuStrip;
 }