Hi,
I'm a PHP newbie, and am stuck as to why I can't find a pattern in a
Win32 binary file.
I'm actually trying to extract the FileVersion information myself
since PHP under Unix doesn't seem to offer support for the PE file
format:
-------------
<?php
$file = "C:\\temp\\test.exe";
$fp = fopen($file, "rb");
$contents = fread($fp, filesize($file));
fclose($fp);
//Unicode?
//If (eregi('F.i.l.e.V.e.r.s.i.o.n', $contents)) {
//if (eregi('FileVersion', $contents)) {
if (eregi("This program cannot be run in DOS mode",
$contents)) {
print "OK!";
} else {
print "Outta luck...";
}
exit;
?>
-------------
Any idea?
Thank you for any tip
Fred.