-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cache output of asm()
#2358
Conversation
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
I think we should use the preprocessed assembly and full assembler command in order to avoid stale bugs on pwntools updates |
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 |
This should catch any changes across pwntools updates and system environment changes.
Two more things:
|
The |
I don't think there is a way to disable caching atm. |
I mostly meant we should be able to reliably run these tests on non-CI/non-fresh machines. But this is not a showstopper.
Email z środy 7 sierpnia 2024 od peace-makera:
… I don't think there is a way to disable caching atm. `context.cache_dir` and `context.cache_dir_base` don't accept an invalid path or `None`/`False`. We can allow setting `cache_dir` to False to disable caching and maybe to `None` to enable it again and have it generate a path based on the `cache_dir_base`? Not really belonging in this PR but w/e.
--
Reply to this email directly or view it on GitHub:
#2358 (comment)
You are receiving this because you commented.
Message ID: ***@***.***
--
Wysłane z mojego urządzenia Sailfish
|
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
andcontext.bits
to see if the exact same shellcode was assembled for the same context before.Fixes #2312