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

Fix possible function typo in function_at #10

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

nazywam
Copy link
Contributor

@nazywam nazywam commented Jun 2, 2020

It seems that there might be an unintended typo in function_at

Because the iteration is done on a new generator (Functions()) instead of the initialized one (functions) it will always return the address of the first function:

Python>function_at(0x00000001800257D1)
0x180001060
Python>function_at(0x000000018002C950)
0x180001060
Python>function_at(0x000000018002A8D0)
0x180001060

I tried to fix it by making minimal changes but it can also be written nicely as

def function_at(ea):
    return next(Functions(ea), None)

@hasherezade hasherezade merged commit 1eca5ff into hasherezade:master Jun 2, 2020
@hasherezade
Copy link
Owner

Thanks!

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.

2 participants