secml_malware
secml_malware copied to clipboard
AttributeError: 'NoneType' object has no attribute 'dos_header'
I follow the tutorials and I have this problem.
Here, are my code
import lief
exe_path = '/Boom'
exe_object: lief.PE = lief.parse(exe_path)
print('DOS Header')
print(exe_object.dos_header)
print('PE Header')
print(exe_object.header)
print('Optional Header')
print(exe_object.optional_header)
print('Sections')
for s in exe_object.sections:
print(s.name, s.characteristics_lists)
The error:
AttributeError Traceback (most recent call last) Input In [42], in <cell line: 2>() 1 print('DOS Header') ----> 2 print(exe_object.dos_header) 4 print('PE Header') 5 print(exe_object.header)
AttributeError: 'NoneType' object has no attribute 'dos_header'
How could I fix it?
Hello, is the file path pointing toward a regular PE file?
Hi, yes it pointing to regular PE file directly On Fri, 12 Aug 2565 BE at 16:50 Luca Demetrio @.***> wrote:
Hello, is the file path pointing toward a regular PE file?
— Reply to this email directly, view it on GitHub https://github.com/pralab/secml_malware/issues/38#issuecomment-1213260320, or unsubscribe https://github.com/notifications/unsubscribe-auth/APDMAN7VOTPN72EIZGOFRSDVYZXEJANCNFSM56GP3AVQ . You are receiving this because you authored the thread.Message ID: @.***>
That is strange, also because I tested it with regular PE program (I tested it right now) and no issues encountered. Which sample are you using? Usually LIEF returns None if the file is not a PE object, but another unrecognized file.
Closing this issue because I can not reproduce it.