Skip to content

Comments

Fixed small bug when supplying bytes variable to MachO() object#6

Open
ayylemao wants to merge 2 commits intopstirparo:mainfrom
ayylemao:main
Open

Fixed small bug when supplying bytes variable to MachO() object#6
ayylemao wants to merge 2 commits intopstirparo:mainfrom
ayylemao:main

Conversation

@ayylemao
Copy link

@ayylemao ayylemao commented Jan 30, 2024

If supplying only bytes buffer to MachO() object and running parse(), self.file_name was not properly initialized leading to:

 macho = MachO(data=binary_bytes)
 macho.parse()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "machofile.py", line 391, in parse
    self.general_info = self.get_general_info()
  File "machofile.py", line 425, in get_general_info
    if self.file_path is None:
AttributeError: 'MachO' object has no attribute 'file_path'

fixed that bug by initializing file_path as None in case of only bytes supplied in constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant