erocarrera / pefile

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

Error in parse dynamic relocations #395

Open GanbaruTobi opened 4 months ago

GanbaruTobi commented 4 months ago

CLFS.SYS 18446735305110650880 454656 \SystemRoot\System32\drivers\CLFS.SYS Traceback (most recent call last): File "/home/gbaru/Tooling/memflow-py/test.py", line 31, in pe = pefile.PE(data=bytes(driver)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gbaru/.virtualenvs/memflow/lib/python3.11/site-packages/pefile.py", line 2895, in init self.parse(name, data, fast_load) File "/home/gbaru/.virtualenvs/memflow/lib/python3.11/site-packages/pefile.py", line 3328, in parse self.full_load() File "/home/gbaru/.virtualenvs/memflow/lib/python3.11/site-packages/pefile.py", line 3439, in full_load self.parse_data_directories() File "/home/gbaru/.virtualenvs/memflow/lib/python3.11/site-packages/pefile.py", line 3735, in parse_data_directories value = entry[1](dir_entry.VirtualAddress, dir_entry.Size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gbaru/.virtualenvs/memflow/lib/python3.11/site-packages/pefile.py", line 4031, in parse_directory_load_config dynamic_relocations = self.parse_dynamic_relocations( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gbaru/.virtualenvs/memflow/lib/python3.11/site-packages/pefile.py", line 4070, in parse_dynamic_relocations self.__warnings.append( TypeError: list.append() takes exactly one argument (2 given)

oleksii-threatray commented 4 months ago

Can confirm - same issue.

With this - in the code on master I do see the correct implementation. At the same time, in my project I am on the same latest version 2023.2.7 and I have the bug. What am I missing?