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

Disassemble .plt section and mark functions as thunks #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TSRBerry
Copy link
Contributor

@TSRBerry TSRBerry commented Oct 17, 2024

This PR closes #19 by disassembling the entire .plt section and creating thunked functions for every PltEntry referencing external functions.

For entries referencing functions in the same binary the AARCH64PltThunkAnalyzer will now be able to take care of them.

I mainly used ghidra's ElfProgramBuilder as a template and added the necessary steps from it.

That said, I don't know a lot about ELF or file formats in general, so I'm not sure if there are any missing cases or if this solution is incorrect.
I tested it with a few binaries myself and the results look right, but I lack the experience to actually judge that.

@TSRBerry TSRBerry marked this pull request as draft November 1, 2024 20:33
This also makes AARCH64PltThunkAnalyzer work for references within the same binary.
@TSRBerry
Copy link
Contributor Author

TSRBerry commented Nov 1, 2024

I just found out how to do this properly, so I updated the PR and changed the description a little bit.

@TSRBerry TSRBerry marked this pull request as ready for review November 1, 2024 22:41
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.

Mark PLT Functions as Thunks
1 participant