Changes from upstream | 相对原版的差异与升级点
Add ARM32/EABI5 ELF Support with Codex。
ELF packer/loader for Linux security research. This checkout supports the current integration targets:
- ARM64 ELF packing.
- ARM32/EABI5 ELF packing.
- x86_64 WSL host-side packing tools for both targets.
Run from the repository root:
make all # ARM64 target
make all32 # ARM32/EABI5 targetOutput layout:
| Directory | Platform | Purpose |
|---|---|---|
build/ARM64 |
ARM64 Linux | ARM64 packer, loader, and stubgen |
build/ARM32_EABI5 |
ARM32 Linux EABI5 | ARM32 packer, loader, and stubgen |
build/X86_X64 |
x86_64 Linux/WSL | Host-native packers and stubgen |
On x86_64 WSL:
build/X86_X64/packerpacks ARM64 ELF payloads.build/X86_X64/packer-arm32packs ARM32/EABI5 ELF payloads.build/X86_X64/stubgencombines packed data with either target loader.
ARM64 target dependencies:
sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install -y \
gcc-aarch64-linux-gnu \
binutils-aarch64-linux-gnu \
libssl-dev:amd64 \
libssl-dev:arm64 \
zlib1g-dev:arm64 \
libzstd-dev:arm64ARM32/EABI5 target dependencies:
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y \
gcc-arm-linux-gnueabihf \
binutils-arm-linux-gnueabihf \
qemu-user \
libssl-dev:amd64 \
libssl-dev:armhf \
zlib1g-dev:armhf \
libzstd-dev:armhfProject targets are also available:
make install-deps
make install-deps32ARM64:
make clean
make all
make verify-build
make testARM32/EABI5:
make all32
make verify-build32
make test32make test32 is a local build/pack/format smoke test. qemu-user is not a
reliable runtime validator for the packed loader because /proc/self/exe and
anti-analysis checks can differ from native execution. Use native ARM32 Linux or
ARM64 Linux with 32-bit ARM compat enabled for payload runtime validation.
make pack INPUT=/path/to/input_arm64_elf OUTPUT=/path/to/output_packed_arm64_elfEquivalent direct commands:
./build/X86_X64/packer /path/to/input_arm64_elf /tmp/payload.packed
./build/X86_X64/stubgen ./build/ARM64/loader /tmp/payload.packed /path/to/output_packed_arm64_elfmake pack32 INPUT=/path/to/input_arm32_eabi5_elf OUTPUT=/path/to/output_packed_arm32_eabi5_elfEquivalent direct commands:
./build/X86_X64/packer-arm32 /path/to/input_arm32_eabi5_elf /tmp/payload.packed
./build/X86_X64/stubgen ./build/ARM32_EABI5/loader /tmp/payload.packed /path/to/output_packed_arm32_eabi5_elfOn ARM64 Linux:
make all
make pack INPUT=/path/to/input_arm64_elf OUTPUT=/path/to/output_packed_arm64_elfOn ARM32/EABI5 Linux:
make all32
make pack32 INPUT=/path/to/input_arm32_eabi5_elf OUTPUT=/path/to/output_packed_arm32_eabi5_elfValidated on x86_64 WSL:
- ARM64 cross-build and pack smoke test.
- ARM32/EABI5 cross-build and pack smoke test.
- Output format checks for
ARM aarch64andARM, EABI5.
Validated on an ARM64 Linux server:
- ARM64 packed
/bin/lsruns successfully and matches original behavior. - ARM32/EABI5 static payload runs directly through the server's 32-bit ARM compatibility layer.
- ARM32/EABI5 packed payload runs and writes the expected runtime marker.
- AES layer uses AES-256-CTR to preserve payload length for arbitrary ELF sizes.
- Additional encryption layers remain ChaCha20 and RC4.
stubgensupports both ELF32 and ELF64 loaders.- Packed outputs receive randomized magic, filler, padding, syscall-table re-keying, string-block re-keying, header blinding, and section-header strip.
- Temporary test artifacts are written under
.codex_tmp.
This tool is intended for authorized security research, controlled red-team testing, and education. Unauthorized use against systems or software you do not own or have permission to test may be illegal.
MIT. See LICENSE.