On Linux: Get Windows file version.

Discussion in 'Perl Misc' started by Naraht, Apr 25, 2006.

  1. Naraht

    Naraht Guest

    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
    Naraht, Apr 25, 2006
    #1
    1. Advertising

  2. Naraht

    Robert May Guest

    Naraht wrote:
    > 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.



    I'd take a look at Win32::Exe, which (as far as I can see from a quick
    glance) is a pure perl implementation for manipulating Win32 exe/dll
    files. It should do what you want, or at least point you in the right
    direction.

    Regards,
    Rob.
    Robert May, Apr 25, 2006
    #2
    1. Advertising

  3. Naraht

    Mothra Guest

    Hi Randolph,

    Naraht wrote:
    > 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
    Mothra, Apr 25, 2006
    #3
  4. Naraht

    Donald King Guest

    Naraht wrote:
    > 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";

    --
    Donald King, a.k.a. Chronos Tachyon
    http://chronos-tachyon.net/
    Donald King, Apr 25, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Naraht

    On Linux: Get Windows file version.

    Naraht, Apr 25, 2006, in forum: C Programming
    Replies:
    2
    Views:
    751
    Donald King
    Apr 25, 2006
  2. V Green
    Replies:
    0
    Views:
    824
    V Green
    Feb 5, 2008
  3. PA Bear [MS MVP]
    Replies:
    0
    Views:
    929
    PA Bear [MS MVP]
    Feb 5, 2008
  4. MowGreen [MVP]
    Replies:
    5
    Views:
    1,993
    PA Bear [MS MVP]
    Feb 9, 2008
  5. Krishna Chaitanya
    Replies:
    1
    Views:
    131
    Krishna Chaitanya
    Feb 27, 2009
Loading...

Share This Page