<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Leoetlino</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Leoetlino"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Leoetlino"/>
	<updated>2026-04-15T23:51:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=BCSAR&amp;diff=21031</id>
		<title>BCSAR</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=BCSAR&amp;diff=21031"/>
		<updated>2019-07-28T07:16:17Z</updated>

		<summary type="html">&lt;p&gt;Leoetlino: /* 0x2204 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The BCSAR (CTR Sound ARchive) format is the 3DS&#039;s equivalent of the Wii&#039;s BRSAR  format. They&#039;re not the same structures, though, but they do have the same purpose.&lt;br /&gt;
&lt;br /&gt;
BCSAR are located in the RomFS, this is usually stored under &amp;quot;romfs:/sound/&amp;lt;name&amp;gt;.bcsar&amp;quot;. This contains various audio formats, such as CSTM, CWSD, and CWAV.&lt;br /&gt;
&lt;br /&gt;
== BCSAR Header ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  MAGIC &amp;quot;CSAR&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Byte order mark (0xFEFF = Big Endian, 0xFFFE = Little Endian)&lt;br /&gt;
|-&lt;br /&gt;
|  0x6&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Length of BCSAR header&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Version&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of the entire BCSAR (starting from 0x0)&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Amount of main partitions in the BCSAR [STRG + INFO + FILE = 0x03 (= 3)]&lt;br /&gt;
|-&lt;br /&gt;
|  0x14&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Partition header length [same for each partition? (ie STRG,INFO,and FILE header lengths)]&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Location of STRG partition&lt;br /&gt;
|-&lt;br /&gt;
|  0x1C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of STRG partition&lt;br /&gt;
|-&lt;br /&gt;
|  0x20&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown (always 0x01200000?)&lt;br /&gt;
|-&lt;br /&gt;
|  0x24&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Location of INFO partition&lt;br /&gt;
|-&lt;br /&gt;
|  0x28&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of INFO partition&lt;br /&gt;
|-&lt;br /&gt;
|  0x30&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Location of main FILE partition&lt;br /&gt;
|-&lt;br /&gt;
|  0x34&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of main FILE partition&lt;br /&gt;
|-&lt;br /&gt;
|  0x38&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Reserved for 4th main partition location?&lt;br /&gt;
|-&lt;br /&gt;
|  0x3C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Reserved for 4th main partition length?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Partitions ==&lt;br /&gt;
&lt;br /&gt;
=== STRG ===&lt;br /&gt;
&lt;br /&gt;
STRG contains the names of the audio files in the BCSAR.&lt;br /&gt;
&lt;br /&gt;
==== Header ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  MAGIC &amp;quot;STRG&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of STRG partition (also in CSAR header)&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  String table type magic (always 0x2400)&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to the string table (always 0x10)&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x4&lt;br /&gt;
|  String table lookup type magic (always 0x2401)&lt;br /&gt;
|-&lt;br /&gt;
|  0x14&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to the string lookup table&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Filename count&lt;br /&gt;
|-&lt;br /&gt;
|  0x1C&lt;br /&gt;
|  0xC * count&lt;br /&gt;
|  String offset table&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== String offset table entry ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Type of the node (should be 0x1F01)&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Offset to data from the end of the STRG header (sizeof 0x18)&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of the data buffer (includes NUL terminator)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then every filename is rawly setted. You can set up a dictionary that contains, using a simple counter, the size of every filename in order. Then, using the same type of counter, get the values of the size of the filename in a correct order.&lt;br /&gt;
&lt;br /&gt;
==== String lookup table ====&lt;br /&gt;
&lt;br /&gt;
===== Header =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Index of the root entry&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Entry count&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x14 * count&lt;br /&gt;
|  Lookup entry&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Entry =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Nonzero if contains data&lt;br /&gt;
|-&lt;br /&gt;
|  0x2&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Bit test condition (index = (this &amp;gt;&amp;gt; 3), bit = (~this &amp;amp; 7)), -1 if unused&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Fail condition leaf index (-1 if unused)&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Success condition leaf index (-1 if unused)&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  String lookup table index (-1 if unused)&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x3&lt;br /&gt;
|  3-byte Resource ID, Little Endian (-1 if unused)&lt;br /&gt;
|-&lt;br /&gt;
|  0x13&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Resource type (01=sound, 02=sound list, 03=sound bank, 04=sound player name?, 06=sound group, FF=unused)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== INFO ===&lt;br /&gt;
&lt;br /&gt;
INFO presumably contains information on the audio files? Possibly used to connect names from STRG to data from FILE?&lt;br /&gt;
&lt;br /&gt;
For now I only know some information in the header for this partition, but I&#039;m working on figuring the rest out.&lt;br /&gt;
&lt;br /&gt;
==== Header ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  MAGIC &amp;quot;INFO&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of INFO partition (also in CSAR header)&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2100&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2104&lt;br /&gt;
|-&lt;br /&gt;
|  0x14&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2101&lt;br /&gt;
|-&lt;br /&gt;
|  0x1C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x20&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2103&lt;br /&gt;
|-&lt;br /&gt;
|  0x24&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x28&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2105&lt;br /&gt;
|-&lt;br /&gt;
|  0x2C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x30&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2102&lt;br /&gt;
|-&lt;br /&gt;
|  0x34&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x38&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x2106&lt;br /&gt;
|-&lt;br /&gt;
|  0x3C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x40&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown magic 0x220B&lt;br /&gt;
|-&lt;br /&gt;
|  0x44&lt;br /&gt;
|  0x4&lt;br /&gt;
|  This + 8 points to unknown&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Blocks ====&lt;br /&gt;
&lt;br /&gt;
Every offset in the header points to data similar to this:&lt;br /&gt;
* 4byte length&lt;br /&gt;
* length array of the below struct&lt;br /&gt;
** u32 type&lt;br /&gt;
** u32 offset relative to the address of the length field (beginning of the block)&lt;br /&gt;
&lt;br /&gt;
The data the offset points to is dependent on the type of the above struct:&lt;br /&gt;
&lt;br /&gt;
===== 0x2200 =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Sound player ID&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Type of the extended info&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Offset to extended info *relative to the beginning of this struct*&lt;br /&gt;
|-&lt;br /&gt;
|  0x14&lt;br /&gt;
|  ???&lt;br /&gt;
|  Unknown...&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== 0x2204 =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  First Sound ID in this sequence set&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Last Sound ID in this sequence set&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Type of the extended info&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Offset to extended info *relative to the beginning of this struct*&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Type of the extended info&lt;br /&gt;
|-&lt;br /&gt;
|  0x14&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Offset to extended info *relative to the beginning of this struct*&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x1C&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== 0x2206 =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Type of the extended info&lt;br /&gt;
|-&lt;br /&gt;
|  0x8&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Offset to extended info *relative to the beginning of this struct*&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x10&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== FILE ===&lt;br /&gt;
&lt;br /&gt;
FILE contains all of the audio data in the BCSAR.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  MAGIC &amp;quot;FILE&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Length of FILE partition (also in CSAR header)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There isn&#039;t a whole lot else I can document about the FILE partition, since the data in it will most definitely vary depending on the game. (since audio is more than likely to change in each game)&lt;br /&gt;
&lt;br /&gt;
There is no table in FILE so a different partition (presumably INFO) must be used to connect the data in FILE with the names from STRG.&lt;br /&gt;
&lt;br /&gt;
After some more research, there are multiple FILE partitions, but only 1 of them is the &#039;main&#039; FILE partition (it&#039;s the one you get from the BCSAR header). The &#039;main&#039; FILE partition contains all of the other sub FILE partitions.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* vgmtoolbox&#039;s Advanced Cutter/Offset Finder tool can extract BCWAVs without filenames&lt;/div&gt;</summary>
		<author><name>Leoetlino</name></author>
	</entry>
</feed>