mirror of
https://github.com/claunia/libexeinfo.git
synced 2025-12-16 19:14:24 +00:00
Add gui panel to hex dump unknown ne resources by default.
This commit is contained in:
@@ -41,6 +41,7 @@ namespace exeinfogui.NE
|
|||||||
Panel pnlResource;
|
Panel pnlResource;
|
||||||
TreeGridItemCollection treeData;
|
TreeGridItemCollection treeData;
|
||||||
TreeGridView treeResources;
|
TreeGridView treeResources;
|
||||||
|
PanelHexDump panelHexDump;
|
||||||
|
|
||||||
public TabNeResources()
|
public TabNeResources()
|
||||||
{
|
{
|
||||||
@@ -56,6 +57,7 @@ namespace exeinfogui.NE
|
|||||||
panelWin16Version = new PanelWin16Version();
|
panelWin16Version = new PanelWin16Version();
|
||||||
panelNeStrings = new PanelNeStrings();
|
panelNeStrings = new PanelNeStrings();
|
||||||
panelNeAccelerators = new PanelNeAccelerators();
|
panelNeAccelerators = new PanelNeAccelerators();
|
||||||
|
panelHexDump=new PanelHexDump();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(IEnumerable<libexeinfo.NE.ResourceType> resourceTypes, libexeinfo.NE.TargetOS os)
|
public void Update(IEnumerable<libexeinfo.NE.ResourceType> resourceTypes, libexeinfo.NE.TargetOS os)
|
||||||
@@ -116,7 +118,8 @@ namespace exeinfogui.NE
|
|||||||
panelNeAccelerators.Update(data, libexeinfo.NE.TargetOS.OS2);
|
panelNeAccelerators.Update(data, libexeinfo.NE.TargetOS.OS2);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pnlResource.Content = null;
|
pnlResource.Content = panelHexDump;
|
||||||
|
panelHexDump.Update(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
exeinfogui/PanelHexDump.xeto
Normal file
11
exeinfogui/PanelHexDump.xeto
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Panel xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<StackLayout Orientation="Vertical">
|
||||||
|
<StackLayoutItem HorizontalAlignment="Center">
|
||||||
|
<Label>Hex dump</Label>
|
||||||
|
</StackLayoutItem>
|
||||||
|
<StackLayoutItem Expand="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
|
<TextArea ID="txtHexDump" ReadOnly="True" Wrap="True"/>
|
||||||
|
</StackLayoutItem>
|
||||||
|
</StackLayout>
|
||||||
|
</Panel>
|
||||||
29
exeinfogui/PanelHexDump.xeto.cs
Normal file
29
exeinfogui/PanelHexDump.xeto.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using Eto.Forms;
|
||||||
|
using Eto.Drawing;
|
||||||
|
using Eto.Serialization.Xaml;
|
||||||
|
|
||||||
|
namespace exeinfogui
|
||||||
|
{
|
||||||
|
public class PanelHexDump : Panel
|
||||||
|
{
|
||||||
|
TextArea txtHexDump;
|
||||||
|
public PanelHexDump()
|
||||||
|
{
|
||||||
|
XamlReader.Load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Update(byte[] data)
|
||||||
|
{
|
||||||
|
txtHexDump.Text = "";
|
||||||
|
for(long pos = 0; pos < data.LongLength; pos++)
|
||||||
|
{
|
||||||
|
if(pos > 0 && pos % 4 == 0) txtHexDump.Text += " ";
|
||||||
|
txtHexDump.Text += $"{data[pos]:X2} ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user