staticx icon indicating copy to clipboard operation
staticx copied to clipboard

Feature: CLI options for bundle directory and program name

Open andria-dev opened this issue 1 year ago • 0 comments

When using staticx, you can rename the resulting executable whatever you want, but looking at a process listing or the /tmp directory, you can easily see that it's a staticx program and you can see the original name of the program too.

Say you're making Impacket's Python smbserver example portable, you would do something like the following.

pyinstaller --onefile /usr/share/doc/python3-impacket/examples/smbserver.py
staticx dist/smbserver dist/smbserver.staticx

Then once it's on another system, you might want to rename it something other than smbserver. But when the program is run, it extracts to and shows up in a process list as /tmp/staticx-XXXXXX/smbserver. It would be nice if there were an option when running staticx to specify the bundle directory and the program path instead of having them decided for you. A workaround for the program name is to rename it before running staticx, but that is not ideal. There is no workaround for the bundle directory.

I'm proposing new CLI options --bundle-dir and --prog-name to keep the naming similar to the environment variables STATICX_BUNDLE_DIR, and STATICX_PROG_PATH.

andria-dev avatar Jul 20 '24 22:07 andria-dev