in reply to method "new" leads to infinite loop with 100% CPU, troubleshooting??

Actually, are you sure that it doesn't eventually complete? I did a directory listing of the DLLs on my system and I noticed that at 8 MB shell32.dll is significantly bigger than any other dll. A quick check with dumpbin shows that it contains over 51000 fixups (relocations).

So, I ran the following and left it running while I did something else, and it eventually completed after nearly 5 minutes:

c:\test>perl -MWin32::Exe -le"print time; $e = Win32::Exe->new( 'c:\windows\system32\shell32.dll +' ); print time" 1219426998 1219427274

The module uses Parse::Binary::FixedFormat and that module is just really, really slow.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: method "new" leads to infinite loop with 100% CPU, troubleshooting??
  • Download Code

Replies are listed 'Best First'.
Re^2: method "new" leads to infinite loop with 100% CPU, troubleshooting??
by resistance (Beadle) on Aug 22, 2008 at 18:44 UTC
    +++BrowserUk+++

    thank you for pointing to this!
    Yes, now I see, it takes minutes(!) to extract the couple of strings from a big binary file like this shell32.dll. Unbelievable!
    Can you point to an another way to get File Version Information from EXE without using WinAPI?

    I think about brute force by finding the text strings in binary.

      found this here on perlmonks:
      http://www.perlmonks.org/?node_id=287010 Win32 Fileversion info from .exe/.dll-files (16/32-bit) - takes only 0.03 second to process shell32.dll file.

      Great site and great members!

      Thanks
        Which "couple of strings" do you need?

        http://www.perlmonks.org/?node_id=287010
        Win32 Fileversion info from .exe/.dll-files This code does exactly what I need - extract CompanyName FileDescription FileVersion ProductVersion etc from exe/dll files.

        Seems that some tasks should/can be done with simple methods like this one, instead of using modules. )