public void Open() { RELMethodNode r = _resource as RELMethodNode; ModuleSectionNode section = r.Root.Children[(int)r.TargetSection] as ModuleSectionNode; foreach (SectionEditor l in SectionEditor._openedSections) { if (l._section == section) { if (l.Position != r.RootOffset - section.RootOffset) { l.Position = r.RootOffset - section.RootOffset; } l.Focus(); return; } } SectionEditor x = new SectionEditor(section); x.Show(); x.Text = String.Format("Module Section Editor - {0}->{1}", r.Object._name, r._name); x.Position = r.RootOffset - section.RootOffset; x.hexBox1.Focus(); }
public void SetTarget(RELMethodNode node) { if (node.ResourceType == ResourceType.RELExternalMethod) { _codes = null; _sectionOffset = 0; _baseOffset = 0; _manager = null; } else { _codes = new List <PPCOpCode>(); for (int i = 0; i < node._codeLen / 4; i++) { _codes.Add(node._manager.GetCode(i)); } _sectionOffset = 0; _baseOffset = (int)node._cmd._addend; _manager = node._manager; } Display(); }