Search code examples
perlportable-executable

How can I read the headers from a WinNT portable executable file using Perl?


I want to work with PE files in Perl and didn't find a module, so I think I will write my own (already did that in delphi once).

I only got one problem, when mapping the executable to a buffer, how can i search for octals like 0x00004550 (IMAGE_NT_SIGNATURE), convert them back to writeable strings etc?


Solution

  • There is a Perl module to manipulate portable executables: Win32::Exe.

    I don't have a clue on your exact question, but if you still want to write your own library, Win32::Exe might be a good reference.