Skip to content

StarCitizenWiki/unp4k

 
 

Repository files navigation

unp4k Release

These tools open, decrypt, and extract data from Star Citizen .p4k files.

Platform support

Tool Windows Linux macOS
unp4k Supported Supported Supported
unforge.cli Supported Supported Supported
unp4k.fs Supported Not supported Not supported

unp4k.fs uses Dokan, so it remains Windows-only.

Prerequisites

  • .NET SDK 8.0 or newer (10.0 recommended for publish artifacts).
  • For Linux/macOS runtime extraction of ZSTD-compressed entries:
    • Linux: install libzstd (sudo apt-get install -y libzstd1 on Debian/Ubuntu).
    • macOS: install zstd (brew install zstd).

Build

dotnet restore
dotnet build src/unp4k/unp4k.csproj -c Release -f net10.0
dotnet build src/unforge.cli/unforge.cli.csproj -c Release -f net10.0

Publish (self-contained)

Examples:

dotnet publish src/unp4k/unp4k.csproj -c Release -f net10.0 -r win-x64
dotnet publish src/unp4k/unp4k.csproj -c Release -f net10.0 -r linux-x64
dotnet publish src/unp4k/unp4k.csproj -c Release -f net10.0 -r osx-arm64

dotnet publish src/unforge.cli/unforge.cli.csproj -c Release -f net10.0 -r win-x64
dotnet publish src/unforge.cli/unforge.cli.csproj -c Release -f net10.0 -r linux-x64
dotnet publish src/unforge.cli/unforge.cli.csproj -c Release -f net10.0 -r osx-arm64

unp4k.fs publish remains Windows-only:

dotnet publish src/unp4k.fs/unp4k.fs.csproj -c Release -f net10.0 -r win-x64

Build with Docker (Linux/macOS binaries)

Build the local builder image:

docker build --no-cache -f Dockerfile.build -t unp4k-builder .

Run the build and write artifacts to ./artifacts:

mkdir -p artifacts
docker run --rm -v "$PWD/artifacts:/artifacts" unp4k-builder

Override target RIDs if needed:

docker run --rm \
  -e RIDS="linux-x64 osx-arm64" \
  -v "$PWD/artifacts:/artifacts" \
  unp4k-builder

Quickstart

  1. Windows GUI style: drag Data.p4k from the StarCitizen\LIVE folder onto unp4k.exe.
  2. CLI: run unp4k <path-to-Data.p4k> [filter].

Example:

unp4k /path/to/Data.p4k "*.xml"

The filter does not fully support wildcards. *.ext works for extension filtering, but broader glob behavior is limited.

File format overview

p4k files used by Star Citizen are Zip archives.

Star Citizen uses multiple archive modes, including STORE, DEFLATE, and custom ZSTD handling.

Some archive data is additionally encrypted; these tools use the known CryEngine-compatible key to decrypt supported entries.

Inside .p4k, XML files are often stored as CryXML rather than raw XML.

unforge.cli can deserialize CryXML and DataForge (.dcb) formats into XML output.

About

Unp4k utilities for Star Citizen

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C# 99.9%
  • Shell 0.1%