Skip to content

A simple one-way XNB unpacker for Stardew Valley.

License

Notifications You must be signed in to change notification settings

vmhocuron0/StardewXnbHack

 
 

Repository files navigation

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.

Usage

To install it:

  1. Install Stardew Valley and SMAPI.
  2. From the releases page, download the StardewXnbHack *.zip file for your operating system under 'assets'.
  3. Unzip it into your Stardew Valley folder, so StardewXnbHack.exe is in the same folder as Stardew 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.

FAQs

How does this compare to other XNB unpackers?

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.

On Linux, the console doesn't open or shows a "Magic number is wrong" error

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

For StardewXnbHack developers

This section explains how to edit or compile StardewXnbHack from the source code. Most users should use the release version instead.

Compile from source

  1. Install Stardew Valley and SMAPI.
  2. Open the .sln solution file in Visual Studio.
  3. Click Build > Build Solution. (If it doesn't find the Stardew Valley folder automatically, see custom game path in the mod build package readme.)

Debug a local build

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.

Prepare a compiled release

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.

  1. Update the semantic version in StardewXnbHack.csproj.
  2. Compile it on Windows, and create a zip file like this:
    StardewXnbHack 1.0.0 for Windows.zip/
       StardewXnbHack.exe
    
  3. 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
    
  4. Post a release with all three zip files.

See also

About

A simple one-way XNB unpacker for Stardew Valley.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 96.2%
  • Shell 3.8%