-
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
Add pyinstaller hook #2215
Add pyinstaller hook #2215
Conversation
This allows to create single-file exploits without the need to have python installed. You still need to have external binutils for asm/disasm. Closes Gallopsled#2086
This is experimental/optional support without guarantees.
PyInstaller allows easy integration into pytest to test bundling, but since we don't use pytest and this is more of a gimmick right now, I don't think adding tests and installing pyinstaller in CI is worth it. |
Could this be done with Note: I did not read into the thing yet, sorry if it is unrelated. |
This is unrelated, since pyinstaller uses static analysis to find which modules and files to include in a bundle and needs help if a project uses dynamic imports. https://pyinstaller.org/en/stable/hooks.html#providing-pyinstaller-hooks-with-your-package I've followed their docs about this and it's just about our dynamic importing of shellcraft templates and constants. I didn't see references to resources or the problem pyoxidizer mentions. I didn't investigate why the hidden imports are needed. Probably using pwnlib directly vs. pwn. |
Okay so if it is unrelated, I would prefer to wait with merging these pyinstaller hooks, as they are not strictly necessary for us (and pyinstaller looks very Windows-first). I suspect this might need to be made a bit different if we use importlib resources, and I would like to use that soon. |
We could just revisit this when someone complains after migrating to importlib.resources. I've only tested this on linux, so I don't see the windows focus. I'm trying to get the numbers of open PRs down and get the feedback on pace, so it's more fun to contribute without having to wait years for a decision. So leaving this PR open on the premise of maybe breaking it in the future isn't really something I'd like to be doing :/ |
I guess there isn't really high demand for this and not worth the maintenance at the moment. Please comment if you have a use case for packing pwntools exploits into an executable and reopen! |
This allows to create single-file exploits without the need to have python installed. You still need to have external binutils for asm/disasm.
https://pyinstaller.org/en/stable/index.html
Closes #2086