示例#1
0
        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();
        }
示例#2
0
        public void Constructor()
        {
            RELNode r = _resource as RELNode;

            if (r._prologSect != -1)
            {
                ModuleDataNode s = r._sections[r._prologSect];

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

                SectionEditor e = new SectionEditor(s as ModuleSectionNode);
                e.Show();
                e.Position = r._prologIndex * 4;
                e.hexBox1.Focus();
            }
            else
            {
                MessageBox.Show("This module has no constructor function.");
            }
        }
示例#3
0
        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.");
            }
        }
示例#4
0
        public MainWindow()
        {
            InitializeComponent();

            RouteController = new RouteController(this);

            UpdateRoute(RouteController.Route);

            // MapControl.Map.Layers.Add(GetKaagTileLayer());
            MapControl.Map.Layers.Add(new TileLayer(KnownTileSources.Create(KnownTileSource.OpenStreetMap)));
            MapControl.Map.Layers.Add(RouteLayer);
            MapControl.Map.Layers.Add(RoutePointsLayer);
            MapControl.Map.Layers.Add(SectionsLayer);
            MapControl.Map.Layers.Add(SectionPointsLayer);

            MapControl.Map.Home = navigator => navigator.NavigateTo(SphericalMercator.FromLonLat(4.55835, 52.22002), 6);

            var wayPointEditor = new WaypointEditor(MapControl, RouteController);
            var sectionEditor  = new SectionEditor(MapControl, RouteController);

            sectionEditor.OnDeselected();

            WaypointModeOption.Checked += (sender, args) => SetEditor(wayPointEditor);
            SectionModeOption.Checked  += (sender, args) => SetEditor(sectionEditor);
            ScreenshotButton.Click     += (sender, args) => Screenshot();

            WaypointModeOption.IsChecked = true;
        }
示例#5
0
        protected override bool GetAddresses(byte[] original, out int rawAddr, out int virtAddr)
        {
            var space = SectionEditor.ReserveBufferSpace((uint)this.Length);

            rawAddr  = (int)space.RawAddress;
            virtAddr = (int)space.VirtualAddress + 0x400000;
            return(true);
        }
示例#6
0
 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());
 }
示例#7
0
 public FormFind(SectionEditor mainWindow)
 {
     InitializeComponent();
     _mainWindow = mainWindow;
     HexBox      = _mainWindow.hexBox1;
     FindOptions = _mainWindow._findOptions;
     rdoAnnotations.CheckedChanged += new EventHandler(rb_CheckedChanged);
     rbString.CheckedChanged       += new EventHandler(rb_CheckedChanged);
     rbHex.CheckedChanged          += new EventHandler(rb_CheckedChanged);
 }
示例#8
0
        public void Open()
        {
            InheritanceItemNode r       = _resource as InheritanceItemNode;
            ModuleSectionNode   section = r.Root.Children[5] as ModuleSectionNode;


            foreach (SectionEditor l in SectionEditor._openedSections)
            {
                if (l._section == section)
                {
                    l.Focus();
                    return;
                }
            }

            SectionEditor x = new SectionEditor(section);

            x.Show();
            x.Text     = $"Module Section Editor - {section._name}";
            x.Position = r.RootOffset;
            x.hexBox1.Focus();
        }
示例#9
0
        public void Unresolved()
        {
            RELNode r = _resource as RELNode;

            ModuleDataNode s = r.Sections[r._unresolvedSection];

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

            SectionEditor e = new SectionEditor(s as ModuleSectionNode);

            e.Show();
            e.Position = r._unresolvedOffset;
            e.hexBox1.Focus();
        }
示例#10
0
 public override void Activate(ChangeArgs args)
 {
     args.Data = SectionEditor.GetBuffer();
     base.Activate(args);
 }
        private void Btn_Add_Section_Click(object sender, RoutedEventArgs e)
        {
            var se = new SectionEditor(new SectionEditorVM());

            se.ShowDialog();
        }