mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-26 12:24:32 +00:00
Fix a bug in test.py.
When iterating through the bytearray it would cause a python crash if the byte value was 0x78. I have a test sample where the first 8 bytes at the entry point are 0xe8 0xa6 0x4e 0x0 0x0 0xe9 0x78 0xfe. If I don't do this dance it crashes when trying to get the 6th (0x78) byte out of the array.
This commit is contained in:
parent
913b3c16d1
commit
bc6b67fa0e
@ -42,7 +42,7 @@ print "Loader flags: %s" % hex(p.loaderflags)
|
||||
print "Number of RVA and sizes: %s" % hex(p.rvasandsize)
|
||||
ep = p.get_entry_point()
|
||||
byts = p.get_bytes(ep, 8)
|
||||
print "Bytes at %s: %s" % (hex(ep), ' '.join([hex(b) for b in byts]))
|
||||
print "Bytes at %s: %s" % (hex(ep), ' '.join(['0x' + binascii.hexlify(b) for b in str(byts)]))
|
||||
sections = p.get_sections()
|
||||
print "Sections: (%i)" % len(sections)
|
||||
for sect in sections:
|
||||
|
Loading…
x
Reference in New Issue
Block a user