diff --git a/exeinfogui/MainForm.xeto.cs b/exeinfogui/MainForm.xeto.cs index 01a75aa..1bdc418 100644 --- a/exeinfogui/MainForm.xeto.cs +++ b/exeinfogui/MainForm.xeto.cs @@ -45,13 +45,16 @@ namespace exeinfogui TextBox txtOs; TextBox txtSubsystem; TextBox txtType; + TabPageSegments tabSegments; public MainForm() { XamlReader.Load(this); + tabSegments = new TabPageSegments {Visible = false}; tabStrings = new TabPageStrings {Visible = false}; tabGemResources = new TabGemResources {Visible = false}; + tabMain.Pages.Add(tabSegments); tabMain.Pages.Add(tabStrings); tabMain.Pages.Add(tabGemResources); } @@ -136,6 +139,12 @@ namespace exeinfogui tabStrings.Update(recognizedExe.Strings); tabStrings.Visible = true; } + + if(recognizedExe.Segments != null && recognizedExe.Segments.Any()) + { + tabSegments.Update(recognizedExe.Segments); + tabSegments.Visible = true; + } } protected void OnMnuAboutClick(object sender, EventArgs e) diff --git a/exeinfogui/TabPageSegments.xeto b/exeinfogui/TabPageSegments.xeto new file mode 100644 index 0000000..e6ba768 --- /dev/null +++ b/exeinfogui/TabPageSegments.xeto @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/exeinfogui/TabPageSegments.xeto.cs b/exeinfogui/TabPageSegments.xeto.cs new file mode 100644 index 0000000..ce2892a --- /dev/null +++ b/exeinfogui/TabPageSegments.xeto.cs @@ -0,0 +1,69 @@ +// +// TabPageSegments.xeto.cs +// +// Author: +// Natalia Portillo +// +// Copyright (c) 2017 Copyright © Claunia.com +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System.Collections.Generic; +using Eto.Forms; +using Eto.Serialization.Xaml; +using libexeinfo; + +namespace exeinfogui +{ + public class TabPageSegments : TabPage + { + GridView treeSegments; + + public TabPageSegments() + { + XamlReader.Load(this); + + treeSegments.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(s => $"{s.Name}")}, + HeaderText = "Name" + }); + treeSegments.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(s => s.Offset != 0 ? $"{s.Offset}" : "N/A")}, + HeaderText = "Offset" + }); + treeSegments.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(s => $"{s.Size}")}, + HeaderText = "Size" + }); + treeSegments.Columns.Add(new GridColumn + { + DataCell = new TextBoxCell {Binding = Binding.Property(s => $"{s.Flags}")}, + HeaderText = "Flags" + }); + } + + public void Update(IEnumerable segments) + { + treeSegments.DataStore = segments; + } + } +} \ No newline at end of file diff --git a/libexeinfo/Structs.cs b/libexeinfo/Structs.cs index 1505601..8fabbac 100644 --- a/libexeinfo/Structs.cs +++ b/libexeinfo/Structs.cs @@ -34,7 +34,7 @@ namespace libexeinfo public string Subsystem; } - public struct Segment + public class Segment { /// /// Standardized segment type name: .text, .data, .rsrc, .bss, etc.