Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent number of functions when Parsering MachO binaries? #479

Closed
puffyCid opened this issue Oct 27, 2020 · 1 comment
Closed

Inconsistent number of functions when Parsering MachO binaries? #479

puffyCid opened this issue Oct 27, 2020 · 1 comment

Comments

@puffyCid
Copy link

Hello,

I am encountering a small issue when attempting to parse MachO binaries twice.
When I parse the binary the first time it returns the correct number of functions.

>>> import lief
>>> bin1 = lief.MachO.parse("/bin/ls")
>>> len(bin1[0].exported_functions)
1
>>> len(bin1[0].functions)
21
>>> len(bin1[0].symbols)
85

But when i try parsing it a second time it returns one less function

>>> bin2 = lief.MachO.parse("/bin/ls")
>>> len(bin2[0].exported_functions)
0
>>> len(bin2[0].functions)
20
>>> len(bin2[0].symbols)
85

I've tried searching the docs and examples for possible solutions but i did not find any.
Am i doing something wrong?
I tested with Python3 and lief version 0.10.1-bfe5414

I am also encountering the same issue with C++ and the lief nightly version
let me know if any more information is needed, thanks.

@romainthomas
Copy link
Member

Thanks for catching this problem :)

@romainthomas romainthomas added this to the Next Release milestone Nov 4, 2020
romainthomas pushed a commit that referenced this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants