andyvand / pefile

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

MemoryError when reading 1GB or bigger EXE file #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Take Big Continious SFX ACE Archive digitally signed (1GB size)
2. Use disitool.py that uses pefile.py
3. Call disitool.py delete signed_archive unsigned_archive

What is the expected output? What do you see instead?
The expected output is the unsigned_archive,
instead I see:
Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "H:\disitool.py", line 258, in <module>
    Main()
  File "H:\disitool.py", line 231, in Main
    DeleteDigitalSignature(args[1], args[2])
  File "H:\disitool.py", line 59, in DeleteDigitalSignature
    pe = pefile.PE(SignedFile)
  File "H:\pypy-1.7\site-packages\pefile.py", line 1667, in __init__
    self.__parse__(name, data, fast_load)
  File "H:\pypy-1.7\site-packages\pefile.py", line 1785, in __parse__
    self.__data__[optional_header_offset:],
MemoryError

What version of the product are you using? On what operating system?
Pefile 1.2.10.114
Disitool 0.3
Windows 7 64bit Version 6.1 (Build 7601: Service Pack 1)

Please provide any additional information below.

There is an 1GB size Continius SFX ACE archive EXE file
the file is digitally signed, thus the CRC is invalid

The goal of disitool.py is to remove the digitally sign from the EXE file
To complete this goal it calls pefile.py
For some unknown reasons the MemoryError exception happens

Memory monitoring tools does not report ANY spike of usage of memory,
even with 3GB of free RAM and lots of Swap Space in Windows, the same error 
happens.

The cause of the error is unknown to me. 

Original issue reported on code.google.com by Wolfer...@Wolferajd.eu on 11 Jan 2012 at 7:40

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ero.carr...@gmail.com on 12 Jan 2012 at 7:14

GoogleCodeExporter commented 9 years ago
I've just committed revision 117 into subversion 
(http://code.google.com/p/pefile/source/browse/trunk/pefile.py)

I'd be great if you could verify whether it fixes the issue.

Original comment by ero.carr...@gmail.com on 22 Jan 2012 at 2:14

GoogleCodeExporter commented 9 years ago
The issue about MemoryError seems to have been resolved.
However, now I get something like that:
Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "..\disitool.py", line 258, in <module>
    Main()
  File "..\disitool.py", line 231, in Main
    DeleteDigitalSignature(args[1], args[2])
  File "..\disitool.py", line 59, in DeleteDigitalSignature
    pe = pefile.PE(SignedFile)
AttributeError: 'module' object has no attribute 'PE'
I'm not really sure what does this mean, because quick view into exe file shows 
magic code "PE"... but the original issue of MemoryError seems to be solved now.

Original comment by Wolfer...@Wolferajd.eu on 22 Jan 2012 at 10:23