|
Posted by Peter van Schie on 10/30/05 15:32
Another option, without using COM, would be to open the binary file and
search for the pattern F\0i\0l\0e\0V\0e\0r\0s\0i\0o\0n\0\0\0\0\0
The version is right behind that string:
$strFile = "c:\\my.exe";
$fpFile = fopen($strFile, "rb");
$strFileContent = fread($fpFile, filesize($strFile));
fclose($fpFile);
$strTagBefore = 'F\0i\0l\0e\0V\0e\0r\0s\0i\0o\0n\0\0\0\0\0';
$strTagAfter = '\0\0';
if (preg_match("/$strTagBefore(.*?)$strTagAfter/", $strFileContent,
$arrMatches))
{
print_r($arrMatches);
}
HTH.
Peter.
--
http://www.phpforums.nl
Navigation:
[Reply to this message]
|