StardewXnbHack is a one-way XNB unpacker for Stardew Valley. It supports every Stardew Valley asset type, is very easy to update for game changes, and is quick at unpacking many files at once.
To install it:
- Install Stardew Valley and SMAPI.
- From the releases page, download the
StardewXnbHack *.zip
file for your operating system under 'assets'. - Unzip it into your Stardew Valley folder,
so
StardewXnbHack.exe
is in the same folder asStardew Valley.exe
.
To unpack the entire Content
folder into Content (unpacked)
on...
OS | instruction |
---|---|
Windows | double-click StardewXnbHack.exe . |
Linux | execute StardewXnbHack.sh . |
MacOS | double-click StardewXnbHack.command . |
StardewXnbHack reads files through a temporary game instance, unlike other unpackers which read them directly. That lets it support custom Stardew Valley formats, but it can't repack files (which is rarely needed anyway) or support other games.
The main differences at a glance:
StardewXnbHack | xnbcli | XNBExtract | |
---|---|---|---|
Supported asset types | ✓ images ✓ maps ✓ dictionary data ✓ font texture ✓ font XML data ✓ structured data |
✓ images ✓ maps ✓ dictionary data ✓ font textures ✓ font XML data ❑ structured data |
✓ images ✓ maps ✓ dictionary data ✓ font textures ❑ font XML data ❑ structured data |
Export formats | ✓ .png for images✓ .tmx for maps✓ .json for data (CP-compatible) |
✓ .png for images✓ .tbin for maps¹❑ .json for data (custom format) |
✓ .png for images✓ .tbin for maps¹❑ .yaml for data |
Supported platforms | ✓ Windows ✓ Linux ✓ Mac |
✓ Windows ✓ Linux ✓ Mac |
✓ Windows ❑ Linux ❑ Mac |
Supported operations | ✓ unpack ❑ pack |
✓ unpack ✓ pack (uncompressed) |
✓ unpack ✓ pack |
Maintainable | ✓ easy to update | ❑ complex | ❑ complex, closed-source |
Sample unpack time (full Content folder) |
≈0m 43s | ≈6m 5s | ≈2m 20s |
License | MIT | GPL | n/a |
¹ .tmx
is the preferred map format, but you can open the .tbin
file in Tiled and export it as .tmx
.
That's a Mono bug with some terminals in the version used by Stardew Valley. You can fix it by...
- changing your default terminal to a supported one like xterm;
- or opening a terminal in the game folder and launching the unpacker like this:
export TERM=xterm &&./StardewXNBHack.sh
This section explains how to edit or compile StardewXnbHack from the source code. Most users should use the release version instead.
- Install Stardew Valley and SMAPI.
- Open the
.sln
solution file in Visual Studio. - Click Build > Build Solution. (If it doesn't find the Stardew Valley folder automatically, see custom game path in the mod build package readme.)
Just launch the project via Debug > Start Debugging. It will run from your bin
folder, but
should auto-detect your game folder and unpack its Content
folder.
To prepare a crossplatform StardewXnbHack release, you'll need to compile it on two platforms. See crossplatforming info on the wiki for the first-time setup.
- Update the semantic version in
StardewXnbHack.csproj
. - Compile it on Windows, and create a zip file like this:
StardewXnbHack 1.0.0 for Windows.zip/ StardewXnbHack.exe
- Compile it on Linux or Mac, and create two zip files like this:
StardewXnbHack 1.0.0 for Linux.zip/ StardewXnbHack.exe StardewXnbHack.sh StardewXnbHack 1.0.0 for MacOS.zip/ StardewXnbHack.command StardewXnbHack.exe
- Post a release with all three zip files.