mirror of
https://github.com/claunia/libexeinfo.git
synced 2025-12-16 19:14:24 +00:00
Do not fill NE resources if there are no entries in resource table.
This commit is contained in:
@@ -62,6 +62,8 @@ namespace exeinfo
|
||||
{
|
||||
recognized = true;
|
||||
Console.Write(neExe.GetInfo());
|
||||
if (neExe.Versions != null)
|
||||
{
|
||||
foreach (NE.Version vers in neExe.Versions)
|
||||
{
|
||||
Console.WriteLine("\tVersion resource {0}:", vers.Name);
|
||||
@@ -106,6 +108,7 @@ namespace exeinfo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!recognized)
|
||||
Console.WriteLine("Executable format not recognized");
|
||||
|
||||
@@ -206,6 +206,7 @@ namespace libexeinfo
|
||||
}
|
||||
|
||||
types.Add(type);
|
||||
System.Console.WriteLine("{0}", stream.Position);
|
||||
}
|
||||
|
||||
table.types = types.ToArray();
|
||||
|
||||
@@ -70,12 +70,18 @@ namespace libexeinfo
|
||||
Marshal.Copy(buffer, 0, hdrPtr, buffer.Length);
|
||||
Header = (NEHeader)Marshal.PtrToStructure(hdrPtr, typeof(NEHeader));
|
||||
Marshal.FreeHGlobal(hdrPtr);
|
||||
IsNE = Header.signature == Signature;
|
||||
if(Header.signature == Signature)
|
||||
{
|
||||
IsNE = true;
|
||||
if (Header.resource_entries > 0)
|
||||
{
|
||||
Resources = GetResources(BaseStream, BaseExecutable.Header.new_offset, Header.resource_table_offset);
|
||||
Versions = GetVersions().ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:libexeinfo.NE"/> class.
|
||||
@@ -97,12 +103,18 @@ namespace libexeinfo
|
||||
Marshal.Copy(buffer, 0, hdrPtr, buffer.Length);
|
||||
Header = (NEHeader)Marshal.PtrToStructure(hdrPtr, typeof(NEHeader));
|
||||
Marshal.FreeHGlobal(hdrPtr);
|
||||
IsNE = Header.signature == Signature;
|
||||
if (Header.signature == Signature)
|
||||
{
|
||||
IsNE = true;
|
||||
if (Header.resource_entries > 0)
|
||||
{
|
||||
Resources = GetResources(BaseStream, BaseExecutable.Header.new_offset, Header.resource_table_offset);
|
||||
Versions = GetVersions().ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies if the specified executable is a Microsoft New Executable
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<Description>Library to get information about executable files.</Description>
|
||||
<PackageProjectUrl>https://github.com/claunia/libexeinfo</PackageProjectUrl>
|
||||
<ReleaseVersion>0.2</ReleaseVersion>
|
||||
<PackageTags>executable MZ NE exe</PackageTags>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
Reference in New Issue
Block a user