<?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=Foofoo+the+guy</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=Foofoo+the+guy"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Foofoo_the_guy"/>
	<updated>2026-04-15T20:26:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DARC&amp;diff=23714</id>
		<title>DARC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DARC&amp;diff=23714"/>
		<updated>2025-12-26T22:40:45Z</updated>

		<summary type="html">&lt;p&gt;Foofoo the guy: /* ARC header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
This page documents the format of DARC.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
DARC files are archives. Containers of files.&lt;br /&gt;
&lt;br /&gt;
This is very similiar to NARC (the DS archives).&lt;br /&gt;
&lt;br /&gt;
== ARC header ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset !!  Size !! Type !!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x000 || 4 || char[4] || Magic Number &#039;darc&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  0x004 || 2 || uint16 || Endianess (=0xFEFF [FF FE]: Little)&lt;br /&gt;
|-&lt;br /&gt;
|  0x006 || 2 || uint16 || Header&#039;s length&lt;br /&gt;
|-&lt;br /&gt;
|  0x008 || 4 || uint32 || Version&lt;br /&gt;
|-&lt;br /&gt;
|  0x00C || 4 || uint32 || File&#039;s length&lt;br /&gt;
|-&lt;br /&gt;
|  0x010 || 4 || uint32 || [[DARC#File_table|File table]] offset (from the beginning of the file)&lt;br /&gt;
|-&lt;br /&gt;
|  0x014 || 4 || uint32 || [[DARC#File_table|File table]] length&lt;br /&gt;
|-&lt;br /&gt;
|  0x018 || 4 || uint32 || [[DARC#Files_data|Files data]] offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== File table ===&lt;br /&gt;
&lt;br /&gt;
The file table starts at 0x01C.&lt;br /&gt;
&lt;br /&gt;
Each file struct consists of 3 uint32:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset !!  Size !! Type !!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x000 || 4 || uint32 || File name offset (from the end of the table) &lt;br /&gt;
&lt;br /&gt;
if (offset &amp;amp; 0x01000000) then this is a folder (i.e. first two nodes &#039;null&#039; &amp;amp; &#039;.&#039;)&lt;br /&gt;
|-&lt;br /&gt;
|  0x004 || 4 || uint32 || File offset&lt;br /&gt;
|-&lt;br /&gt;
|  0x008 || 4 || uint32 || File length&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Folder&#039;s length is end-index of the folder in the table.&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
* [https://github.com/yellows8/darctool]&lt;/div&gt;</summary>
		<author><name>Foofoo the guy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CGFX&amp;diff=22548</id>
		<title>CGFX</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CGFX&amp;diff=22548"/>
		<updated>2024-05-04T21:01:15Z</updated>

		<summary type="html">&lt;p&gt;Foofoo the guy: Remove duplicate offset from DICT header&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CGFX is a container format used to store graphics resources. It can contain 3D models, textures and animation data.&lt;br /&gt;
&lt;br /&gt;
== CGFX ==&lt;br /&gt;
&lt;br /&gt;
CGFX header :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;CGFX&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Byte order mark: FFFE (little endian) or FEFF (big endian)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| CGFX header size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Revision&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| File size (bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A typical CGFX file contains two main entries, beginning directly after the CGFX header: DATA and IMAG.&lt;br /&gt;
&lt;br /&gt;
== DATA ==&lt;br /&gt;
&lt;br /&gt;
DATA contains a list of DICT references.&lt;br /&gt;
&lt;br /&gt;
DATA header (for N = 0..15) :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;DATA&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| DATA Size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 +(N*8)&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries in DICT N&lt;br /&gt;
|-&lt;br /&gt;
| 0xC +(N*8)&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to DICT N&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The DATA header contains the entry counts and offsets for each DICT entry. The number of entries can vary (probably based on the version?), but are always in the following order. Any unused entries are zeroed.&lt;br /&gt;
&lt;br /&gt;
Typical entries:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! N&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Models&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Textures&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| LUTS (Material/Color/Shader look-up tables?)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Materials&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Shaders&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Cameras&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Lights&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Fog&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Environments&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Skeleton animations&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Texture animations&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Visibility animations&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Camera animations&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Light animations&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Emitters&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DICT ==&lt;br /&gt;
&lt;br /&gt;
DICTs are generic structures used to store values (and associate them to a key ?). A DICT header is 0x1C bytes long.&lt;br /&gt;
&lt;br /&gt;
DICT header :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;DICT&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| DICT size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Unknown. Seems to be shifted left by 4 bits in the source.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0xA&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
DICT entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to symbol&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CMDL ==&lt;br /&gt;
&lt;br /&gt;
CMDL is used to describe a 3D model.&lt;br /&gt;
&lt;br /&gt;
CMDL Header :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (bit 7: hasSkeletonSobj)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;CMDL&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to model name&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x18&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries in Animation Types DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Animation Types DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0xC&lt;br /&gt;
| Global scale vector (3 floats : x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x18&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x30&lt;br /&gt;
| Matrix 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x84&lt;br /&gt;
| 0x30&lt;br /&gt;
| Matrix 2&lt;br /&gt;
|-&lt;br /&gt;
| 0xB4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of Vertex Info SOBJ entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xB8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Vertex Info SOBJ list&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of MTOB DICT entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to MTOB DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of Vertex Info SOBJ entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Vertex Info SOBJ list&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of Unknown DICT entries&lt;br /&gt;
|-&lt;br /&gt;
| 0xD0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Unknown DICT&lt;br /&gt;
|-&lt;br /&gt;
| 0xD4&lt;br /&gt;
| 0xC&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xE0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Skeleton Info SOBJ offset (self-relative) [only present if flag bit 7 is set]&lt;br /&gt;
|-&lt;br /&gt;
| 0xB8+[0xB8]&lt;br /&gt;
| 0x4*N&lt;br /&gt;
| Vertex Info SOBJ self-relative offset list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A CMDL section refers to outside data; it can not be considered separately from the rest of the CGFX file.&lt;br /&gt;
The second DICT in the CMDL section contains offsets to MTOB objects.&lt;br /&gt;
&lt;br /&gt;
== SOBJ ==&lt;br /&gt;
&lt;br /&gt;
SOBJ structures can be used to describe 3D objects that are part of the model. If such is the case then they will follow this structure :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (bit 4: model; bit 1: skeleton)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;SOBJ&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown symbol offset (self-relative)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0xC&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Unknown1 (appears to hold array of floats) ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0xC&lt;br /&gt;
| Mesh position offset (X/Y/Z floats)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Face groups count&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to face groups offset array&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex groups count&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to vertex groups offset array&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown offset (self-relative) ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Face groups:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Bone groups count&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to UInt32 bone group IDs array&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown2 count&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to Unknown2 offset array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unknown2:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Face group descriptor count&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to face array descriptors offset array&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown3 count&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to UInt32 Unknown3 array&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Face array descriptor:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (bit 1: vertex index format: 0=byte, 1=short)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex index array size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to vertex index array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex groups come in a number of different formats. Typically the first vertex group entry is of format 0x40000002 and contains the actual vertex array.&lt;br /&gt;
&lt;br /&gt;
Vertex group format 0x40000002:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (0x40000002)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex array size (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to vertex array&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex stride/size in bytes (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown3 count&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to component declaration offset array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each mesh&#039;s primary vertex group contains an array of vertex component declaration objects, defining the order and parameters for each of a vertex&#039;s components.&lt;br /&gt;
&lt;br /&gt;
Vertex component declaration:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags (0x40000001)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Vertex component type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x1&lt;br /&gt;
| Component data type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x26&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of values in this component (e.g. XYZ-&amp;gt;3, UV-&amp;gt;2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Multiplier for this component&#039;s values (float)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x4&lt;br /&gt;
| Position of this component within vertex stride&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex formats with bone data support multiple bone assignment. In this case, the sum of all bone weights is 0x64.&lt;br /&gt;
&lt;br /&gt;
Vertex component types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Position&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| Normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| ? (unobserved)&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Color&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| UV0&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| UV1&lt;br /&gt;
|-&lt;br /&gt;
| 0x06&lt;br /&gt;
| ? (unobserved, possibly UV2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x07&lt;br /&gt;
| Weight&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex component data types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| sbyte&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| byte&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| short&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| ? (unobserved, possibly ushort)&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| ? (unobserved, possibly int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| ? (unobserved, possibly uint)&lt;br /&gt;
|-&lt;br /&gt;
| 0x06&lt;br /&gt;
| float&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Vertex components are stored as one of the above data types, and the vertex component declaration contains a multiplier that adapts the values to the float version which the game will use.&lt;br /&gt;
For example, color RGBA values are stored as bytes, and the multiplier converts them from 0-255 to 0-1.0, and position components using short values are normalized via the multiplier to take advantage of the entire short value range.&lt;br /&gt;
&lt;br /&gt;
== TXOB ==&lt;br /&gt;
&lt;br /&gt;
TXOBs are contained within MTOBs. They can describe textures; if such is the case, then their structure is as follows :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;TXOB&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self-relative) to symbol&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture height&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture width&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mipmap levels&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture format ID (see table below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture height (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture width (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture data size&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture data offset (self-relative)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Texture format ID&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|RGBA8&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|RGB8&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|RGBA5551&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|RGB565&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|RGBA4&lt;br /&gt;
|-&lt;br /&gt;
|0x5&lt;br /&gt;
|LA8&lt;br /&gt;
|-&lt;br /&gt;
|0x6&lt;br /&gt;
|HILO8&lt;br /&gt;
|-&lt;br /&gt;
|0x7&lt;br /&gt;
|L8&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|A8&lt;br /&gt;
|-&lt;br /&gt;
|0x9&lt;br /&gt;
|LA4&lt;br /&gt;
|-&lt;br /&gt;
|0xA&lt;br /&gt;
|L4&lt;br /&gt;
|-&lt;br /&gt;
|0xB&lt;br /&gt;
|A4 ?&lt;br /&gt;
|-&lt;br /&gt;
|0xC&lt;br /&gt;
|ETC1 (see notes below)&lt;br /&gt;
|-&lt;br /&gt;
|0xD&lt;br /&gt;
|ETC1A4 ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Every texture format has its texture data divided into 8x8 tiles. See [[SMDH#Icon_graphics|SMDH]] for more information.&lt;br /&gt;
ETC1 is a compressed texture format which compresses blocks of 4x4 pixels into u64s. These u64 are traditionally stored in big endian; however, nintendo&#039;s implementation stores them in little endian. ETC1 textures are stored in 8x8 tiles; decompressed 4x4 therefore have to be organized accordingly. See [https://gist.github.com/smealum/8897237] for implementation example.&lt;br /&gt;
&lt;br /&gt;
== LUTS ==&lt;br /&gt;
&lt;br /&gt;
Appears to contain color lookup tables possibly for use with shaders.&lt;br /&gt;
&lt;br /&gt;
LUTS Header:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;LUTS&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Seems to adhere to powers of 2 (width/height/flags?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| Seems to adhere to powers of 2 (width/height/flags?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x8&lt;br /&gt;
| all zeroes ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset to DICT (self-relative) ?&lt;br /&gt;
|}&lt;br /&gt;
All observed instances have an otherwise unreferenced DICT section immediately afterward (the last LUTS value being a 0x4, which may describe the relative position of that DICT), which appears to describe material specularity.&lt;br /&gt;
&lt;br /&gt;
== Skeleton data ==&lt;br /&gt;
&lt;br /&gt;
Skeleton data is stored in an array. Each entry is 0xE0 bytes in length and organized this way :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset (self relative) to name symbol&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Joint ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Parent joint ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Signed offset (self-relative) to parent joint&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0xC&lt;br /&gt;
| Angle vector (floats, x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0xC&lt;br /&gt;
| Position vector (floats, x, y, z)&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x30&lt;br /&gt;
| Transformation matrix (4x3)&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| 0x30&lt;br /&gt;
| Identity matrix ? (4x3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each entry stores the joint transformation data twice; once as angle/position vectors and once as a transformation matrix. Each entry also stores a second matrix which appears to always be identity. (?)&lt;br /&gt;
&lt;br /&gt;
== CANM ==&lt;br /&gt;
&lt;br /&gt;
CANMs are used to store skeletal animation data.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
* Every File Explorer&lt;br /&gt;
* Ohana3DS and its forks&lt;br /&gt;
* SPICA&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* Another CGFX Format Description (Archived Page): [https://web.archive.org/web/20150511211029/http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format) http://florian.nouwt.com/wiki/index.php/CGFX_(File_Format)]&lt;br /&gt;
&lt;br /&gt;
[[Category:File formats]]&lt;/div&gt;</summary>
		<author><name>Foofoo the guy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21808</id>
		<title>Mii</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21808"/>
		<updated>2022-02-02T16:33:43Z</updated>

		<summary type="html">&lt;p&gt;Foofoo the guy: /* Mii format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Originally [http://wiibrew.org/wiki/Mii_Data created for the Nintendo Wii] (and backported to a selection of DS/i games), the &#039;&#039;&#039;Mii&#039;&#039;&#039; format was expanded with a larger selection of facial features and a new &amp;quot;copying&amp;quot; permission for the 3DS family, and later implemented as-is on Wii U.&lt;br /&gt;
&lt;br /&gt;
See [[Mii Maker]] for the application chiefly designed to create, edit, delete, and trade Miis or convert them from and to a QR code.&lt;br /&gt;
&lt;br /&gt;
The default endianness in this page is little-endian, unless explicitly specified.&lt;br /&gt;
&lt;br /&gt;
==Mii Database==&lt;br /&gt;
Format of the Mii main database &#039;&#039;&#039;CFL_DB.dat&#039;&#039;&#039;, found in [[Extdata#NAND_Shared_Extdata|shared extdata]] archive f0000000b.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFOG&amp;quot; (Mii Maker section)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x23F0 (100 * 0x5C)&lt;br /&gt;
| Array of owned (saved in Mii Maker) Miis. Order in file is unrelated to canonical order in-app.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFHE&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FC&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list tail index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list head index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x2400&lt;br /&gt;
| 0xA410 (3000 * 0xE)&lt;br /&gt;
| Linked list of objects? See chapter&lt;br /&gt;
|-&lt;br /&gt;
| 0xC810&lt;br /&gt;
| 0xE&lt;br /&gt;
| Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81E&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum of all of the above (the first 0xC81E byte). See section [[#Checksum|below]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC820&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFRA&amp;quot; (Invitations section)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC824&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii count in this section. Maximum 100&lt;br /&gt;
|-&lt;br /&gt;
| 0xC828&lt;br /&gt;
| 0x64 (100 * 0x1)&lt;br /&gt;
| Order index of Mii in this section?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC88C&lt;br /&gt;
| 0x1C20 (100 * 0x48)&lt;br /&gt;
| Array of Miis contributed from games, used for Mii Plaza &amp;quot;invitations&amp;quot; feature.&amp;lt;br/&amp;gt;The format isn&#039;t that of a full Mii. The &amp;quot;author&amp;quot; field is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4AC&lt;br /&gt;
| 0x12&lt;br /&gt;
| 01 00 [..] 00&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4BE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum over the data above starting from 0xC820&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4C0&lt;br /&gt;
| 0x3D860 (3000 * 0x54)&lt;br /&gt;
| Another array of Miis. Seems related to the CFHE section. &amp;lt;br/&amp;gt;The Mii format in this section is modified. The &amp;quot;author&amp;quot; field is missing, A 4-byte timestamp (seconds since 2000) together with 8-byte zeros(?) is appended at the end.&lt;br /&gt;
|}&lt;br /&gt;
When encrypted in QR codes, 4 additional bytes are added. Two null bytes and a CRC-16. It&#039;s the exact same CRC-16 as for the Wii blocks on the 0x5e first bytes. It seems that the CRC is ignored, the Mii Maker expecting the result of APT:Unwrap to detect integrity loss.&lt;br /&gt;
&lt;br /&gt;
==CFHE object==&lt;br /&gt;
&lt;br /&gt;
A 0xE-byte long linked list node. The format is 4-byte Mii ID (See Mii format) + 6-byte MAC + 2-byte previous node index (prev) + 2-byte next node index (next).&lt;br /&gt;
&lt;br /&gt;
An invalid node has value: ID = 0, MAC = 0, prev = 0x7FFF, next = 0x7FFF.&lt;br /&gt;
&lt;br /&gt;
The highest bit of these fields has some special meaning and isn&#039;t part of the index value.&lt;br /&gt;
&lt;br /&gt;
==Checksum==&lt;br /&gt;
&lt;br /&gt;
The algorithm used to verify the integrity of the database is based on [http://srecord.sourceforge.net/crc16-ccitt.html CRC16-CCITT], though it&#039;s an incorrect implementation. It is the same algorithm used to verify [http://wiibrew.org/wiki/Mii_Data#Block_format Mii Data on the Wii].&lt;br /&gt;
&lt;br /&gt;
To obtain the correct value for the checksum, apply the algorithm to the first 0xC81E bytes of the database. This can be done using [https://gbatemp.net/threads/tutorial-give-your-mii-gold-pants-and-use-it-for-streetpass.379146/page-24#post-6569186 FixCRC]; alternativly a pseudocode implementation of the checksum algorithm is given below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def crc16_CCITTWii(u8[]: data) -&amp;gt; u16:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Calculate a checksum of data using the CRC16-CCITT implementation of the Wii&lt;br /&gt;
&lt;br /&gt;
    This implementation uses 0x0000 as the starting value, which is different&lt;br /&gt;
    from what CRC16-CCITT specifies.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # note: a correct implementation of CRC16-CCITT&lt;br /&gt;
    #       would initialize this to 0xffff&lt;br /&gt;
    u32 crc := 0x0&lt;br /&gt;
&lt;br /&gt;
    for byte in data:&lt;br /&gt;
        # Iterate over every of the 8 bits in byte.&lt;br /&gt;
        # Begin with the most significant bit. (7, 6, ... , 1, 0)&lt;br /&gt;
        for bit in 7..0:&lt;br /&gt;
            # &amp;amp; - binary `and&#039;; &amp;lt;&amp;lt;/&amp;gt;&amp;gt; - bitshift left/right; ^ - binary `xor&#039;&lt;br /&gt;
            crc := (&lt;br /&gt;
                     (crc &amp;lt;&amp;lt; 1) | ((byte &amp;gt;&amp;gt; bit) &amp;amp; 0x1)&lt;br /&gt;
                     ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
                   )&lt;br /&gt;
&lt;br /&gt;
    for _ in 0..15:&lt;br /&gt;
        crc := (crc &amp;lt;&amp;lt; 1) ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
&lt;br /&gt;
    # only return the lowest 16 bit of crc&lt;br /&gt;
    return (u16) (crc &amp;amp; 0xffff)&lt;br /&gt;
&lt;br /&gt;
checksum := crc16_CCITTWii(miidb[0:0xc81e]) # checksum over the first 0xc81e bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mii format==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii Version - Always 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: allow copying&amp;lt;br/&amp;gt;bit 1: profanity flag (whether in Mii name or creator name does not matter)&amp;lt;br/&amp;gt;bit 2-3: region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)&amp;lt;br/&amp;gt;bit4-5:character set(0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii position shown on the selection screen&amp;lt;br/&amp;gt;bit 0-3: page index &amp;lt;br/&amp;gt;bit 4-7: slot index&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: ?&amp;lt;br/&amp;gt;bit 4-6: Device Mii was originally made on (1=Wii, 2=DS, 3=3DS, 4=Wii U/Switch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| System ID (identifies owner, for purpose of enforcing editing restrictions and blue pants).&amp;lt;br/&amp;gt;Is not tied to the MAC address anymore.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii ID (big-endian 32bit unsigned integer):&amp;lt;br/&amp;gt;Bit 0..27: (bit[0..27] * 2) = date of creation (seconds since 01/01/2010 00:00:00)&amp;lt;br/&amp;gt;Bit 28: Always set?&amp;lt;br/&amp;gt;Bit 29: set for temporary Mii&amp;lt;br/&amp;gt;Bit 30: Set for DSi mii?&amp;lt;br/&amp;gt;Bit 31: not set if Mii is special&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x6&lt;br /&gt;
| Creator&#039;s full MAC&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding (0000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: sex (0 if male, 1 if female)&amp;lt;br/&amp;gt;bit 1-4: birthday month&amp;lt;br/&amp;gt;bit 5-9: birthday day&amp;lt;br/&amp;gt;bit 10-13: favorite color&amp;lt;br/&amp;gt;bit 14: favorite mii (0 if false, 1 if true)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Mii Name (10 chars max, 0000 terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 0x2&lt;br /&gt;
| width &amp;amp; height&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: disable sharing&amp;lt;br/&amp;gt;bit 1-4: face shape&amp;lt;br/&amp;gt;bit 5-7: skin color&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: wrinkles&amp;lt;br/&amp;gt;bit 4-7: makeup&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 0x1&lt;br /&gt;
| hair style&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-2: hair color&amp;lt;br/&amp;gt;bit 3: flip hair&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-5: eye style&amp;lt;br/&amp;gt;bit 6-8: eye color &amp;lt;br/&amp;gt;bit 9-12: eye scale &amp;lt;br/&amp;gt;bit 13-15: eye yscale&amp;lt;br/&amp;gt;bit 16-20: eye rotation&amp;lt;br/&amp;gt;bit 21-24: eye x spacing&amp;lt;br/&amp;gt;bit 25-29: eye y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-4: eyebrow style&amp;lt;br/&amp;gt;bit 5-7: eyebrow color &amp;lt;br/&amp;gt;bit 8-11: eyebrow scale&amp;lt;br/&amp;gt;bit 12-14: eyebrow yscale &amp;lt;br/&amp;gt;bit 16-19: eyebrow rotation&amp;lt;br/&amp;gt;bit 21-24: eyebrow x spacing&amp;lt;br/&amp;gt;bit 25-29: eyebrow y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: nose style&amp;lt;br/&amp;gt;bit 5-8: nose scale&amp;lt;br/&amp;gt;bit 9-13: nose y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-5: mouth style&amp;lt;br/&amp;gt;bit 6-8: mouth color&amp;lt;br/&amp;gt;bit 9-12: mouth scale&amp;lt;br/&amp;gt;bit 13-15: mouth yscale&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: mouth y position&amp;lt;br/&amp;gt;bit 5-7: mustach style&lt;br /&gt;
|-&lt;br /&gt;
| 0x42&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-2: beard style&amp;lt;br/&amp;gt;bit 3-5: beard color&amp;lt;br/&amp;gt;bit 6-9: mustache scale&amp;lt;br/&amp;gt;bit 10-14:mustache y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-3: glasses style&amp;lt;br/&amp;gt;bit 4-6: glasses color&amp;lt;br/&amp;gt;bit 7-10: glasses scale&amp;lt;br/&amp;gt;bit 11-15: glasses y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x46&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: enable mole&amp;lt;br/&amp;gt;bit 1-4: mole scale&amp;lt;br/&amp;gt;bit 5-9: mole x position&amp;lt;br/&amp;gt;bit 10-14: mole y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Author Name (10 chars max, 0000 terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Mii categories (pants colors)==&lt;br /&gt;
&lt;br /&gt;
====Special (gold) Miis====&lt;br /&gt;
Specialness will override any other pants color.&lt;br /&gt;
&lt;br /&gt;
A special Mii cannot have sharing on or else it will be deemed invalid.&lt;br /&gt;
&lt;br /&gt;
Zeroed system-id and timestamp?&lt;br /&gt;
&lt;br /&gt;
====Imported (blue) Miis====&lt;br /&gt;
Any (non-gold) Mii with a different System ID will appear as a foreign one.&lt;br /&gt;
&lt;br /&gt;
There is also a range of Mii IDs that are always foreign and uneditable, regardless of the System ID:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Regular (black/red) Miis====&lt;br /&gt;
Always editable, since they can only appear as such on the console that created them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Personal (red) Mii====&lt;br /&gt;
A red Mii that happens to be the first in the file!&lt;br /&gt;
&lt;br /&gt;
The Mii doesn&#039;t really need to be red, it is only red because the personal Mii is always favorited.&lt;br /&gt;
&lt;br /&gt;
==Mii values==&lt;br /&gt;
Each of the following values were found with NTR Debugger:&lt;br /&gt;
If you want to access the value, grab the given &amp;quot;NTR address&amp;quot; and add 0x08815000.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Data&lt;br /&gt;
! NTR address&lt;br /&gt;
! Variation (hex)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Face style&lt;br /&gt;
| 0x894&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Face color&lt;br /&gt;
| 0x898&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Wrinkles&lt;br /&gt;
| 0x89C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Makeup&lt;br /&gt;
| 0x8A0&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Hair style&lt;br /&gt;
| 0x8A4&lt;br /&gt;
| 00-84&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Hair color&lt;br /&gt;
| 0x8A8&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Hair flipped&lt;br /&gt;
| 0x8AC&lt;br /&gt;
| 1 if true&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eye style&lt;br /&gt;
| 0x8B0&lt;br /&gt;
| 00-3C&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyes color&lt;br /&gt;
| 0x8B4&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyes size&lt;br /&gt;
| 0x8B8&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes thickness&lt;br /&gt;
| 0x8BC&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes rotation&lt;br /&gt;
| 0x8C0&lt;br /&gt;
| 00-07&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes spacing&lt;br /&gt;
| 0x8C4&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes height&lt;br /&gt;
| 0x8C8&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows style&lt;br /&gt;
| 0x8CC&lt;br /&gt;
| 00-18&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows color&lt;br /&gt;
| 0x8D0&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows size&lt;br /&gt;
| 0x8D4&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows thickness&lt;br /&gt;
| 0x8D8&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows rotation&lt;br /&gt;
| 0x8DC&lt;br /&gt;
| 00-0B&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows spacing&lt;br /&gt;
| 0x8E0&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows height&lt;br /&gt;
| 0x8E4&lt;br /&gt;
| 03-12&lt;br /&gt;
| Yup, minimum is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| Nose style&lt;br /&gt;
| 0x8E8&lt;br /&gt;
| 00-11&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Nose size&lt;br /&gt;
| 0x8EC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Nose height&lt;br /&gt;
| 0x8F0&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mouth style&lt;br /&gt;
| 0x8F4&lt;br /&gt;
| 00-23&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Mouth color&lt;br /&gt;
| 0x8F8&lt;br /&gt;
| 00-04&lt;br /&gt;
| From top to bottom.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth size&lt;br /&gt;
| 0x8FC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth thickness&lt;br /&gt;
| 0x900&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth height&lt;br /&gt;
| 0x904&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mustache style&lt;br /&gt;
| 0x908&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Beard style&lt;br /&gt;
| 0x90C&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache/Beard color&lt;br /&gt;
| 0x910&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to button.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache size&lt;br /&gt;
| 0x914&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache height&lt;br /&gt;
| 0x918&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Glasses style&lt;br /&gt;
| 0x91C&lt;br /&gt;
| 00-08&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses color&lt;br /&gt;
| 0x920&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Glasses size&lt;br /&gt;
| 0x924&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses height&lt;br /&gt;
| 0x928&lt;br /&gt;
| 00-14&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole enable&lt;br /&gt;
| 0x92C&lt;br /&gt;
| 1 if enabled, 0 else.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole size&lt;br /&gt;
| 0x930&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mole horiz pos&lt;br /&gt;
| 0x934&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole vert pos&lt;br /&gt;
| 0x938&lt;br /&gt;
| 00-1E&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii height&lt;br /&gt;
| 0x93C&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii weight&lt;br /&gt;
| 0x940&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii name&lt;br /&gt;
| 0x944-0x959&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Creator&#039;s name&lt;br /&gt;
| 0x95A-96F&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Mii gender&lt;br /&gt;
| 0x970&lt;br /&gt;
| 0: Male, 1: Female&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate month&lt;br /&gt;
| 0x974&lt;br /&gt;
| 01-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate day&lt;br /&gt;
| 0x978&lt;br /&gt;
| 01-1F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii shirt color&lt;br /&gt;
| 0x97C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Ordered like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Favorite&lt;br /&gt;
| 0x980&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow copy&lt;br /&gt;
| 0x981&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Unused byte?&lt;br /&gt;
| 0x982&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow sharing&lt;br /&gt;
| 0x983&lt;br /&gt;
| 0: true, 1: false&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x984-0x98F&lt;br /&gt;
| All zero?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x990-0x997&lt;br /&gt;
| 4?&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
0x08815998: Same 4 bytes as encrypted Mii: first 4 bits for Mii type, 4 next for number of seconds since 01/01/2010 00:00:00 UTC+3 (should be verified by other country and region 3DS) divided by 2.&lt;br /&gt;
0x0881599C: 6 bytes of MAC address of the 3DS that created the Mii.&lt;br /&gt;
0x088159A2: 6 unknow uses bytes&lt;br /&gt;
0x088159A8: Same 8 bytes as decrypted Mii at 0x04 through 0x0B. Seems NAND specific, kept the same on Miis created on same NAND but different 3DS via System Transfer. Might be a coincidence but the two first bytes are in ID0 folder name in the Nintendo 3DS folder.&lt;br /&gt;
&lt;br /&gt;
===Mapped Editor &amp;lt;-&amp;gt; Hex values===&lt;br /&gt;
&lt;br /&gt;
Most of the values are ordered (left button decreases, right increases, color choices are top to bottom...) but for most &amp;quot;main&amp;quot; part of the UI, where you choose the style of the part being edited, hex values has no correlation with displayed order.&lt;br /&gt;
Here is a JSON that can go from a Part, a Page and Position to the right hex value. This is 0 indexed (eg: datas[&amp;quot;face&amp;quot;][0][11]).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{&lt;br /&gt;
face: [&lt;br /&gt;
    0x00,0x01,0x08,&lt;br /&gt;
    0x02,0x03,0x09,&lt;br /&gt;
    0x04,0x05,0x0a,&lt;br /&gt;
    0x06,0x07,0x0b&lt;br /&gt;
],&lt;br /&gt;
hairs: [&lt;br /&gt;
    [0x21,0x2f,0x28,&lt;br /&gt;
    0x25,0x20,0x6b,&lt;br /&gt;
    0x30,0x33,0x37,&lt;br /&gt;
    0x46,0x2c,0x42],&lt;br /&gt;
    [0x34,0x32,0x26,&lt;br /&gt;
    0x31,0x2b,0x1f,&lt;br /&gt;
    0x38,0x44,0x3e,&lt;br /&gt;
    0x73,0x4c,0x77],&lt;br /&gt;
    [0x40,0x51,0x74,&lt;br /&gt;
    0x79,0x16,0x3a,&lt;br /&gt;
    0x3c,0x57,0x7d,&lt;br /&gt;
    0x75,0x49,0x4b],&lt;br /&gt;
    [0x2a,0x59,0x39,&lt;br /&gt;
    0x36,0x50,0x22,&lt;br /&gt;
    0x17,0x56,0x58,&lt;br /&gt;
    0x76,0x27,0x24],&lt;br /&gt;
    [0x2d,0x43,0x3b,&lt;br /&gt;
    0x41,0x29,0x1e,&lt;br /&gt;
    0x0c,0x10,0x0a,&lt;br /&gt;
    0x52,0x80,0x81],&lt;br /&gt;
    [0x0e,0x5f,0x69,&lt;br /&gt;
    0x64,0x06,0x14,&lt;br /&gt;
    0x5d,0x66,0x1b,&lt;br /&gt;
    0x04,0x11,0x6e],&lt;br /&gt;
    [0x7b,0x08,0x6a,&lt;br /&gt;
    0x48,0x03,0x15,&lt;br /&gt;
    0x00,0x62,0x3f,&lt;br /&gt;
    0x5a,0x0b,0x78],&lt;br /&gt;
    [0x05,0x4a,0x6c,&lt;br /&gt;
    0x5e,0x7c,0x19,&lt;br /&gt;
    0x63,0x45,0x23,&lt;br /&gt;
    0x0d,0x7a,0x71],&lt;br /&gt;
    [0x35,0x18,0x55,&lt;br /&gt;
    0x53,0x47,0x83,&lt;br /&gt;
    0x60,0x65,0x1d,&lt;br /&gt;
    0x07,0x0f,0x70],&lt;br /&gt;
    [0x4f,0x01,0x6d,&lt;br /&gt;
    0x7f,0x5b,0x1a,&lt;br /&gt;
    0x3d,0x67,0x02,&lt;br /&gt;
    0x4d,0x12,0x5c],&lt;br /&gt;
    [0x54,0x09,0x13,&lt;br /&gt;
    0x82,0x61,0x68,&lt;br /&gt;
    0x2e,0x4e,0x1c,&lt;br /&gt;
    0x72,0x7e,0x6f]&lt;br /&gt;
],&lt;br /&gt;
eyebrows: [&lt;br /&gt;
    [0x06,0x00,0x0c,&lt;br /&gt;
    0x01,0x09,0x13,&lt;br /&gt;
    0x07,0x15,0x08,&lt;br /&gt;
    0x11,0x05,0x04],&lt;br /&gt;
    [0x0b,0x0a,0x02,&lt;br /&gt;
    0x03,0x0e,0x14,&lt;br /&gt;
    0x0f,0x0d,0x16,&lt;br /&gt;
    0x12,0x10,0x17]&lt;br /&gt;
],&lt;br /&gt;
eyes: [&lt;br /&gt;
    [0x02,0x04,0x00,&lt;br /&gt;
    0x08,0x27,0x11,&lt;br /&gt;
    0x01,0x1a,0x10,&lt;br /&gt;
    0x0f,0x1b,0x14],&lt;br /&gt;
    [0x21,0x0b,0x13,&lt;br /&gt;
    0x20,0x09,0x0c,&lt;br /&gt;
    0x17,0x22,0x15,&lt;br /&gt;
    0x19,0x28,0x23],&lt;br /&gt;
    [0x05,0x29,0x0d,&lt;br /&gt;
    0x24,0x25,0x06,&lt;br /&gt;
    0x18,0x1e,0x1f,&lt;br /&gt;
    0x12,0x1c,0x2e],&lt;br /&gt;
    [0x07,0x2c,0x26,&lt;br /&gt;
    0x2a,0x2d,0x1d,&lt;br /&gt;
    0x03,0x2b,0x16,&lt;br /&gt;
    0x0a,0x0e,0x2f],&lt;br /&gt;
    [0x30,0x31,0x32,&lt;br /&gt;
    0x35,0x3b,0x38,&lt;br /&gt;
    0x36,0x3a,0x39,&lt;br /&gt;
    0x37,0x33,0x34]&lt;br /&gt;
],&lt;br /&gt;
nose: [&lt;br /&gt;
    [0x01,0x0a,0x02,&lt;br /&gt;
    0x03,0x06,0x00,&lt;br /&gt;
    0x05,0x04,0x08,&lt;br /&gt;
    0x09,0x07,0x0B],&lt;br /&gt;
    [0x0d,0x0e,0x0c,&lt;br /&gt;
    0x11,0x10,0x0f]&lt;br /&gt;
],&lt;br /&gt;
mouth: [&lt;br /&gt;
    [0x17,0x01,0x13,&lt;br /&gt;
    0x15,0x16,0x05,&lt;br /&gt;
    0x00,0x08,0x0a,&lt;br /&gt;
    0x10,0x06,0x0d],&lt;br /&gt;
    [0x07,0x09,0x02,&lt;br /&gt;
    0x11,0x03,0x04,&lt;br /&gt;
    0x0f,0x0b,0x14,&lt;br /&gt;
    0x12,0x0e,0x0c],&lt;br /&gt;
    [0x1b,0x1e,0x18,&lt;br /&gt;
    0x19,0x1d,0x1c,&lt;br /&gt;
    0x1a,0x23,0x1f,&lt;br /&gt;
    0x22,0x21,0x20]&lt;br /&gt;
]&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Foofoo the guy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21572</id>
		<title>Mii</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21572"/>
		<updated>2021-08-23T15:52:01Z</updated>

		<summary type="html">&lt;p&gt;Foofoo the guy: /* Personal (red) Mii */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Originally [http://wiibrew.org/wiki/Mii_Data created for the Nintendo Wii] (and backported to a selection of DS/i games), the &#039;&#039;&#039;Mii&#039;&#039;&#039; format was expanded with a larger selection of facial features and a new &amp;quot;copying&amp;quot; permission for the 3DS family, and later implemented as-is on Wii U.&lt;br /&gt;
&lt;br /&gt;
See [[Mii Maker]] for the application chiefly designed to create, edit, delete, and trade Miis or convert them from and to a QR code.&lt;br /&gt;
&lt;br /&gt;
The default endianness in this page is little-endian, unless explicitly specified.&lt;br /&gt;
&lt;br /&gt;
==Mii Database==&lt;br /&gt;
Format of the Mii main database &#039;&#039;&#039;CFL_DB.dat&#039;&#039;&#039;, found in [[Extdata#NAND_Shared_Extdata|shared extdata]] archive f0000000b.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFOG&amp;quot; (Mii Maker section)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x23F0 (100 * 0x5C)&lt;br /&gt;
| Array of owned (saved in Mii Maker) Miis. Order in file is unrelated to canonical order in-app.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFHE&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FC&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list tail index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list head index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x2400&lt;br /&gt;
| 0xA410 (3000 * 0xE)&lt;br /&gt;
| Linked list of objects? See chapter&lt;br /&gt;
|-&lt;br /&gt;
| 0xC810&lt;br /&gt;
| 0xE&lt;br /&gt;
| Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81E&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum of all of the above (the first 0xC81E byte). See section [[#Checksum|below]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC820&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFRA&amp;quot; (Invitations section)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC824&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii count in this section. Maximum 100&lt;br /&gt;
|-&lt;br /&gt;
| 0xC828&lt;br /&gt;
| 0x64 (100 * 0x1)&lt;br /&gt;
| Order index of Mii in this section?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC88C&lt;br /&gt;
| 0x1C20 (100 * 0x48)&lt;br /&gt;
| Array of Miis contributed from games, used for Mii Plaza &amp;quot;invitations&amp;quot; feature.&amp;lt;br/&amp;gt;The format isn&#039;t that of a full Mii. The &amp;quot;author&amp;quot; field is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4AC&lt;br /&gt;
| 0x12&lt;br /&gt;
| 01 00 [..] 00&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4BE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum over the data above starting from 0xC820&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4C0&lt;br /&gt;
| 0x3D860 (3000 * 0x54)&lt;br /&gt;
| Another array of Miis. Seems related to the CFHE section. &amp;lt;br/&amp;gt;The Mii format in this section is modified. The &amp;quot;author&amp;quot; field is missing, A 4-byte timestamp (seconds since 2000) together with 8-byte zeros(?) is appended at the end.&lt;br /&gt;
|}&lt;br /&gt;
When encrypted in QR codes, 4 additional bytes are added. Two null bytes and a CRC-16. It&#039;s the exact same CRC-16 as for the Wii blocks on the 0x5e first bytes. It seems that the CRC is ignored, the Mii Maker expecting the result of APT:Unwrap to detect integrity loss.&lt;br /&gt;
&lt;br /&gt;
==CFHE object==&lt;br /&gt;
&lt;br /&gt;
A 0xE-byte long linked list node. The format is 4-byte Mii ID (See Mii format) + 6-byte MAC + 2-byte previous node index (prev) + 2-byte next node index (next).&lt;br /&gt;
&lt;br /&gt;
An invalid node has value: ID = 0, MAC = 0, prev = 0x7FFF, next = 0x7FFF.&lt;br /&gt;
&lt;br /&gt;
The highest bit of these fields has some special meaning and isn&#039;t part of the index value.&lt;br /&gt;
&lt;br /&gt;
==Checksum==&lt;br /&gt;
&lt;br /&gt;
The algorithm used to verify the integrity of the database is based on [http://srecord.sourceforge.net/crc16-ccitt.html CRC16-CCITT], though it&#039;s an incorrect implementation. It is the same algorithm used to verify [http://wiibrew.org/wiki/Mii_Data#Block_format Mii Data on the Wii].&lt;br /&gt;
&lt;br /&gt;
To obtain the correct value for the checksum, apply the algorithm to the first 0xC81E bytes of the database. This can be done using [https://gbatemp.net/threads/tutorial-give-your-mii-gold-pants-and-use-it-for-streetpass.379146/page-24#post-6569186 FixCRC]; alternativly a pseudocode implementation of the checksum algorithm is given below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def crc16_CCITTWii(u8[]: data) -&amp;gt; u16:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Calculate a checksum of data using the CRC16-CCITT implementation of the Wii&lt;br /&gt;
&lt;br /&gt;
    This implementation uses 0x0000 as the starting value, which is different&lt;br /&gt;
    from what CRC16-CCITT specifies.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # note: a correct implementation of CRC16-CCITT&lt;br /&gt;
    #       would initialize this to 0xffff&lt;br /&gt;
    u32 crc := 0x0&lt;br /&gt;
&lt;br /&gt;
    for byte in data:&lt;br /&gt;
        # Iterate over every of the 8 bits in byte.&lt;br /&gt;
        # Begin with the most significant bit. (7, 6, ... , 1, 0)&lt;br /&gt;
        for bit in 7..0:&lt;br /&gt;
            # &amp;amp; - binary `and&#039;; &amp;lt;&amp;lt;/&amp;gt;&amp;gt; - bitshift left/right; ^ - binary `xor&#039;&lt;br /&gt;
            crc := (&lt;br /&gt;
                     (crc &amp;lt;&amp;lt; 1) | ((byte &amp;gt;&amp;gt; bit) &amp;amp; 0x1)&lt;br /&gt;
                     ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
                   )&lt;br /&gt;
&lt;br /&gt;
    for _ in 0..15:&lt;br /&gt;
        crc := (crc &amp;lt;&amp;lt; 1) ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
&lt;br /&gt;
    # only return the lowest 16 bit of crc&lt;br /&gt;
    return (u16) (crc &amp;amp; 0xffff)&lt;br /&gt;
&lt;br /&gt;
checksum := crc16_CCITTWii(miidb[0:0xc81e]) # checksum over the first 0xc81e bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mii format==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii Version - Always 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: allow copying&amp;lt;br/&amp;gt;bit 1: profanity flag (whether in Mii name or creator name does not matter)&amp;lt;br/&amp;gt;bit 2-3: region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)&amp;lt;br/&amp;gt;bit4-5:character set(0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii position shown on the selection screen&amp;lt;br/&amp;gt;bit 0-3: page index &amp;lt;br/&amp;gt;bit 4-7: slot index&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: ?&amp;lt;br/&amp;gt;bit 4-6: Device Mii was originally made on (1=Wii, 2=DS, 3=3DS, 4=Wii U/Switch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| System ID (identifies owner, for purpose of enforcing editing restrictions and blue pants).&amp;lt;br/&amp;gt;Is not tied to the MAC address anymore.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii ID (big-endian 32bit unsigned integer):&amp;lt;br/&amp;gt;Bit 0..27: (bit[0..27] * 2) = date of creation (seconds since 01/01/2010 00:00:00)&amp;lt;br/&amp;gt;Bit 28: Always set?&amp;lt;br/&amp;gt;Bit 29: set for temporary Mii&amp;lt;br/&amp;gt;Bit 30: Set for DSi mii?&amp;lt;br/&amp;gt;Bit 31: not set iff Mii is special&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x6&lt;br /&gt;
| Creator&#039;s full MAC&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding (0000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: sex (0 if male, 1 if female)&amp;lt;br/&amp;gt;bit 1-4: birthday month&amp;lt;br/&amp;gt;bit 5-9: birthday day&amp;lt;br/&amp;gt;bit 10-13: favorite color&amp;lt;br/&amp;gt;bit 14: favorite mii (0 if false, 1 if true)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Mii Name (10 chars max, 0000 terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 0x2&lt;br /&gt;
| width &amp;amp; height&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: disable sharing&amp;lt;br/&amp;gt;bit 1-4: face shape&amp;lt;br/&amp;gt;bit 5-7: skin color&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: wrinkles&amp;lt;br/&amp;gt;bit 4-7: makeup&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 0x1&lt;br /&gt;
| hair style&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-2: hair color&amp;lt;br/&amp;gt;bit 3: flip hair&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-5: eye style&amp;lt;br/&amp;gt;bit 6-8: eye color &amp;lt;br/&amp;gt;bit 9-12: eye scale &amp;lt;br/&amp;gt;bit 13-15: eye yscale&amp;lt;br/&amp;gt;bit 16-20: eye rotation&amp;lt;br/&amp;gt;bit 21-24: eye x spacing&amp;lt;br/&amp;gt;bit 25-29: eye y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-4: eyebrow style&amp;lt;br/&amp;gt;bit 5-7: eyebrow color &amp;lt;br/&amp;gt;bit 8-11: eyebrow scale&amp;lt;br/&amp;gt;bit 12-14: eyebrow yscale &amp;lt;br/&amp;gt;bit 16-19: eyebrow rotation&amp;lt;br/&amp;gt;bit 21-24: eyebrow x spacing&amp;lt;br/&amp;gt;bit 25-29: eyebrow y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: nose style&amp;lt;br/&amp;gt;bit 5-8: nose scale&amp;lt;br/&amp;gt;bit 9-13: nose y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-5: mouth style&amp;lt;br/&amp;gt;bit 6-8: mouth color&amp;lt;br/&amp;gt;bit 9-12: mouth scale&amp;lt;br/&amp;gt;bit 13-15: mouth yscale&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: mouth y position&amp;lt;br/&amp;gt;bit 5-7: mustach style&lt;br /&gt;
|-&lt;br /&gt;
| 0x42&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-2: beard style&amp;lt;br/&amp;gt;bit 3-5: beard color&amp;lt;br/&amp;gt;bit 6-9: mustache scale&amp;lt;br/&amp;gt;bit 10-14:mustache y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-3: glasses style&amp;lt;br/&amp;gt;bit 4-6: glasses color&amp;lt;br/&amp;gt;bit 7-10: glasses scale&amp;lt;br/&amp;gt;bit 11-15: glasses y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x46&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: enable mole&amp;lt;br/&amp;gt;bit 1-4: mole scale&amp;lt;br/&amp;gt;bit 5-9: mole x position&amp;lt;br/&amp;gt;bit 10-14: mole y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Author Name (10 chars max, 0000 terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Mii categories (pants colors)==&lt;br /&gt;
&lt;br /&gt;
====Special (gold) Miis====&lt;br /&gt;
Specialness will override any other pants color.&lt;br /&gt;
&lt;br /&gt;
A special Mii cannot have sharing on or else it will be deemed invalid.&lt;br /&gt;
&lt;br /&gt;
Zeroed system-id and timestamp?&lt;br /&gt;
&lt;br /&gt;
====Imported (blue) Miis====&lt;br /&gt;
Any (non-gold) Mii with a different System ID will appear as a foreign one.&lt;br /&gt;
&lt;br /&gt;
There is also a range of Mii IDs that are always foreign and uneditable, regardless of the System ID:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Regular (black/red) Miis====&lt;br /&gt;
Always editable, since they can only appear as such on the console that created them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Personal (red) Mii====&lt;br /&gt;
A red Mii that happens to be the first in the file!&lt;br /&gt;
&lt;br /&gt;
The Mii doesn&#039;t really need to be red, it is only red because the personal Mii is always favorited.&lt;br /&gt;
&lt;br /&gt;
==Mii values==&lt;br /&gt;
Each of the following values were found with NTR Debugger:&lt;br /&gt;
If you want to access the value, grab the given &amp;quot;NTR address&amp;quot; and add 0x08815000.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Data&lt;br /&gt;
! NTR address&lt;br /&gt;
! Variation (hex)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Face style&lt;br /&gt;
| 0x894&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Face color&lt;br /&gt;
| 0x898&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Wrinkles&lt;br /&gt;
| 0x89C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Makeup&lt;br /&gt;
| 0x8A0&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Hair style&lt;br /&gt;
| 0x8A4&lt;br /&gt;
| 00-84&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Hair color&lt;br /&gt;
| 0x8A8&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Hair flipped&lt;br /&gt;
| 0x8AC&lt;br /&gt;
| 1 if true&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eye style&lt;br /&gt;
| 0x8B0&lt;br /&gt;
| 00-3C&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyes color&lt;br /&gt;
| 0x8B4&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyes size&lt;br /&gt;
| 0x8B8&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes thickness&lt;br /&gt;
| 0x8BC&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes rotation&lt;br /&gt;
| 0x8C0&lt;br /&gt;
| 00-07&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes spacing&lt;br /&gt;
| 0x8C4&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes height&lt;br /&gt;
| 0x8C8&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows style&lt;br /&gt;
| 0x8CC&lt;br /&gt;
| 00-18&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows color&lt;br /&gt;
| 0x8D0&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows size&lt;br /&gt;
| 0x8D4&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows thickness&lt;br /&gt;
| 0x8D8&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows rotation&lt;br /&gt;
| 0x8DC&lt;br /&gt;
| 00-0B&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows spacing&lt;br /&gt;
| 0x8E0&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows height&lt;br /&gt;
| 0x8E4&lt;br /&gt;
| 03-12&lt;br /&gt;
| Yup, minimum is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| Nose style&lt;br /&gt;
| 0x8E8&lt;br /&gt;
| 00-11&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Nose size&lt;br /&gt;
| 0x8EC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Nose height&lt;br /&gt;
| 0x8F0&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mouth style&lt;br /&gt;
| 0x8F4&lt;br /&gt;
| 00-23&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Mouth color&lt;br /&gt;
| 0x8F8&lt;br /&gt;
| 00-04&lt;br /&gt;
| From top to bottom.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth size&lt;br /&gt;
| 0x8FC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth thickness&lt;br /&gt;
| 0x900&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth height&lt;br /&gt;
| 0x904&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mustache style&lt;br /&gt;
| 0x908&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Beard style&lt;br /&gt;
| 0x90C&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache/Beard color&lt;br /&gt;
| 0x910&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to button.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache size&lt;br /&gt;
| 0x914&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache height&lt;br /&gt;
| 0x918&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Glasses style&lt;br /&gt;
| 0x91C&lt;br /&gt;
| 00-08&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses color&lt;br /&gt;
| 0x920&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Glasses size&lt;br /&gt;
| 0x924&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses height&lt;br /&gt;
| 0x928&lt;br /&gt;
| 00-14&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole enable&lt;br /&gt;
| 0x92C&lt;br /&gt;
| 1 if enabled, 0 else.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole size&lt;br /&gt;
| 0x930&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mole horiz pos&lt;br /&gt;
| 0x934&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole vert pos&lt;br /&gt;
| 0x938&lt;br /&gt;
| 00-1E&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii height&lt;br /&gt;
| 0x93C&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii weight&lt;br /&gt;
| 0x940&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii name&lt;br /&gt;
| 0x944-0x959&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Creator&#039;s name&lt;br /&gt;
| 0x95A-96F&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Mii gender&lt;br /&gt;
| 0x970&lt;br /&gt;
| 0: Male, 1: Female&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate month&lt;br /&gt;
| 0x974&lt;br /&gt;
| 01-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate day&lt;br /&gt;
| 0x978&lt;br /&gt;
| 01-1F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii shirt color&lt;br /&gt;
| 0x97C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Ordered like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Favorite&lt;br /&gt;
| 0x980&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow copy&lt;br /&gt;
| 0x981&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Unused byte?&lt;br /&gt;
| 0x982&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow sharing&lt;br /&gt;
| 0x983&lt;br /&gt;
| 0: true, 1: false&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x984-0x98F&lt;br /&gt;
| All zero?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x990-0x997&lt;br /&gt;
| 4?&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
0x08815998: Same 4 bytes as encrypted Mii: first 4 bits for Mii type, 4 next for number of seconds since 01/01/2010 00:00:00 UTC+3 (should be verified by other country and region 3DS) divided by 2.&lt;br /&gt;
0x0881599C: 6 bytes of MAC address of the 3DS that created the Mii.&lt;br /&gt;
0x088159A2: 6 unknow uses bytes&lt;br /&gt;
0x088159A8: Same 8 bytes as decrypted Mii at 0x04 through 0x0B. Seems NAND specific, kept the same on Miis created on same NAND but different 3DS via System Transfer. Might be a coincidence but the two first bytes are in ID0 folder name in the Nintendo 3DS folder.&lt;br /&gt;
&lt;br /&gt;
===Mapped Editor &amp;lt;-&amp;gt; Hex values===&lt;br /&gt;
&lt;br /&gt;
Most of the values are ordered (left button decreases, right increases, color choices are top to bottom...) but for most &amp;quot;main&amp;quot; part of the UI, where you choose the style of the part being edited, hex values has no correlation with displayed order.&lt;br /&gt;
Here is a JSON that can go from a Part, a Page and Position to the right hex value. This is 0 indexed (eg: datas[&amp;quot;face&amp;quot;][0][11]).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{&lt;br /&gt;
face: [&lt;br /&gt;
    0x00,0x01,0x08,&lt;br /&gt;
    0x02,0x03,0x09,&lt;br /&gt;
    0x04,0x05,0x0a,&lt;br /&gt;
    0x06,0x07,0x0b&lt;br /&gt;
],&lt;br /&gt;
hairs: [&lt;br /&gt;
    [0x21,0x2f,0x28,&lt;br /&gt;
    0x25,0x20,0x6b,&lt;br /&gt;
    0x30,0x33,0x37,&lt;br /&gt;
    0x46,0x2c,0x42],&lt;br /&gt;
    [0x34,0x32,0x26,&lt;br /&gt;
    0x31,0x2b,0x1f,&lt;br /&gt;
    0x38,0x44,0x3e,&lt;br /&gt;
    0x73,0x4c,0x77],&lt;br /&gt;
    [0x40,0x51,0x74,&lt;br /&gt;
    0x79,0x16,0x3a,&lt;br /&gt;
    0x3c,0x57,0x7d,&lt;br /&gt;
    0x75,0x49,0x4b],&lt;br /&gt;
    [0x2a,0x59,0x39,&lt;br /&gt;
    0x36,0x50,0x22,&lt;br /&gt;
    0x17,0x56,0x58,&lt;br /&gt;
    0x76,0x27,0x24],&lt;br /&gt;
    [0x2d,0x43,0x3b,&lt;br /&gt;
    0x41,0x29,0x1e,&lt;br /&gt;
    0x0c,0x10,0x0a,&lt;br /&gt;
    0x52,0x80,0x81],&lt;br /&gt;
    [0x0e,0x5f,0x69,&lt;br /&gt;
    0x64,0x06,0x14,&lt;br /&gt;
    0x5d,0x66,0x1b,&lt;br /&gt;
    0x04,0x11,0x6e]&lt;br /&gt;
    [0x7b,0x08,0x6a,&lt;br /&gt;
    0x48,0x03,0x15,&lt;br /&gt;
    0x00,0x62,0x3f,&lt;br /&gt;
    0x5a,0x0b,0x78],&lt;br /&gt;
    [0x05,0x4a,0x6c,&lt;br /&gt;
    0x5e,0x7c,0x19,&lt;br /&gt;
    0x63,0x45,0x23,&lt;br /&gt;
    0x0d,0x7a,0x71],&lt;br /&gt;
    [0x35,0x18,0x55,&lt;br /&gt;
    0x53,0x47,0x83,&lt;br /&gt;
    0x60,0x65,0x1d,&lt;br /&gt;
    0x07,0x0f,0x70],&lt;br /&gt;
    [0x4f,0x01,0x6d,&lt;br /&gt;
    0x7f,0x5b,0x1a,&lt;br /&gt;
    0x3d,0x67,0x02,&lt;br /&gt;
    0x4d,0x12,0x5c],&lt;br /&gt;
    [0x54,0x09,0x13,&lt;br /&gt;
    0x82,0x61,0x68,&lt;br /&gt;
    0x2e,0x4e,0x1c,&lt;br /&gt;
    0x72,0x7e,0x6f]&lt;br /&gt;
],&lt;br /&gt;
eyebrows: [&lt;br /&gt;
    [0x06,0x00,0x0c,&lt;br /&gt;
    0x01,0x09,0x13,&lt;br /&gt;
    0x07,0x15,0x08,&lt;br /&gt;
    0x11,0x05,0x04],&lt;br /&gt;
    [0x0b,0x0a,0x02,&lt;br /&gt;
    0x03,0x0e,0x14,&lt;br /&gt;
    0x0f,0x0d,0x16,&lt;br /&gt;
    0x12,0x10,0x17]&lt;br /&gt;
],&lt;br /&gt;
eyes: [&lt;br /&gt;
    [0x02,0x04,0x00,&lt;br /&gt;
    0x08,0x27,0x11,&lt;br /&gt;
    0x01,0x1a,0x10,&lt;br /&gt;
    0x0f,0x1b,0x14],&lt;br /&gt;
    [0x21,0x0b,0x13,&lt;br /&gt;
    0x20,0x09,0x0c,&lt;br /&gt;
    0x17,0x22,0x15,&lt;br /&gt;
    0x19,0x28,0x23],&lt;br /&gt;
    [0x05,0x29,0x0d,&lt;br /&gt;
    0x24,0x25,0x06,&lt;br /&gt;
    0x18,0x1e,0x1f,&lt;br /&gt;
    0x12,0x1c,0x2e],&lt;br /&gt;
    [0x07,0x2c,0x26,&lt;br /&gt;
    0x2a,0x2d,0x1d,&lt;br /&gt;
    0x03,0x2b,0x16,&lt;br /&gt;
    0x0a,0x0e,0x2f],&lt;br /&gt;
    [0x30,0x31,0x32,&lt;br /&gt;
    0x35,0x3b,0x38,&lt;br /&gt;
    0x36,0x3a,0x39,&lt;br /&gt;
    0x37,0x33,0x34]&lt;br /&gt;
],&lt;br /&gt;
nose: [&lt;br /&gt;
    [0x01,0x0a,0x02,&lt;br /&gt;
    0x03,0x06,0x00,&lt;br /&gt;
    0x05,0x04,0x08,&lt;br /&gt;
    0x09,0x07,0x0B],&lt;br /&gt;
    [0x0d,0x0e,0x0c,&lt;br /&gt;
    0x11,0x10,0x0f]&lt;br /&gt;
],&lt;br /&gt;
mouth: [&lt;br /&gt;
    [0x17,0x01,0x13,&lt;br /&gt;
    0x15,0x16,0x05,&lt;br /&gt;
    0x00,0x08,0x0a,&lt;br /&gt;
    0x10,0x06,0x0d],&lt;br /&gt;
    [0x07,0x09,0x02,&lt;br /&gt;
    0x11,0x03,0x04,&lt;br /&gt;
    0x0f,0x0b,0x14,&lt;br /&gt;
    0x12,0x0e,0x0c],&lt;br /&gt;
    [0x1b,0x1e,0x18,&lt;br /&gt;
    0x19,0x1d,0x1c,&lt;br /&gt;
    0x1a,0x23,0x1f,&lt;br /&gt;
    0x22,0x21,0x20]&lt;br /&gt;
]&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Foofoo the guy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21571</id>
		<title>Mii</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21571"/>
		<updated>2021-08-23T15:51:23Z</updated>

		<summary type="html">&lt;p&gt;Foofoo the guy: /* Personal (red) Mii */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Originally [http://wiibrew.org/wiki/Mii_Data created for the Nintendo Wii] (and backported to a selection of DS/i games), the &#039;&#039;&#039;Mii&#039;&#039;&#039; format was expanded with a larger selection of facial features and a new &amp;quot;copying&amp;quot; permission for the 3DS family, and later implemented as-is on Wii U.&lt;br /&gt;
&lt;br /&gt;
See [[Mii Maker]] for the application chiefly designed to create, edit, delete, and trade Miis or convert them from and to a QR code.&lt;br /&gt;
&lt;br /&gt;
The default endianness in this page is little-endian, unless explicitly specified.&lt;br /&gt;
&lt;br /&gt;
==Mii Database==&lt;br /&gt;
Format of the Mii main database &#039;&#039;&#039;CFL_DB.dat&#039;&#039;&#039;, found in [[Extdata#NAND_Shared_Extdata|shared extdata]] archive f0000000b.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFOG&amp;quot; (Mii Maker section)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x23F0 (100 * 0x5C)&lt;br /&gt;
| Array of owned (saved in Mii Maker) Miis. Order in file is unrelated to canonical order in-app.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFHE&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FC&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list tail index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list head index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x2400&lt;br /&gt;
| 0xA410 (3000 * 0xE)&lt;br /&gt;
| Linked list of objects? See chapter&lt;br /&gt;
|-&lt;br /&gt;
| 0xC810&lt;br /&gt;
| 0xE&lt;br /&gt;
| Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81E&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum of all of the above (the first 0xC81E byte). See section [[#Checksum|below]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC820&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFRA&amp;quot; (Invitations section)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC824&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii count in this section. Maximum 100&lt;br /&gt;
|-&lt;br /&gt;
| 0xC828&lt;br /&gt;
| 0x64 (100 * 0x1)&lt;br /&gt;
| Order index of Mii in this section?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC88C&lt;br /&gt;
| 0x1C20 (100 * 0x48)&lt;br /&gt;
| Array of Miis contributed from games, used for Mii Plaza &amp;quot;invitations&amp;quot; feature.&amp;lt;br/&amp;gt;The format isn&#039;t that of a full Mii. The &amp;quot;author&amp;quot; field is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4AC&lt;br /&gt;
| 0x12&lt;br /&gt;
| 01 00 [..] 00&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4BE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum over the data above starting from 0xC820&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4C0&lt;br /&gt;
| 0x3D860 (3000 * 0x54)&lt;br /&gt;
| Another array of Miis. Seems related to the CFHE section. &amp;lt;br/&amp;gt;The Mii format in this section is modified. The &amp;quot;author&amp;quot; field is missing, A 4-byte timestamp (seconds since 2000) together with 8-byte zeros(?) is appended at the end.&lt;br /&gt;
|}&lt;br /&gt;
When encrypted in QR codes, 4 additional bytes are added. Two null bytes and a CRC-16. It&#039;s the exact same CRC-16 as for the Wii blocks on the 0x5e first bytes. It seems that the CRC is ignored, the Mii Maker expecting the result of APT:Unwrap to detect integrity loss.&lt;br /&gt;
&lt;br /&gt;
==CFHE object==&lt;br /&gt;
&lt;br /&gt;
A 0xE-byte long linked list node. The format is 4-byte Mii ID (See Mii format) + 6-byte MAC + 2-byte previous node index (prev) + 2-byte next node index (next).&lt;br /&gt;
&lt;br /&gt;
An invalid node has value: ID = 0, MAC = 0, prev = 0x7FFF, next = 0x7FFF.&lt;br /&gt;
&lt;br /&gt;
The highest bit of these fields has some special meaning and isn&#039;t part of the index value.&lt;br /&gt;
&lt;br /&gt;
==Checksum==&lt;br /&gt;
&lt;br /&gt;
The algorithm used to verify the integrity of the database is based on [http://srecord.sourceforge.net/crc16-ccitt.html CRC16-CCITT], though it&#039;s an incorrect implementation. It is the same algorithm used to verify [http://wiibrew.org/wiki/Mii_Data#Block_format Mii Data on the Wii].&lt;br /&gt;
&lt;br /&gt;
To obtain the correct value for the checksum, apply the algorithm to the first 0xC81E bytes of the database. This can be done using [https://gbatemp.net/threads/tutorial-give-your-mii-gold-pants-and-use-it-for-streetpass.379146/page-24#post-6569186 FixCRC]; alternativly a pseudocode implementation of the checksum algorithm is given below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def crc16_CCITTWii(u8[]: data) -&amp;gt; u16:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Calculate a checksum of data using the CRC16-CCITT implementation of the Wii&lt;br /&gt;
&lt;br /&gt;
    This implementation uses 0x0000 as the starting value, which is different&lt;br /&gt;
    from what CRC16-CCITT specifies.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # note: a correct implementation of CRC16-CCITT&lt;br /&gt;
    #       would initialize this to 0xffff&lt;br /&gt;
    u32 crc := 0x0&lt;br /&gt;
&lt;br /&gt;
    for byte in data:&lt;br /&gt;
        # Iterate over every of the 8 bits in byte.&lt;br /&gt;
        # Begin with the most significant bit. (7, 6, ... , 1, 0)&lt;br /&gt;
        for bit in 7..0:&lt;br /&gt;
            # &amp;amp; - binary `and&#039;; &amp;lt;&amp;lt;/&amp;gt;&amp;gt; - bitshift left/right; ^ - binary `xor&#039;&lt;br /&gt;
            crc := (&lt;br /&gt;
                     (crc &amp;lt;&amp;lt; 1) | ((byte &amp;gt;&amp;gt; bit) &amp;amp; 0x1)&lt;br /&gt;
                     ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
                   )&lt;br /&gt;
&lt;br /&gt;
    for _ in 0..15:&lt;br /&gt;
        crc := (crc &amp;lt;&amp;lt; 1) ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
&lt;br /&gt;
    # only return the lowest 16 bit of crc&lt;br /&gt;
    return (u16) (crc &amp;amp; 0xffff)&lt;br /&gt;
&lt;br /&gt;
checksum := crc16_CCITTWii(miidb[0:0xc81e]) # checksum over the first 0xc81e bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mii format==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii Version - Always 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: allow copying&amp;lt;br/&amp;gt;bit 1: profanity flag (whether in Mii name or creator name does not matter)&amp;lt;br/&amp;gt;bit 2-3: region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)&amp;lt;br/&amp;gt;bit4-5:character set(0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii position shown on the selection screen&amp;lt;br/&amp;gt;bit 0-3: page index &amp;lt;br/&amp;gt;bit 4-7: slot index&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: ?&amp;lt;br/&amp;gt;bit 4-6: Device Mii was originally made on (1=Wii, 2=DS, 3=3DS, 4=Wii U/Switch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| System ID (identifies owner, for purpose of enforcing editing restrictions and blue pants).&amp;lt;br/&amp;gt;Is not tied to the MAC address anymore.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii ID (big-endian 32bit unsigned integer):&amp;lt;br/&amp;gt;Bit 0..27: (bit[0..27] * 2) = date of creation (seconds since 01/01/2010 00:00:00)&amp;lt;br/&amp;gt;Bit 28: Always set?&amp;lt;br/&amp;gt;Bit 29: set for temporary Mii&amp;lt;br/&amp;gt;Bit 30: Set for DSi mii?&amp;lt;br/&amp;gt;Bit 31: not set iff Mii is special&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x6&lt;br /&gt;
| Creator&#039;s full MAC&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding (0000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: sex (0 if male, 1 if female)&amp;lt;br/&amp;gt;bit 1-4: birthday month&amp;lt;br/&amp;gt;bit 5-9: birthday day&amp;lt;br/&amp;gt;bit 10-13: favorite color&amp;lt;br/&amp;gt;bit 14: favorite mii (0 if false, 1 if true)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Mii Name (10 chars max, 0000 terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 0x2&lt;br /&gt;
| width &amp;amp; height&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: disable sharing&amp;lt;br/&amp;gt;bit 1-4: face shape&amp;lt;br/&amp;gt;bit 5-7: skin color&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: wrinkles&amp;lt;br/&amp;gt;bit 4-7: makeup&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 0x1&lt;br /&gt;
| hair style&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-2: hair color&amp;lt;br/&amp;gt;bit 3: flip hair&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-5: eye style&amp;lt;br/&amp;gt;bit 6-8: eye color &amp;lt;br/&amp;gt;bit 9-12: eye scale &amp;lt;br/&amp;gt;bit 13-15: eye yscale&amp;lt;br/&amp;gt;bit 16-20: eye rotation&amp;lt;br/&amp;gt;bit 21-24: eye x spacing&amp;lt;br/&amp;gt;bit 25-29: eye y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-4: eyebrow style&amp;lt;br/&amp;gt;bit 5-7: eyebrow color &amp;lt;br/&amp;gt;bit 8-11: eyebrow scale&amp;lt;br/&amp;gt;bit 12-14: eyebrow yscale &amp;lt;br/&amp;gt;bit 16-19: eyebrow rotation&amp;lt;br/&amp;gt;bit 21-24: eyebrow x spacing&amp;lt;br/&amp;gt;bit 25-29: eyebrow y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: nose style&amp;lt;br/&amp;gt;bit 5-8: nose scale&amp;lt;br/&amp;gt;bit 9-13: nose y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-5: mouth style&amp;lt;br/&amp;gt;bit 6-8: mouth color&amp;lt;br/&amp;gt;bit 9-12: mouth scale&amp;lt;br/&amp;gt;bit 13-15: mouth yscale&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: mouth y position&amp;lt;br/&amp;gt;bit 5-7: mustach style&lt;br /&gt;
|-&lt;br /&gt;
| 0x42&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-2: beard style&amp;lt;br/&amp;gt;bit 3-5: beard color&amp;lt;br/&amp;gt;bit 6-9: mustache scale&amp;lt;br/&amp;gt;bit 10-14:mustache y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-3: glasses style&amp;lt;br/&amp;gt;bit 4-6: glasses color&amp;lt;br/&amp;gt;bit 7-10: glasses scale&amp;lt;br/&amp;gt;bit 11-15: glasses y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x46&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: enable mole&amp;lt;br/&amp;gt;bit 1-4: mole scale&amp;lt;br/&amp;gt;bit 5-9: mole x position&amp;lt;br/&amp;gt;bit 10-14: mole y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Author Name (10 chars max, 0000 terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Mii categories (pants colors)==&lt;br /&gt;
&lt;br /&gt;
====Special (gold) Miis====&lt;br /&gt;
Specialness will override any other pants color.&lt;br /&gt;
&lt;br /&gt;
A special Mii cannot have sharing on or else it will be deemed invalid.&lt;br /&gt;
&lt;br /&gt;
Zeroed system-id and timestamp?&lt;br /&gt;
&lt;br /&gt;
====Imported (blue) Miis====&lt;br /&gt;
Any (non-gold) Mii with a different System ID will appear as a foreign one.&lt;br /&gt;
&lt;br /&gt;
There is also a range of Mii IDs that are always foreign and uneditable, regardless of the System ID:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Regular (black/red) Miis====&lt;br /&gt;
Always editable, since they can only appear as such on the console that created them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Personal (red) Mii====&lt;br /&gt;
A red Mii that happens to be the first in the file!&lt;br /&gt;
&lt;br /&gt;
The Mii doesn&#039;t really need to be red, it is only red because the personal Mii is always favorite&lt;br /&gt;
&lt;br /&gt;
==Mii values==&lt;br /&gt;
Each of the following values were found with NTR Debugger:&lt;br /&gt;
If you want to access the value, grab the given &amp;quot;NTR address&amp;quot; and add 0x08815000.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Data&lt;br /&gt;
! NTR address&lt;br /&gt;
! Variation (hex)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Face style&lt;br /&gt;
| 0x894&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Face color&lt;br /&gt;
| 0x898&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Wrinkles&lt;br /&gt;
| 0x89C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Makeup&lt;br /&gt;
| 0x8A0&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Hair style&lt;br /&gt;
| 0x8A4&lt;br /&gt;
| 00-84&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Hair color&lt;br /&gt;
| 0x8A8&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Hair flipped&lt;br /&gt;
| 0x8AC&lt;br /&gt;
| 1 if true&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eye style&lt;br /&gt;
| 0x8B0&lt;br /&gt;
| 00-3C&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyes color&lt;br /&gt;
| 0x8B4&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyes size&lt;br /&gt;
| 0x8B8&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes thickness&lt;br /&gt;
| 0x8BC&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes rotation&lt;br /&gt;
| 0x8C0&lt;br /&gt;
| 00-07&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes spacing&lt;br /&gt;
| 0x8C4&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes height&lt;br /&gt;
| 0x8C8&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows style&lt;br /&gt;
| 0x8CC&lt;br /&gt;
| 00-18&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows color&lt;br /&gt;
| 0x8D0&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows size&lt;br /&gt;
| 0x8D4&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows thickness&lt;br /&gt;
| 0x8D8&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows rotation&lt;br /&gt;
| 0x8DC&lt;br /&gt;
| 00-0B&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows spacing&lt;br /&gt;
| 0x8E0&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows height&lt;br /&gt;
| 0x8E4&lt;br /&gt;
| 03-12&lt;br /&gt;
| Yup, minimum is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| Nose style&lt;br /&gt;
| 0x8E8&lt;br /&gt;
| 00-11&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Nose size&lt;br /&gt;
| 0x8EC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Nose height&lt;br /&gt;
| 0x8F0&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mouth style&lt;br /&gt;
| 0x8F4&lt;br /&gt;
| 00-23&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Mouth color&lt;br /&gt;
| 0x8F8&lt;br /&gt;
| 00-04&lt;br /&gt;
| From top to bottom.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth size&lt;br /&gt;
| 0x8FC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth thickness&lt;br /&gt;
| 0x900&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth height&lt;br /&gt;
| 0x904&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mustache style&lt;br /&gt;
| 0x908&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Beard style&lt;br /&gt;
| 0x90C&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache/Beard color&lt;br /&gt;
| 0x910&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to button.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache size&lt;br /&gt;
| 0x914&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache height&lt;br /&gt;
| 0x918&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Glasses style&lt;br /&gt;
| 0x91C&lt;br /&gt;
| 00-08&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses color&lt;br /&gt;
| 0x920&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Glasses size&lt;br /&gt;
| 0x924&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses height&lt;br /&gt;
| 0x928&lt;br /&gt;
| 00-14&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole enable&lt;br /&gt;
| 0x92C&lt;br /&gt;
| 1 if enabled, 0 else.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole size&lt;br /&gt;
| 0x930&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mole horiz pos&lt;br /&gt;
| 0x934&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole vert pos&lt;br /&gt;
| 0x938&lt;br /&gt;
| 00-1E&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii height&lt;br /&gt;
| 0x93C&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii weight&lt;br /&gt;
| 0x940&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii name&lt;br /&gt;
| 0x944-0x959&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Creator&#039;s name&lt;br /&gt;
| 0x95A-96F&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Mii gender&lt;br /&gt;
| 0x970&lt;br /&gt;
| 0: Male, 1: Female&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate month&lt;br /&gt;
| 0x974&lt;br /&gt;
| 01-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate day&lt;br /&gt;
| 0x978&lt;br /&gt;
| 01-1F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii shirt color&lt;br /&gt;
| 0x97C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Ordered like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Favorite&lt;br /&gt;
| 0x980&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow copy&lt;br /&gt;
| 0x981&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Unused byte?&lt;br /&gt;
| 0x982&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow sharing&lt;br /&gt;
| 0x983&lt;br /&gt;
| 0: true, 1: false&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x984-0x98F&lt;br /&gt;
| All zero?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x990-0x997&lt;br /&gt;
| 4?&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
0x08815998: Same 4 bytes as encrypted Mii: first 4 bits for Mii type, 4 next for number of seconds since 01/01/2010 00:00:00 UTC+3 (should be verified by other country and region 3DS) divided by 2.&lt;br /&gt;
0x0881599C: 6 bytes of MAC address of the 3DS that created the Mii.&lt;br /&gt;
0x088159A2: 6 unknow uses bytes&lt;br /&gt;
0x088159A8: Same 8 bytes as decrypted Mii at 0x04 through 0x0B. Seems NAND specific, kept the same on Miis created on same NAND but different 3DS via System Transfer. Might be a coincidence but the two first bytes are in ID0 folder name in the Nintendo 3DS folder.&lt;br /&gt;
&lt;br /&gt;
===Mapped Editor &amp;lt;-&amp;gt; Hex values===&lt;br /&gt;
&lt;br /&gt;
Most of the values are ordered (left button decreases, right increases, color choices are top to bottom...) but for most &amp;quot;main&amp;quot; part of the UI, where you choose the style of the part being edited, hex values has no correlation with displayed order.&lt;br /&gt;
Here is a JSON that can go from a Part, a Page and Position to the right hex value. This is 0 indexed (eg: datas[&amp;quot;face&amp;quot;][0][11]).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{&lt;br /&gt;
face: [&lt;br /&gt;
    0x00,0x01,0x08,&lt;br /&gt;
    0x02,0x03,0x09,&lt;br /&gt;
    0x04,0x05,0x0a,&lt;br /&gt;
    0x06,0x07,0x0b&lt;br /&gt;
],&lt;br /&gt;
hairs: [&lt;br /&gt;
    [0x21,0x2f,0x28,&lt;br /&gt;
    0x25,0x20,0x6b,&lt;br /&gt;
    0x30,0x33,0x37,&lt;br /&gt;
    0x46,0x2c,0x42],&lt;br /&gt;
    [0x34,0x32,0x26,&lt;br /&gt;
    0x31,0x2b,0x1f,&lt;br /&gt;
    0x38,0x44,0x3e,&lt;br /&gt;
    0x73,0x4c,0x77],&lt;br /&gt;
    [0x40,0x51,0x74,&lt;br /&gt;
    0x79,0x16,0x3a,&lt;br /&gt;
    0x3c,0x57,0x7d,&lt;br /&gt;
    0x75,0x49,0x4b],&lt;br /&gt;
    [0x2a,0x59,0x39,&lt;br /&gt;
    0x36,0x50,0x22,&lt;br /&gt;
    0x17,0x56,0x58,&lt;br /&gt;
    0x76,0x27,0x24],&lt;br /&gt;
    [0x2d,0x43,0x3b,&lt;br /&gt;
    0x41,0x29,0x1e,&lt;br /&gt;
    0x0c,0x10,0x0a,&lt;br /&gt;
    0x52,0x80,0x81],&lt;br /&gt;
    [0x0e,0x5f,0x69,&lt;br /&gt;
    0x64,0x06,0x14,&lt;br /&gt;
    0x5d,0x66,0x1b,&lt;br /&gt;
    0x04,0x11,0x6e]&lt;br /&gt;
    [0x7b,0x08,0x6a,&lt;br /&gt;
    0x48,0x03,0x15,&lt;br /&gt;
    0x00,0x62,0x3f,&lt;br /&gt;
    0x5a,0x0b,0x78],&lt;br /&gt;
    [0x05,0x4a,0x6c,&lt;br /&gt;
    0x5e,0x7c,0x19,&lt;br /&gt;
    0x63,0x45,0x23,&lt;br /&gt;
    0x0d,0x7a,0x71],&lt;br /&gt;
    [0x35,0x18,0x55,&lt;br /&gt;
    0x53,0x47,0x83,&lt;br /&gt;
    0x60,0x65,0x1d,&lt;br /&gt;
    0x07,0x0f,0x70],&lt;br /&gt;
    [0x4f,0x01,0x6d,&lt;br /&gt;
    0x7f,0x5b,0x1a,&lt;br /&gt;
    0x3d,0x67,0x02,&lt;br /&gt;
    0x4d,0x12,0x5c],&lt;br /&gt;
    [0x54,0x09,0x13,&lt;br /&gt;
    0x82,0x61,0x68,&lt;br /&gt;
    0x2e,0x4e,0x1c,&lt;br /&gt;
    0x72,0x7e,0x6f]&lt;br /&gt;
],&lt;br /&gt;
eyebrows: [&lt;br /&gt;
    [0x06,0x00,0x0c,&lt;br /&gt;
    0x01,0x09,0x13,&lt;br /&gt;
    0x07,0x15,0x08,&lt;br /&gt;
    0x11,0x05,0x04],&lt;br /&gt;
    [0x0b,0x0a,0x02,&lt;br /&gt;
    0x03,0x0e,0x14,&lt;br /&gt;
    0x0f,0x0d,0x16,&lt;br /&gt;
    0x12,0x10,0x17]&lt;br /&gt;
],&lt;br /&gt;
eyes: [&lt;br /&gt;
    [0x02,0x04,0x00,&lt;br /&gt;
    0x08,0x27,0x11,&lt;br /&gt;
    0x01,0x1a,0x10,&lt;br /&gt;
    0x0f,0x1b,0x14],&lt;br /&gt;
    [0x21,0x0b,0x13,&lt;br /&gt;
    0x20,0x09,0x0c,&lt;br /&gt;
    0x17,0x22,0x15,&lt;br /&gt;
    0x19,0x28,0x23],&lt;br /&gt;
    [0x05,0x29,0x0d,&lt;br /&gt;
    0x24,0x25,0x06,&lt;br /&gt;
    0x18,0x1e,0x1f,&lt;br /&gt;
    0x12,0x1c,0x2e],&lt;br /&gt;
    [0x07,0x2c,0x26,&lt;br /&gt;
    0x2a,0x2d,0x1d,&lt;br /&gt;
    0x03,0x2b,0x16,&lt;br /&gt;
    0x0a,0x0e,0x2f],&lt;br /&gt;
    [0x30,0x31,0x32,&lt;br /&gt;
    0x35,0x3b,0x38,&lt;br /&gt;
    0x36,0x3a,0x39,&lt;br /&gt;
    0x37,0x33,0x34]&lt;br /&gt;
],&lt;br /&gt;
nose: [&lt;br /&gt;
    [0x01,0x0a,0x02,&lt;br /&gt;
    0x03,0x06,0x00,&lt;br /&gt;
    0x05,0x04,0x08,&lt;br /&gt;
    0x09,0x07,0x0B],&lt;br /&gt;
    [0x0d,0x0e,0x0c,&lt;br /&gt;
    0x11,0x10,0x0f]&lt;br /&gt;
],&lt;br /&gt;
mouth: [&lt;br /&gt;
    [0x17,0x01,0x13,&lt;br /&gt;
    0x15,0x16,0x05,&lt;br /&gt;
    0x00,0x08,0x0a,&lt;br /&gt;
    0x10,0x06,0x0d],&lt;br /&gt;
    [0x07,0x09,0x02,&lt;br /&gt;
    0x11,0x03,0x04,&lt;br /&gt;
    0x0f,0x0b,0x14,&lt;br /&gt;
    0x12,0x0e,0x0c],&lt;br /&gt;
    [0x1b,0x1e,0x18,&lt;br /&gt;
    0x19,0x1d,0x1c,&lt;br /&gt;
    0x1a,0x23,0x1f,&lt;br /&gt;
    0x22,0x21,0x20]&lt;br /&gt;
]&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Foofoo the guy</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21570</id>
		<title>Mii</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mii&amp;diff=21570"/>
		<updated>2021-08-23T15:49:06Z</updated>

		<summary type="html">&lt;p&gt;Foofoo the guy: /* Special (gold) Miis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Originally [http://wiibrew.org/wiki/Mii_Data created for the Nintendo Wii] (and backported to a selection of DS/i games), the &#039;&#039;&#039;Mii&#039;&#039;&#039; format was expanded with a larger selection of facial features and a new &amp;quot;copying&amp;quot; permission for the 3DS family, and later implemented as-is on Wii U.&lt;br /&gt;
&lt;br /&gt;
See [[Mii Maker]] for the application chiefly designed to create, edit, delete, and trade Miis or convert them from and to a QR code.&lt;br /&gt;
&lt;br /&gt;
The default endianness in this page is little-endian, unless explicitly specified.&lt;br /&gt;
&lt;br /&gt;
==Mii Database==&lt;br /&gt;
Format of the Mii main database &#039;&#039;&#039;CFL_DB.dat&#039;&#039;&#039;, found in [[Extdata#NAND_Shared_Extdata|shared extdata]] archive f0000000b.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFOG&amp;quot; (Mii Maker section)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x23F0 (100 * 0x5C)&lt;br /&gt;
| Array of owned (saved in Mii Maker) Miis. Order in file is unrelated to canonical order in-app.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFHE&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FC&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list tail index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x23FE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Linked list head index. 0xFFFF if the list is empty&lt;br /&gt;
|-&lt;br /&gt;
| 0x2400&lt;br /&gt;
| 0xA410 (3000 * 0xE)&lt;br /&gt;
| Linked list of objects? See chapter&lt;br /&gt;
|-&lt;br /&gt;
| 0xC810&lt;br /&gt;
| 0xE&lt;br /&gt;
| Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81E&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum of all of the above (the first 0xC81E byte). See section [[#Checksum|below]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC820&lt;br /&gt;
| 0x4&lt;br /&gt;
| Header &amp;quot;CFRA&amp;quot; (Invitations section)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC824&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii count in this section. Maximum 100&lt;br /&gt;
|-&lt;br /&gt;
| 0xC828&lt;br /&gt;
| 0x64 (100 * 0x1)&lt;br /&gt;
| Order index of Mii in this section?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC88C&lt;br /&gt;
| 0x1C20 (100 * 0x48)&lt;br /&gt;
| Array of Miis contributed from games, used for Mii Plaza &amp;quot;invitations&amp;quot; feature.&amp;lt;br/&amp;gt;The format isn&#039;t that of a full Mii. The &amp;quot;author&amp;quot; field is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4AC&lt;br /&gt;
| 0x12&lt;br /&gt;
| 01 00 [..] 00&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4BE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Checksum over the data above starting from 0xC820&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4C0&lt;br /&gt;
| 0x3D860 (3000 * 0x54)&lt;br /&gt;
| Another array of Miis. Seems related to the CFHE section. &amp;lt;br/&amp;gt;The Mii format in this section is modified. The &amp;quot;author&amp;quot; field is missing, A 4-byte timestamp (seconds since 2000) together with 8-byte zeros(?) is appended at the end.&lt;br /&gt;
|}&lt;br /&gt;
When encrypted in QR codes, 4 additional bytes are added. Two null bytes and a CRC-16. It&#039;s the exact same CRC-16 as for the Wii blocks on the 0x5e first bytes. It seems that the CRC is ignored, the Mii Maker expecting the result of APT:Unwrap to detect integrity loss.&lt;br /&gt;
&lt;br /&gt;
==CFHE object==&lt;br /&gt;
&lt;br /&gt;
A 0xE-byte long linked list node. The format is 4-byte Mii ID (See Mii format) + 6-byte MAC + 2-byte previous node index (prev) + 2-byte next node index (next).&lt;br /&gt;
&lt;br /&gt;
An invalid node has value: ID = 0, MAC = 0, prev = 0x7FFF, next = 0x7FFF.&lt;br /&gt;
&lt;br /&gt;
The highest bit of these fields has some special meaning and isn&#039;t part of the index value.&lt;br /&gt;
&lt;br /&gt;
==Checksum==&lt;br /&gt;
&lt;br /&gt;
The algorithm used to verify the integrity of the database is based on [http://srecord.sourceforge.net/crc16-ccitt.html CRC16-CCITT], though it&#039;s an incorrect implementation. It is the same algorithm used to verify [http://wiibrew.org/wiki/Mii_Data#Block_format Mii Data on the Wii].&lt;br /&gt;
&lt;br /&gt;
To obtain the correct value for the checksum, apply the algorithm to the first 0xC81E bytes of the database. This can be done using [https://gbatemp.net/threads/tutorial-give-your-mii-gold-pants-and-use-it-for-streetpass.379146/page-24#post-6569186 FixCRC]; alternativly a pseudocode implementation of the checksum algorithm is given below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def crc16_CCITTWii(u8[]: data) -&amp;gt; u16:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Calculate a checksum of data using the CRC16-CCITT implementation of the Wii&lt;br /&gt;
&lt;br /&gt;
    This implementation uses 0x0000 as the starting value, which is different&lt;br /&gt;
    from what CRC16-CCITT specifies.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # note: a correct implementation of CRC16-CCITT&lt;br /&gt;
    #       would initialize this to 0xffff&lt;br /&gt;
    u32 crc := 0x0&lt;br /&gt;
&lt;br /&gt;
    for byte in data:&lt;br /&gt;
        # Iterate over every of the 8 bits in byte.&lt;br /&gt;
        # Begin with the most significant bit. (7, 6, ... , 1, 0)&lt;br /&gt;
        for bit in 7..0:&lt;br /&gt;
            # &amp;amp; - binary `and&#039;; &amp;lt;&amp;lt;/&amp;gt;&amp;gt; - bitshift left/right; ^ - binary `xor&#039;&lt;br /&gt;
            crc := (&lt;br /&gt;
                     (crc &amp;lt;&amp;lt; 1) | ((byte &amp;gt;&amp;gt; bit) &amp;amp; 0x1)&lt;br /&gt;
                     ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
                   )&lt;br /&gt;
&lt;br /&gt;
    for _ in 0..15:&lt;br /&gt;
        crc := (crc &amp;lt;&amp;lt; 1) ^ (0x1021 if crc &amp;amp; 0x8000 else 0)&lt;br /&gt;
&lt;br /&gt;
    # only return the lowest 16 bit of crc&lt;br /&gt;
    return (u16) (crc &amp;amp; 0xffff)&lt;br /&gt;
&lt;br /&gt;
checksum := crc16_CCITTWii(miidb[0:0xc81e]) # checksum over the first 0xc81e bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mii format==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! &lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii Version - Always 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: allow copying&amp;lt;br/&amp;gt;bit 1: profanity flag (whether in Mii name or creator name does not matter)&amp;lt;br/&amp;gt;bit 2-3: region lock (0=no lock, 1=JPN, 2=USA, 3=EUR)&amp;lt;br/&amp;gt;bit4-5:character set(0=JPN+USA+EUR, 1=CHN, 2=KOR, 3=TWN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mii position shown on the selection screen&amp;lt;br/&amp;gt;bit 0-3: page index &amp;lt;br/&amp;gt;bit 4-7: slot index&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: ?&amp;lt;br/&amp;gt;bit 4-6: Device Mii was originally made on (1=Wii, 2=DS, 3=3DS, 4=Wii U/Switch)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| System ID (identifies owner, for purpose of enforcing editing restrictions and blue pants).&amp;lt;br/&amp;gt;Is not tied to the MAC address anymore.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Mii ID (big-endian 32bit unsigned integer):&amp;lt;br/&amp;gt;Bit 0..27: (bit[0..27] * 2) = date of creation (seconds since 01/01/2010 00:00:00)&amp;lt;br/&amp;gt;Bit 28: Always set?&amp;lt;br/&amp;gt;Bit 29: set for temporary Mii&amp;lt;br/&amp;gt;Bit 30: Set for DSi mii?&amp;lt;br/&amp;gt;Bit 31: not set iff Mii is special&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x6&lt;br /&gt;
| Creator&#039;s full MAC&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding (0000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: sex (0 if male, 1 if female)&amp;lt;br/&amp;gt;bit 1-4: birthday month&amp;lt;br/&amp;gt;bit 5-9: birthday day&amp;lt;br/&amp;gt;bit 10-13: favorite color&amp;lt;br/&amp;gt;bit 14: favorite mii (0 if false, 1 if true)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Mii Name (10 chars max, 0000 terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 0x2&lt;br /&gt;
| width &amp;amp; height&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0: disable sharing&amp;lt;br/&amp;gt;bit 1-4: face shape&amp;lt;br/&amp;gt;bit 5-7: skin color&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-3: wrinkles&amp;lt;br/&amp;gt;bit 4-7: makeup&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 0x1&lt;br /&gt;
| hair style&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 0x1&lt;br /&gt;
| bit 0-2: hair color&amp;lt;br/&amp;gt;bit 3: flip hair&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-5: eye style&amp;lt;br/&amp;gt;bit 6-8: eye color &amp;lt;br/&amp;gt;bit 9-12: eye scale &amp;lt;br/&amp;gt;bit 13-15: eye yscale&amp;lt;br/&amp;gt;bit 16-20: eye rotation&amp;lt;br/&amp;gt;bit 21-24: eye x spacing&amp;lt;br/&amp;gt;bit 25-29: eye y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x4&lt;br /&gt;
| bit 0-4: eyebrow style&amp;lt;br/&amp;gt;bit 5-7: eyebrow color &amp;lt;br/&amp;gt;bit 8-11: eyebrow scale&amp;lt;br/&amp;gt;bit 12-14: eyebrow yscale &amp;lt;br/&amp;gt;bit 16-19: eyebrow rotation&amp;lt;br/&amp;gt;bit 21-24: eyebrow x spacing&amp;lt;br/&amp;gt;bit 25-29: eyebrow y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: nose style&amp;lt;br/&amp;gt;bit 5-8: nose scale&amp;lt;br/&amp;gt;bit 9-13: nose y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-5: mouth style&amp;lt;br/&amp;gt;bit 6-8: mouth color&amp;lt;br/&amp;gt;bit 9-12: mouth scale&amp;lt;br/&amp;gt;bit 13-15: mouth yscale&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-4: mouth y position&amp;lt;br/&amp;gt;bit 5-7: mustach style&lt;br /&gt;
|-&lt;br /&gt;
| 0x42&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-2: beard style&amp;lt;br/&amp;gt;bit 3-5: beard color&amp;lt;br/&amp;gt;bit 6-9: mustache scale&amp;lt;br/&amp;gt;bit 10-14:mustache y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0-3: glasses style&amp;lt;br/&amp;gt;bit 4-6: glasses color&amp;lt;br/&amp;gt;bit 7-10: glasses scale&amp;lt;br/&amp;gt;bit 11-15: glasses y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x46&lt;br /&gt;
| 0x2&lt;br /&gt;
| bit 0: enable mole&amp;lt;br/&amp;gt;bit 1-4: mole scale&amp;lt;br/&amp;gt;bit 5-9: mole x position&amp;lt;br/&amp;gt;bit 10-14: mole y position&lt;br /&gt;
|-&lt;br /&gt;
| 0x48&lt;br /&gt;
| 0x14&lt;br /&gt;
| UTF-16 Author Name (10 chars max, 0000 terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Mii categories (pants colors)==&lt;br /&gt;
&lt;br /&gt;
====Special (gold) Miis====&lt;br /&gt;
Specialness will override any other pants color.&lt;br /&gt;
&lt;br /&gt;
A special Mii cannot have sharing on or else it will be deemed invalid.&lt;br /&gt;
&lt;br /&gt;
Zeroed system-id and timestamp?&lt;br /&gt;
&lt;br /&gt;
====Imported (blue) Miis====&lt;br /&gt;
Any (non-gold) Mii with a different System ID will appear as a foreign one.&lt;br /&gt;
&lt;br /&gt;
There is also a range of Mii IDs that are always foreign and uneditable, regardless of the System ID:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Regular (black/red) Miis====&lt;br /&gt;
Always editable, since they can only appear as such on the console that created them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Personal (red) Mii====&lt;br /&gt;
A red Mii that happens to be the first in the file!&lt;br /&gt;
&lt;br /&gt;
==Mii values==&lt;br /&gt;
Each of the following values were found with NTR Debugger:&lt;br /&gt;
If you want to access the value, grab the given &amp;quot;NTR address&amp;quot; and add 0x08815000.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Data&lt;br /&gt;
! NTR address&lt;br /&gt;
! Variation (hex)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Face style&lt;br /&gt;
| 0x894&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Face color&lt;br /&gt;
| 0x898&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Wrinkles&lt;br /&gt;
| 0x89C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Makeup&lt;br /&gt;
| 0x8A0&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Same order as displayed in editor&lt;br /&gt;
|-&lt;br /&gt;
| Hair style&lt;br /&gt;
| 0x8A4&lt;br /&gt;
| 00-84&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Hair color&lt;br /&gt;
| 0x8A8&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Hair flipped&lt;br /&gt;
| 0x8AC&lt;br /&gt;
| 1 if true&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eye style&lt;br /&gt;
| 0x8B0&lt;br /&gt;
| 00-3C&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyes color&lt;br /&gt;
| 0x8B4&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyes size&lt;br /&gt;
| 0x8B8&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes thickness&lt;br /&gt;
| 0x8BC&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyes rotation&lt;br /&gt;
| 0x8C0&lt;br /&gt;
| 00-07&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes spacing&lt;br /&gt;
| 0x8C4&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyes height&lt;br /&gt;
| 0x8C8&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows style&lt;br /&gt;
| 0x8CC&lt;br /&gt;
| 00-18&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows color&lt;br /&gt;
| 0x8D0&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows size&lt;br /&gt;
| 0x8D4&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows thickness&lt;br /&gt;
| 0x8D8&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows rotation&lt;br /&gt;
| 0x8DC&lt;br /&gt;
| 00-0B&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows spacing&lt;br /&gt;
| 0x8E0&lt;br /&gt;
| 00-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Eyebrows height&lt;br /&gt;
| 0x8E4&lt;br /&gt;
| 03-12&lt;br /&gt;
| Yup, minimum is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| Nose style&lt;br /&gt;
| 0x8E8&lt;br /&gt;
| 00-11&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Nose size&lt;br /&gt;
| 0x8EC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Nose height&lt;br /&gt;
| 0x8F0&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mouth style&lt;br /&gt;
| 0x8F4&lt;br /&gt;
| 00-23&lt;br /&gt;
| Not ordered as in editor, read below&lt;br /&gt;
|-&lt;br /&gt;
| Mouth color&lt;br /&gt;
| 0x8F8&lt;br /&gt;
| 00-04&lt;br /&gt;
| From top to bottom.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth size&lt;br /&gt;
| 0x8FC&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth thickness&lt;br /&gt;
| 0x900&lt;br /&gt;
| 06-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mouth height&lt;br /&gt;
| 0x904&lt;br /&gt;
| 00-12&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mustache style&lt;br /&gt;
| 0x908&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Beard style&lt;br /&gt;
| 0x90C&lt;br /&gt;
| 00-05&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache/Beard color&lt;br /&gt;
| 0x910&lt;br /&gt;
| 00-07&lt;br /&gt;
| From top to button.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache size&lt;br /&gt;
| 0x914&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mustache height&lt;br /&gt;
| 0x918&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Glasses style&lt;br /&gt;
| 0x91C&lt;br /&gt;
| 00-08&lt;br /&gt;
| Order like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses color&lt;br /&gt;
| 0x920&lt;br /&gt;
| 00-05&lt;br /&gt;
| From top to bottom&lt;br /&gt;
|-&lt;br /&gt;
| Glasses size&lt;br /&gt;
| 0x924&lt;br /&gt;
| 07-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Glasses height&lt;br /&gt;
| 0x928&lt;br /&gt;
| 00-14&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole enable&lt;br /&gt;
| 0x92C&lt;br /&gt;
| 1 if enabled, 0 else.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole size&lt;br /&gt;
| 0x930&lt;br /&gt;
| 08-00&lt;br /&gt;
| Left button increases value.&lt;br /&gt;
|-&lt;br /&gt;
| Mole horiz pos&lt;br /&gt;
| 0x934&lt;br /&gt;
| 00-10&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mole vert pos&lt;br /&gt;
| 0x938&lt;br /&gt;
| 00-1E&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii height&lt;br /&gt;
| 0x93C&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii weight&lt;br /&gt;
| 0x940&lt;br /&gt;
| 00-7F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii name&lt;br /&gt;
| 0x944-0x959&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Creator&#039;s name&lt;br /&gt;
| 0x95A-96F&lt;br /&gt;
| UTF-16&lt;br /&gt;
| Terminated with 0x0000. Not updated immediatly?&lt;br /&gt;
|-&lt;br /&gt;
| Mii gender&lt;br /&gt;
| 0x970&lt;br /&gt;
| 0: Male, 1: Female&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate month&lt;br /&gt;
| 0x974&lt;br /&gt;
| 01-0C&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Birthdate day&lt;br /&gt;
| 0x978&lt;br /&gt;
| 01-1F&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Mii shirt color&lt;br /&gt;
| 0x97C&lt;br /&gt;
| 00-0B&lt;br /&gt;
| Ordered like in editor.&lt;br /&gt;
|-&lt;br /&gt;
| Favorite&lt;br /&gt;
| 0x980&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow copy&lt;br /&gt;
| 0x981&lt;br /&gt;
| 0: false, 1: true&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Unused byte?&lt;br /&gt;
| 0x982&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Allow sharing&lt;br /&gt;
| 0x983&lt;br /&gt;
| 0: true, 1: false&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x984-0x98F&lt;br /&gt;
| All zero?&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ???&lt;br /&gt;
| 0x990-0x997&lt;br /&gt;
| 4?&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
0x08815998: Same 4 bytes as encrypted Mii: first 4 bits for Mii type, 4 next for number of seconds since 01/01/2010 00:00:00 UTC+3 (should be verified by other country and region 3DS) divided by 2.&lt;br /&gt;
0x0881599C: 6 bytes of MAC address of the 3DS that created the Mii.&lt;br /&gt;
0x088159A2: 6 unknow uses bytes&lt;br /&gt;
0x088159A8: Same 8 bytes as decrypted Mii at 0x04 through 0x0B. Seems NAND specific, kept the same on Miis created on same NAND but different 3DS via System Transfer. Might be a coincidence but the two first bytes are in ID0 folder name in the Nintendo 3DS folder.&lt;br /&gt;
&lt;br /&gt;
===Mapped Editor &amp;lt;-&amp;gt; Hex values===&lt;br /&gt;
&lt;br /&gt;
Most of the values are ordered (left button decreases, right increases, color choices are top to bottom...) but for most &amp;quot;main&amp;quot; part of the UI, where you choose the style of the part being edited, hex values has no correlation with displayed order.&lt;br /&gt;
Here is a JSON that can go from a Part, a Page and Position to the right hex value. This is 0 indexed (eg: datas[&amp;quot;face&amp;quot;][0][11]).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;{&lt;br /&gt;
face: [&lt;br /&gt;
    0x00,0x01,0x08,&lt;br /&gt;
    0x02,0x03,0x09,&lt;br /&gt;
    0x04,0x05,0x0a,&lt;br /&gt;
    0x06,0x07,0x0b&lt;br /&gt;
],&lt;br /&gt;
hairs: [&lt;br /&gt;
    [0x21,0x2f,0x28,&lt;br /&gt;
    0x25,0x20,0x6b,&lt;br /&gt;
    0x30,0x33,0x37,&lt;br /&gt;
    0x46,0x2c,0x42],&lt;br /&gt;
    [0x34,0x32,0x26,&lt;br /&gt;
    0x31,0x2b,0x1f,&lt;br /&gt;
    0x38,0x44,0x3e,&lt;br /&gt;
    0x73,0x4c,0x77],&lt;br /&gt;
    [0x40,0x51,0x74,&lt;br /&gt;
    0x79,0x16,0x3a,&lt;br /&gt;
    0x3c,0x57,0x7d,&lt;br /&gt;
    0x75,0x49,0x4b],&lt;br /&gt;
    [0x2a,0x59,0x39,&lt;br /&gt;
    0x36,0x50,0x22,&lt;br /&gt;
    0x17,0x56,0x58,&lt;br /&gt;
    0x76,0x27,0x24],&lt;br /&gt;
    [0x2d,0x43,0x3b,&lt;br /&gt;
    0x41,0x29,0x1e,&lt;br /&gt;
    0x0c,0x10,0x0a,&lt;br /&gt;
    0x52,0x80,0x81],&lt;br /&gt;
    [0x0e,0x5f,0x69,&lt;br /&gt;
    0x64,0x06,0x14,&lt;br /&gt;
    0x5d,0x66,0x1b,&lt;br /&gt;
    0x04,0x11,0x6e]&lt;br /&gt;
    [0x7b,0x08,0x6a,&lt;br /&gt;
    0x48,0x03,0x15,&lt;br /&gt;
    0x00,0x62,0x3f,&lt;br /&gt;
    0x5a,0x0b,0x78],&lt;br /&gt;
    [0x05,0x4a,0x6c,&lt;br /&gt;
    0x5e,0x7c,0x19,&lt;br /&gt;
    0x63,0x45,0x23,&lt;br /&gt;
    0x0d,0x7a,0x71],&lt;br /&gt;
    [0x35,0x18,0x55,&lt;br /&gt;
    0x53,0x47,0x83,&lt;br /&gt;
    0x60,0x65,0x1d,&lt;br /&gt;
    0x07,0x0f,0x70],&lt;br /&gt;
    [0x4f,0x01,0x6d,&lt;br /&gt;
    0x7f,0x5b,0x1a,&lt;br /&gt;
    0x3d,0x67,0x02,&lt;br /&gt;
    0x4d,0x12,0x5c],&lt;br /&gt;
    [0x54,0x09,0x13,&lt;br /&gt;
    0x82,0x61,0x68,&lt;br /&gt;
    0x2e,0x4e,0x1c,&lt;br /&gt;
    0x72,0x7e,0x6f]&lt;br /&gt;
],&lt;br /&gt;
eyebrows: [&lt;br /&gt;
    [0x06,0x00,0x0c,&lt;br /&gt;
    0x01,0x09,0x13,&lt;br /&gt;
    0x07,0x15,0x08,&lt;br /&gt;
    0x11,0x05,0x04],&lt;br /&gt;
    [0x0b,0x0a,0x02,&lt;br /&gt;
    0x03,0x0e,0x14,&lt;br /&gt;
    0x0f,0x0d,0x16,&lt;br /&gt;
    0x12,0x10,0x17]&lt;br /&gt;
],&lt;br /&gt;
eyes: [&lt;br /&gt;
    [0x02,0x04,0x00,&lt;br /&gt;
    0x08,0x27,0x11,&lt;br /&gt;
    0x01,0x1a,0x10,&lt;br /&gt;
    0x0f,0x1b,0x14],&lt;br /&gt;
    [0x21,0x0b,0x13,&lt;br /&gt;
    0x20,0x09,0x0c,&lt;br /&gt;
    0x17,0x22,0x15,&lt;br /&gt;
    0x19,0x28,0x23],&lt;br /&gt;
    [0x05,0x29,0x0d,&lt;br /&gt;
    0x24,0x25,0x06,&lt;br /&gt;
    0x18,0x1e,0x1f,&lt;br /&gt;
    0x12,0x1c,0x2e],&lt;br /&gt;
    [0x07,0x2c,0x26,&lt;br /&gt;
    0x2a,0x2d,0x1d,&lt;br /&gt;
    0x03,0x2b,0x16,&lt;br /&gt;
    0x0a,0x0e,0x2f],&lt;br /&gt;
    [0x30,0x31,0x32,&lt;br /&gt;
    0x35,0x3b,0x38,&lt;br /&gt;
    0x36,0x3a,0x39,&lt;br /&gt;
    0x37,0x33,0x34]&lt;br /&gt;
],&lt;br /&gt;
nose: [&lt;br /&gt;
    [0x01,0x0a,0x02,&lt;br /&gt;
    0x03,0x06,0x00,&lt;br /&gt;
    0x05,0x04,0x08,&lt;br /&gt;
    0x09,0x07,0x0B],&lt;br /&gt;
    [0x0d,0x0e,0x0c,&lt;br /&gt;
    0x11,0x10,0x0f]&lt;br /&gt;
],&lt;br /&gt;
mouth: [&lt;br /&gt;
    [0x17,0x01,0x13,&lt;br /&gt;
    0x15,0x16,0x05,&lt;br /&gt;
    0x00,0x08,0x0a,&lt;br /&gt;
    0x10,0x06,0x0d],&lt;br /&gt;
    [0x07,0x09,0x02,&lt;br /&gt;
    0x11,0x03,0x04,&lt;br /&gt;
    0x0f,0x0b,0x14,&lt;br /&gt;
    0x12,0x0e,0x0c],&lt;br /&gt;
    [0x1b,0x1e,0x18,&lt;br /&gt;
    0x19,0x1d,0x1c,&lt;br /&gt;
    0x1a,0x23,0x1f,&lt;br /&gt;
    0x22,0x21,0x20]&lt;br /&gt;
]&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Foofoo the guy</name></author>
	</entry>
</feed>