kongo86 / pefile

Automatically exported from code.google.com/p/pefile
Other
0 stars 0 forks source link

Virtual relocations cause pefile to crash #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download file: 
http://corkami.googlecode.com/svn/trunk/src/PE/bin/virtrelocXP.exe
2. execute this script (with virtrelocXP.exe as argument):

pe =  pefile.PE(sys.argv[1], fast_load=True)
pe.parse_data_directories()
print pe.dump_info()

What is the expected output? What do you see instead?

I expect to see a dump.
The program crashes with the following message:

Traceback (most recent call last):
  File "/home/deque/bin/resourcetest.py", line 5, in <module>
    pe =  pefile.PE(sys.argv[1], fast_load=True)
  File "/usr/local/lib/python2.7/dist-packages/pefile.py", line 1667, in __init__
    self.__parse__(name, data, fast_load)
  File "/usr/local/lib/python2.7/dist-packages/pefile.py", line 1938, in __parse__
    offset = self.parse_sections(sections_offset)
  File "/usr/local/lib/python2.7/dist-packages/pefile.py", line 2180, in parse_sections
    section.__unpack__(self.__data__[section_offset : section_offset + section.sizeof()])
  File "/usr/local/lib/python2.7/dist-packages/pefile.py", line 873, in __unpack__
    raise PEFormatError('Data length less than expected header length.')
pefile.PEFormatError: 'Data length less than expected header length.'

What version of the product are you using? On what operating system?

pefile 1.2.10-139
Ubuntu 14.04

Please provide any additional information below.

Original issue reported on code.google.com by Struppi...@googlemail.com on 11 Nov 2014 at 9:37