pouët.net

lz4pack

lz4pack

Small packer for Linux/x86 by dominikr

./lz4pack [FILE]


Unpack stub is a static binary, no dependencies, using a built-in LZ4
decompressor. The decompressor is a 32-bit port of LZ4_8088 by Trixter/Hornet
(lz4_decompress_small, more specifically).

The decompression stub is 156 bytes, and can be used by simply appending an
LZ4 file to it. If you want to see how well this tool can compress your binary
before downloading it... compress it with LZ4 and add 156 to it.

Arguments and environment are preserved, the memfd_name gets set to argv[0]
(so that e.g. pgrep works more or less the same).
Maximum supported input file size is 16MB.

Uses memfd_create() to create an anonymous file, which is then executed with a
regular execve(). This means you can pack anything your target system is able
to execute - scripts, 64bit ELF files, Windows EXE files if you have
binfmt_misc enabled for that....


The ported LZ4_8088.ASM is included as lz4.asm. See the file for Trixter's
license. Source for the stub is... missing at the moment.

A newer version with zx0 support, and options to disable env/argv preservation
is in the works, but it might still be a while until it's ready.