secml_malware icon indicating copy to clipboard operation
secml_malware copied to clipboard

AttributeError: 'NoneType' object has no attribute 'dos_header'

Open dumpsgod opened this issue 3 years ago • 2 comments

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?

dumpsgod avatar Aug 11 '22 01:08 dumpsgod

Hello, is the file path pointing toward a regular PE file?

zangobot avatar Aug 12 '22 15:08 zangobot

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: @.***>

dumpsgod avatar Aug 13 '22 15:08 dumpsgod

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.

zangobot avatar Aug 19 '22 12:08 zangobot

Closing this issue because I can not reproduce it.

zangobot avatar Aug 28 '22 13:08 zangobot