On Linux: Get Windows file version.

N

Naraht

I'm looking for information on getting the Version of a Windows
Executable (or DLL) *after* the file has been copied to a Linux system.


This probably means I will need to recreate GetFileVersionInfoSize,
GetFileVersionInfo and VerQueryValue. Does anyone have any ideas on
where I can find those either as libraries or the source for them? The
languages I have available for this are C, Perl and shell scripts.

(This is for a commerical vulnerability scanner that runs on Linux and
can copy files over from the Windows box it is scanning using SSH.)

Thank You
Randolph Finder
Saint Corporation
 
M

Mothra

Hi Randolph,
I'm looking for information on getting the Version of a Windows
Executable (or DLL) *after* the file has been copied to a Linux
system.


This probably means I will need to recreate GetFileVersionInfoSize,
GetFileVersionInfo and VerQueryValue. Does anyone have any ideas on
where I can find those either as libraries or the source for them? The
languages I have available for this are C, Perl and shell scripts.
You may want to checkout the wine project for information on this.
On Windows these functions are located in the version.dll. I checked the
wine project is it has a version.dll.so. You may want to start there.

Hope this helps

Mothra
 
D

Donald King

Naraht said:
I'm looking for information on getting the Version of a Windows
Executable (or DLL) *after* the file has been copied to a Linux system.


This probably means I will need to recreate GetFileVersionInfoSize,
GetFileVersionInfo and VerQueryValue. Does anyone have any ideas on
where I can find those either as libraries or the source for them? The
languages I have available for this are C, Perl and shell scripts.

(This is for a commerical vulnerability scanner that runs on Linux and
can copy files over from the Windows box it is scanning using SSH.)

Thank You
Randolph Finder
Saint Corporation

I was going to suggest running Win32::File::VersionInfo under Wine, but
then I stumbled across Win32::Exe, which as far as I can tell uses a
hand-rolled parser for MZ/PE headers, including common resource types.
Very cool! The documentation is a little sparse, but what little there
is has this as example code:

use Win32::Exe;
my $exe = Win32::Exe->new('c:/windows/notepad.exe');

# Get version information
print $exe->version_info->get('FileDescription'), ": ",
$exe->version_info->get('LegalCopyright'), "\n";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top