Tool for unpacking and repacking Snapmaker U1 firmware files
Snapmaker U1 firmware uses a custom format with XOR-obfuscated headers and checksums. This tool handles the decryption, extraction, and repacking of firmware images.
cargo build --releaseBinary will be at target/release/snapmaker_firmware_repacker
./snapmaker_firmware_repacker unpack -i firmware.bin -o output_dirExtracts:
- update.img
- at32f403a.bin
- at32f415.bin
- MCU_DESC
./snapmaker_firmware_repacker pack \
-i input_dir \
-o new_firmware.bin \
-v "0.9.0.121" \
-b "20251106132913"Version and build time strings must match the format Snapmaker U1 expects.
-
64-byte main header (XOR encrypted)
- Magic:
SNMK(0x4B4D4E53) - Version string at offset 8
- Build time at offset 32
- File count at offset 47 (single byte)
- Checksum at offset 6-7
- Magic:
-
32-byte sub-file headers (XOR encrypted)
- File type, offset, size, MD5 hash
- Own checksum field
-
File data (not encrypted)
XOR table is 256 bytes, used as a simple substitution cipher on headers.
- MD5 hashes are verified on unpack
- Checksums are validated for both main and sub-file headers
- Repacked firmware matches 1 to 1 to original firmware