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
In reply to Re: Get EXE VersionInfo
by BrowserUk
in thread Get EXE VersionInfo
by resistance
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |