A single static Go binary that applies the THUG2: Violet Vandal Edition mod
layer onto a Tony Hawk's Underground 2 (PC) install. It is the engine behind
the Revert toolkit — it compiles NeverScript in-process and packs .prx
archives with no runtime dependencies (no Python, no external compiler), so
it cross-compiles cleanly to Windows, Linux, and Steam Deck.
Status: early. Private while the wider project takes shape; will open up when ready.
prx— read / list / extract / replace files inside THUG2.prx(PRE) archives, including LZSS (de)compression. Round-trips byte-identically.apply— read a mod set (mods.list+ per-modmod.conf/inject.list) and apply it to an install: compile.ns→.qbin-process and inject into the right archive (raw, or LZSS-compressed for the size-cappedqb_scripts).tag— turn any image into a custom in-game Create-A-Graphic tag: encode it into a CAGR sprite (.img.xbx), inject intocagpieces.prx, and build a correctly-checksummed.GRFthat loads directly. (Native Go port of the reference Python tag importer; the.GRFit builds is byte-identical.)build— produce a whole edition from a clean pristine base + the mod sources: mirror the base, install the no-CD exe, apply the WidescreenFix (thedinput8.dll→winmm.dllrename, via stdlibarchive/zip), runapply, install custom tags, copy the HUD-fix.asi, overlay an HQ A/V pack, and optionally bake a default soundtrack (with theqb_scriptsboot ceiling enforced). This is the in-process, zero-dep core of the Revert installer's build step — it never shells out, so archive extraction (ISO/MSI/7z) and the optional Python asset steps stay in Revert's bash wrapper.
thugkit prx <roundtrip|list|extract|replace|replacez> ...
thugkit apply <install-dir> [--mods <dir>] [--layer all|binary|source] [--only a,b]
thugkit tag <image> --gamedir <dir> [--name X] [--slot grap_50] [--size 64|128|256] [--scale F] [--out dir] [--install]
thugkit build <dest> --pristine <dir> [--mods dir] [--fast] [--no-cd exe] [--wsfix zip] [--hq-audio dir] [--hudfix asi] [--glyphfix asi] [--tags dir] [--soundtrack-qb f] [--only a,b]
go build -o thugkit ./cmd/thugkit
# cross-compile, zero deps:
GOOS=windows GOARCH=amd64 go build -o thugkit.exe ./cmd/thugkit
go test ./... # hermetic unit tests (no game data needed)
go test ./prx -run x -fuzz FuzzLZSS # fuzz the LZSS codec
The verify_*.sh / verify_parity.py scripts are integration harnesses that
compare against the reference Python/bash pipeline; they expect the surrounding
project layout (clean game data + mods/) and are not needed to build or unit-test.
The patched NeverScript compiler is vendored as a git submodule at
third_party/neverscript (the public fork github.com/violetvandal/NeverScript,
pinned to the thug2-runtime-safe-recompiler branch); go.mod replaces
github.com/byxor/NeverScript with it. The repo is self-contained — just clone
with submodules:
git clone --recursive git@github.com:violetvandal/thugkit.git
# or, after a plain clone:
git submodule update --init --recursive
MIT — see LICENSE.