Add full decoding of LE and LX objects, tables, and resource tables, plus viewer for LE VxD version resource.

This commit is contained in:
2018-03-08 16:50:25 +00:00
parent 4e130af164
commit 26007b6b8b
10 changed files with 751 additions and 205 deletions

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<TabPage Text="VxD Version" xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackLayout Orientation="Vertical">
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
<Panel ID="pnlVersion"/>
</StackLayoutItem>
</StackLayout>
</TabPage>

View File

@@ -0,0 +1,51 @@
//
// TabLeVxdVersion.xeto.cs
//
// Author:
// Natalia Portillo <claunia@claunia.com>
//
// Copyright (c) 2017-2018 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 exeinfogui.Win16;
using Eto.Forms;
using Eto.Serialization.Xaml;
namespace exeinfogui.LE
{
public class TabLeVxdVersion : TabPage
{
PanelWin16Version panelWin16Version;
Panel pnlVersion;
public TabLeVxdVersion()
{
XamlReader.Load(this);
panelWin16Version = new PanelWin16Version();
pnlVersion.Content = panelWin16Version;
}
public void Update(libexeinfo.NE.Version version)
{
panelWin16Version.Update(version);
}
}
}

View File

@@ -27,6 +27,7 @@
using System;
using System.Linq;
using exeinfogui.GEM;
using exeinfogui.LE;
using exeinfogui.NE;
using Eto.Forms;
using Eto.Serialization.Xaml;
@@ -39,6 +40,7 @@ namespace exeinfogui
ComboBox cmbArch;
Label lblSubsystem;
TabGemResources tabGemResources;
TabLeVxdVersion tabLeVxdVersion;
TabControl tabMain;
TabNeResources tabNeResources;
TabPageSegments tabSegments;
@@ -57,10 +59,12 @@ namespace exeinfogui
tabStrings = new TabPageStrings {Visible = false};
tabGemResources = new TabGemResources {Visible = false};
tabNeResources = new TabNeResources {Visible = false};
tabLeVxdVersion = new TabLeVxdVersion {Visible = false};
tabMain.Pages.Add(tabSegments);
tabMain.Pages.Add(tabStrings);
tabMain.Pages.Add(tabGemResources);
tabMain.Pages.Add(tabNeResources);
tabMain.Pages.Add(tabLeVxdVersion);
}
protected void OnBtnLoadClick(object sender, EventArgs e)
@@ -73,6 +77,9 @@ namespace exeinfogui
txtSubsystem.Visible = false;
tabStrings.Visible = false;
tabGemResources.Visible = false;
tabSegments.Visible = false;
tabNeResources.Visible = false;
tabLeVxdVersion.Visible = false;
OpenFileDialog dlgOpen = new OpenFileDialog {Title = "Choose executable file", MultiSelect = false};
@@ -113,7 +120,15 @@ namespace exeinfogui
tabNeResources.Visible = true;
}
}
else if(lxExe.Recognized) recognizedExe = lxExe;
else if(lxExe.Recognized)
{
recognizedExe = lxExe;
if(((LX)lxExe).WinVersion != null)
{
tabLeVxdVersion.Visible = true;
tabLeVxdVersion.Update(((LX)lxExe).WinVersion);
}
}
else if(peExe.Recognized) recognizedExe = peExe;
else if(stExe.Recognized)
{

View File

@@ -88,19 +88,22 @@ namespace exeinfogui.Win16
public void Update(byte[] data)
{
libexeinfo.NE.Version version = new libexeinfo.NE.Version(data);
txtFileDate.Text = version.FileDate != new DateTime(1601, 1, 1) ? $"{version.FileDate}" : "Not set";
txtFileFlags.Text = version.FileFlags == 0 ? "Normal" : $"{version.FileFlags}";
txtFileOs.Text = libexeinfo.NE.Version.OsToString(version.FileOS);
Update(new libexeinfo.NE.Version(data));
}
public void Update(libexeinfo.NE.Version version)
{
txtFileDate.Text = version.FileDate != new DateTime(1601, 1, 1) ? $"{version.FileDate}" : "Not set";
txtFileFlags.Text = version.FileFlags == 0 ? "Normal" : $"{version.FileFlags}";
txtFileOs.Text = libexeinfo.NE.Version.OsToString(version.FileOS);
if(version.FileType == libexeinfo.NE.VersionFileType.VFT_DRV)
txtFileSubtype.Text = $"{libexeinfo.NE.Version.DriverToString(version.FileSubtype)} driver";
else if(version.FileType == libexeinfo.NE.VersionFileType.VFT_DRV)
txtFileSubtype.Text = $"{libexeinfo.NE.Version.FontToString(version.FileSubtype)} font";
else if(version.FileSubtype > 0)
txtFileSubtype.Text = $"{(uint)version.FileSubtype}";
else
txtFileSubtype.Text = "None";
txtFileSubtype.Text =
$"{libexeinfo.NE.Version.FontToString(version.FileSubtype)} font";
else if(version.FileSubtype > 0) txtFileSubtype.Text = $"{(uint)version.FileSubtype}";
else txtFileSubtype.Text = "None";
txtFileType.Text = libexeinfo.NE.Version.TypeToString(version.FileType);
txtFileVersion.Text = $"{version.FileVersion}";
@@ -113,8 +116,8 @@ namespace exeinfogui.Win16
string cultureName;
string encodingName;
try { cultureName = new CultureInfo(Convert.ToInt32(strByLang.Key.Substring(0, 4), 16)).DisplayName; }
catch { cultureName = $"0x{Convert.ToInt32(strByLang.Key.Substring(0, 4), 16):X4}"; }
try { cultureName = new CultureInfo(Convert.ToInt32(strByLang.Key.Substring(0, 4), 16)).DisplayName; }
catch { cultureName = $"0x{Convert.ToInt32(strByLang.Key.Substring(0, 4), 16):X4}"; }
try
{

View File

@@ -19,10 +19,12 @@
</ItemGroup>
<ItemGroup>
<Folder Include="GEM\" />
<Folder Include="LE" />
<Folder Include="NE" />
<Folder Include="NE\" />
<Folder Include="Win16\" />
<Folder Include="Os2\" />
<Folder Include="Windows\" />
<Folder Include="LE\" />
</ItemGroup>
</Project>