Hello
I am using Win32::Exe to extract version info from windows executables. This module parses binary without using of WinAPI so it can be used on Linux too. Some files (packed) cannot be processed, and I use eval() to skip them. Today I discovered one windows system file (shell32.dll) which put the PC in the infinite loop — the are no errors, no warnings — the eval() cannot help here. The only solution I found is using $SIG{ALRM} to escape by timeout:
#!/usr/bin/perl
use strict;
use warnings;
use Win32::Exe;
$SIG{ALRM} = sub {die "timeout"};
eval{
alarm(1);
Win32::Exe->new($ARGV[0]);
alarm(0);
};
if($@){
if($@ =~/timeout/){die "timeout detected"};
}else{
print "ok, can parse $ARGV[0]\n";
};
I test it on Linux and Windows, old and new module version.
Before I post the bug I would try to find out the problem.
Here the binary (shell32.dll from Windows XP SP1 German):
http://rapidshare.com/files/139266982/shell32.dll_cannot_get_version_info.html
Some ideas?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.