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

Cache output of asm() #2358

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Conversation

peace-maker
Copy link
Member

To speed up repeated runs of an exploit, cache the assembled output.

Use a sha1 hash of the shellcode as well as relevant context values like context.arch and context.bits to see if the exact same shellcode was assembled for the same context before.

Fixes #2312

To speed up repeated runs of an exploit, cache the assembled output.

Use a sha1 hash of the shellcode as well as relevant context values
like `context.arch` and `context.bits` to see if the exact same
shellcode was assembled for the same context before.

Fixes Gallopsled#2312
@Arusekk
Copy link
Member

Arusekk commented May 20, 2024

I think we should use the preprocessed assembly and full assembler command in order to avoid stale bugs on pwntools updates

@peace-maker
Copy link
Member Author

peace-maker commented May 21, 2024

Yeah, that's fine too. I wanted to avoid running any processes. But one instead of several is still an improvement if it prevents subtle bugs in the future.

"The assembler command" is tricky though due to the multi step approach. Building the command line arguments calls which too to find the binutils tools.

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.

Cache assembler output
2 participants