public void OpenRelocation(RelocationTarget target)
        {
            if (target == null)
            {
                return;
            }

            if (target._sectionID != _section.Index)
            {
                foreach (SectionEditor r in _openedSections)
                {
                    if (r._section.Index == target._sectionID)
                    {
                        r.Position = target._index * 4;
                        r.Focus();
                        r.hexBox1.Focus();
                        return;
                    }
                }

                //TODO: use target module id here
                ModuleSectionNode section = ((ModuleNode)_section.Root).Sections[target._sectionID];
                SectionEditor     x       = new SectionEditor(section);
                x.Show();

                x.Position = target._index * 4;
                x.hexBox1.Focus();
            }
            else
            {
                Position = target._index * 4;
                hexBox1.Focus();
            }
        }
        public void OpenRelocation(Relocation target)
        {
            if (target == null)
            {
                return;
            }

            if (target._section != _section)
            {
                foreach (SectionEditor r in _openedSections)
                {
                    if (r._section == target._section)
                    {
                        r.Position = target._index * 4;
                        r.Focus();
                        r.hexBox1.Focus();
                        return;
                    }
                }

                SectionEditor x = new SectionEditor(target._section as ModuleSectionNode);
                x.Show();

                x.Position = target._index * 4;
                x.hexBox1.Focus();
            }
            else
            {
                Position = target._index * 4;
                hexBox1.Focus();
            }
        }
示例#3
0
 public FormFind(SectionEditor mainWindow)
 {
     InitializeComponent();
     _mainWindow              = mainWindow;
     HexBox                   = _mainWindow.hexBox1;
     FindOptions              = _mainWindow._findOptions;
     rbString.CheckedChanged += new EventHandler(rb_CheckedChanged);
     rbHex.CheckedChanged    += new EventHandler(rb_CheckedChanged);
 }
 public FormFind(SectionEditor mainWindow)
 {
     InitializeComponent();
     _mainWindow = mainWindow;
     HexBox = _mainWindow.hexBox1;
     FindOptions = _mainWindow._findOptions;
     rbString.CheckedChanged += new EventHandler(rb_CheckedChanged);
     rbHex.CheckedChanged += new EventHandler(rb_CheckedChanged);
 }
 public DialogResult ShowDialog(Relocation relocation, SectionEditor mainWindow)
 {
     _mainWindow = mainWindow;
     _targetRelocation = relocation;
     oldValue = _targetRelocation.RawValue;
     propertyGrid1.SelectedObject = _code = _targetRelocation.Code;
     label3.Text = "0x" + (_targetRelocation._index * 4).ToString("X");
     return base.ShowDialog();
 }
        public void OpenRelocation(Relocation target)
        {
            if (target == null)
                return;

            if (target._section != _section)
            {
                foreach (SectionEditor r in _openedSections)
                    if (r._section == target._section)
                    {
                        r.Position = target._index * 4;
                        r.Focus();
                        r.hexBox1.Focus();
                        return;
                    }

                SectionEditor x = new SectionEditor(target._section as ModuleSectionNode);
                x.Show();

                x.Position = target._index * 4;
                x.hexBox1.Focus();
            }
            else
            {
                Position = target._index * 4;
                hexBox1.Focus();
            }
        }
        public void Unresolved()
        {
            RELNode r = _resource as RELNode;
            if (r._unresReloc != null)
            {
                ModuleDataNode s = r._unresReloc._section;

                foreach (SectionEditor l in SectionEditor._openedSections)
                    if (l._section == s)
                    {
                        l.Focus();
                        l.Position = r._unresReloc._index * 4;
                        l.hexBox1.Focus();
                        return;
                    }

                SectionEditor e = new SectionEditor(s as ModuleSectionNode);
                e.Show();
                e.Position = r._unresReloc._index * 4;
                e.hexBox1.Focus();
            }
            else
                MessageBox.Show("This module has no unresolved function.");
        }