Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:BFRES

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Nintendo's graphics resource container of the Wii U and Switch (.bfres, .sbfres, .bfres inside SARC): magic FRES; on Wii U the version follows at +4, on Switch four spaces follow (FRES + 0x20202020) and the version sits at +8; holds models (FMDL with FSKL, FSHP, FMAT, FVTX), animations, textures (Wii U) and external files such as BNTX (Switch).

Overview

BFRES (also written FRES) packs models, skeletons, materials, animations and, on the Wii U, textures. Layout details below come from KillzXGaming/BfresLibrary (MIT, derived from Syroot.NintenTools.Bfres) and KillzXGaming/Switch-Toolbox (GPL-3.0). Files are frequently stored Yaz0-compressed inside a Format:SARC archive (extensions such as .sbfres, .sbitemico, .sbmaptex, .sbstftex appear in Switch-Toolbox's handler list).

Telling the platforms apart

  • Both start with FRES (46 52 45 53).
  • Switch: the next four bytes are spaces (0x20202020), then the u32 version at +0x08, a byte order mark at +0x0C (Switch files are little endian), alignment byte, target address size byte, offset of the file name, u16 flags, u16 block offset, u32 relocation table offset, u32 file size. BfresLibrary's IsSwitchBinary tests exactly this padding word.
  • Wii U: the u32 version is at +0x04 (big endian), then the BOM, u16 header size, u32 file size, u32 alignment, file name offset, string pool size and offset, followed by dictionary offsets for models, textures, skeletal animations, shader parameter, colour, texture SRT and texture pattern animations, bone visibility animations and shape animations.

Version numbers

Switch: major = version >> 16, minor = (version >> 8) & 0xFF, minor2 = version & 0xFF. Wii U: four parts, version >> 24, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF. BfresLibrary branches on the Switch major version (for example 9 and 10 add reserved space and external flags in the header; version 10 files may hold external strings or a separate GPU section).

Contents

Subfiles (FMDL models with FSKL skeletons, FSHP shapes, FMAT materials, FVTX vertex buffers, FSKA, FSHA, FSCN animations) are reached through name dictionaries (ResDict). Unverified: on Switch, textures are not stored in the FRES itself but in an external BNTX (Format:BNTX), named in the external file dictionary or shipped as a separate .Tex file.

Related

Format:BNTX, Format:SARC archive, Format:Yaz0, Platform:Nintendo Switch.

Code & repositories

  • https://github.com/KillzXGaming/BfresLibrary @ 65c005275deed1e085069e72fea523247f955b87 · license: MIT
    C# reader and writer for Wii U and Switch BFRES (MIT, from Syroot.NintenTools.Bfres); Switch/ResFileParser.cs and WiiU/ResFileParser.cs show the header fields and version handling
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-17