erocarrera / pefile

pefile is a Python module to read and work with PE (Portable Executable) files
MIT License
1.88k stars 522 forks source link

find bug in format string at line 4074 #368

Closed im-overlord04 closed 1 year ago

im-overlord04 commented 1 year ago

Hello, I've found a little bug (and a typo) in the format string at line 4074/4075:

4074 "No pasring available for IMAGE_DYNAMIC_RELOCATION_TABLE.Version = %d",
4075                image_dynamic_reloc_table_struct.Version,

I guess that the comma should be replaced with '%' as follows:

4074 "No parsing available for IMAGE_DYNAMIC_RELOCATION_TABLE.Version = %d"%
4075                image_dynamic_reloc_table_struct.Version,

Is the fix correct? Thanks for viewing

im-overlord04 commented 1 year ago

In the same function if it is not possible to unpack image_dynamic_reloc_table_struct (line 4061), in the except clause None should be returned to avoid several subsequent errors.

erocarrera commented 1 year ago

Thank you, good eye! you are correct.