Paksmith

A cross-platform tool for exploring and extracting Unreal Engine game assets. Written in Rust.
Status
Core library — Phases 1–3 complete.
- Phase 1 — pak container reader. Parses UE pak archives v3 through
v11 with opt-in SHA-1 verification (entry payloads + main-index, FDI,
and PHI regions on v10+) and zlib decompression.
- Phase 2 — UAsset parsing. Full
.uasset deserialization: package
summary, name/import/export tables, and FPropertyTag streams decoded
into a typed property tree — primitives, containers
(Array/Map/Set/Struct), object references, and typed engine structs
(FVector, FTransform, …). Includes .uexp companion stitching and
unversioned/.usmap schema-driven properties.
- Phase 3 — export pipeline. Typed export readers plus format
handlers: textures → PNG (BCn/ASTC/ETC decode, virtual textures),
static and skeletal meshes → glTF 2.0 (skin weights, multiple LODs),
audio → WAV/OGG (ADPCM, Vorbis), and data tables → CSV/JSON — with
FByteBulkData resolution across all storage tiers.
CLI surface — list and inspect. The export pipeline above lives
in the paksmith-core library; wiring it to an extract subcommand is
Phase 4. The remaining phases — game profile registry (5), Iced GUI
(6–7), IoStore container reading (8), and a wgpu 3D viewport (9) — are
not yet started. See docs/plans/ROADMAP.md
for the phased plan.
Building
cargo build # builds the default workspace members (core, cli, gui, oodle)
cargo test # default-member tests (`cargo test --workspace` adds the
# crates excluded below; CI runs the workspace suite with
# `--all-features`)
Four crates are excluded from default-members (paksmith-fixture-gen,
paksmith-core-tests, paksmith-bench, paksmith-doc-lint) so a routine
cargo build stays lean. The fixture-generation crate in particular depends on
a git-sourced parser used as a cross-validation oracle; to regenerate test
fixtures explicitly:
cargo run -p paksmith-fixture-gen
Installation
Pre-built binaries are published on the GitHub Releases page. Each release ships per-target archives plus a sibling SHA256SUMS-<target>.txt file:
| Platform |
Asset |
Checksum |
| Linux (x86_64) |
paksmith-vX.Y.Z-x86_64-unknown-linux-gnu.tar.gz |
SHA256SUMS-x86_64-unknown-linux-gnu.txt |
| macOS (Apple Silicon) |
paksmith-vX.Y.Z-aarch64-apple-darwin.tar.gz |
SHA256SUMS-aarch64-apple-darwin.txt |
| Windows (x86_64) |
paksmith-vX.Y.Z-x86_64-pc-windows-msvc.zip |
SHA256SUMS-x86_64-pc-windows-msvc.txt |
Each archive contains the paksmith CLI and the paksmith-gui stub (the GUI is a Phase 6 deliverable; today it prints a banner). Extract the archive, then move paksmith somewhere on your PATH.
Verify the download against the published checksum file before running. The checksum is written by the job that built the archive, so it only catches a damaged download:
shasum -a 256 -c SHA256SUMS-<target>.txt
Each archive also has a signed build provenance attestation recording which workflow run built it. It does not show that the release itself was authorized. With the GitHub CLI, check that the release workflow built the archive from its tag:
gh attestation verify <archive> -R r6e/paksmith --signer-workflow r6e/paksmith/.github/workflows/release-assets.yml --source-ref refs/tags/vX.Y.Z
A release whose build had to be started again from main is signed from main instead of its tag. If the check fails, repeat it with --source-ref refs/heads/main, which shows only that the release workflow on main built the archive for some release tag.
Nightly builds
The Nightly workflow builds the same three archives from main on any night main has changed. They are attached to that workflow run as artifacts named paksmith-nightly-<date>-<commit>-<target>, not published as releases. Nightlies are unsupported snapshots of main. A nightly’s paksmith --version ends with its label, as in paksmith 0.1.0 (nightly-20261115-abc1234), and the GUI’s About panel shows the same label.
Artifacts need a signed-in GitHub account to download and are kept for 30 days, so there is no nightly to download once main has been unchanged for longer than that.
In a browser: open the list of scheduled nightly runs and find the newest run whose page has an Artifacts section; a run without one found main unchanged and built nothing. Nightlies a maintainer started by hand are in the list of manual runs, and one of those can be newer. Download the artifact for your platform.
With the GitHub CLI: this downloads the newest nightly for one target into a directory named after the artifact; delete that directory to download the same nightly again. Set target to x86_64-unknown-linux-gnu, aarch64-apple-darwin or x86_64-pc-windows-msvc. It needs a POSIX shell (Git Bash on Windows).
target=x86_64-unknown-linux-gnu
name=
for run in $(gh run list -R r6e/paksmith -w nightly.yml -b main -s success -L 100 --json databaseId,event -q '.[] | select(.event == "schedule" or .event == "workflow_dispatch") | .databaseId'); do
name=$(gh api "repos/r6e/paksmith/actions/runs/$run/artifacts" -q ".artifacts[] | select(.expired | not) | .name | select(endswith(\"-$target\"))") || { name=; break; }
[ -n "$name" ] && break
done
gh run download "$run" -R r6e/paksmith -n "${name:?no nightly found}" -D "$name"
Either way you get the archive and its SHA256SUMS-<target>.txt (the browser download wraps them in a zip). Verify and extract them as for a release. A nightly’s attestation names the nightly workflow and main; pass the archive itself, not the browser’s zip:
gh attestation verify <archive> -R r6e/paksmith --signer-workflow r6e/paksmith/.github/workflows/nightly.yml --source-ref refs/heads/main
macOS first-run note
The aarch64-apple-darwin binaries in releases and nightlies are ad-hoc codesigned but not Apple-notarized. On first run, macOS Gatekeeper blocks with “paksmith cannot be opened because the developer cannot be verified.” It’s one-time per binary.
After verifying with shasum above, clear the quarantine attribute:
xattr -d com.apple.quarantine /path/to/paksmith
Or via Finder: right-click the binary → Open → confirm in the dialog.
Background: notarization is permanently off the roadmap (#168).
Windows first-run note
The x86_64-pc-windows-msvc binaries in releases and nightlies are not code-signed. Windows tags a file downloaded with a browser as coming from the internet (the Mark of the Web), and Explorer passes the tag to the files it extracts. SmartScreen may then block a binary started from Explorer with “Windows protected your PC.” Running paksmith from an open terminal does not normally prompt.
Windows has no shasum. In PowerShell, print the archive’s SHA-256 and compare it with the one in SHA256SUMS-x86_64-pc-windows-msvc.txt; letter case does not matter. A nightly’s archive has its own name:
Get-FileHash .\paksmith-vX.Y.Z-x86_64-pc-windows-msvc.zip
If they differ, download the archive again. If they match, clear the tag from the archive before extracting it, so neither binary inherits it:
Unblock-File .\paksmith-vX.Y.Z-x86_64-pc-windows-msvc.zip
Or in the SmartScreen dialog: More info → Run anyway.
Running
The commands below run paksmith from a source checkout (cargo run -p paksmith-cli). If you installed a pre-built binary, substitute paksmith for cargo run -p paksmith-cli --.
List the entries in a pak archive:
cargo run -p paksmith-cli -- list path/to/archive.pak
Record the archive locations on the profile once:
cargo run -p paksmith-cli -- profile add hero --name Hero --pak-path '/games/hero/Paks/*.pak'
Then the path argument can be omitted — every matching archive is listed, with
per-entry source provenance:
cargo run -p paksmith-cli -- --game hero list
paksmith list auto-detects whether stdout is a terminal — emits a human-readable
table (with color; set NO_COLOR to disable) interactively, JSON when piped or
redirected. Override with --format table or --format json. --quiet silences
advisory notes and drops logging to error-level (errors still print). --log-json switches stderr
diagnostics to line-delimited JSON records and suppresses the advisory notes.
Control and bidirectional-control characters in record values, as in JSON on
stdout, are written as JSON escapes such as \u001b, so they decode to the
original text but never reach the terminal raw. Human-readable output (tables, note: lines and the
paksmith: error: line) shows control and bidirectional-control characters
from archive, registry or store text as U+FFFD, and a multi-line error indents
its continuation lines. Execution failures (exit 2) still end with the plain paksmith: error: line
(argument errors print clap’s usage text instead); exit-1 completions, and
verify’s exit 2 for an archive it reports in its document, keep stderr pure
JSON, with failure detail on stdout. Independent of --format,
which governs the stdout payload. The JSON shape is
a versioned envelope shared with search:
{ "schema_version": 1, "entries": [ { "path": "...", "size": 123, "...": "..." } ] }
paksmith profile
Every profile subcommand honours --format, resolving auto the same way
list does — table on a terminal, JSON when piped or redirected. Piping
profile list therefore yields JSON, not the tab-separated table. Pass
--format table to keep the human shape in a script.
One change reaches the human output too: when a registry document repeats a
profile id, list and detect now report it once rather than once per
occurrence, in both formats. The first occurrence wins, matching which profile
--game and show already resolved. The GUI’s profile selector dedupes with
them. Any --detect resolution — the global flag on paksmith list,
search, inspect or extract, the profile detect subcommand, or the
GUI’s install-dir detect flow — logs one warning per genuinely repeated id
(unless a local profile shadows that id — then the local copy wins and the
collapse is silent), and so does the GUI selector’s loader, independent of
--detect;
profile list collapses silently, so absent that warning the signal is the
fetch.profile_count comparison described below. (The selector globals
--game/--detect/--aes-key are not used by profile subcommands,
though --aes-key is still validated before dispatch; --format,
--verbose, --quiet and --log-json apply there as everywhere.)
Each read surface carries its own schema_version — no two return the same
document — and the four mutations share one, because they share one shape:
| command |
shape |
list |
{schema_version, profiles: [{id, name, engine_version, key_count, source}]} |
show |
{schema_version, id, source, name, engine_version, mappings, pak_paths, keys} |
detect |
{schema_version, dir, matches: [{id, name, source}]} |
test |
{schema_version, id, outcome, ok} |
fetch |
{schema_version, fetched, profile_count} |
add, remove, key add, key remove |
{schema_version, action, id, guid?} |
source is local or registry. test.outcome is a stable token —
verified, decrypted, wrong_key or unsupported — deliberately not the
table’s prose, which reads “decrypted (no index hash to verify)”; branch on
ok, and treat an unrecognised outcome as informational.
fetch.fetched is false when a fresh cache short-circuited the network, so a
script can tell “already current” from “downloaded”. fetch.profile_count is
how many profiles the registry document carries — deliberately not spelled
profiles, which on list is an array. To detect collapsed entries, compare
it with the number of source: "registry" rows list returns — not list’s
total, which counts local rows too; any gap is entries collapsed by shadowing
or repetition, and the counts alone cannot say which. The mutations return an
action of added, removed, key_added or key_removed; the two key
subcommands also report the guid slot they acted on, which add and remove
omit because they have none. It is normalised to lowercase hex rather than
echoed, so compare case-insensitively against a --guid you passed.
show renders key material only under --show-keys; when redacted the key
field is omitted entirely rather than set to a placeholder, so the presence
of the field is itself the signal.
Exit codes: 2 is a real error — paksmith: error: … on stderr, stdout
empty, no document in either format. There is no JSON error envelope. 1 is
not an error but profile test reporting a key that did not open the archive
(outcome wrong_key or unsupported); the document is still written, so
branch on ok rather than treating non-zero as failure. A stdout that closes
before the document is written masks the 1 as 0 — BrokenPipe takes
precedence. Note this is not what | head -1 does here: the test document is
small enough to fit the pipe buffer, so the write succeeds and the 1 stands.
Reaching the masked case takes a reader that closes before the write; | true
usually does, but that is a race rather than a guarantee, so do not rely on
either shell recipe — rely on ok.
paksmith verify
Check the SHA-1 hashes in each archive’s index and report what was checked.
Like list, it takes archives from --game/--detect when no path is given.
cargo run -p paksmith-cli -- verify path/to/a.pak path/to/b.pak
The table has a line per archive, with its index regions’ states and the
entry listing’s counts, or failed: and the error:
path/to/a.pak: ok, fully verified; index verified, fdi not present, phi not present; 3 of 3 entries with a hash in the listing, 0 without (0 with no hash in the index, 0 zeroed)
path/to/b.pak: ok; index verified, fdi verified, phi verified; 0 of 3 entries with a hash in the listing, 3 without (3 with no hash in the index, 0 zeroed)
When mixes_hash_presence (below) is true, a listing: line follows the
archive’s line, such as listing: records a non-zero hash for 2 of this archive's 3 entries. It is part of the table on stdout, so --quiet doesn’t
drop it. The JSON document is
{schema_version, archives: [{archive, ok, code, index?, counts?, integrity?, fully_verified?, error?}]}:
archive is the archive’s path, and code its own exit code, as below.
index (main, fdi and phi, each verified, skipped_no_hash or
not_present), counts (verified, skipped_no_hash) and
fully_verified are present when the archive verified. Treat an
unrecognised region state as not verified.
integrity (claim, not_in_index, no_claim, stripped,
mixes_hash_presence) is present whenever the archive opened.
error is present whenever ok is false.
A v10+ pak’s encoded index records carry no entry hash, so those entries count
in skipped_no_hash rather than being checked, and core also logs a warning
on stderr that some bytes were not hashed; --quiet drops it.
mixes_hash_presence is true when some entries carry a non-zero hash in the
entry listing and others count in not_in_index (no hash there) or
no_claim (a zeroed one in an archive whose index isn’t hashed); stripped
entries count on neither side. It is information only, and doesn’t change the
exit code.
An archive that fails doesn’t stop the rest, whether it fails to open, to
verify, or under --game/--detect to have its footer read or its key found.
The exit code is the highest any archive produced: 0 when it verified,
1 when a stored hash didn’t match or was zeroed in an archive whose index
is hashed, and 2 when it couldn’t be opened or verified, such as a
plaintext entry whose listing records a hash, in a compression method paksmith
doesn’t recognise. An archive’s 1 or 2 comes with the document and no
paksmith: error: line, so a stdout that closes before the document is written
masks either as 0; branch on each archive’s code.
Like list, a selector or profile that doesn’t resolve fails the run with no
document, the usual exit 2 and a paksmith: error: line, such as a profile
whose pak_paths match nothing, an unknown --game, or a profile store that
won’t load. With explicit paths and no --aes-key, an unknown --game fails
the run only once an archive’s footer can be read.
paksmith inspect
Dump a uasset’s structural header (summary, name table, import/export
tables) plus each export’s decoded property tree as JSON. Properties
decode to typed values — primitives, containers (Array/Map/Set/Struct),
object references, and typed engine structs — and recognized export
classes (textures, meshes, data tables, sound waves) additionally
surface their typed export data.
cargo run -p paksmith-cli -- inspect path/to/archive.pak Game/Maps/Demo.uasset
Testing
cargo test # routine
cargo clippy --workspace --all-targets --all-features -- -D warnings # lint (mirrors CI)
cargo fmt --all -- --check # format check
License
MIT
评论