in reply to Get EXE VersionInfo
If the intent is to extract the version information embedded in windows executables, whilst running under Linux, then it is a fairly trivial process to open the file, locate the appropriate offset and then read and interpret the relevant 32-bit integer.
The full MS specification for the PE & COFF file formats is downloadable, though enough information to locate and interpret the various version fields is freely obtainable many places on-line. For example: here.
To get you started here is a crude script I knocked up a couple of years ago to extract the timestamp field:
#! perl -slw use strict; open EXE, '<:raw', $ARGV[0] or die "$ARGV[0] : $!"; my $dos = do{ local $/ = \65536; <EXE> }; die "$ARGV[0] is not a .exe or .dll (sig='${ \substr $dos, 0, 2 }')" unless substr( $dos, 0, 2 ) eq 'MZ'; my $coffoff = 8+ unpack 'x60 V', $dos; read( EXE, $dos, $coffoff - 65536 + 4, 65536 ) or die $! if $coffoff > 65536; my $ts = unpack "x$coffoff V", $dos; print "$ARGV[0] : ", defined $ts ? ( scalar( localtime $ts) || "has unfathomable timestamp value $t +s" ) : 'has no timestamp'; __END__ C:\cl>p:exetime.pl atlprov.dll Sat Jan 5 11:46:16 2002 C:\cl>p:exetime.pl cl.exe Sat Jan 5 10:48:19 2002
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Get EXE VersionInfo
by resistance (Beadle) on Jun 29, 2008 at 17:45 UTC | |
by BrowserUk (Patriarch) on Jun 29, 2008 at 23:17 UTC | |
|
Re^2: Get EXE VersionInfo
by Anonymous Monk on Aug 22, 2008 at 12:33 UTC | |
by BrowserUk (Patriarch) on Aug 22, 2008 at 12:45 UTC | |
by Anonymous Monk on Aug 22, 2008 at 19:02 UTC | |
by Anonymous Monk on Aug 22, 2008 at 19:27 UTC |