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:BRRES resource archive

From ReverseEngineering.wiki
Format
Platforms Platform:Nintendo Wii
Magic 62 72 65 73 ("bres")
Extensions .brres
Endianness byte order mark dependent, big endian on the Wii
On this wiki Facts · Code · Notes · Topics

Wii (NW4R) resource container (.brres, magic bres, often inside U8 .szs archives): a header with byte order mark, version, size and root offset, a root section whose index groups of 16-byte entries lead to sub files with magics MDL0, TEX0, SRT0, CHR0, PAT0, CLR0, SHP0 and SCN0.

Overview

BRRES bundles models, textures and animations of Wii games built with Nintendo's NW4R library. This page is from Wiimm's SZS Tools (Wiimm/wiimms-szs-tools, GPL-2.0-or-later) at commit 246fdb38d7, project/src/lib-szs.h and lib-brres.h, documentation only. The Wii U and Switch container is Format:BFRES.

Header

lib-szs.h lines 1172-1196 (brres_header_t): bres, u16 byte order mark, u16 version (the tool's comment: usually 0 for BRRES, 9 or 11 for BREFF/BREFT), u32 file size, u16 offset of the root section, u16 number of sections. The data is big or little endian according to the BOM.

Root section and index groups

  • The root section starts with root and a u32 size (line 1223-1231) and is followed by the first index group.
  • Group (brres_group_t): u32 size, u32 entry count, then count + 1 entries; entry 0 is a special root node of the search tree.
  • Entry (16 bytes): u16 id, u16 unknown, u16 left index, u16 right index (a binary tree over the name), u32 name offset in the string pool, u32 data offset. The tree makes name lookup possible without scanning.
  • Sub file header (brsub_header_t): 4-character magic, u32 size, u32 version, u32 negative offset back to the BRRES start, then u32 offsets of the sub file's own groups.

Sub file magics

lib-brres.h lines 133-140: MDL0 (model), TEX0 (texture), SRT0 (texture SRT animation), CHR0 (character animation), PAT0 (texture pattern animation), CLR0 (colour animation), SHP0 (shape animation), SCN0 (scene settings). Unverified: the grouping names of the root groups (for example 3DModels(NW4R), Textures(NW4R)) and the TEX0 pixel layout were not read here.

A second reader, noclip.website (MIT, src/rres/brres.ts at fd973ff240233c63883750a557c62baf6ff2a6c7, read not run), adds VIS0 (visibility animation) to the list of sub-file magics it handles, finds the groups by the names Palettes(NW4R), Textures(NW4R), 3DModels(NW4R), AnmTexSrt(NW4R), AnmTexPat(NW4R), AnmClr(NW4R), AnmChr(NW4R), AnmVis(NW4R) and AnmScn(NW4R), and treats entry name and data offsets as relative to the start of the group. TEX0 and PLT0 layouts: Fact:BRRES resource archive/struct/TEX0 texture sub file, Fact:BRRES resource archive/struct/PLT0 palette sub file; reader checks and accepted versions: Fact:BRRES resource archive/behavior/noclip BRRES reader: header, groups and sub-file versions. Pixel formats: Format:GX texture formats (GameCube and Wii). The group names are now seen in noclip's code. Unverified: that TEX0 pixel data is plain GX tiled data in every game (noclip passes it to the GX decoder).

Related

Format:U8 archive, Format:TPL texture palette, Platform:Nintendo Wii.

Code & repositories

  • https://github.com/Wiimm/wiimms-szs-tools @ 246fdb38d7c2fb3054b8f8528e11dc8f17691750 · license: GPL-2.0-or-later (declared by the contributor; GitHub's detector did not recognize a license file)
    Mario Kart Wii tool set; project/dclib/lib-bmg.h (BMG), project/src/lib-szs.h and lib-brres.h (BRRES), lib-rarc.h (RARC) document the structures in comments
    Tested on: source read, not run: source read as documentation, not run · checked 2026-10-19
  • https://github.com/magcius/noclip.website @ fd973ff240233c63883750a557c62baf6ff2a6c7 · license: MIT (declared by the contributor for the files used; GitHub reports MIT (read from LICENSE; GitHub's detector did not classify it) for the repository)
    src/gx/gx_enum.ts, gx_texture.ts, src/Common/JSYSTEM/JUTTexture.ts, src/rres/brres.ts and u8.ts: TypeScript parsers for GX textures, BTI, BRRES and U8
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-19