<?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=WulfyStylez</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=WulfyStylez"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/WulfyStylez"/>
	<updated>2026-04-20T23:22:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mysteries&amp;diff=18815</id>
		<title>Mysteries</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mysteries&amp;diff=18815"/>
		<updated>2016-12-09T06:59:00Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Why are there two CTRCARD controllers? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a list of mysteries.&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
* What is the CTR abbreviation?&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
=== Why are there two CTRCARD controllers? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; Also [http://problemkaputt.de/twl-core.jpg DSi SoC pinout] shows evidence of dual NTRCARD controllers on the final DSi SoC. (This was a [https://i.kinja-img.com/gawker-media/image/upload/s--Qk87hEjW--/18j4up3g4zdkqjpg.jpg planned feature] of the DSi before being axed later in development)&lt;br /&gt;
&lt;br /&gt;
=== Why are there two EMMC controllers? ===&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; At some point during 3DS hardware development there was an idea to split up CTR and TWL nand into two different chips.&lt;br /&gt;
=== Is there a JTAG? ===&lt;br /&gt;
=== Is there more than one revision of the bootrom? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; Bootrom visible portion has been dumped on 3DS, 3DSXL, 2DS, New3DS. All matching exactly.&lt;br /&gt;
=== What is the EMMC controller @ 0x10100000 doing? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; There&#039;s dead code in NWM referencing it.&lt;br /&gt;
=== Why did they put NTRCARD accessible from ARM11? ===&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; At some point during 3DS hardware development there was a concept where ARM11 ran a menu with DS(i) icons while ARM9 was in TWL mode.&lt;br /&gt;
&lt;br /&gt;
=== Is there a secret message embedded in the 3DS keyscrambler constant? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; TWL keyscrambler constant was Nintendo in Japanese, utf-8 encoded.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
=== What was the problem in &amp;quot;initial program loader&amp;quot; that was mentioned in an FCC filing by Nintendo for 2DS? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; http://www.neogaf.com/forum/showthread.php?t=814624&amp;amp;page=1&lt;br /&gt;
=== What did SVC 0x74 in the ARM11 kernel do before it got stubbed? ===&lt;br /&gt;
=== What is the PTM abbreviation? ===&lt;br /&gt;
=== What is the PDN abbreviation? ===&lt;br /&gt;
=== Why is the DTCM not used anywhere except bootrom? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; Bootrom is known to use part of DTCM as state, memsetting it to 0 when it&#039;s done. After that, it is never used again.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Titles&amp;diff=18527</id>
		<title>Titles</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Titles&amp;diff=18527"/>
		<updated>2016-11-02T05:06:41Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: .cmd files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Nintendo 3DS utilizes a similar title-based organization as seen in the Wii and DSi platforms. The update server is located  [http://nus.cdn.c.shop.nintendowifi.net/ccs/download/ here]. When using SSL, the update/shop servers must be accessed via SSLv3.&lt;br /&gt;
&lt;br /&gt;
For a list of 3DS titles see the [[Title list]].                           &lt;br /&gt;
                     &lt;br /&gt;
= Title IDs =&lt;br /&gt;
&lt;br /&gt;
The organization of Title IDs has not been documented fully yet. Region info isn&#039;t stored in title IDs however there does appear to be evidence that the regions are sequential, similar to how Wii System Menu Updates are ordered: JPN USA EUR KOR and CHN (introduced with the DSi). 3DS has one additional region: TWN.&lt;br /&gt;
&lt;br /&gt;
Note: The terms &#039;Title ID&#039;, &#039;Partition ID&#039; and &#039;Media ID&#039; are interchangeable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TitleID Structure&#039;&#039;&#039;: 0xCCCCABCDLLLLLLRR&lt;br /&gt;
&lt;br /&gt;
* CCCC defines the console &#039;&#039;&#039;Platform&#039;&#039;&#039; (5=WiiU, 4=3DS, 3=DSi, 1=[http://wiibrew.org/wiki/Title_database Wii])&lt;br /&gt;
* ABCD defines the &#039;&#039;&#039;Content Category&#039;&#039;&#039; of the title, Demo, DLPChild, etc.&lt;br /&gt;
* LLLLLL For CTR titles, this is the title&#039;s &#039;&#039;&#039;Unique ID&#039;&#039;&#039;. For TWL converted titles this is in two sections grouped as SSLLLL. SS is the old title identification used by the DSi and is made redundant by &#039;ABCD&#039;. LLLL is the TWL title&#039;s &#039;Unique ID&#039;. There are restrictions on the Unique ID, see below for more info.&lt;br /&gt;
* RR This is the Title ID &#039;&#039;&#039;Variation&#039;&#039;&#039;, and has various uses.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Content Categories&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
This u16 is a collection bit mask flag. Each Category is a group of one or more bit masks.&lt;br /&gt;
&lt;br /&gt;
Specific Bitmask Flags:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Category&lt;br /&gt;
!  Bitmask&lt;br /&gt;
|-&lt;br /&gt;
|  Normal&lt;br /&gt;
|  0x0&lt;br /&gt;
|-&lt;br /&gt;
|  DlpChild&lt;br /&gt;
|  0x1&lt;br /&gt;
|-&lt;br /&gt;
|  Demo&lt;br /&gt;
|  0x2&lt;br /&gt;
|-&lt;br /&gt;
|  Contents&lt;br /&gt;
|  0x3&lt;br /&gt;
|-&lt;br /&gt;
|  AddOnContents&lt;br /&gt;
|  0x4&lt;br /&gt;
|-&lt;br /&gt;
|  Patch&lt;br /&gt;
|  0x6&lt;br /&gt;
|-&lt;br /&gt;
|  CannotExecution&lt;br /&gt;
|  0x8&lt;br /&gt;
|-&lt;br /&gt;
|  System&lt;br /&gt;
|  0x10&lt;br /&gt;
|-&lt;br /&gt;
|  RequireBatchUpdate&lt;br /&gt;
|  0x20&lt;br /&gt;
|-&lt;br /&gt;
|  NotRequireUserApproval&lt;br /&gt;
|  0x40&lt;br /&gt;
|-&lt;br /&gt;
|  NotRequireRightForMount&lt;br /&gt;
|  0x80&lt;br /&gt;
|-&lt;br /&gt;
|  CanSkipConvertJumpId&lt;br /&gt;
|  0x100&lt;br /&gt;
|-&lt;br /&gt;
|  TWL&lt;br /&gt;
|  0x8000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* TWL Category bit mask are carried over from original TWL category bitmasks (ignoring bit mask 0x8000), so TWL system titles have the bitmask of 0x8001.&lt;br /&gt;
&lt;br /&gt;
* System titles (TWL and CTR) are eligible to be updated during a System Update.&lt;br /&gt;
&lt;br /&gt;
* Bit Mask 0x4000 appears to be reserved, as it renders the &#039;&#039;TWL&#039;&#039; and &#039;&#039;System&#039;&#039; bit masks useless.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unique ID Restrictions&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
For the CTR titles, there appears to be is a correlation between Unique IDs (UID) and 3DS &#039;title types&#039;. For developer titles this is known(shown below), and retail titles *appear* to follow suite. It is unknown if this correlation is enforced on retail units, or if it is just for organisation purposes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  TITLE TYPE&lt;br /&gt;
!  UNIQUE ID RANGE&lt;br /&gt;
|-&lt;br /&gt;
|  System&lt;br /&gt;
|  0x0 - 0x2FF&lt;br /&gt;
|- &lt;br /&gt;
|  Application&lt;br /&gt;
|  0x300 - 0xF7FFF&lt;br /&gt;
|- &lt;br /&gt;
|  Evaluation&lt;br /&gt;
|  0xF8000 - 0xFEFFF (?)&lt;br /&gt;
|- &lt;br /&gt;
|  Prototype*&lt;br /&gt;
|  0xFF000 - 0xFF3FF&lt;br /&gt;
|- &lt;br /&gt;
|  Developer&lt;br /&gt;
|  0xFF400 - 0xFF7FF (?)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;On the home menu, titles with UIDs within the &#039;Prototype&#039; range, appear on the home menu after install without the gift fanfare.&lt;br /&gt;
&lt;br /&gt;
ProgramID/titleID low bitmask 0xF0000000(uniqueID bitmask 0xF00000) seems to be related to which hardware the title is allowed to run on. 3DS code tends to clear this bitmask when handling programIDs. This bitmask is normally zero. When this is 0x2, this indicates that the title only runs on [[New_3DS]](that is, programID-low 0x20000000 / uniqueID 0x200000).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TitleID Variation&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
This u8 allows enumeration of titles from the same category and unique ID. Common uses are explained below:&lt;br /&gt;
&lt;br /&gt;
* CTR System Titles: The 3DS has two copies of most modules/applets/archives for usage with either the NATIVE_FIRM or SAFE_MODE_FIRM. This is allowed for, by changing the title ID variation of the title to match the core version set by the FIRM it is designed to be used with:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  RR&lt;br /&gt;
!  MEANING&lt;br /&gt;
|- &lt;br /&gt;
|  02&lt;br /&gt;
|  System Title (Core version 0x2)&lt;br /&gt;
|-&lt;br /&gt;
|  03&lt;br /&gt;
|  SAFE_MODE System Title (Core version 0x3)&lt;br /&gt;
|}&lt;br /&gt;
Normally on retail SAFE_MODE ARM11 [[NCCH#CXI|CXI]] titles can&#039;t be launched, since the [[Configuration_Memory|system]] core version doesn&#039;t match the CXI exheader core version.&lt;br /&gt;
&lt;br /&gt;
* Only most non-Normal Applications are known to utilise Title ID variation, this is explained in their respective sections on this page.&lt;br /&gt;
&lt;br /&gt;
* [[3DS Development Unit Software|Dev Menu]] installs CTR Applications with a TitleID variation of 0x02 to the CTR NAND.&lt;br /&gt;
&lt;br /&gt;
* Title ID variation is ignored for TWL titles, this value is carried over from the original TWL title ID and is used for region lock:&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
&lt;br /&gt;
v## = 0xHHHH = 0bBBBBBBBB...&lt;br /&gt;
&lt;br /&gt;
* The version major,minor and micro can be extracted from the version number by converting the 16 bit number to binary&lt;br /&gt;
* 6 bits : Major, this matches the NCCH remaster-version.&lt;br /&gt;
* 6 bits : Minor&lt;br /&gt;
* 4 bits : Micro (&#039;Build&#039; in some contexts)&lt;br /&gt;
* i.e. v2069 (Taken from 000400DB00017302) = 0b000010 000001 0101 means that the title version is v2.1.5. For reasons unknown, the CVer build, stored in the RomFS of the title, has always been zero (at time of writing), regardless of the CVer build in the TMD. So when predicting the firmware version, this should be taken into account.&lt;br /&gt;
&lt;br /&gt;
= Data Structure =&lt;br /&gt;
&lt;br /&gt;
Titles are installed to either the NAND (System and Application) or to the SD Card (Application only), and their respective directory locations are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| [[Flash Filesystem|NAND]]&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| [[SD Filesystem|SD]]&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Title Data&lt;br /&gt;
| nand/title&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | sdmc/Nintendo 3DS/&amp;lt;ID0&amp;gt;/&amp;lt;ID1&amp;gt;/title&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Save Data&lt;br /&gt;
| nand/data/&amp;lt;ID0&amp;gt;/sysdata&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
ID0 is the first 0x10-bytes from a SHA256 [[nand/private/movable.sed|hash]] and ID1 is generated from the SD card CID.&lt;br /&gt;
&lt;br /&gt;
Title data stored on the SD Card is encrypted with the console-unique [[nand/private/movable.sed|keyslots]], whereas NAND title data is stored as cleartext.&lt;br /&gt;
&lt;br /&gt;
The base CTR for files stored under /title is likely based on the /title path, similar to extdata. This base CTR is unique per titleID and filename. The base CTR never changes after creation of each file.&lt;br /&gt;
&lt;br /&gt;
When a newer version of a title is installed, the new .app content, .tmd, and .cmd(and .ctx for NAND titles) are written to the /title directory, however the old files here are not yet deleted. Once installation of the title is [[AMNet:InstallTitlesFinish|finalized]], the info from [[Title_Database|import.db]] is moved to [[Title_Database|title.db]] so that the system uses the newer files instead, then the old /title files are deleted.&lt;br /&gt;
&lt;br /&gt;
The title data is contained in this directory structure (note that [[Title list#0004008C - Add-on Content (DLC)|DLC]] titles are stored in a different way):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| NAND&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| SD (non-DLC)&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| SD (DLC)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Title Data:&lt;br /&gt;
|&lt;br /&gt;
 &amp;lt;Title ID High&amp;gt;&lt;br /&gt;
 └── &amp;lt;Title ID Low&amp;gt;&lt;br /&gt;
     ├── 00000000.ctx&lt;br /&gt;
     └── content&lt;br /&gt;
         ├── &amp;lt;ContentID&amp;gt;.app&lt;br /&gt;
         ├── &amp;lt;ContentID&amp;gt;.tmd&lt;br /&gt;
         └── cmd&lt;br /&gt;
             └── &amp;lt;ContentID&amp;gt;.cmd&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
 &amp;lt;Title ID High&amp;gt;&lt;br /&gt;
 └── &amp;lt;Title ID Low&amp;gt;&lt;br /&gt;
     ├── 00000000.ctx&lt;br /&gt;
     ├── content&lt;br /&gt;
     │   ├── &amp;lt;ContentID&amp;gt;.app&lt;br /&gt;
     │   ├── &amp;lt;ContentID&amp;gt;.tmd&lt;br /&gt;
     │   └── cmd&lt;br /&gt;
     │       └── &amp;lt;ContentID&amp;gt;.cmd&lt;br /&gt;
     └── data&lt;br /&gt;
         └── 00000001.sav&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
 0004008C&lt;br /&gt;
 └── &amp;lt;Title ID Low&amp;gt;&lt;br /&gt;
     ├── 00000000.ctx&lt;br /&gt;
     └── content&lt;br /&gt;
         ├── &amp;lt;ContentID&amp;gt;.tmd&lt;br /&gt;
         ├── 00000000&lt;br /&gt;
         │   └── &amp;lt;ContentID&amp;gt;.app&lt;br /&gt;
         └── cmd&lt;br /&gt;
             └── &amp;lt;ContentID&amp;gt;.cmd&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;|  Save Data:&lt;br /&gt;
|&lt;br /&gt;
 &amp;lt;SaveID0&amp;gt;&lt;br /&gt;
 └── &amp;lt;SaveID1&amp;gt;&lt;br /&gt;
     └── 00000001.sav&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;&amp;lt;ContentID&amp;gt;.tmd&#039;&#039;&#039;&amp;quot; - (The Content ID is a u32, initially: &#039;&#039;&#039;00000000&#039;&#039;&#039; when the title is first installed. Changing by an increment of +&#039;&#039;&#039;0x1&#039;&#039;&#039; for each title update the 3DS installs) This is the [[Title metadata]] associated with the title, it is encrypted with a console-unique [[AES|keyslot]]. The decrypted TMD is available on Nintendo&#039;s CDN server at &amp;quot;http://nus.cdn.c.shop.nintendowifi.net/ccs/download/TitleIDhere/tmd&amp;quot;. Though CDN version of the title TMD has a certificate chain attached at the end of the TMD, so removing it will give you the 1:1 decrypted TMD. After installation the &amp;quot;&amp;lt;ContentID&amp;gt;.tmd&amp;quot; is redundant, because important title data is extracted and imported into the [[Title Database|title.db]] and &amp;quot;.cmd&amp;quot; files, but is however kept as a reference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;&amp;lt;ContentID&amp;gt;.app&#039;&#039;&#039;&amp;quot; - (The Content ID is a u32, taken from the title&#039;s [[TMD]]) These files are [[NCCH]] files, where the entire file is encrypted with a console-unique [[AES|keyslot]](this is on top of the encryption of the NCCH contents). There can be more than one NCCH in this directory, as seen with .[[CCI]] files, the game executable ([[CXI]]) can be accompanied with additional non-executable NCCH files ([[NCCH#CFA|CFA]]) such as the electronic manual and DLP Child containers. Determining the function of the encrypted NCCH, is done by finding the Content Index of the &amp;quot;XXXXXXXX.app&amp;quot; file in the title&#039;s TMD(see above for retrieving decrypted TMD), interpreting the Content Index is as follows (does not apply to DLC content):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index&lt;br /&gt;
!  Content Type&lt;br /&gt;
|-&lt;br /&gt;
|  0000&lt;br /&gt;
|  Main Executable (.[[NCCH#CXI|CXI]])(In the case of [[Title list|System Data Archives]], this is a [[NCCH#CFA|CFA]] file)&lt;br /&gt;
|-&lt;br /&gt;
|  0001&lt;br /&gt;
|  Home Menu Manual (.[[NCCH#CFA|CFA]])&lt;br /&gt;
|-&lt;br /&gt;
|  0002&lt;br /&gt;
|  DLP Child Container (.[[NCCH#CFA|CFA]])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Unlike the TMD, a decrypted version of the NCCH files cannot be retrieved from Nintendo&#039;s CDN, the NCCH files do exist on Nintendo&#039;s CDN but are [[AES|encrypted]]. Decrypting CDN versions of content, requires the title&#039;s [[CommonETicket|ticket]], and the common key specified by an index in the  [[CommonETicket|ticket]]. Of course editing/deleting &amp;quot;.app&amp;quot; files will have an effect. Deleting/renaming the manual &amp;quot;.app&#039; will cause the manual not to load when clicked on. And deleting/renaming the executable &amp;quot;.app&amp;quot; will cause the application to not load, and the 3D Banner does not show(The banner is loaded each time from the game&#039;s executable NCCH when the home menu loads, it is not cached like the icon and name).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;&amp;lt;ContentID&amp;gt;.cmd&#039;&#039;&#039;&amp;quot; - (The Content ID is a u32, initially: &#039;&#039;&#039;00000001&#039;&#039;&#039; when the title is first installed. Changing by an increment of +&#039;&#039;&#039;0x1&#039;&#039;&#039; for each time the 3DS adds/removes &#039;.app&#039; files) This file contains data taken from the title&#039;s [[TMD]]. See the below table for the format of the cleartext .cmd file. The [[Title Database|Title.db]] contains the Content ID for the &#039;.cmd&#039; file, but does not contain a hash of the &#039;.cmd&#039; file. In addition it is also encrypted with a console-unique [[AES|keyslot]]. This acts as part of the DRM for installed titles, along with the [[Title Database|title.db]].&lt;br /&gt;
&lt;br /&gt;
The below AES-MACs(including the last 0x10-bytes of the header) are only used for SD titles, and for NAND [[Title_list|download-play]] titles. For other titles, these MACs are set to all-zero.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| .cmd ContentID, for the .cmd filename. This is the beginning of the header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of entries? Usually the same as the following u32.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of AESMACs? Usually the same as the preceding u32.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown, usually (always?) 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| AESMAC over contents?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4*(No. of entries)&lt;br /&gt;
| List of contentIDs in (usually) descending order&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 + 0x4*(No. of entries)&lt;br /&gt;
| 0x4*(No. of entries)&lt;br /&gt;
| List of contentIDs in (usually) ascending order&lt;br /&gt;
|-&lt;br /&gt;
| 0x20+0x8*(No. of entries)&lt;br /&gt;
| 0x10*(No. of entries)&lt;br /&gt;
| These are AESMACs, one for each content.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entries format:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Start&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| ContentID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| Unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;00000001.sav&amp;quot;&#039;&#039;&#039; - This is the title&#039;s encrypted [[Savegames|savegame]]. Renaming these savegames causes home-menu to hang while launching titles, modifying these saves results in the same corruption errors as other savegames.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;00000000.ctx&amp;quot;&#039;&#039;&#039; - This file encrypted with a console-unique [[AES|keyslot]] is temporarily stored on SD card while a title is being downloaded from the eShop, it is deleted after the download is completed. This contains an AP0000000000000000 cert used to sign the data following the cert, this cert is signed by the [[CTCert]].&lt;br /&gt;
The unknown signed data is likely an ECDSA public key. There&#039;s .ctx files stored under the /title directory for NAND CTR/TWL titles, however those use the [[CTXT]] format which is completely different from this SD .ctx format. These .ctx files for NAND/SD titles only exist for titles where installation was not yet finalized(like when a system update install was not yet finalized).&lt;br /&gt;
&lt;br /&gt;
=== DLC Titles ===&lt;br /&gt;
&lt;br /&gt;
DLC titles have a different directory structure to most installed titles. This is because all DLC content for a given title is installed under the same Title ID, but DLC add-ons are usually separate purchases, hence the structure altered so any combination of DLC content can be installed. DLC titles can receive &#039;updates&#039;, this is usually in the form of more DLC content and/or DLC bug fixes. Individual DLC content can only be managed from with-in the application using the DLC.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;00000000&amp;quot;&#039;&#039;&#039; - This extra directory only found in DLC titles, contains the DLC [[NCCH]] content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;&amp;lt;ContentID&amp;gt;.tmd&#039;&#039;&#039;&amp;quot; - This is not modified by the 3DS, and contains the details for all DLC content(installed or not).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;&amp;lt;ContentID&amp;gt;.cmd&#039;&#039;&#039;&amp;quot; - This contains entries for all &#039;&#039;&#039;installed&#039;&#039;&#039; DLC [[NCCH]] content, and is updated (&amp;lt;ContentID&amp;gt; will change) every time DLC content is installed/removed.&lt;br /&gt;
&lt;br /&gt;
=Installing other-model system-titles=&lt;br /&gt;
When finalizing title-install of already downloaded Old3DS system-titles to a New3DS NAND image with New3DS NATIVE_FIRM, the end result is that the New3DS version (TID-low bitmask 0x20000000) of those titles gets deleted.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown where this behaviour is implemented (might be NIM, AM, or AMXPXI).&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CTXT&amp;diff=18526</id>
		<title>CTXT</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CTXT&amp;diff=18526"/>
		<updated>2016-11-02T00:01:25Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the .ctx files located at [[Title_Data_Structure|nand:/title/&amp;lt;titlepath&amp;gt;/00000000.ctx]].&lt;br /&gt;
&lt;br /&gt;
=Structure=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10&lt;br /&gt;
| AESMAC over SHA256 of bytes 0x10..0x30&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;CTXT&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Value 0 usually?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Value 1 usually?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Value 0 usually?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x8&lt;br /&gt;
| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown u32&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x1D4&lt;br /&gt;
| All-zero&lt;br /&gt;
|-&lt;br /&gt;
| 0x200&lt;br /&gt;
| 0x10&lt;br /&gt;
| AES-MAC?&lt;br /&gt;
|-&lt;br /&gt;
| 0x210&lt;br /&gt;
| 0x8&lt;br /&gt;
| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x218&lt;br /&gt;
| 0x4&lt;br /&gt;
| contentID for contentindex0&lt;br /&gt;
|-&lt;br /&gt;
| 0x21C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown u32 for contentindex0&lt;br /&gt;
|-&lt;br /&gt;
| 0x220&lt;br /&gt;
| 0x8&lt;br /&gt;
| content-size for contentindex0&lt;br /&gt;
|-&lt;br /&gt;
| 0x228&lt;br /&gt;
| 0x8&lt;br /&gt;
| Usually zero?&lt;br /&gt;
|-&lt;br /&gt;
| 0x230&lt;br /&gt;
| 0x3CC&lt;br /&gt;
| Usually 0xFF?&lt;br /&gt;
|-&lt;br /&gt;
| 0x5FC&lt;br /&gt;
| 0x4&lt;br /&gt;
| This has the same value as the u32 at 0x28.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=17375</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=17375"/>
		<updated>2016-05-13T01:59:07Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: RTC is a guess, but what else is a hardware device with up to 0x8 stored at power-off?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle TWL_FIRM and AGB_FIRM&#039;s ARM7 requirements. This is due to the fact that much of the hardware used by both ARM7 and ARM9 is (evidently) not physically hooked up to ARM11. Thus, ARM11 cannot simply emulate ARM7.&lt;br /&gt;
&lt;br /&gt;
ARM7 has the AGB BIOS implemented in hardware. The BIOS is completely identical to the original AGB BIOS. The system is booted silently by calling SWI 0x1 (RegisterRamReset), followed by jumping to the code that does SWI 0x0 (SoftReset) to finish booting. The boot splash is still in BIOS, however, and can be seen by calling (or replacing one of the previous interrupts with) SWI 0x26 (HardReset).&lt;br /&gt;
= Registers =&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Name&lt;br /&gt;
!  Address&lt;br /&gt;
!  Width&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CNT&lt;br /&gt;
| 0x10018000&lt;br /&gt;
| 0x1 &lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CODE&lt;br /&gt;
| 0x10018080&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_SAVE_MODE&lt;br /&gt;
| 0x10018100&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_CNT&lt;br /&gt;
| 0x10018104&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_RTC_CNT?&lt;br /&gt;
| 0x10018108&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10018110&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10018114&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_RTC_LO?&lt;br /&gt;
| 0x10018118&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_RTC_HI?&lt;br /&gt;
| 0x1001811C&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_SAVE_CFG &lt;br /&gt;
| 0x10018120&lt;br /&gt;
| 0x10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM7_CNT ==&lt;br /&gt;
This seems to control the mode of the ARM7. 1 = TWL, 2 = AGB.&lt;br /&gt;
&lt;br /&gt;
== ARM7_CODE ==&lt;br /&gt;
This is the first code that will be run after execution begins. TwlProcess9 uses this to put ARM7 in a loop (TWL), and to set the POSTFLG and branch to more copied code (AGB).This doesn&#039;t seem to start execution by itself.&lt;br /&gt;
&lt;br /&gt;
== ARM7_SAVE_MODE ==&lt;br /&gt;
This tells the save storage emulation hardware which device type to emulate (EEPROM, 512k flash, and SRAM are all that have been spotted). This comes directly from the [[3DS_Virtual_Console#Footer|ROM footer]].&lt;br /&gt;
&lt;br /&gt;
== ARM7_RTC(?) ==&lt;br /&gt;
These registers may be used to control a realtime clock. To set or read the data here, first ARM7_RTC_CNT&#039;s bit 15 is waited on. Next ARM7_RTC_CNT is set to zero. &lt;br /&gt;
&lt;br /&gt;
For a write: the two registers are written, a 1 is written to ARM7_RTC_CNT, and it is waited on the same as before. Afterwards if bit 14 is not set in ARM7_RTC_CNT, the value was set successfully.&lt;br /&gt;
&lt;br /&gt;
For a read: a 2 is written to ARM7_RTC_CNT, it&#039;s waited on again. Afterwards, if bit 14 is not set, the RTC can be read. Presumably the hardware can be re-enabled by writing a zero to ARM7_RTC_CNT at this point, but AGB_FIRM does not.&lt;br /&gt;
&lt;br /&gt;
== ARM7_SAVE_CFG ==&lt;br /&gt;
This is copied from rom footer + 0x10. It presumably configures details about storage, such as IDs, and likely allows enabling the RTC for games which need it. Format of this data is unknown, and slightly difficult to determine without some hardware poking.&lt;br /&gt;
&lt;br /&gt;
= Memory map =&lt;br /&gt;
The virtual memory mapping for the ARM7 is the same as for the [[Memory_layout#TWL_FIRM_Userland_Memory|other core]]. However, it has additional internal memory mapped to it. Interestingly enough, much of this memory seems to lie within ARM9&#039;s own &amp;quot;internal memory.&amp;quot;&lt;br /&gt;
*0x08060000 -&amp;gt; 0x03800000, ARM7-WRAM (64KB)&lt;br /&gt;
*0x080B0000 -&amp;gt; 0x03000000, GBA on-chip WRAM (32KB)&lt;br /&gt;
*0x080C0000 -&amp;gt; EEPROM/SRAM/Flash (0x10018104 must be set to 1 before reading memory here, and restored to its previous value afterwards)&lt;br /&gt;
*0x01FFC000 -&amp;gt; 0x01000000, ARM9 ITCM under TWL (16KB)&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=MCU_Services&amp;diff=16183</id>
		<title>MCU Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=MCU_Services&amp;diff=16183"/>
		<updated>2016-03-24T21:24:33Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* MCU service &amp;quot;mcu::HWC&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Only one session can be open per service at a time. If a session is already open for a service, MCU module will wait for the thread handling the session to terminate(triggered by the session being closed by the user process), then it accepts the new session. The commands for each service are handled by separate threads.&lt;br /&gt;
&lt;br /&gt;
=MCU camera service &amp;quot;mcu::CAM&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU GPU service &amp;quot;mcu::GPU&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| GetLcdPowerState. This writes the value of I2C-MCU register 0xf bit6 to u8 cmdreply[2], and the value of bit5 from that register to u8 cmdreply[3].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| SetLcdPowerState. This writes the upper LCD bits of MCU register 0x22.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003000&lt;br /&gt;
| GetGpuLcdInterfaceState. This writes the value of I2C-MCU register 0xf bit7 to u8 cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| SetGpuLcdInterfaceState. This writes the lower two bits of MCU register 0x22.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| GetMcuFwVerHigh. Called by gsp module&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| GetMcuFwVerLow. Called by gsp module&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B....&lt;br /&gt;
| Set3dLedState&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C....&lt;br /&gt;
| Get3dLedState&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D....&lt;br /&gt;
| GetMcuGpuEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E....&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU HID service &amp;quot;mcu::HID&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| Get3dSliderState&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C....&lt;br /&gt;
| GetMcuHidEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[MCUHID:GetSoundVolume|GetSoundVolume]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU service &amp;quot;mcu::RTC&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| SetSystemClock (RTC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| GetSystemClock (RTC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0009....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0010....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0011....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0012....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0013....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0014....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0015....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0016....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0017....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0018....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0019....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0040&lt;br /&gt;
| SetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200000&lt;br /&gt;
| GetPedometerState&lt;br /&gt;
|-&lt;br /&gt;
| 0x0021....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0022....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0023....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0024....&lt;br /&gt;
| GetMcuRtcEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x0025....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0026....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0027....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0028....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0029....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A0000&lt;br /&gt;
| GetShellState. This writes the value of I2C-MCU register 0xf bit1 to u8 cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0000&lt;br /&gt;
| GetAdapterState. This writes the value of I2C-MCU register 0xf bit3 to u8 cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0000&lt;br /&gt;
| GetBatteryChargeState. This writes the value of I2C-MCU register 0xf bit4 to u8 cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D0000&lt;br /&gt;
| [[MCURTC:GetBatteryLevel|GetBatteryLevel]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0030....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0031....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0032....&lt;br /&gt;
| [[MCURTC:PowerOff|PowerOff]] (writes 0x1 to i2c MCU device, reg 0x20)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0033....&lt;br /&gt;
| [[MCURTC:HardwareReboot|HardwareReboot]] (writes 0x4 to i2c MCU device, reg 0x20)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0034....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0035....&lt;br /&gt;
| Writes 0x10 to i2c MCU device, reg 0x20&lt;br /&gt;
|-&lt;br /&gt;
| 0x0036....&lt;br /&gt;
| SetWatchdogTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x0037....&lt;br /&gt;
| GetWatchdogTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x0038....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0039....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x003A....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x003B0640&lt;br /&gt;
| [[MCURTC:SetInfoLEDPattern|SetInfoLEDPattern]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003C0040&lt;br /&gt;
| [[MCURTC:SetInfoLEDPatternHeader|SetInfoLEDPatternHeader]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0000&lt;br /&gt;
| [[MCURTC:GetInfoLEDStatus|GetInfoLEDStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x003F....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0040....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0041....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00420040&lt;br /&gt;
| [[MCURTC:SetBatteryEmptyLEDPattern|SetBatteryEmptyLEDPattern]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0043....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0044....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0045....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0046....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0047....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0048....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0049....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x004A....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x004B....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x004C....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x004D....&lt;br /&gt;
| [[MCURTC:ReadHidFlagRegister|ReadHidFlagRegister]] (reads i2c MCU device, reg 0x10)&lt;br /&gt;
|-&lt;br /&gt;
| 0x004E....&lt;br /&gt;
| [[MCURTC:PublishHidNotifications|PublishHidNotifications]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004F....&lt;br /&gt;
| Sets some flag (otherwise set when uploading MCU firmware)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0050....&lt;br /&gt;
| Returns the above flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x0051....&lt;br /&gt;
| SetLegacyPoweroff&lt;br /&gt;
|-&lt;br /&gt;
| 0x00520000&lt;br /&gt;
| IsLegacyPoweroff&lt;br /&gt;
|-&lt;br /&gt;
| 0x0053....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0054....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0055....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0056....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0057....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0058....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0059....&lt;br /&gt;
| SetLegacyJumpProhibitedFlag&lt;br /&gt;
|-&lt;br /&gt;
| 0x005A....&lt;br /&gt;
| GetLegacyJumpProhibitedFlag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that using invalid input with these InfoLED/SetBatteryEmptyLEDPattern commands(especially SetInfoLEDPattern) can cause the system to be bricked(however the boot failure may not begin immediately after using the invalid parameters). For the bitmasks controlling these LEDs, bit clear = LED enable, bit set = LED disable? These notification LEDs(red LED, green LED, blue LED, ...) can only be enabled/disabled, nothing more.&lt;br /&gt;
&lt;br /&gt;
=MCU sound service &amp;quot;mcu::SND&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| GetSoundVolume&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU wifi service &amp;quot;mcu::NWM&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| SetWiFiLedState&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| GetWiFiLedState&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| Sets GPIO 0x20 high/low?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| Gets GPIO 0x20 high/low?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| Sets GPIO 0x40000 high/low?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| Gets GPIO 0x40000 high/low?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| Sets a FIRM WiFi-state-related flag?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| Gets the above flag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU service &amp;quot;mcu::HWC&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| GetMcuRegister? Seems to read an arbitrary register (by parameter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| SetMcuRegister?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| GetBatteryLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0009....&lt;br /&gt;
| Set3dLedState&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0640&lt;br /&gt;
| This is the same as [[MCURTC:SetInfoLEDPattern]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B....&lt;br /&gt;
| GetSoundVolume&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F....&lt;br /&gt;
| GetRtcTime&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| GetMcuFwVerHigh&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110000&lt;br /&gt;
| GetMcuFwVerLow&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU service &amp;quot;mcu::PLS&amp;quot;=&lt;br /&gt;
&lt;br /&gt;
RTC-related? Each of these seems to retrieve a second counter from a different RTC register.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0009....&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MCU codec service &amp;quot;mcu::CDC&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=New3DS=&lt;br /&gt;
The Old3DS/New3DS MCU sysmodules are identical except that the MCU firmware binary written via I2C is different. The size of that binary is the same. The only different words in .text are for the version of that MCU fw binary.&lt;br /&gt;
&lt;br /&gt;
=MCU firmware versions=&lt;br /&gt;
&lt;br /&gt;
These reside in mcu-module .rodata, are uploaded to MCU register 0x05 and are usually size 0x4003 bytes. (0x4000 bytes with 3 byte magic &amp;quot;jhl&amp;quot;?)&lt;br /&gt;
&lt;br /&gt;
There exists an alternate code path where uploading is done using register 0x3B (decided by making some nonsense conclusions about registers 0x0F and 0x10). This may be a &amp;quot;hack&amp;quot; around early versions of MCU? Register 0x3B is RTC-related on recent versions of MCU, and the &amp;quot;nonsense&amp;quot; condition is not met even on factory MCU firmware.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Title version&lt;br /&gt;
!  Firmware&lt;br /&gt;
|-&lt;br /&gt;
| New3DS v8192/safe v9217 (latest)&lt;br /&gt;
| 19.56&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS v6145 to v8192 (latest)&lt;br /&gt;
| 18.37&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS v5122&lt;br /&gt;
| 18.35&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS v4102&lt;br /&gt;
| 18.30&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS v2048&lt;br /&gt;
| 17.52&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS safe v0&lt;br /&gt;
| 17.20&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS factory&lt;br /&gt;
| 17.07&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Config_Savegame&amp;diff=16179</id>
		<title>Config Savegame</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Config_Savegame&amp;diff=16179"/>
		<updated>2016-03-24T20:59:20Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Configuration blocks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the format of the [[Config_Services|Cfg]] [[System_SaveData|NAND]] savegame. These blocks can be accessed with the Cfg service commands.&lt;br /&gt;
&lt;br /&gt;
==Structure of save-file &amp;quot;/config&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Total entries&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Data entries offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4558&lt;br /&gt;
| Block entries&lt;br /&gt;
|-&lt;br /&gt;
| 0x455C&lt;br /&gt;
| &lt;br /&gt;
| Data for the entries&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The filesize for this /config file is 0x8000-bytes.&lt;br /&gt;
&lt;br /&gt;
==Configuration block entry ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| BlkID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset to the data for this block when size is &amp;gt;4, otherwise this word is the data for this block&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x2&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x2&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Configuration blocks==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  BlkID&lt;br /&gt;
!  Size&lt;br /&gt;
!  Flags&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00000000&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
| Config savegame version?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030001&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0xE&lt;br /&gt;
| ? (zeroed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040000&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040001&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040002&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040003&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050001&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050002&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050003&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050005&lt;br /&gt;
| 0x20&lt;br /&gt;
|?&lt;br /&gt;
| Stereo camera settings?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050006&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070001&lt;br /&gt;
| 0x1&lt;br /&gt;
|?&lt;br /&gt;
| Sound output mode?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| 0xC00&lt;br /&gt;
| 0x2?&lt;br /&gt;
| WiFi configuration slot 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080001&lt;br /&gt;
| 0xC00&lt;br /&gt;
| 0x2?&lt;br /&gt;
| WiFi configuration slot 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080002&lt;br /&gt;
| 0xC00&lt;br /&gt;
| 0x2?&lt;br /&gt;
| WiFi configuration slot 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x2?&lt;br /&gt;
| This contains a u64 ID, used by processes using [[NWMUDS:Initialize]]. The first word is the same as [[CfgS:GetLocalFriendCodeSeed|LocalFriendCodeSeed]], while the latter is a separate random word&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090001&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0xE&lt;br /&gt;
| This console-unique u64 used by [[Cfg:GenHashConsoleUnique|GenHashConsoleUnique]] is generated with the LocalFriendCodeSeed and with random data&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0xE&lt;br /&gt;
| Username&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0001&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0xE&lt;br /&gt;
| Birthday (u8 month, u8 day)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0002&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xA&lt;br /&gt;
| Language&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8&lt;br /&gt;
| CountryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0001&lt;br /&gt;
| 0x800&lt;br /&gt;
| 0x2?&lt;br /&gt;
| Country name in UTF-16, every 0x80-bytes is an entry for each language, in the order of the Language table below (not all entries are set)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0002&lt;br /&gt;
| 0x800&lt;br /&gt;
| 0x2?&lt;br /&gt;
| State name in UTF-16, every 0x80-bytes is an entry for each language&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0003&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0xE&lt;br /&gt;
| Pair of 16-bit values, meaning unknown but related to address (ZIP code?)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| 0xC0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Restricted photo exchange data, and other info&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0001&lt;br /&gt;
| 0x14&lt;br /&gt;
|?&lt;br /&gt;
| Same as above?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0000&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| u16 at offset 0x0: [[SMDH#EULA_Version|EULA Version]] which was agreed to.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0000&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8?&lt;br /&gt;
| Unknown, used by [[NS]] on dev-units for [[SVC|svcKernelSetState]], where Type is 6. During NS startup on debug-units, NS compares the u32 from +8 in this config-block with the [[Configuration_Memory#APPMEMTYPE|APPMEMTYPE]]. When those don&#039;t match NS starts a FIRM-launch (with the same FIRM titleID as the currently running one) to boot into a FIRM with the APPMEMTYPE value from this config-block&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0004&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8?&lt;br /&gt;
| The first u8 is the System-Model [[Cfg:GetSystemModel|value]], the last 3-bytes are unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110000&lt;br /&gt;
| 0x4&lt;br /&gt;
|?&lt;br /&gt;
| The low u16 indicates whether the system setup is required, such as when the system is booted for the first time or after doing a [[System Settings|System Format]]: 0 = setup required, non-zero = no setup required&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110001&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0xA?&lt;br /&gt;
| TitleID of the menu to launch, used by [[NS]] on dev units (this block can be edited on dev units with [[3DS Development Unit Software#Config|Config]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120000&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| 0x4&lt;br /&gt;
|?&lt;br /&gt;
| If response is 0x100 then debug mode is enabled.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160000&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x8?&lt;br /&gt;
| Unknown, first byte is used by config service-cmd [[Config_Services|0x00070040]]. (Unknown whether the last 3-bytes are used)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The developer unit TID block only exists on developer units.&lt;br /&gt;
&lt;br /&gt;
===Languages===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ID&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| JP&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| EN&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| FR&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| DE&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| IT&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ES&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| ZH&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| KO&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| NL&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| PT&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| RU&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| TW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===CountryInfo===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Country code, same as DSi/Wii country codes. Value 0xFF is invalid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===0x000A0000 Block===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0-0x13&lt;br /&gt;
| UTF-16 username, with no NULL-terminator.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14-17&lt;br /&gt;
| Usually zero?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18-0x1B&lt;br /&gt;
| u32 NGWord version the username was last checked with. If this value is less than the u32 stored in the NGWord CFA &amp;quot;romfs:/version.dat&amp;quot;, the system then checks the username string with the bad-word list CFA again, then updates this field with the value from the CFA&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=TIMER_Registers&amp;diff=15984</id>
		<title>TIMER Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=TIMER_Registers&amp;diff=15984"/>
		<updated>2016-03-07T04:42:46Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: kinda important!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are 4 timers. These timers run at a frequency of ~67027.964kHz.&lt;br /&gt;
&lt;br /&gt;
= Registers =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Name&lt;br /&gt;
!  Address&lt;br /&gt;
!  Width&lt;br /&gt;
!  Used by&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#TIMER_VAL|TIMER_VAL]](n)&lt;br /&gt;
| 0x10003000 + 4*n&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#TIMER_CNT|TIMER_CNT]](n)&lt;br /&gt;
| 0x10003002 + 4*n&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TIMER_VAL ==&lt;br /&gt;
Writing to REG_TMxVAL loads a starting value for one of the 4 timers, while reading it will show the current timer value.&lt;br /&gt;
&lt;br /&gt;
== TIMER_CNT ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ REG_TMxCNT&lt;br /&gt;
!  BIT&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Prescaler select (0=F/1, 1=F/64, 2=F/256, 3=F/1024)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Count-up (0=Disabled, 1=Enabled)&lt;br /&gt;
|-&lt;br /&gt;
| 3-5&lt;br /&gt;
| Not used&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| IRQ enable (0=Disabled, 1=IRQ on timer value overflow)&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Start/Stop (0=Stop, 1=Start)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Count-up ==&lt;br /&gt;
When count-up is enabled, the timer value will increase every time the previous timer overflows.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=15437</id>
		<title>3DS System Flaws</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=15437"/>
		<updated>2016-01-19T20:25:54Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: this has been leaking all over the place for the last year so i&amp;#039;m just throwing it up for the greater good&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Exploits are used to execute unofficial code (homebrew) on the Nintendo 3DS. This page is a list of publicly known system flaws, for userland applications/applets flaws see [[3DS_Userland_Flaws|here]].&lt;br /&gt;
&lt;br /&gt;
=Stale / Rejected Efforts=&lt;br /&gt;
* Neimod has been working on a RAM dumping setup for a little while now. He&#039;s de-soldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039; PCB up to a custom RAM dumping setup. A while ago he published photos showing his setup to be working quite well, with the 3DS successfully booting up. However, his flickr stream is now private along with most of his work.&lt;br /&gt;
&lt;br /&gt;
* Someone (who will remain unnamed) has released CFW and CIA installers, all of which is copied from the work of others, or copyrighted material.&lt;br /&gt;
&lt;br /&gt;
==Tips and info==&lt;br /&gt;
The 3DS uses the XN feature of the ARM11 processor. There&#039;s no official way from applications to enable executable permission for memory containing arbitrary unsigned code(there&#039;s a [[SVC]] for this, but only [[RO_Services|RO-module]] has access to it). An usable userland exploit would still be useful: you could only do return-oriented-programming with it initially. From ROP one could then exploit system flaw(s), see below.&lt;br /&gt;
&lt;br /&gt;
SD card [[extdata]] and SD savegames can be attacked, for consoles where the console-unique [[Nand/private/movable.sed|movable.sed]] was dumped(accessing SD data is far easier by running code on the target 3DS however).&lt;br /&gt;
&lt;br /&gt;
=System flaws=&lt;br /&gt;
== Hardware ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed with hardware model/revision&lt;br /&gt;
!  Newest hardware model/revision this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| ARM9/ARM11 bootrom vectors point at unitialized RAM&lt;br /&gt;
| ARM9&#039;s and ARM11&#039;s exception vectors are hardcoded to point at the CPU&#039;s internal memory (0x08000000 region for ARM9, AXIWRAM for ARM11). While the bootrom does set them up to point to an endless loop at some point during boot, it does not do so immediately. As such, a carefully-timed fault injection (via hardware) to trigger an exception (such as an invalid instruction) will cause execution to fall into ARM9 RAM. &lt;br /&gt;
Since RAM isn&#039;t cleared on boot (see below), one can immediately start execution of their own code here to dump bootrom, OTP, etc.&lt;br /&gt;
The ARM9 bootrom does the following at reset:  reset vector branches to another instruction, then branches to bootrom+0x8000. Hence, there&#039;s no way to know for certain when exactly the ARM9 exception-vector data stored in memory gets initialized.&lt;br /&gt;
&lt;br /&gt;
This requires *very* *precise* timing for triggering the hardware fault: it&#039;s unknown if anyone actually exploited this successfully at the time of writing(the one who attempted+discovered it *originally* as listed in this wiki section hasn&#039;t).&lt;br /&gt;
| None: all available 3DS models at the time of writing have the exact same ARM9/ARM11 bootrom for the unprotected areas.&lt;br /&gt;
| New3DS&lt;br /&gt;
| End of February 2014&lt;br /&gt;
| [[User:Derrek|derrek]], WulfyStylez (May 2015) independently&lt;br /&gt;
|-&lt;br /&gt;
| Missing AES key clearing&lt;br /&gt;
| The hardware AES engine does not clear keys when doing a hard reset/reboot.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2014&lt;br /&gt;
| Mathieulh/Others&lt;br /&gt;
|-&lt;br /&gt;
| No RAM clearing on reboots&lt;br /&gt;
| On an MCU-triggered reboot all RAM including FCRAM/ARM9 memory/AXIWRAM/VRAM keeps its contents.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2014&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| 32bits of actual console-unique TWLNAND keydata&lt;br /&gt;
| On retail the 8-bytes at ARM9 address [[Memory_layout|0x01FFB808]] are XORed with hard-coded data, to generate the TWL console-unique keys, including TWLNAND. On Old3DS the high u32 is always 0x0, while on New3DS that u32 is always 0x2. On top of this, the lower u32&#039;s highest bit is always ORed. only 31 bits of the TWL console-unique keydata / TWL consoleID are actually console-unique.&lt;br /&gt;
This allows one to easily bruteforce the TWL console-unique keydata with *just* data from TWLNAND. On DSi the actual console-unique data for key generation is 8-bytes(all bytes actually set).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2012?&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| DSi / 3DS-TWL key-generator&lt;br /&gt;
| After using the key generator to generate the normal-key, you could overwrite parts of the normal-key with your own data and then recover the key-generator output by comparing the new crypto output with the original crypto output. From the normal-key outputs, you could deduce the TWL key-generator function.&lt;br /&gt;
This applies to the keyX/keyY too.&lt;br /&gt;
&lt;br /&gt;
This attack does not work for the 3DS key-generator because keyslots 0-3 are only for TWL keys.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2011&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| 3DS key-generator&lt;br /&gt;
| The algorithm for generating the normal-keys for keyslots is cryptographically weak.  As a result, it is easily susceptible to differential cryptanalysis if the normal-key corresponding to any scrambler-generated keyslot is discovered.&lt;br /&gt;
&lt;br /&gt;
Several such pairs of matching normal-keys and KeyY values were found, leading to deducing the key-generator function.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| FIRM partitions known-plaintext&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are encrypted with AES-CTR. Since this works by XOR&#039;ing data with a static (per-console in this case) keystream, one can deduce the keystream of a portion of each FIRM partition if they have the actual FIRM binary stored in it.&lt;br /&gt;
&lt;br /&gt;
This can be paired with many exploits. For example, it allows minor FIRM downgrades (i.e. 10.4 to 9.6 or 9.5 to 9.4, but not 9.6 to 9.5).&lt;br /&gt;
&lt;br /&gt;
This can be somewhat addressed by having a FIRM header skip over previously used section offsets, but this would just air-gap newer FIRMs without fixing the core bug. This can also only be done a limited number of times due to the size of FIRM versus the size of the partitions.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| &lt;br /&gt;
| Everyone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
=== arm9loader ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Public disclosure timeframe&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Uncleared OTP hash keydata in console-unique 0x11 key-generation&lt;br /&gt;
| Kernel9Loader does not clear the [[SHA_Registers#SHA_HASH|SHA_HASH register]] after use. As a result, the data stored here as K9L hands over to Kernel9 is the hash of [[OTP_Registers|OTP data]] used to seed the [[FIRM#New_3DS_FIRM|console-unique NAND keystore decryption key]] set on keyslot 0x11.&lt;br /&gt;
&lt;br /&gt;
Retrieving this keydata and the [[Flash_Filesystem#0x12C00|NAND keystore]] of the same device allows calculating the decrypted New3DS NAND keystore (non-unique, common to all New3DS units), which contains AES normal keys, also set on keyslot 0x11, which are then used to derive all current [[AES_Registers#Keyslots|New3DS-only AES keyXs]] including the newer batch introduced in [[9.6.0-24#arm9loader|9.6.0-X]]. From there, it is trivial to perform the same key derivation in order to initialize those keys on any system version, and even on Old3DS.&lt;br /&gt;
&lt;br /&gt;
This can be performed by exploiting the &amp;quot;arm9loaderhax&amp;quot; vulnerability to obtain post-K9L code execution after an MCU reboot (the bootrom section-loading fail is not relevant here, this attack was performed without OTP data by brute-forcing keys), and using this to dump the SHA_HASH register. This attack works on any FIRM version shipping a vulnerable version of K9L, whereas OTP dumping required a boot of &amp;lt;[[3.0.0-6|3.0.0-X]].&lt;br /&gt;
&lt;br /&gt;
This attack results in obtaining the entire (0x200-bytes) NAND keystore - it was confirmed at a later date that this keystore is encrypted with the same key (by comparing the decrypted data from multiple units), and therefore using another key in this store will not remedy the issue as all keys are known (i.e. later, unused keys decrypt to the same 0x200-bytes constant with the same OTP hash). Later keys could have been encrypted differently but this is not the case. As a result of this, it is not possible for Nintendo to use K9L again in its current format for its intended purpose, though this was not news from the moment people dumped a New3DS OTP.&lt;br /&gt;
| Derivation of all New3DS keys generated via the NAND keystore (0x1B &amp;quot;Secure4&amp;quot; etc.)&lt;br /&gt;
| None&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| ~April 2015, implemented in May 2015&lt;br /&gt;
| 13 January 2016&lt;br /&gt;
| [[User:WulfyStylez|WulfyStylez]], [[User:Dazzozo|Dazzozo]], [[User:Shinyquagsire23|shinyquagsire23]] (complimentary + implemented), [[User:Plutooo|plutoo]], Normmatt (discovered independently)&lt;br /&gt;
|-&lt;br /&gt;
| enhanced-arm9loaderhax&lt;br /&gt;
| See the 32c3 3ds talk.&lt;br /&gt;
Since this is a combination of a trick with the arm9-bootrom + arm9loaderhax, and since you have to manually write FIRM to the firm0/firm1 NAND partitions, this can&#039;t be completely fixed. Any system with existing ARM9 code execution and an OTP/OTP hash dump can exploit this. Additionally, by using the FIRM partition known-plaintext bug and bruteforcing the second entry in the keystore, this can currently be exploited on all New3DS systems without any other prerequisite hacks.&lt;br /&gt;
| arm9loaderhax which automatically occurs at hard-boot.&lt;br /&gt;
| See arm9loaderhax / description.&lt;br /&gt;
| See arm9loaderhax / description.&lt;br /&gt;
| Theorized around mid July, 2015. Later implemented+tested by [[User:Plutooo|plutoo]] and derrek.&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Missing verification-block for the 9.6 keys (arm9loaderhax)&lt;br /&gt;
| Starting with [[9.6.0-24|9.6.0-X]] a new set of NAND-based keys were introduced. However, no verification block was added to verify that the new key read from NAND is correct. This was technically an issue from [[9.5.0-22|9.5.0-X]] with the original sector+0 keydata, however the below is only possible with [[9.6.0-24|9.6.0-X]] since keyslots 0x15 and 0x16 are generated from different 0x11 keyXs.&lt;br /&gt;
&lt;br /&gt;
Writing an incorrect key to NAND will cause arm9loader to decrypt the ARM9 kernel as garbage and then jump to it.&lt;br /&gt;
&lt;br /&gt;
This allows an hardware-based attack where you can boot into an older exploited firmware, fill all memory with NOP sleds/jump-instructions, and then reboot into executing garbage. By automating this process with various input keydata, eventually you&#039;ll find some garbage that jumps to your code.&lt;br /&gt;
&lt;br /&gt;
This gives very early ARM9 code execution (pre-ARM9 kernel). As such, it is possible to dump RSA keyslots with this and calculate the 6.x [[Savegames#6.0.0-11_Savegame_keyY|save]], and 7.x [[NCCH]] keys. This cannot be used to recover keys initialized by arm9loader itself. This is due to it wiping the area used for its stack during NAND sector decryption and keyslot init. &lt;br /&gt;
&lt;br /&gt;
Due to FIRMs on both Old and New 3DS using the same RSA data, this can be exploited on Old3DS as well, but only if one already has the actual plaintext normalkey from New3DS NAND sector 0x96 offset-0 and has dumped the OTP area of the Old3DS.&lt;br /&gt;
| Recovery of 6.x [[Savegames#6.0.0-11_Savegame_keyY|save key]]/7.x [[NCCH]] key&lt;br /&gt;
| None&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| March, 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| Uncleared New3DS keyslot 0x11&lt;br /&gt;
| Originally the New3DS [[FIRM]] arm9bin loader only cleared keyslot 0x11 when it gets executed at firmlaunch. This was fixed with [[9.5.0-22|9.5.0-X]] by completely clearing keyslot 0x11 immediately after the loader finishes using keyslot 0x11.&lt;br /&gt;
This means that any ARM9 code that can execute before the loader clears the keyslot at firmlaunch(including firmlaunch-hax) can get access to the uncleared keyslot 0x11, which then allows one to generate all &amp;lt;=v9.5 New3DS keyXs which are generated by keyslot 0x11.&lt;br /&gt;
&lt;br /&gt;
Therefore, to completely fix this the loader would have to generate more keys using different keyslot 0x11 keydata. This was done with [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
| New3DS keyXs generation&lt;br /&gt;
| Mostly fixed with [[9.5.0-22|9.5.0-X]], completely fixed with new keys with [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
| &lt;br /&gt;
| February 3, 2015 (one day after [[9.5.0-22|9.5.0-X]] release)&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Public disclosure timeframe&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Leak of normal-key matching a key-scrambler key&lt;br /&gt;
| New 3DS firmware versions [[8.1.0-0 New3DS|8.1.0]] through [[9.2.0-20|9.2.0]] set the encryption key for [[Amiibo]] data using a hardcoded normal-key in Process9.  In firmware [[9.3.0-21|9.3.0]], Nintendo &amp;quot;fixed&amp;quot; this by using the key scrambler instead, by calculating the keyY value for keyslot 0x39 that results in the same normal-key, then hardcoding that keyY into Process9.&lt;br /&gt;
&lt;br /&gt;
Nintendo&#039;s fix is actually the problem: Nintendo revealed the normal-key matching an unknown keyX and a known keyY.  Combined with the key scrambler using an insecure scrambling algorithm (see &amp;quot;Hardware&amp;quot; above), the key scrambler function could be deduced.&lt;br /&gt;
| Deducing the keyX for keyslot 0x39 and the key scrambler algorithm&lt;br /&gt;
| New 3DS [[9.3.0-21|9.3.0-X]], sort of&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| Sometime in 2015 after the hardware key-generator was broken.&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| &lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[10.3.0-28|10.3.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| Title downgrading via [[Application_Manager_Services|AM]]([[Application_Manager_Services_PXI|PXI]])&lt;br /&gt;
| When a title is *already* installed, Process9 will compare the installed title-version with the title-version being installed. When the one being installed is older, Process9 would return an error.&lt;br /&gt;
&lt;br /&gt;
However, this can be bypassed by just deleting the title first via the service command(s) for that: with the title removed from the [[Title_Database]], Process9 can&#039;t compare the input title-version with anything. Hence, titles can be downgraded this way.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| None&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| FAT FS code null-deref&lt;br /&gt;
| When FSFile:Read is used with a file which is corrupted on a FAT filesystem(in particular SD), Process9 can crash. This particular crash is caused by a function returning NULL instead of an actual ptr due to an error. The caller of that function doesn&#039;t check for NULL which then triggers a read based at NULL.&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;fsck.vfat -n -v -V &amp;lt;fat image backup&amp;gt;&amp;quot; output for the above crash:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
Starting check/repair pass.&lt;br /&gt;
&amp;lt;FilePath0&amp;gt; and&lt;br /&gt;
&amp;lt;FilePath1&amp;gt;&lt;br /&gt;
 share clusters.&lt;br /&gt;
 Truncating second to 3375104 bytes.&lt;br /&gt;
&amp;lt;FilePath1&amp;gt;&lt;br /&gt;
 File size is 2787392 bytes, cluster chain length is 16384 bytes.&lt;br /&gt;
 Truncating file to 16384 bytes.&lt;br /&gt;
Checking for unused clusters.&lt;br /&gt;
Reclaimed 1 unused cluster (16384 bytes).&lt;br /&gt;
Checking free cluster summary.&lt;br /&gt;
Free cluster summary wrong (1404490 vs. really 1404491)&lt;br /&gt;
 Auto-correcting.&lt;br /&gt;
Starting verification pass.&lt;br /&gt;
Checking for unused clusters.&lt;br /&gt;
Leaving filesystem unchanged.&amp;lt;/pre&amp;gt;&lt;br /&gt;
| Useless null-based-read&lt;br /&gt;
| None&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| July 8-9, 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| RSA signature padding checks&lt;br /&gt;
| The TWL_FIRM RSA sig padding check code used for all TWL RSA sig-checks has issues, see [[FIRM|here]].&lt;br /&gt;
The main 3DS RSA padding check code(non-certificate, including NATIVE_FIRM) uses the function used with the above to extract more padding + the actual hash from the additional padding. This isn&#039;t really a problem here because there&#039;s proper padding check code which is executed prior to this.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.5.0-22|9.5.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[AMPXI:ValidateDSiWareSectionMAC]] [[AES_Registers|AES]] keyslot reuse&lt;br /&gt;
| When the input DSiWare section index is higher than &amp;lt;max number of DSiWare sections supported by this FIRM&amp;gt;, Process9 uses keyid 0x40 for calculating the AESMAC, which translates to keyslot 0x40. The result is that the keyslot is left at whatever was already selected before, since the AES selectkeyslot code will immediately  return when keyslot is &amp;gt;=0x40. However, actually exploiting this is difficult: the calculated AESMAC is never returned, this command just compares the calculated AESMAC with the input AESMAC(result-code depends on whether the AESMACs match). It&#039;s unknown whether a timing attack would work with this.&lt;br /&gt;
This is basically a different form of the pxips9 keyslot vuln, except with AESMAC etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| March 15, 2015&lt;br /&gt;
| December 29, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| pxips9 [[AES_Registers|AES]] keyslot reuse&lt;br /&gt;
| This requires access to the [[Process_Services|ps:ps]]/pxi:ps9 services. One way to get access to this would be snshax on system-version &amp;lt;=10.1.0-X(see 32c3 3ds talk).&lt;br /&gt;
When an invalid key-type value is passed to any of the PS commands, Process9 will try to select keyslot 0x40. That aesengine_setkeyslot() code will then immediately return due to the invalid keyslot value. Since that function doesn&#039;t return any errors, Process9 will just continue to do crypto with whatever AES keyslot was selected before the PS command was sent.&lt;br /&gt;
| Reusing the previously used keyslot, for crypto with PS.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| Roughly the same time(same day?) as firmlaunch-hax.&lt;br /&gt;
| December 29, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| firmlaunch-hax: FIRM header ToCToU&lt;br /&gt;
| This can&#039;t be exploited from ARM11 userland.&lt;br /&gt;
During [[FIRM]] launch, the only FIRM header the ARM9 uses at all is stored in FCRAM, this is 0x200-bytes(the actual used FIRM RSA signature is read to the Process9 stack however). The ARM9 doesn&#039;t expect &amp;quot;anything&amp;quot; besides the ARM9 to access this data.&lt;br /&gt;
With [[9.5.0-22]] the address of this FIRM header was changed from a FCRAM address, to ARM9-only address 0x01fffc00.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[9.5.0-22]]&lt;br /&gt;
| &lt;br /&gt;
| 2012, 3 days after [[User:Yellows8|Yellows8]] started Process9 code RE.&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Uninitialized data output for (PXI) command replies&lt;br /&gt;
| PXI commands for various services(including some [[Filesystem_services_PXI|here]] and many others) can write uninitialized data (like from ARM registers) to the command reply. This happens with stubbed commands, but this can also occur with certain commands when returning an error.&lt;br /&gt;
Certain ARM11 service commands have this same issue as well.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem_services_PXI|FSPXI]] OpenArchive SD permissions&lt;br /&gt;
| Process9 does not use the exheader ARM9 access-mount permission flag for SD at all.&lt;br /&gt;
This would mean ARM11-kernelmode code / fs-module itself could directly use FSPXI to access SD card without ARM9 checking for SD access, but this is rather useless since a process is usually running with SD access(Home Menu for example) anyway.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| 2012&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[AMPXI:ExportDSiWare]] export path&lt;br /&gt;
| Process9 allocates memory on Process9 heap for the export path then verifies that the actual allocated size matches the input size. Then Process9 copies the input path from FCRAM to this buffer, and uses it with the Process9 FS openfile code, which use paths in the form of &amp;quot;&amp;lt;mountpoint&amp;gt;:/&amp;lt;path&amp;gt;&amp;quot;.&lt;br /&gt;
Process9 does not check the contents of this path at all before passing it to the FS code, besides writing a NUL-terminator to the end of the buffer.&lt;br /&gt;
| Exporting of DSiWare to arbitrary Process9 file-paths, such as &amp;quot;nand:/&amp;lt;path&amp;gt;&amp;quot; etc. This isn&#039;t really useful since the data which gets written can&#039;t be controlled.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.5.0-22]]&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DSiWare_Exports]] [[CTCert]] verification&lt;br /&gt;
| Just like DSi originally did, 3DS verifies the APCert for DSiWare on SD with the CTCert also in the DSiWare .bin. On DSi this was fixed with with system-version 1.4.2 by verifying with the actual console-unique cert instead(stored in NAND), while on 3DS it&#039;s still not(?) fixed.&lt;br /&gt;
On 3DS however this is rather useless, due to the entire DSiWare .bin being encrypted with the console-unique movable.sed keyY.&lt;br /&gt;
| When the movable.sed keyY for the target 3DS is known and the target 3DS CTCert private-key is unknown, importing of modified DSiWare SD .bin files.&lt;br /&gt;
| Unknown, probably none.&lt;br /&gt;
| ?&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Gamecard_Services_PXI]] unchecked REG_CTRCARDCNT transfer-size&lt;br /&gt;
| The u8 REG_CTRCARDCNT transfer-size parameter for the [[Gamecard_Services_PXI]] read/write CTRCARD commands is used as an index for an array of u16 values. Before [[5.0.0-11|5.0.0-X]] this u8 value wasn&#039;t checked, thus out-of-bounds reads could be triggered(which is rather useless in this case).&lt;br /&gt;
| Out-of-bounds read for a value which gets written to a register.&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2013?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[PXI_Registers|PXI]] cmdbuf buffer overrun&lt;br /&gt;
| The Process9 code responsible [[PXI_Registers|PXI]] communications didn&#039;t verify the size of the incoming command before writing it to a C++ member variable. &lt;br /&gt;
| Probably ARM9 code execution&lt;br /&gt;
| [[5.0.0-11|5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| March 2015, original timeframe if any unknown&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]/[[User:Yellows8|Yellows8]]/maybe others(?)&lt;br /&gt;
|-&lt;br /&gt;
| [[Application_Manager_Services_PXI|PXIAM]] command 0x003D0108(See also [[Application_Manager_Services|this]])&lt;br /&gt;
| When handling this command, Process9 allocates a 0x2800-byte heap buffer, then copies the 4 FCRAM input buffers to this heap buffer without checking the sizes at all(only the buffers with non-zero sizes are copied). Starting with [[5.0.0-11|5.0.0-X]], the total combined size of the input data must be &amp;lt;=0x2800.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| May 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Process_Services_PXI|PS RSA]] commands buffer overflows&lt;br /&gt;
| pxips9 cmd1(not accessible via ps:ps) and VerifyRsaSha256: unchecked copy to a buffer in Process9&#039;s .bss, from the input FCRAM buffer. The buffer is located before the pxi cmdhandler threads&#039; stacks. SignRsaSha256 also has a buf overflow, but this isn&#039;t exploitable.&lt;br /&gt;
The buffer for this is the buffer for the signature data. With v5.0, the signature buffer was moved to stack, with a check for the signature data size. When the signature data size is too large, Process9 uses [[SVC|svcBreak]].&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[PXI_Registers|PXI]] pxi_id bad check&lt;br /&gt;
| The Process9 code responsible for [[PXI_Registers|PXI]] communications read pxi_id as a signed char. There were two flaws:&lt;br /&gt;
* They used it as index to a lookup-table without checking the value at all.&lt;br /&gt;
* Another function verified that pxi_id &amp;lt; 7, allowing negative values to pass the check. This would also cause an out-of-range table-lookup.&lt;br /&gt;
| Maybe ARM9 code execution&lt;br /&gt;
| [[3.0.0-5|3.0.0-5]]&lt;br /&gt;
|&lt;br /&gt;
| March 2015, originally 2012 for the first issue at least&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]], maybe others(?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel9 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG Registers#CFG_SYSPROT9|CFG_SYSPROT9]] bit1 not set by Kernel9&lt;br /&gt;
| Old versions of Kernel9 never set bit1 of [[CONFIG Registers#CFG_SYSPROT9|CFG_SYSPROT9]]. This leaves the [[OTP Registers|0x10012000]]-region unprotected (this region should be locked early during boot!). Since it&#039;s never locked, you can dump it once you get ARM9 code execution. See [[OTP Registers|here]] regarding the data stored there.&lt;br /&gt;
&lt;br /&gt;
From [[3.0.0-5|3.0.0-X]] this was fixed by setting the bit in Kernel9 after poking some registers in that region. On New3DS arm9loader sets this bit instead of Kernel9.&lt;br /&gt;
&lt;br /&gt;
This flaw resurged when it gained a new practical use: retrieving the OTP data for a New3DS console in order to decrypt the key data used in arm9loader. This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (see partition encryption types [[Flash_Filesystem#NAND_structure|here]]), it is possible to boot a New3DS using Old3DS firmware 1.0-2.x, and retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping of the [[OTP Registers|OTP]] area&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| February 2015&lt;br /&gt;
| [[User:Plutooo|plutoo]], Normmatt independently&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM11 software ==&lt;br /&gt;
=== Kernel11 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
|  [[SVC]] table too small&lt;br /&gt;
|  The table of function pointers for SVC&#039;s only contains entries up to 0x7D, but the biggest allowed SVC for the table is 0x7F. Thus, executing SVC7E or SVC7F would make the SVC-handler read after the buffer, and interpret some ARM instructions as function pointers.&lt;br /&gt;
&lt;br /&gt;
However, this would require patching the kernel .text or modifying SVC-access-control. Even if you could get these to execute, they would still jump to memory that isn&#039;t mapped as executable.&lt;br /&gt;
| &lt;br /&gt;
|  None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| 2012&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
|  [[SVC|svcBackdoor (0x7B)]]&lt;br /&gt;
|  This backdoor allows executing SVC-mode code at the user-specified code-address. This is used by Process9, using this on the ARM11(with NATIVE_FIRM) requires patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
|  None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory_layout#ARM11_Detailed_virtual_memory_map|0xEFF00000]] / 0xDFF00000 ARM11 kernel virtual-memory&lt;br /&gt;
| The ARM11 kernel-mode 0xEFF00000/0xDFF00000 virtual-memory(size 0x100000) is mapped to phys-mem 0x1FF00000(entire DSP-mem + entire AXIWRAM), with permissions RW-. This is used during ARM11 kernel startup for loading the FIRM-modules from the FIRM section located in DSP-mem, this never seems to be used after that, however. This is never unmapped either.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Memchunkhax2&lt;br /&gt;
| &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| derrek&lt;br /&gt;
|-&lt;br /&gt;
|  AffinityMask/processorid validation&lt;br /&gt;
|  With [[10.0.0-27|10.0.0-X]] the following functions were updated: svcGetThreadAffinityMask, svcGetProcessAffinityMask, svcSetProcessAffinityMask, and svcCreateThread. The code changes for all but svcCreateThread are identical.&lt;br /&gt;
The original code with the first 3 did the following: &lt;br /&gt;
* if(u32_processorcount &amp;gt; ~0x80000001)return 0xe0e01bfd;&lt;br /&gt;
* if(s32_processorcount &amp;gt; &amp;lt;total_cores&amp;gt;)return 0xd8e007fd;&lt;br /&gt;
The following code replaced the above:&lt;br /&gt;
* if(u32_processorcount &amp;gt;= &amp;lt;total_cores+1&amp;gt;)return 0xd8e007fd;&lt;br /&gt;
In theory the latter should catch everything that the former did, so it&#039;s unknown if this was really a security issue.&lt;br /&gt;
&lt;br /&gt;
The svcCreateThread changes with [[10.0.0-27|10.0.0-X]] definitely did fix a security issue.&lt;br /&gt;
* Original code: &amp;quot;if(s32_processorid &amp;gt; &amp;lt;total_cores&amp;gt;)return 0xd8e007fd;&amp;quot;&lt;br /&gt;
* New code: &amp;quot;if(s32_processorid &amp;gt;= &amp;lt;total_cores&amp;gt; || s32_processorid &amp;lt;= -4)return 0xd8e007fd;&amp;quot;&lt;br /&gt;
This fixed an off-by-one issue: if one would use processorid=total_cores, which isn&#039;t actually a valid value, svcCreateThread would accept that value on &amp;lt;[[10.0.0-27|10.0.0-X]]. This results in data being written out-of-bounds(baseaddr = arrayaddr + entrysize*processorid), which has the following result:&lt;br /&gt;
* Old3DS: Useless kernel-mode crash due to accessing unmapped memory.&lt;br /&gt;
* New3DS: uncontrolled data write into a kernel-mode L1 MMU-table. This isn&#039;t really useful: the data can&#039;t be controlled, and the data which gets overwritten is all-zero anyway(this isn&#039;t anywhere near MMU L1 entries for actually mapped memory).&lt;br /&gt;
The previous version also allowed large negative s32_processorid values(negative processorid values are special values not actual procids), but it appears using values like that won&#039;t actually do anything(meaning no crash) besides the thread not running / thread not running for a while(besides triggering a kernelpanic with certain s32_processorid value(s)).&lt;br /&gt;
| Nothing useful&lt;br /&gt;
|  [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| svcCreateThread issue: May 31, 2015. The rest: September 8, 2015, via v9.6-&amp;gt;v10.0 ARM11-kernel code-diff.&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax&lt;br /&gt;
| The kernel originally did not validate the data stored in the FCRAM kernel heap [[Memchunkhdr|memchunk-headers]] for free-memory at all. Exploiting this requires raw R/W access to these memchunk-headers, like physical-memory access with gspwn.&lt;br /&gt;
&lt;br /&gt;
There are &#039;&#039;multiple&#039;&#039; ways to exploit this, but the end-result for most of these is the same: overwrite code in AXIWRAM via the 0xEFF00000/0xDFF00000 kernel virtual-memory mapping.&lt;br /&gt;
&lt;br /&gt;
This was fixed in [[9.3.0-21|9.3.0-X]] by checking that the memchunk(including size, next, and prev ptrs) is located within the currently used heap memory. The kernel may also check that the next/prev ptrs are valid compared to other memchunk-headers basically. When any of these checks fail, kernelpanic() is called.&lt;br /&gt;
| When combined with other flaws: ARM11-kernelmode code execution&lt;br /&gt;
| [[9.3.0-21|9.3.0-21]]&lt;br /&gt;
| &lt;br /&gt;
| February 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Multiple [[KLinkedListNode|KLinkedListNode]] SlabHeap use after free bugs&lt;br /&gt;
| The ARM11-kernel did access the &#039;key&#039; field of [[KLinkedListNode|KLinkedListNode]] objects, which are located on the SlabHeap, after freeing them. Thus, triggering an allocation of a new [[KLinkedListNode|KLinkedListNode]] object at the right time could result in a type-confusion. Pseudo-code:&lt;br /&gt;
SlabHeap_free(KLinkedListNode);&lt;br /&gt;
KObject *obj = KLinkedListNode-&amp;gt;key;  // the object there might have changed!&lt;br /&gt;
This bug appeared all over the place.&lt;br /&gt;
| ARM11-kernelmode code exec maybe&lt;br /&gt;
| [[8.0.0-18|8.0.0-18]]&lt;br /&gt;
| &lt;br /&gt;
| April 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| PXI [[RPC_Command_Structure|Command]] input/output buffer permissions&lt;br /&gt;
| Originally the ARM11-kernel didn&#039;t check permissions for PXI input/output buffers for commands. Starting with [[6.0.0-11|6.0.0]] PXI input/output buffers must have RW permissions, otherwise kernelpanic is triggered.&lt;br /&gt;
| &lt;br /&gt;
| [[6.0.0-11|6.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcStartInterProcessDma]]&lt;br /&gt;
| For svcStartInterProcessDma, the kernel code had the following flaws:&lt;br /&gt;
&lt;br /&gt;
* Originally the ARM11-kernel read the input DmaConfig structure directly in kernel-mode(ldr(b/h) instructions), without checking whether the DmaConfig address is readable under userland. This was fixed by copying that structure to the SVC-mode stack, using the ldrbt instruction.&lt;br /&gt;
&lt;br /&gt;
* Integer overflows for srcaddr+size and dstaddr+size are now checked(with [[6.0.0-11]]), which were not checked before.&lt;br /&gt;
&lt;br /&gt;
* The kernel now also checks whether the srcaddr/dstaddr (+size) is within userland memory (0x20000000), the kernel now (with [[6.0.0-11]]) returns an error when the address is beyond userland memory. Using an address &amp;gt;=0x20000000 would result in the kernel reading from the process L1 MMU table, beyond the memory allocated for that MMU table(for vaddr-&amp;gt;physaddr conversion). &lt;br /&gt;
| &lt;br /&gt;
| [[6.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| DmaConfig issue: unknown. The rest: 2014&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] independently&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcControlMemory]] Parameter checks&lt;br /&gt;
| For svcControlMemory the parameter check had these two flaws:&lt;br /&gt;
&lt;br /&gt;
* The allowed range for addr0, addr1, size parameters depends on which MemoryOperation is being specified. The limitation for GSP heap was only checked if op=(u32)0x10003. By setting a random bit in op that has no meaning (like bit17?), op would instead be (u32)0x30003, and the range-check would be less strict and not accurate. However, the kernel doesn&#039;t actually use the input address for LINEAR memory-mapping at all besides the range-checks, so this isn&#039;t actually useful. This was fixed in the kernel by just checking for the LINEAR bit, instead of comparing the entire MemoryOperation value with 0x10003.&lt;br /&gt;
&lt;br /&gt;
* Integer overflows on (addr0+size) are now checked that previously weren&#039;t (this also applies to most other address checks elsewhere in the kernel).&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| [[RPC_Command_Structure|Command]] request/response buffer overflow&lt;br /&gt;
| Originally the kernel did not check the word-values from the command-header. Starting with [[5.0.0-11]], the kernel will trigger a kernelpanic() when the total word-size of the entire command(including the cmd-header) is larger than 0x40-words (0x100-bytes). This allows overwriting threadlocalstorage+0x180 in the destination thread. However, since the data written there would be translate parameters (such as header-words + buffer addresses), exploiting this would likely be very difficult, if possible at all.&lt;br /&gt;
&lt;br /&gt;
If the two words at threadlocalstorage+0x180 could be overwritten with controlled data this way, one could then use a command with a buffer-header of &amp;lt;nowiki&amp;gt;((size&amp;lt;&amp;lt;14) | 2)&amp;lt;/nowiki&amp;gt; to write arbitrary memory to any RW userland memory in the destination process.&lt;br /&gt;
| &lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| v4.1 FIRM -&amp;gt; v5.0 code diff&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|SVC stack allocation overflows]]&lt;br /&gt;
| &lt;br /&gt;
* Syscalls that allocate a variable-length array on stack, only checked bit31 before multiplying by 4/16 (when calculating how much memory to allocate). If a large integer was passed as input to one of these syscalls, an integer overflow would occur, and too little memory would have been allocated on stack resulting in a buffer overrun. &lt;br /&gt;
* The alignment (size+7)&amp;amp;~7 calculation before allocation was not checked for integer overflow.&lt;br /&gt;
&lt;br /&gt;
This might allow for ARM11 kernel code-execution.&lt;br /&gt;
&lt;br /&gt;
(Applies to svcSetResourceLimitValues, svcGetThreadList, svcGetProcessList, svcReplyAndReceive, svcWaitSynchronizationN.)&lt;br /&gt;
| &lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| v4.1 FIRM -&amp;gt; v5.0 code diff&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] complementary&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcControlMemory]] MemoryOperation MAP memory-permissions&lt;br /&gt;
| svcControlMemory with MemoryOperation=MAP allows mapping the already-mapped process virtual-mem at addr1, to addr0. The lowest address permitted for addr1 is 0x00100000. Originally the ARM11 kernel didn&#039;t check memory permissions for addr1. Therefore .text as addr1 could be mapped elsewhere as RW- memory, which allowed ARM11 userland code-execution.&lt;br /&gt;
| &lt;br /&gt;
| [[4.1.0-8]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[RPC_Command_Structure|Command]] input/output buffer permissions&lt;br /&gt;
| Originally the ARM11 kernel didn&#039;t check memory permissions for the input/output buffers for commands. Starting with [[4.0.0-7]] the ARM11 kernel will trigger a kernelpanic() if the input/output buffers don&#039;t have the required memory permissions. For example, this allowed a FSUSER file-read to .text, which therefore allowed ARM11-userland code execution.&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcReadProcessMemory/svcWriteProcessMemory memory]] permissions&lt;br /&gt;
| Originally the kernel only checked the first page(0x1000-bytes) of the src/dst buffers, for svcReadProcessMemory and svcWriteProcessMemory. There is no known retail processes which have access to these SVCs.&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| &lt;br /&gt;
| 2012?&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== [[FIRM]] Sysmodules ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[Services|&amp;quot;srv:pm&amp;quot;]] process registration&lt;br /&gt;
| Originally any process had access to the port &amp;quot;srv:pm&amp;quot;. The PID&#039;s used for the (un)registration commands are not checked either. This allowed any process to re-register itself with &amp;quot;srv:pm&amp;quot;, and therefore allowed the process to give itself access to any service, bypassing the exheader service-access-control list.&lt;br /&gt;
&lt;br /&gt;
This was fixed in [[7.0.0-13]]: starting with [[7.0.0-13]] &amp;quot;srv:pm&amp;quot; is now a service instead of a globally accessible port. Only processes with PID&#039;s less than 6 (in other words: fs, ldr, sm, pm, pxi modules) have access to it. With [[7.0.0-13]] there can only be one session for &amp;quot;srv:pm&amp;quot; open at a time(this is used by pm module), svcBreak will be executed if more sessions are opened by the processes which can access this.&lt;br /&gt;
&lt;br /&gt;
This flaw was needed for exploiting the &amp;lt;=v4.x Process9 PXI vulnerabilities from ARM11 userland ROP, since most applications don&#039;t have access to those service(s).&lt;br /&gt;
| Access to arbitrary services&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| FSDIR null-deref&lt;br /&gt;
| [[Filesystem_services|FS]]-module may crash in some cases when handling directory reading. The trigger seems to be due to using [[FSDir:Close]] without closing the dir-handle afterwards?(Perhaps this is caused by out-of-memory?) This seems to be useless since it&#039;s just a null-deref.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| May 19(?)-20, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Standalone Sysmodules ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in system-module system-version&lt;br /&gt;
!  Last system-module system-version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Timeframe this was added to wiki&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[NIM_Services|NIM]]: Downloading old title-versions from eShop&lt;br /&gt;
| Multiple NIM service commands(such as [[NIMS:StartDownload]]) use a title-version value specified by the user-process, NIM does not validate that this input version matches the latest version available via SOAP. Therefore, when combined with AM(PXI) [[#Process9|title-downgrading]] via deleting the target eShop title with System Settings Data Management(if the title was already installed), this allows downloading+installing any title-version from eShop &#039;&#039;if&#039;&#039; it&#039;s still available from CDN.&lt;br /&gt;
The easiest way to exploit this is to just patch the eShop system-application code using these NIM commands(ideally the code which loads the title-version).&lt;br /&gt;
&lt;br /&gt;
Originally this was tested with a debugging-system via modded-FIRM, eventually smea implemented it in HANS for the 32c3 release.&lt;br /&gt;
| Downloading old title-versions from eShop&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| October 24, 2015 (Unknown when exactly the first eShop title downgrade was actually tested, maybe November)&lt;br /&gt;
| January 7, 2016 (Same day Ironfall v1.0 was removed from CDN via the main-CXI files)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SPI_Services|SPI]] service out-of-bounds write&lt;br /&gt;
| cmd1 has out-of-bounds write allowing overwrite of some static variables in .data.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.5.0-22]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NFC_Services|NFC]] module service command buf-overflows&lt;br /&gt;
| NFC module copies data with certain commands, from command input buffers to stack without checking the size. These commands include the following, it&#039;s unknown if there&#039;s more commands with similar issues: &amp;quot;nfc:dev&amp;quot; &amp;lt;0x000C....&amp;gt; and &amp;quot;nfc:s&amp;quot; &amp;lt;0x0037....&amp;gt;.&lt;br /&gt;
Since both of these commands are stubbed in the Old3DS NFC module from the very first version(those just return an error), these issues only affect the New3DS NFC module.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known retail titles which have access to either of these services.&lt;br /&gt;
| ROP under NFC module.&lt;br /&gt;
| New3DS: None&lt;br /&gt;
| New3DS: [[9.5.0-22]]&lt;br /&gt;
| December 2014?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[News_Services|NEWSS]] service command notificationID validation failure&lt;br /&gt;
| This module does not validate the input notificationID for &amp;lt;nowiki&amp;gt;&amp;quot;news:s&amp;quot;&amp;lt;/nowiki&amp;gt; service commands. This is an out-of-bounds array index bug. For example, [[NEWSS:SetNotificationHeader]] could be used to exploit news module: this copies the input data(size is properly checked) to: out = newsdb_savedata+0x10 + (someu32array[notificationID]*0x70).&lt;br /&gt;
| ROP under news module.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.7.0-25|9.7.0-X]]&lt;br /&gt;
| December 2014&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWMUDS:DecryptBeaconData]] heap buffer overflow&lt;br /&gt;
| input_size = 0x1E * &amp;lt;value the u8 from input_[[NWM_Services|networkstruct]]+0x1D&amp;gt;. Then input_tag0 is copied to a heap buffer. When input_size is larger than 0xFA-bytes, it will then copy input_tag1 to &amp;lt;end_address_of_previous_outbuf&amp;gt;, with size=input_size-0xFA.&lt;br /&gt;
&lt;br /&gt;
This can be triggered by either using this command directly, or by boadcasting a wifi beacon which triggers it while a 3DS system running the target process is in range, when the process is scanning for hosts to connect to. Processes will only pass tag data to this command when the wlancommID and other thing(s) match the values for the process.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to actually exploit this for getting ROP under NWM-module, at the time of originally adding this to the wiki. This is because the data which gets copied out-of-bounds *and* actually causes crash(es), can&#039;t be controlled it seems(with just broadcasting a beacon at least). It&#039;s unknown whether this could be exploited from just using NWMUDS service-cmd(s) directly.&lt;br /&gt;
| Without any actual way to exploit this: NWM-module DoS, resulting in process termination(process crash). This breaks *everything* involving wifi comms, a reboot is required to recover from this.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| ~September 23, 2014(see the [[NWMUDS:DecryptBeaconData]] page history)&lt;br /&gt;
| August 3, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HID_Services|HID]] module shared-mem&lt;br /&gt;
| HID module does not validate the index values in [[HID_Shared_Memory|sharedmem]](just changes index to 0 when index == maxval when updating), therefore large values will result in HID module writing HID data to arbitrary addresses.&lt;br /&gt;
| ROP under HID module, but this is *very* unlikely to be exploitable since the data written is HID data.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.3.0-21]]&lt;br /&gt;
| 2014?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| gspwn&lt;br /&gt;
| GSP module does not validate addresses given to the GPU. This allows a user-mode application/applet to read/write to a large part of physical FCRAM using GPU DMA. From this, you can overwrite the .text segment of the application you&#039;re running under, and gain real code-execution from a ROP-chain. Normally applets&#039; .text([[Home Menu]], [[Internet Browser]], etc) is located beyond the area accessible by the GPU, except for [[RO_Services|CROs]] used by applets([[Internet Browser]] for example).&lt;br /&gt;
&lt;br /&gt;
FCRAM is gpu-accessible up to physaddr 0x26800000 on Old3DS, and 0x2DC00000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 with the default memory-layout on Old3DS/New3DS.&lt;br /&gt;
| User-mode code execution.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Early 2014&lt;br /&gt;
| &lt;br /&gt;
| smea, [[User:Yellows8|Yellows8]]/others before then&lt;br /&gt;
|-&lt;br /&gt;
| rohax&lt;br /&gt;
| Using gspwn, it is possible to overwrite a loaded [[CRO0]]/[[CRR0]] after its RSA-signature has been validated. Badly validated [[CRO0]] header leads to arbitrary read/write of memory in the ro-process. This gives code-execution in the ro module, who has access to [[SVC|syscalls]] 0x70-0x72, 0x7D.&lt;br /&gt;
&lt;br /&gt;
This was fixed after [[ninjhax]] release by adding checks on [[CRO0]]-based pointers before writing to them.&lt;br /&gt;
| Memory-mapping syscalls.&lt;br /&gt;
| [[9.3.0-21]]&lt;br /&gt;
| [[9.4.0-21]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| smea, [[User:Plutooo|plutoo]] joint effort&lt;br /&gt;
|-&lt;br /&gt;
| Region free&lt;br /&gt;
| Only [[Home Menu]] itself checks gamecards&#039; region when launching them. Therefore, any application launch that is done directly with [[NS]] without signaling Home Menu to launch the app, will result in region checks being bypassed.&lt;br /&gt;
This essentially means launching the gamecard with the [[NS_and_APT_Services|&amp;quot;ns:s&amp;quot;]] service. The main way to exploit this is to trigger a FIRM launch with an application specified, either with a normal FIRM launch or a hardware [[NSS:RebootSystem|reboot]].&lt;br /&gt;
| Launching gamecards from any region + bypassing Home Menu gamecard-sysupdate installation&lt;br /&gt;
| None&lt;br /&gt;
| Last tested with [[10.1.0-27|10.1.0-X]].&lt;br /&gt;
| June(?) 2014&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]] service-cmd state null-ptr deref&lt;br /&gt;
| The NWMUDS service command code loads a ptr from .data, adds an offset to that, then passes that as the state address for the actual command-handler function. The value of the ptr loaded from .data is not checked, therefore this will cause crashes due to that being 0x0 when NWMUDS was not properly initialized.&lt;br /&gt;
It&#039;s unknown whether any NWM services besides NWMUDS have this issue.&lt;br /&gt;
| This is rather useless since it&#039;s only a crash caused by a state ptr based at 0x0.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| 2013?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== General/CTRSDK ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|UDS]] beacon additional-data buffer overflow&lt;br /&gt;
| Originally CTRSDK did not validate the UDS additional-data size before using that size to copy the additional-data to a [[NWM_Services|networkstruct]]. This was eventually fixed.&lt;br /&gt;
This was discovered while doing code RE with an old dlp-module version. It&#039;s unknown in what specific CTRSDK version this was fixed, or even what system-version updated titles with a fixed version.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown if there&#039;s any titles using a vulnerable CTRSDK version which are also exploitable with this(dlp module can&#039;t be exploited with this).&lt;br /&gt;
&lt;br /&gt;
The maximum number of bytes that can be written beyond the end of the outbuf is 0x37-bytes, with additionaldata_size=0xFF.&lt;br /&gt;
| Perhaps ROP, very difficult if possible with anything at all&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| September(?) 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=15436</id>
		<title>3DS System Flaws</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=15436"/>
		<updated>2016-01-19T19:41:56Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: this can be worked around as an initial entrypoint but it&amp;#039;s not really intended as that. also cleanup on base exploit description - k9l keys aren&amp;#039;t really relevant to this hack. standby for known-plaintext description.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Exploits are used to execute unofficial code (homebrew) on the Nintendo 3DS. This page is a list of publicly known system flaws, for userland applications/applets flaws see [[3DS_Userland_Flaws|here]].&lt;br /&gt;
&lt;br /&gt;
=Stale / Rejected Efforts=&lt;br /&gt;
* Neimod has been working on a RAM dumping setup for a little while now. He&#039;s de-soldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039; PCB up to a custom RAM dumping setup. A while ago he published photos showing his setup to be working quite well, with the 3DS successfully booting up. However, his flickr stream is now private along with most of his work.&lt;br /&gt;
&lt;br /&gt;
* Someone (who will remain unnamed) has released CFW and CIA installers, all of which is copied from the work of others, or copyrighted material.&lt;br /&gt;
&lt;br /&gt;
==Tips and info==&lt;br /&gt;
The 3DS uses the XN feature of the ARM11 processor. There&#039;s no official way from applications to enable executable permission for memory containing arbitrary unsigned code(there&#039;s a [[SVC]] for this, but only [[RO_Services|RO-module]] has access to it). An usable userland exploit would still be useful: you could only do return-oriented-programming with it initially. From ROP one could then exploit system flaw(s), see below.&lt;br /&gt;
&lt;br /&gt;
SD card [[extdata]] and SD savegames can be attacked, for consoles where the console-unique [[Nand/private/movable.sed|movable.sed]] was dumped(accessing SD data is far easier by running code on the target 3DS however).&lt;br /&gt;
&lt;br /&gt;
=System flaws=&lt;br /&gt;
== Hardware ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed with hardware model/revision&lt;br /&gt;
!  Newest hardware model/revision this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| ARM9/ARM11 bootrom vectors point at unitialized RAM&lt;br /&gt;
| ARM9&#039;s and ARM11&#039;s exception vectors are hardcoded to point at the CPU&#039;s internal memory (0x08000000 region for ARM9, AXIWRAM for ARM11). While the bootrom does set them up to point to an endless loop at some point during boot, it does not do so immediately. As such, a carefully-timed fault injection (via hardware) to trigger an exception (such as an invalid instruction) will cause execution to fall into ARM9 RAM. &lt;br /&gt;
Since RAM isn&#039;t cleared on boot (see below), one can immediately start execution of their own code here to dump bootrom, OTP, etc.&lt;br /&gt;
The ARM9 bootrom does the following at reset:  reset vector branches to another instruction, then branches to bootrom+0x8000. Hence, there&#039;s no way to know for certain when exactly the ARM9 exception-vector data stored in memory gets initialized.&lt;br /&gt;
&lt;br /&gt;
This requires *very* *precise* timing for triggering the hardware fault: it&#039;s unknown if anyone actually exploited this successfully at the time of writing(the one who attempted+discovered it *originally* as listed in this wiki section hasn&#039;t).&lt;br /&gt;
| None: all available 3DS models at the time of writing have the exact same ARM9/ARM11 bootrom for the unprotected areas.&lt;br /&gt;
| New3DS&lt;br /&gt;
| End of February 2014&lt;br /&gt;
| [[User:Derrek|derrek]], WulfyStylez (May 2015) independently&lt;br /&gt;
|-&lt;br /&gt;
| Missing AES key clearing&lt;br /&gt;
| The hardware AES engine does not clear keys when doing a hard reset/reboot.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2014&lt;br /&gt;
| Mathieulh/Others&lt;br /&gt;
|-&lt;br /&gt;
| No RAM clearing on reboots&lt;br /&gt;
| On an MCU-triggered reboot all RAM including FCRAM/ARM9 memory/AXIWRAM/VRAM keeps its contents.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2014&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| 32bits of actual console-unique TWLNAND keydata&lt;br /&gt;
| On retail the 8-bytes at ARM9 address [[Memory_layout|0x01FFB808]] are XORed with hard-coded data, to generate the TWL console-unique keys, including TWLNAND. On Old3DS the high u32 is always 0x0, while on New3DS that u32 is always 0x2. On top of this, the lower u32&#039;s highest bit is always ORed. only 31 bits of the TWL console-unique keydata / TWL consoleID are actually console-unique.&lt;br /&gt;
This allows one to easily bruteforce the TWL console-unique keydata with *just* data from TWLNAND. On DSi the actual console-unique data for key generation is 8-bytes(all bytes actually set).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2012?&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| DSi / 3DS-TWL key-generator&lt;br /&gt;
| After using the key generator to generate the normal-key, you could overwrite parts of the normal-key with your own data and then recover the key-generator output by comparing the new crypto output with the original crypto output. From the normal-key outputs, you could deduce the TWL key-generator function.&lt;br /&gt;
This applies to the keyX/keyY too.&lt;br /&gt;
&lt;br /&gt;
This attack does not work for the 3DS key-generator because keyslots 0-3 are only for TWL keys.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2011&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| 3DS key-generator&lt;br /&gt;
| The algorithm for generating the normal-keys for keyslots is cryptographically weak.  As a result, it is easily susceptible to differential cryptanalysis if the normal-key corresponding to any scrambler-generated keyslot is discovered.&lt;br /&gt;
&lt;br /&gt;
Several such pairs of matching normal-keys and KeyY values were found, leading to deducing the key-generator function.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Plutooo|plutoo]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
=== arm9loader ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Public disclosure timeframe&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Uncleared OTP hash keydata in console-unique 0x11 key-generation&lt;br /&gt;
| Kernel9Loader does not clear the [[SHA_Registers#SHA_HASH|SHA_HASH register]] after use. As a result, the data stored here as K9L hands over to Kernel9 is the hash of [[OTP_Registers|OTP data]] used to seed the [[FIRM#New_3DS_FIRM|console-unique NAND keystore decryption key]] set on keyslot 0x11.&lt;br /&gt;
&lt;br /&gt;
Retrieving this keydata and the [[Flash_Filesystem#0x12C00|NAND keystore]] of the same device allows calculating the decrypted New3DS NAND keystore (non-unique, common to all New3DS units), which contains AES normal keys, also set on keyslot 0x11, which are then used to derive all current [[AES_Registers#Keyslots|New3DS-only AES keyXs]] including the newer batch introduced in [[9.6.0-24#arm9loader|9.6.0-X]]. From there, it is trivial to perform the same key derivation in order to initialize those keys on any system version, and even on Old3DS.&lt;br /&gt;
&lt;br /&gt;
This can be performed by exploiting the &amp;quot;arm9loaderhax&amp;quot; vulnerability to obtain post-K9L code execution after an MCU reboot (the bootrom section-loading fail is not relevant here, this attack was performed without OTP data by brute-forcing keys), and using this to dump the SHA_HASH register. This attack works on any FIRM version shipping a vulnerable version of K9L, whereas OTP dumping required a boot of &amp;lt;[[3.0.0-6|3.0.0-X]].&lt;br /&gt;
&lt;br /&gt;
This attack results in obtaining the entire (0x200-bytes) NAND keystore - it was confirmed at a later date that this keystore is encrypted with the same key (by comparing the decrypted data from multiple units), and therefore using another key in this store will not remedy the issue as all keys are known (i.e. later, unused keys decrypt to the same 0x200-bytes constant with the same OTP hash). Later keys could have been encrypted differently but this is not the case. As a result of this, it is not possible for Nintendo to use K9L again in its current format for its intended purpose, though this was not news from the moment people dumped a New3DS OTP.&lt;br /&gt;
| Derivation of all New3DS keys generated via the NAND keystore (0x1B &amp;quot;Secure4&amp;quot; etc.)&lt;br /&gt;
| None&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| ~April 2015, implemented in May 2015&lt;br /&gt;
| 13 January 2016&lt;br /&gt;
| [[User:WulfyStylez|WulfyStylez]], [[User:Dazzozo|Dazzozo]], [[User:Shinyquagsire23|shinyquagsire23]] (complimentary + implemented), [[User:Plutooo|plutoo]], Normmatt (discovered independently)&lt;br /&gt;
|-&lt;br /&gt;
| enhanced-arm9loaderhax&lt;br /&gt;
| See the 32c3 3ds talk.&lt;br /&gt;
Since this is a combination of a trick with the arm9-bootrom + arm9loaderhax, and since you have to manually write FIRM to the firm0/firm1 NAND partitions, this can&#039;t be completely fixed. Any system with existing ARM9 code execution and an OTP/OTP hash dump can exploit this. Additionally, by using the FIRM partition known-plaintext bug and bruteforcing the second entry in the keystore, this can currently be exploited on all New3DS systems without any other prerequisite hacks.&lt;br /&gt;
| arm9loaderhax which automatically occurs at hard-boot.&lt;br /&gt;
| See arm9loaderhax / description.&lt;br /&gt;
| See arm9loaderhax / description.&lt;br /&gt;
| Theorized around mid July, 2015. Later implemented+tested by [[User:Plutooo|plutoo]] and derrek.&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Missing verification-block for the 9.6 keys (arm9loaderhax)&lt;br /&gt;
| Starting with [[9.6.0-24|9.6.0-X]] a new set of NAND-based keys were introduced. However, no verification block was added to verify that the new key read from NAND is correct. This was technically an issue from [[9.5.0-22|9.5.0-X]] with the original sector+0 keydata, however the below is only possible with [[9.6.0-24|9.6.0-X]] since keyslots 0x15 and 0x16 are generated from different 0x11 keyXs.&lt;br /&gt;
&lt;br /&gt;
Writing an incorrect key to NAND will cause arm9loader to decrypt the ARM9 kernel as garbage and then jump to it.&lt;br /&gt;
&lt;br /&gt;
This allows an hardware-based attack where you can boot into an older exploited firmware, fill all memory with NOP sleds/jump-instructions, and then reboot into executing garbage. By automating this process with various input keydata, eventually you&#039;ll find some garbage that jumps to your code.&lt;br /&gt;
&lt;br /&gt;
This gives very early ARM9 code execution (pre-ARM9 kernel). As such, it is possible to dump RSA keyslots with this and calculate the 6.x [[Savegames#6.0.0-11_Savegame_keyY|save]], and 7.x [[NCCH]] keys. This cannot be used to recover keys initialized by arm9loader itself. This is due to it wiping the area used for its stack during NAND sector decryption and keyslot init. &lt;br /&gt;
&lt;br /&gt;
Due to FIRMs on both Old and New 3DS using the same RSA data, this can be exploited on Old3DS as well, but only if one already has the actual plaintext normalkey from New3DS NAND sector 0x96 offset-0 and has dumped the OTP area of the Old3DS.&lt;br /&gt;
| Recovery of 6.x [[Savegames#6.0.0-11_Savegame_keyY|save key]]/7.x [[NCCH]] key&lt;br /&gt;
| None&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| March, 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| Uncleared New3DS keyslot 0x11&lt;br /&gt;
| Originally the New3DS [[FIRM]] arm9bin loader only cleared keyslot 0x11 when it gets executed at firmlaunch. This was fixed with [[9.5.0-22|9.5.0-X]] by completely clearing keyslot 0x11 immediately after the loader finishes using keyslot 0x11.&lt;br /&gt;
This means that any ARM9 code that can execute before the loader clears the keyslot at firmlaunch(including firmlaunch-hax) can get access to the uncleared keyslot 0x11, which then allows one to generate all &amp;lt;=v9.5 New3DS keyXs which are generated by keyslot 0x11.&lt;br /&gt;
&lt;br /&gt;
Therefore, to completely fix this the loader would have to generate more keys using different keyslot 0x11 keydata. This was done with [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
| New3DS keyXs generation&lt;br /&gt;
| Mostly fixed with [[9.5.0-22|9.5.0-X]], completely fixed with new keys with [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
| &lt;br /&gt;
| February 3, 2015 (one day after [[9.5.0-22|9.5.0-X]] release)&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Public disclosure timeframe&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Leak of normal-key matching a key-scrambler key&lt;br /&gt;
| New 3DS firmware versions [[8.1.0-0 New3DS|8.1.0]] through [[9.2.0-20|9.2.0]] set the encryption key for [[Amiibo]] data using a hardcoded normal-key in Process9.  In firmware [[9.3.0-21|9.3.0]], Nintendo &amp;quot;fixed&amp;quot; this by using the key scrambler instead, by calculating the keyY value for keyslot 0x39 that results in the same normal-key, then hardcoding that keyY into Process9.&lt;br /&gt;
&lt;br /&gt;
Nintendo&#039;s fix is actually the problem: Nintendo revealed the normal-key matching an unknown keyX and a known keyY.  Combined with the key scrambler using an insecure scrambling algorithm (see &amp;quot;Hardware&amp;quot; above), the key scrambler function could be deduced.&lt;br /&gt;
| Deducing the keyX for keyslot 0x39 and the key scrambler algorithm&lt;br /&gt;
| New 3DS [[9.3.0-21|9.3.0-X]], sort of&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| Sometime in 2015 after the hardware key-generator was broken.&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| &lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[10.3.0-28|10.3.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| Title downgrading via [[Application_Manager_Services|AM]]([[Application_Manager_Services_PXI|PXI]])&lt;br /&gt;
| When a title is *already* installed, Process9 will compare the installed title-version with the title-version being installed. When the one being installed is older, Process9 would return an error.&lt;br /&gt;
&lt;br /&gt;
However, this can be bypassed by just deleting the title first via the service command(s) for that: with the title removed from the [[Title_Database]], Process9 can&#039;t compare the input title-version with anything. Hence, titles can be downgraded this way.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| None&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| FAT FS code null-deref&lt;br /&gt;
| When FSFile:Read is used with a file which is corrupted on a FAT filesystem(in particular SD), Process9 can crash. This particular crash is caused by a function returning NULL instead of an actual ptr due to an error. The caller of that function doesn&#039;t check for NULL which then triggers a read based at NULL.&lt;br /&gt;
&lt;br /&gt;
Sample &amp;quot;fsck.vfat -n -v -V &amp;lt;fat image backup&amp;gt;&amp;quot; output for the above crash:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
Starting check/repair pass.&lt;br /&gt;
&amp;lt;FilePath0&amp;gt; and&lt;br /&gt;
&amp;lt;FilePath1&amp;gt;&lt;br /&gt;
 share clusters.&lt;br /&gt;
 Truncating second to 3375104 bytes.&lt;br /&gt;
&amp;lt;FilePath1&amp;gt;&lt;br /&gt;
 File size is 2787392 bytes, cluster chain length is 16384 bytes.&lt;br /&gt;
 Truncating file to 16384 bytes.&lt;br /&gt;
Checking for unused clusters.&lt;br /&gt;
Reclaimed 1 unused cluster (16384 bytes).&lt;br /&gt;
Checking free cluster summary.&lt;br /&gt;
Free cluster summary wrong (1404490 vs. really 1404491)&lt;br /&gt;
 Auto-correcting.&lt;br /&gt;
Starting verification pass.&lt;br /&gt;
Checking for unused clusters.&lt;br /&gt;
Leaving filesystem unchanged.&amp;lt;/pre&amp;gt;&lt;br /&gt;
| Useless null-based-read&lt;br /&gt;
| None&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| July 8-9, 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| RSA signature padding checks&lt;br /&gt;
| The TWL_FIRM RSA sig padding check code used for all TWL RSA sig-checks has issues, see [[FIRM|here]].&lt;br /&gt;
The main 3DS RSA padding check code(non-certificate, including NATIVE_FIRM) uses the function used with the above to extract more padding + the actual hash from the additional padding. This isn&#039;t really a problem here because there&#039;s proper padding check code which is executed prior to this.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.5.0-22|9.5.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[AMPXI:ValidateDSiWareSectionMAC]] [[AES_Registers|AES]] keyslot reuse&lt;br /&gt;
| When the input DSiWare section index is higher than &amp;lt;max number of DSiWare sections supported by this FIRM&amp;gt;, Process9 uses keyid 0x40 for calculating the AESMAC, which translates to keyslot 0x40. The result is that the keyslot is left at whatever was already selected before, since the AES selectkeyslot code will immediately  return when keyslot is &amp;gt;=0x40. However, actually exploiting this is difficult: the calculated AESMAC is never returned, this command just compares the calculated AESMAC with the input AESMAC(result-code depends on whether the AESMACs match). It&#039;s unknown whether a timing attack would work with this.&lt;br /&gt;
This is basically a different form of the pxips9 keyslot vuln, except with AESMAC etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| March 15, 2015&lt;br /&gt;
| December 29, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| pxips9 [[AES_Registers|AES]] keyslot reuse&lt;br /&gt;
| This requires access to the [[Process_Services|ps:ps]]/pxi:ps9 services. One way to get access to this would be snshax on system-version &amp;lt;=10.1.0-X(see 32c3 3ds talk).&lt;br /&gt;
When an invalid key-type value is passed to any of the PS commands, Process9 will try to select keyslot 0x40. That aesengine_setkeyslot() code will then immediately return due to the invalid keyslot value. Since that function doesn&#039;t return any errors, Process9 will just continue to do crypto with whatever AES keyslot was selected before the PS command was sent.&lt;br /&gt;
| Reusing the previously used keyslot, for crypto with PS.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| Roughly the same time(same day?) as firmlaunch-hax.&lt;br /&gt;
| December 29, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| firmlaunch-hax: FIRM header ToCToU&lt;br /&gt;
| This can&#039;t be exploited from ARM11 userland.&lt;br /&gt;
During [[FIRM]] launch, the only FIRM header the ARM9 uses at all is stored in FCRAM, this is 0x200-bytes(the actual used FIRM RSA signature is read to the Process9 stack however). The ARM9 doesn&#039;t expect &amp;quot;anything&amp;quot; besides the ARM9 to access this data.&lt;br /&gt;
With [[9.5.0-22]] the address of this FIRM header was changed from a FCRAM address, to ARM9-only address 0x01fffc00.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[9.5.0-22]]&lt;br /&gt;
| &lt;br /&gt;
| 2012, 3 days after [[User:Yellows8|Yellows8]] started Process9 code RE.&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Uninitialized data output for (PXI) command replies&lt;br /&gt;
| PXI commands for various services(including some [[Filesystem_services_PXI|here]] and many others) can write uninitialized data (like from ARM registers) to the command reply. This happens with stubbed commands, but this can also occur with certain commands when returning an error.&lt;br /&gt;
Certain ARM11 service commands have this same issue as well.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Filesystem_services_PXI|FSPXI]] OpenArchive SD permissions&lt;br /&gt;
| Process9 does not use the exheader ARM9 access-mount permission flag for SD at all.&lt;br /&gt;
This would mean ARM11-kernelmode code / fs-module itself could directly use FSPXI to access SD card without ARM9 checking for SD access, but this is rather useless since a process is usually running with SD access(Home Menu for example) anyway.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| 2012&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[AMPXI:ExportDSiWare]] export path&lt;br /&gt;
| Process9 allocates memory on Process9 heap for the export path then verifies that the actual allocated size matches the input size. Then Process9 copies the input path from FCRAM to this buffer, and uses it with the Process9 FS openfile code, which use paths in the form of &amp;quot;&amp;lt;mountpoint&amp;gt;:/&amp;lt;path&amp;gt;&amp;quot;.&lt;br /&gt;
Process9 does not check the contents of this path at all before passing it to the FS code, besides writing a NUL-terminator to the end of the buffer.&lt;br /&gt;
| Exporting of DSiWare to arbitrary Process9 file-paths, such as &amp;quot;nand:/&amp;lt;path&amp;gt;&amp;quot; etc. This isn&#039;t really useful since the data which gets written can&#039;t be controlled.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.5.0-22]]&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DSiWare_Exports]] [[CTCert]] verification&lt;br /&gt;
| Just like DSi originally did, 3DS verifies the APCert for DSiWare on SD with the CTCert also in the DSiWare .bin. On DSi this was fixed with with system-version 1.4.2 by verifying with the actual console-unique cert instead(stored in NAND), while on 3DS it&#039;s still not(?) fixed.&lt;br /&gt;
On 3DS however this is rather useless, due to the entire DSiWare .bin being encrypted with the console-unique movable.sed keyY.&lt;br /&gt;
| When the movable.sed keyY for the target 3DS is known and the target 3DS CTCert private-key is unknown, importing of modified DSiWare SD .bin files.&lt;br /&gt;
| Unknown, probably none.&lt;br /&gt;
| ?&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Gamecard_Services_PXI]] unchecked REG_CTRCARDCNT transfer-size&lt;br /&gt;
| The u8 REG_CTRCARDCNT transfer-size parameter for the [[Gamecard_Services_PXI]] read/write CTRCARD commands is used as an index for an array of u16 values. Before [[5.0.0-11|5.0.0-X]] this u8 value wasn&#039;t checked, thus out-of-bounds reads could be triggered(which is rather useless in this case).&lt;br /&gt;
| Out-of-bounds read for a value which gets written to a register.&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2013?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[PXI_Registers|PXI]] cmdbuf buffer overrun&lt;br /&gt;
| The Process9 code responsible [[PXI_Registers|PXI]] communications didn&#039;t verify the size of the incoming command before writing it to a C++ member variable. &lt;br /&gt;
| Probably ARM9 code execution&lt;br /&gt;
| [[5.0.0-11|5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| March 2015, original timeframe if any unknown&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]/[[User:Yellows8|Yellows8]]/maybe others(?)&lt;br /&gt;
|-&lt;br /&gt;
| [[Application_Manager_Services_PXI|PXIAM]] command 0x003D0108(See also [[Application_Manager_Services|this]])&lt;br /&gt;
| When handling this command, Process9 allocates a 0x2800-byte heap buffer, then copies the 4 FCRAM input buffers to this heap buffer without checking the sizes at all(only the buffers with non-zero sizes are copied). Starting with [[5.0.0-11|5.0.0-X]], the total combined size of the input data must be &amp;lt;=0x2800.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| May 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Process_Services_PXI|PS RSA]] commands buffer overflows&lt;br /&gt;
| pxips9 cmd1(not accessible via ps:ps) and VerifyRsaSha256: unchecked copy to a buffer in Process9&#039;s .bss, from the input FCRAM buffer. The buffer is located before the pxi cmdhandler threads&#039; stacks. SignRsaSha256 also has a buf overflow, but this isn&#039;t exploitable.&lt;br /&gt;
The buffer for this is the buffer for the signature data. With v5.0, the signature buffer was moved to stack, with a check for the signature data size. When the signature data size is too large, Process9 uses [[SVC|svcBreak]].&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[PXI_Registers|PXI]] pxi_id bad check&lt;br /&gt;
| The Process9 code responsible for [[PXI_Registers|PXI]] communications read pxi_id as a signed char. There were two flaws:&lt;br /&gt;
* They used it as index to a lookup-table without checking the value at all.&lt;br /&gt;
* Another function verified that pxi_id &amp;lt; 7, allowing negative values to pass the check. This would also cause an out-of-range table-lookup.&lt;br /&gt;
| Maybe ARM9 code execution&lt;br /&gt;
| [[3.0.0-5|3.0.0-5]]&lt;br /&gt;
|&lt;br /&gt;
| March 2015, originally 2012 for the first issue at least&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]], maybe others(?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel9 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG Registers#CFG_SYSPROT9|CFG_SYSPROT9]] bit1 not set by Kernel9&lt;br /&gt;
| Old versions of Kernel9 never set bit1 of [[CONFIG Registers#CFG_SYSPROT9|CFG_SYSPROT9]]. This leaves the [[OTP Registers|0x10012000]]-region unprotected (this region should be locked early during boot!). Since it&#039;s never locked, you can dump it once you get ARM9 code execution. See [[OTP Registers|here]] regarding the data stored there.&lt;br /&gt;
&lt;br /&gt;
From [[3.0.0-5|3.0.0-X]] this was fixed by setting the bit in Kernel9 after poking some registers in that region. On New3DS arm9loader sets this bit instead of Kernel9.&lt;br /&gt;
&lt;br /&gt;
This flaw resurged when it gained a new practical use: retrieving the OTP data for a New3DS console in order to decrypt the key data used in arm9loader. This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (see partition encryption types [[Flash_Filesystem#NAND_structure|here]]), it is possible to boot a New3DS using Old3DS firmware 1.0-2.x, and retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping of the [[OTP Registers|OTP]] area&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| February 2015&lt;br /&gt;
| [[User:Plutooo|plutoo]], Normmatt independently&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM11 software ==&lt;br /&gt;
=== Kernel11 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
|  [[SVC]] table too small&lt;br /&gt;
|  The table of function pointers for SVC&#039;s only contains entries up to 0x7D, but the biggest allowed SVC for the table is 0x7F. Thus, executing SVC7E or SVC7F would make the SVC-handler read after the buffer, and interpret some ARM instructions as function pointers.&lt;br /&gt;
&lt;br /&gt;
However, this would require patching the kernel .text or modifying SVC-access-control. Even if you could get these to execute, they would still jump to memory that isn&#039;t mapped as executable.&lt;br /&gt;
| &lt;br /&gt;
|  None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| 2012&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
|  [[SVC|svcBackdoor (0x7B)]]&lt;br /&gt;
|  This backdoor allows executing SVC-mode code at the user-specified code-address. This is used by Process9, using this on the ARM11(with NATIVE_FIRM) requires patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
|  None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory_layout#ARM11_Detailed_virtual_memory_map|0xEFF00000]] / 0xDFF00000 ARM11 kernel virtual-memory&lt;br /&gt;
| The ARM11 kernel-mode 0xEFF00000/0xDFF00000 virtual-memory(size 0x100000) is mapped to phys-mem 0x1FF00000(entire DSP-mem + entire AXIWRAM), with permissions RW-. This is used during ARM11 kernel startup for loading the FIRM-modules from the FIRM section located in DSP-mem, this never seems to be used after that, however. This is never unmapped either.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| Memchunkhax2&lt;br /&gt;
| &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| derrek&lt;br /&gt;
|-&lt;br /&gt;
|  AffinityMask/processorid validation&lt;br /&gt;
|  With [[10.0.0-27|10.0.0-X]] the following functions were updated: svcGetThreadAffinityMask, svcGetProcessAffinityMask, svcSetProcessAffinityMask, and svcCreateThread. The code changes for all but svcCreateThread are identical.&lt;br /&gt;
The original code with the first 3 did the following: &lt;br /&gt;
* if(u32_processorcount &amp;gt; ~0x80000001)return 0xe0e01bfd;&lt;br /&gt;
* if(s32_processorcount &amp;gt; &amp;lt;total_cores&amp;gt;)return 0xd8e007fd;&lt;br /&gt;
The following code replaced the above:&lt;br /&gt;
* if(u32_processorcount &amp;gt;= &amp;lt;total_cores+1&amp;gt;)return 0xd8e007fd;&lt;br /&gt;
In theory the latter should catch everything that the former did, so it&#039;s unknown if this was really a security issue.&lt;br /&gt;
&lt;br /&gt;
The svcCreateThread changes with [[10.0.0-27|10.0.0-X]] definitely did fix a security issue.&lt;br /&gt;
* Original code: &amp;quot;if(s32_processorid &amp;gt; &amp;lt;total_cores&amp;gt;)return 0xd8e007fd;&amp;quot;&lt;br /&gt;
* New code: &amp;quot;if(s32_processorid &amp;gt;= &amp;lt;total_cores&amp;gt; || s32_processorid &amp;lt;= -4)return 0xd8e007fd;&amp;quot;&lt;br /&gt;
This fixed an off-by-one issue: if one would use processorid=total_cores, which isn&#039;t actually a valid value, svcCreateThread would accept that value on &amp;lt;[[10.0.0-27|10.0.0-X]]. This results in data being written out-of-bounds(baseaddr = arrayaddr + entrysize*processorid), which has the following result:&lt;br /&gt;
* Old3DS: Useless kernel-mode crash due to accessing unmapped memory.&lt;br /&gt;
* New3DS: uncontrolled data write into a kernel-mode L1 MMU-table. This isn&#039;t really useful: the data can&#039;t be controlled, and the data which gets overwritten is all-zero anyway(this isn&#039;t anywhere near MMU L1 entries for actually mapped memory).&lt;br /&gt;
The previous version also allowed large negative s32_processorid values(negative processorid values are special values not actual procids), but it appears using values like that won&#039;t actually do anything(meaning no crash) besides the thread not running / thread not running for a while(besides triggering a kernelpanic with certain s32_processorid value(s)).&lt;br /&gt;
| Nothing useful&lt;br /&gt;
|  [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| svcCreateThread issue: May 31, 2015. The rest: September 8, 2015, via v9.6-&amp;gt;v10.0 ARM11-kernel code-diff.&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax&lt;br /&gt;
| The kernel originally did not validate the data stored in the FCRAM kernel heap [[Memchunkhdr|memchunk-headers]] for free-memory at all. Exploiting this requires raw R/W access to these memchunk-headers, like physical-memory access with gspwn.&lt;br /&gt;
&lt;br /&gt;
There are &#039;&#039;multiple&#039;&#039; ways to exploit this, but the end-result for most of these is the same: overwrite code in AXIWRAM via the 0xEFF00000/0xDFF00000 kernel virtual-memory mapping.&lt;br /&gt;
&lt;br /&gt;
This was fixed in [[9.3.0-21|9.3.0-X]] by checking that the memchunk(including size, next, and prev ptrs) is located within the currently used heap memory. The kernel may also check that the next/prev ptrs are valid compared to other memchunk-headers basically. When any of these checks fail, kernelpanic() is called.&lt;br /&gt;
| When combined with other flaws: ARM11-kernelmode code execution&lt;br /&gt;
| [[9.3.0-21|9.3.0-21]]&lt;br /&gt;
| &lt;br /&gt;
| February 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Multiple [[KLinkedListNode|KLinkedListNode]] SlabHeap use after free bugs&lt;br /&gt;
| The ARM11-kernel did access the &#039;key&#039; field of [[KLinkedListNode|KLinkedListNode]] objects, which are located on the SlabHeap, after freeing them. Thus, triggering an allocation of a new [[KLinkedListNode|KLinkedListNode]] object at the right time could result in a type-confusion. Pseudo-code:&lt;br /&gt;
SlabHeap_free(KLinkedListNode);&lt;br /&gt;
KObject *obj = KLinkedListNode-&amp;gt;key;  // the object there might have changed!&lt;br /&gt;
This bug appeared all over the place.&lt;br /&gt;
| ARM11-kernelmode code exec maybe&lt;br /&gt;
| [[8.0.0-18|8.0.0-18]]&lt;br /&gt;
| &lt;br /&gt;
| April 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| PXI [[RPC_Command_Structure|Command]] input/output buffer permissions&lt;br /&gt;
| Originally the ARM11-kernel didn&#039;t check permissions for PXI input/output buffers for commands. Starting with [[6.0.0-11|6.0.0]] PXI input/output buffers must have RW permissions, otherwise kernelpanic is triggered.&lt;br /&gt;
| &lt;br /&gt;
| [[6.0.0-11|6.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcStartInterProcessDma]]&lt;br /&gt;
| For svcStartInterProcessDma, the kernel code had the following flaws:&lt;br /&gt;
&lt;br /&gt;
* Originally the ARM11-kernel read the input DmaConfig structure directly in kernel-mode(ldr(b/h) instructions), without checking whether the DmaConfig address is readable under userland. This was fixed by copying that structure to the SVC-mode stack, using the ldrbt instruction.&lt;br /&gt;
&lt;br /&gt;
* Integer overflows for srcaddr+size and dstaddr+size are now checked(with [[6.0.0-11]]), which were not checked before.&lt;br /&gt;
&lt;br /&gt;
* The kernel now also checks whether the srcaddr/dstaddr (+size) is within userland memory (0x20000000), the kernel now (with [[6.0.0-11]]) returns an error when the address is beyond userland memory. Using an address &amp;gt;=0x20000000 would result in the kernel reading from the process L1 MMU table, beyond the memory allocated for that MMU table(for vaddr-&amp;gt;physaddr conversion). &lt;br /&gt;
| &lt;br /&gt;
| [[6.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| DmaConfig issue: unknown. The rest: 2014&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] independently&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcControlMemory]] Parameter checks&lt;br /&gt;
| For svcControlMemory the parameter check had these two flaws:&lt;br /&gt;
&lt;br /&gt;
* The allowed range for addr0, addr1, size parameters depends on which MemoryOperation is being specified. The limitation for GSP heap was only checked if op=(u32)0x10003. By setting a random bit in op that has no meaning (like bit17?), op would instead be (u32)0x30003, and the range-check would be less strict and not accurate. However, the kernel doesn&#039;t actually use the input address for LINEAR memory-mapping at all besides the range-checks, so this isn&#039;t actually useful. This was fixed in the kernel by just checking for the LINEAR bit, instead of comparing the entire MemoryOperation value with 0x10003.&lt;br /&gt;
&lt;br /&gt;
* Integer overflows on (addr0+size) are now checked that previously weren&#039;t (this also applies to most other address checks elsewhere in the kernel).&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| [[RPC_Command_Structure|Command]] request/response buffer overflow&lt;br /&gt;
| Originally the kernel did not check the word-values from the command-header. Starting with [[5.0.0-11]], the kernel will trigger a kernelpanic() when the total word-size of the entire command(including the cmd-header) is larger than 0x40-words (0x100-bytes). This allows overwriting threadlocalstorage+0x180 in the destination thread. However, since the data written there would be translate parameters (such as header-words + buffer addresses), exploiting this would likely be very difficult, if possible at all.&lt;br /&gt;
&lt;br /&gt;
If the two words at threadlocalstorage+0x180 could be overwritten with controlled data this way, one could then use a command with a buffer-header of &amp;lt;nowiki&amp;gt;((size&amp;lt;&amp;lt;14) | 2)&amp;lt;/nowiki&amp;gt; to write arbitrary memory to any RW userland memory in the destination process.&lt;br /&gt;
| &lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| v4.1 FIRM -&amp;gt; v5.0 code diff&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|SVC stack allocation overflows]]&lt;br /&gt;
| &lt;br /&gt;
* Syscalls that allocate a variable-length array on stack, only checked bit31 before multiplying by 4/16 (when calculating how much memory to allocate). If a large integer was passed as input to one of these syscalls, an integer overflow would occur, and too little memory would have been allocated on stack resulting in a buffer overrun. &lt;br /&gt;
* The alignment (size+7)&amp;amp;~7 calculation before allocation was not checked for integer overflow.&lt;br /&gt;
&lt;br /&gt;
This might allow for ARM11 kernel code-execution.&lt;br /&gt;
&lt;br /&gt;
(Applies to svcSetResourceLimitValues, svcGetThreadList, svcGetProcessList, svcReplyAndReceive, svcWaitSynchronizationN.)&lt;br /&gt;
| &lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| &lt;br /&gt;
| v4.1 FIRM -&amp;gt; v5.0 code diff&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] complementary&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcControlMemory]] MemoryOperation MAP memory-permissions&lt;br /&gt;
| svcControlMemory with MemoryOperation=MAP allows mapping the already-mapped process virtual-mem at addr1, to addr0. The lowest address permitted for addr1 is 0x00100000. Originally the ARM11 kernel didn&#039;t check memory permissions for addr1. Therefore .text as addr1 could be mapped elsewhere as RW- memory, which allowed ARM11 userland code-execution.&lt;br /&gt;
| &lt;br /&gt;
| [[4.1.0-8]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[RPC_Command_Structure|Command]] input/output buffer permissions&lt;br /&gt;
| Originally the ARM11 kernel didn&#039;t check memory permissions for the input/output buffers for commands. Starting with [[4.0.0-7]] the ARM11 kernel will trigger a kernelpanic() if the input/output buffers don&#039;t have the required memory permissions. For example, this allowed a FSUSER file-read to .text, which therefore allowed ARM11-userland code execution.&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcReadProcessMemory/svcWriteProcessMemory memory]] permissions&lt;br /&gt;
| Originally the kernel only checked the first page(0x1000-bytes) of the src/dst buffers, for svcReadProcessMemory and svcWriteProcessMemory. There is no known retail processes which have access to these SVCs.&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| &lt;br /&gt;
| 2012?&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== [[FIRM]] Sysmodules ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in [[FIRM]] system version&lt;br /&gt;
!  Last [[FIRM]] system version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[Services|&amp;quot;srv:pm&amp;quot;]] process registration&lt;br /&gt;
| Originally any process had access to the port &amp;quot;srv:pm&amp;quot;. The PID&#039;s used for the (un)registration commands are not checked either. This allowed any process to re-register itself with &amp;quot;srv:pm&amp;quot;, and therefore allowed the process to give itself access to any service, bypassing the exheader service-access-control list.&lt;br /&gt;
&lt;br /&gt;
This was fixed in [[7.0.0-13]]: starting with [[7.0.0-13]] &amp;quot;srv:pm&amp;quot; is now a service instead of a globally accessible port. Only processes with PID&#039;s less than 6 (in other words: fs, ldr, sm, pm, pxi modules) have access to it. With [[7.0.0-13]] there can only be one session for &amp;quot;srv:pm&amp;quot; open at a time(this is used by pm module), svcBreak will be executed if more sessions are opened by the processes which can access this.&lt;br /&gt;
&lt;br /&gt;
This flaw was needed for exploiting the &amp;lt;=v4.x Process9 PXI vulnerabilities from ARM11 userland ROP, since most applications don&#039;t have access to those service(s).&lt;br /&gt;
| Access to arbitrary services&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| &lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| FSDIR null-deref&lt;br /&gt;
| [[Filesystem_services|FS]]-module may crash in some cases when handling directory reading. The trigger seems to be due to using [[FSDir:Close]] without closing the dir-handle afterwards?(Perhaps this is caused by out-of-memory?) This seems to be useless since it&#039;s just a null-deref.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| May 19(?)-20, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Standalone Sysmodules ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in system-module system-version&lt;br /&gt;
!  Last system-module system-version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Timeframe this was added to wiki&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[NIM_Services|NIM]]: Downloading old title-versions from eShop&lt;br /&gt;
| Multiple NIM service commands(such as [[NIMS:StartDownload]]) use a title-version value specified by the user-process, NIM does not validate that this input version matches the latest version available via SOAP. Therefore, when combined with AM(PXI) [[#Process9|title-downgrading]] via deleting the target eShop title with System Settings Data Management(if the title was already installed), this allows downloading+installing any title-version from eShop &#039;&#039;if&#039;&#039; it&#039;s still available from CDN.&lt;br /&gt;
The easiest way to exploit this is to just patch the eShop system-application code using these NIM commands(ideally the code which loads the title-version).&lt;br /&gt;
&lt;br /&gt;
Originally this was tested with a debugging-system via modded-FIRM, eventually smea implemented it in HANS for the 32c3 release.&lt;br /&gt;
| Downloading old title-versions from eShop&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| October 24, 2015 (Unknown when exactly the first eShop title downgrade was actually tested, maybe November)&lt;br /&gt;
| January 7, 2016 (Same day Ironfall v1.0 was removed from CDN via the main-CXI files)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SPI_Services|SPI]] service out-of-bounds write&lt;br /&gt;
| cmd1 has out-of-bounds write allowing overwrite of some static variables in .data.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[9.5.0-22]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NFC_Services|NFC]] module service command buf-overflows&lt;br /&gt;
| NFC module copies data with certain commands, from command input buffers to stack without checking the size. These commands include the following, it&#039;s unknown if there&#039;s more commands with similar issues: &amp;quot;nfc:dev&amp;quot; &amp;lt;0x000C....&amp;gt; and &amp;quot;nfc:s&amp;quot; &amp;lt;0x0037....&amp;gt;.&lt;br /&gt;
Since both of these commands are stubbed in the Old3DS NFC module from the very first version(those just return an error), these issues only affect the New3DS NFC module.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known retail titles which have access to either of these services.&lt;br /&gt;
| ROP under NFC module.&lt;br /&gt;
| New3DS: None&lt;br /&gt;
| New3DS: [[9.5.0-22]]&lt;br /&gt;
| December 2014?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[News_Services|NEWSS]] service command notificationID validation failure&lt;br /&gt;
| This module does not validate the input notificationID for &amp;lt;nowiki&amp;gt;&amp;quot;news:s&amp;quot;&amp;lt;/nowiki&amp;gt; service commands. This is an out-of-bounds array index bug. For example, [[NEWSS:SetNotificationHeader]] could be used to exploit news module: this copies the input data(size is properly checked) to: out = newsdb_savedata+0x10 + (someu32array[notificationID]*0x70).&lt;br /&gt;
| ROP under news module.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.7.0-25|9.7.0-X]]&lt;br /&gt;
| December 2014&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWMUDS:DecryptBeaconData]] heap buffer overflow&lt;br /&gt;
| input_size = 0x1E * &amp;lt;value the u8 from input_[[NWM_Services|networkstruct]]+0x1D&amp;gt;. Then input_tag0 is copied to a heap buffer. When input_size is larger than 0xFA-bytes, it will then copy input_tag1 to &amp;lt;end_address_of_previous_outbuf&amp;gt;, with size=input_size-0xFA.&lt;br /&gt;
&lt;br /&gt;
This can be triggered by either using this command directly, or by boadcasting a wifi beacon which triggers it while a 3DS system running the target process is in range, when the process is scanning for hosts to connect to. Processes will only pass tag data to this command when the wlancommID and other thing(s) match the values for the process.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to actually exploit this for getting ROP under NWM-module, at the time of originally adding this to the wiki. This is because the data which gets copied out-of-bounds *and* actually causes crash(es), can&#039;t be controlled it seems(with just broadcasting a beacon at least). It&#039;s unknown whether this could be exploited from just using NWMUDS service-cmd(s) directly.&lt;br /&gt;
| Without any actual way to exploit this: NWM-module DoS, resulting in process termination(process crash). This breaks *everything* involving wifi comms, a reboot is required to recover from this.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| ~September 23, 2014(see the [[NWMUDS:DecryptBeaconData]] page history)&lt;br /&gt;
| August 3, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HID_Services|HID]] module shared-mem&lt;br /&gt;
| HID module does not validate the index values in [[HID_Shared_Memory|sharedmem]](just changes index to 0 when index == maxval when updating), therefore large values will result in HID module writing HID data to arbitrary addresses.&lt;br /&gt;
| ROP under HID module, but this is *very* unlikely to be exploitable since the data written is HID data.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.3.0-21]]&lt;br /&gt;
| 2014?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| gspwn&lt;br /&gt;
| GSP module does not validate addresses given to the GPU. This allows a user-mode application/applet to read/write to a large part of physical FCRAM using GPU DMA. From this, you can overwrite the .text segment of the application you&#039;re running under, and gain real code-execution from a ROP-chain. Normally applets&#039; .text([[Home Menu]], [[Internet Browser]], etc) is located beyond the area accessible by the GPU, except for [[RO_Services|CROs]] used by applets([[Internet Browser]] for example).&lt;br /&gt;
&lt;br /&gt;
FCRAM is gpu-accessible up to physaddr 0x26800000 on Old3DS, and 0x2DC00000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 with the default memory-layout on Old3DS/New3DS.&lt;br /&gt;
| User-mode code execution.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Early 2014&lt;br /&gt;
| &lt;br /&gt;
| smea, [[User:Yellows8|Yellows8]]/others before then&lt;br /&gt;
|-&lt;br /&gt;
| rohax&lt;br /&gt;
| Using gspwn, it is possible to overwrite a loaded [[CRO0]]/[[CRR0]] after its RSA-signature has been validated. Badly validated [[CRO0]] header leads to arbitrary read/write of memory in the ro-process. This gives code-execution in the ro module, who has access to [[SVC|syscalls]] 0x70-0x72, 0x7D.&lt;br /&gt;
&lt;br /&gt;
This was fixed after [[ninjhax]] release by adding checks on [[CRO0]]-based pointers before writing to them.&lt;br /&gt;
| Memory-mapping syscalls.&lt;br /&gt;
| [[9.3.0-21]]&lt;br /&gt;
| [[9.4.0-21]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| smea, [[User:Plutooo|plutoo]] joint effort&lt;br /&gt;
|-&lt;br /&gt;
| Region free&lt;br /&gt;
| Only [[Home Menu]] itself checks gamecards&#039; region when launching them. Therefore, any application launch that is done directly with [[NS]] without signaling Home Menu to launch the app, will result in region checks being bypassed.&lt;br /&gt;
This essentially means launching the gamecard with the [[NS_and_APT_Services|&amp;quot;ns:s&amp;quot;]] service. The main way to exploit this is to trigger a FIRM launch with an application specified, either with a normal FIRM launch or a hardware [[NSS:RebootSystem|reboot]].&lt;br /&gt;
| Launching gamecards from any region + bypassing Home Menu gamecard-sysupdate installation&lt;br /&gt;
| None&lt;br /&gt;
| Last tested with [[10.1.0-27|10.1.0-X]].&lt;br /&gt;
| June(?) 2014&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]] service-cmd state null-ptr deref&lt;br /&gt;
| The NWMUDS service command code loads a ptr from .data, adds an offset to that, then passes that as the state address for the actual command-handler function. The value of the ptr loaded from .data is not checked, therefore this will cause crashes due to that being 0x0 when NWMUDS was not properly initialized.&lt;br /&gt;
It&#039;s unknown whether any NWM services besides NWMUDS have this issue.&lt;br /&gt;
| This is rather useless since it&#039;s only a crash caused by a state ptr based at 0x0.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| 2013?&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== General/CTRSDK ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Successful exploitation result&lt;br /&gt;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|UDS]] beacon additional-data buffer overflow&lt;br /&gt;
| Originally CTRSDK did not validate the UDS additional-data size before using that size to copy the additional-data to a [[NWM_Services|networkstruct]]. This was eventually fixed.&lt;br /&gt;
This was discovered while doing code RE with an old dlp-module version. It&#039;s unknown in what specific CTRSDK version this was fixed, or even what system-version updated titles with a fixed version.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown if there&#039;s any titles using a vulnerable CTRSDK version which are also exploitable with this(dlp module can&#039;t be exploited with this).&lt;br /&gt;
&lt;br /&gt;
The maximum number of bytes that can be written beyond the end of the outbuf is 0x37-bytes, with additionaldata_size=0xFF.&lt;br /&gt;
| Perhaps ROP, very difficult if possible with anything at all&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| September(?) 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=OTP_Registers&amp;diff=14989</id>
		<title>OTP Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=OTP_Registers&amp;diff=14989"/>
		<updated>2015-12-15T14:46:43Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: note on console-unique keys and analog in ITCM being memset&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Console-unique keys seem to be derived from here, though it is unknown how. Access to this region is disabled once the ARM9 writes 0x2 to [[CONFIG|REG_SYSPROT9]].&lt;br /&gt;
&lt;br /&gt;
This is very likely the console-unique data store, including [[CTCert]] and other unit info values, that ends up in ITCM at 0x01FFB800. Bootrom would decrypt it, check for magic (0xDEADB00F), and then set CFG_UNITINFO, etc to match the specific console at hand. This is a guess based on the matching size of both sets of data (ITCM&#039;s is padded to 0x100, specifically) and the lack of another known source for this data on the system (it is not sourced from eMMC). On top of this, the latter half of this data is likely used as console-unique keydata, thus explaining ITCM&#039;s copy being memcleared and the OTP lock mechanism existing.  &lt;br /&gt;
&lt;br /&gt;
Originally the console-unique TWL keyinit + region disable was done by Kernel9. However, with the [[New_3DS]] FIRM ARM9 binary this is now done in the [[FIRM]] ARM9 binary loader, which also uses the 0x10012000 region for key generation.&lt;br /&gt;
&lt;br /&gt;
On development units ([[CONFIG|UNITINFO]]!=0) ARM9 uses the first 8-bytes from 0x10012000 for the TWL Console ID. This region doesn&#039;t seem to be used by NATIVE_FIRM on retail at all, besides New3DS key-generation in the [[FIRM|ARM9-loader]]. It is unknown if bootrom reads from it, but it is likely.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| Console-unique data. This data appears appears to be random, even when multiple consoles&#039; dumps from this area are XORed. None of the raw data here seems to match any of the console-unique keys (tested: keyX, keyY and normal-key, both big and little u32 endianness for all keyslots) for the AES engine. It&#039;s unknown whether there&#039;s any encryption on this area.&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before writing REG_SYSPROT9 bit1, the ARM9 copies the 8-byte TWL Console ID here. This sets the registers at 0x4004D00 for ARM7.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=OTP_Registers&amp;diff=14988</id>
		<title>OTP Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=OTP_Registers&amp;diff=14988"/>
		<updated>2015-12-15T14:20:55Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Console-unique keys seem to be derived from here, though it is unknown how. This is very likely the console-unique data store, including [[CTCert]] and other unit info values, that ends up in ITCM at 0x01FFB800. Bootrom would decrypt it, check for magic (0xDEADB00F), and then set CFG_UNITINFO, etc to match the specific console at hand. This is a guess based on the matching size of both sets of data (ITCM&#039;s is padded to 0x100, specifically) and the lack of another known source for this data on the system (it is not sourced from eMMC). Access to this region is disabled once the ARM9 writes 0x2 to [[CONFIG|REG_SYSPROT9]].&lt;br /&gt;
&lt;br /&gt;
Originally the console-unique TWL keyinit + region disable was done by Kernel9. However, with the [[New_3DS]] FIRM ARM9 binary this is now done in the [[FIRM]] ARM9 binary loader, which also uses the 0x10012000 region for key generation.&lt;br /&gt;
&lt;br /&gt;
On development units ([[CONFIG|UNITINFO]]!=0) ARM9 uses the first 8-bytes from 0x10012000 for the TWL Console ID. This region doesn&#039;t seem to be used by NATIVE_FIRM on retail at all, besides New3DS key-generation in the [[FIRM|ARM9-loader]]. It is unknown if bootrom reads from it, but it is likely.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| Console-unique data. This data appears appears to be random, even when multiple consoles&#039; dumps from this area are XORed. None of the raw data here seems to match any of the console-unique keys (tested: keyX, keyY and normal-key, both big and little u32 endianness for all keyslots) for the AES engine. It&#039;s unknown whether there&#039;s any encryption on this area.&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before writing REG_SYSPROT9 bit1, the ARM9 copies the 8-byte TWL Console ID here. This sets the registers at 0x4004D00 for ARM7.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NAND_Redirection&amp;diff=14464</id>
		<title>NAND Redirection</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=NAND_Redirection&amp;diff=14464"/>
		<updated>2015-11-04T01:25:05Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: q:3c&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NAND redirection is an umbrella term for methods used to redirect [[Flash_Filesystem|NAND]] reads and writes from the actual system storage (in this context called sysNAND) to the SD card (or technically, any other data source). Among other things, this allows for accessing more recent (in some cases fully updated) system versions (installed on the redirection source) while keeping access to full-control exploits (through the old system installed on sysNAND).&lt;br /&gt;
&lt;br /&gt;
=== General Idea ===&lt;br /&gt;
&lt;br /&gt;
The SD filesystem, being a FAT32 partition,  can be shrinked and relocated easily. As such, it is easy to make room on the SD card for a full NAND image. By not listing the NAND image partition in the SD card&#039;s Master Boot Record (the first 512 bytes of data on the device which is responsible for providing information on the contained filesystems), the NAND image does not interfere with regular SD card access. The actual redirection needs to be done through use of a [[FIRM|firmware]] modification depending on the location of the NAND image on the SD card. Two common approaches for this are known as EmuNAND and RedNAND, albeit these terms are sometimes also used as synonyms for the concept of NAND redirection in general.&lt;br /&gt;
&lt;br /&gt;
=== RedNAND ===&lt;br /&gt;
&lt;br /&gt;
RedNAND places the full NAND image at byte offset 512 on the SD card. The modified firmware hence needs to offset all NAND reads and writes by 512 bytes.&lt;br /&gt;
&lt;br /&gt;
=== EmuNAND ===&lt;br /&gt;
&lt;br /&gt;
Calling the NAND image size N, EmuNAND places bytes [512:N-1] of the NAND image at byte offset 512 on the SD card, and bytes [0:511] at byte offset N. The modified firmware needs to make sure that NAND reads/writes to the first 512 bytes are redirected properly, but leaves all other accesses unmodified.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions on New 3DS ===&lt;br /&gt;
&lt;br /&gt;
If the sysNAND of a New 3DS console is below system version 9.6, it is not currently publicly possible to have NAND redirection work with a redirected NAND of any system version since 9.6. This is because the [[AES|AES engine keyslots]] introduced for NCCH decryption with 9.6 are initialized by arm9loader using data generated from [[OTP Registers|OTP data] upon boot. Since OTP access is blocked via [[CONFIG_Registers#CFG_SYSPROT9|CFG_SYSPROT9]] shortly after that, it&#039;s impossible to perform this keyslot initialization at any later time.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=14420</id>
		<title>3DS Virtual Console</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=14420"/>
		<updated>2015-11-01T20:04:41Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* NAND Savegame */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There&#039;s two types of VC titles: regular VC titles, and dedicated GBA VC titles.&lt;br /&gt;
&lt;br /&gt;
=Regular VC=&lt;br /&gt;
Regular VC titles: an emulator application + VC ROM in the NCCH [[RomFS]](among other things in the RomFS). The emulator build includes support for all supported VC platforms, not specific to just the included ROM platform.&lt;br /&gt;
&lt;br /&gt;
This emulator includes GBA support, however the GBA emulation for this this is somewhat slow. This was presumably implemented before AGB_FIRM was.&lt;br /&gt;
&lt;br /&gt;
Unlike Wii VC, the 3DS VC ROMs for NES use the &amp;quot;TNES&amp;quot; header.&lt;br /&gt;
&lt;br /&gt;
==RomFS==&lt;br /&gt;
* &amp;quot;rom:/rom/&amp;quot; This directory contains the ROM file(s). Filenames used under here don&#039;t matter: the filename is determined by the emulator app by doing a directory read.&lt;br /&gt;
* &amp;quot;rom:/shaders/&amp;quot; This directory contains GPU shaders used by the emulator app: .shbin, .csdr, and .obj.&lt;br /&gt;
* &amp;quot;rom:/VCM/&amp;quot; This directory contains graphics, audio, and text used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/agb.bin&amp;quot; GBA BIOS.&lt;br /&gt;
* &amp;quot;rom:/buildtime.txt&amp;quot; Emulator app build timestamp.&lt;br /&gt;
* &amp;quot;rom:/config.ini&amp;quot; Emulator configuration .ini, contains sections for all supported 3DS VC platforms.&lt;br /&gt;
* &amp;quot;rom:/&amp;lt;rom_name&amp;gt;.patch&amp;quot; rom_name = filename from the rom directory. This .ini contains patches for the ROM.&lt;br /&gt;
* &amp;quot;rom:/shader.shbin&amp;quot; GPU shader.&lt;br /&gt;
&lt;br /&gt;
=GBA VC=&lt;br /&gt;
GBA VC is run by [[FIRM|AGB_FIRM]]. RomFS isn&#039;t used for GBA VC titles, but can be found empty within GBA VC titles. The NCCH [[ExeFS]] contains the same files as a normal application. The [[ExeFS]]:/.code contains the GBA VC ROM followed by a 0x360 byte long footer.&lt;br /&gt;
&lt;br /&gt;
===Footer===&lt;br /&gt;
All values in the GBA VC footer are little-endian.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x004&lt;br /&gt;
|  0x4&lt;br /&gt;
|  GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x008&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x020&lt;br /&gt;
| 0x1&lt;br /&gt;
| Manufacturer info select (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x024&lt;br /&gt;
| 0x300&lt;br /&gt;
| Unknown, three different types of this data have been observed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x338&lt;br /&gt;
| 0x4&lt;br /&gt;
| GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x344&lt;br /&gt;
| 0x4&lt;br /&gt;
| GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x350&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &#039;.CAA&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x35A&lt;br /&gt;
| 0x2&lt;br /&gt;
| High two bytes of GBA ROM file size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Save types:&lt;br /&gt;
* EEPROM (various sizes, IDs specified in footer): 0x2&lt;br /&gt;
* SRAM/FRAM (128k): 0xE&lt;br /&gt;
* Flash (512k): 0x9&lt;br /&gt;
&lt;br /&gt;
Support for RTC and 1m-flash chips is not implemented in AGB_FIRM.&lt;br /&gt;
&lt;br /&gt;
Manufacturer info:&lt;br /&gt;
GBA games&#039; SDK-provided save code only supports a range of manufacturers from which Nintendo was buying memory from around the time of that game&#039;s development. As such, most games don&#039;t support a generic emulated storage chip. This byte appears to select a manufacturer info set to emulate. This has been observed to be 0x90, 0xC0, and (in one EEPROM-based game), 0x80.&lt;br /&gt;
* SRAM games up to and including V111 use 0xC0. Above use 0x90.&lt;br /&gt;
* FRAM V103 uses 0xC0. V104+ don&#039;t exist, and lower versions also likely use 0xC0.&lt;br /&gt;
* Flash V124 was observed 0x90, V131 was observed 0xC0.&lt;br /&gt;
* EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===NAND Savegame===&lt;br /&gt;
AGB_FIRM saves its active save memory to NAND on exit, this is then immediately picked up by NATIVE_FIRM on reboot by checking [[CONFIG_Registers#CFG_BOOTENV|CFG_BOOTENV]]. From there, this is verified and copied out to SD. The savegame format is as follows:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Magic (&#039;.SAV&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0xC&lt;br /&gt;
| Always 0xFF&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| AES-MAC of the SHA256 hash of 0x30..0x200 + the entire save itself, keyslot 0x24, keyY from process9 .rodata&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x10&lt;br /&gt;
| Always 0xFF&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x40&lt;br /&gt;
| Always 0x1&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of times saved (unused?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x8&lt;br /&gt;
| AGB TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x10&lt;br /&gt;
| SD card CID from the console the save was made on (verified on load)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save start addr (always 0x200)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save size&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 0x8&lt;br /&gt;
| Always 0xFF (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 0x4&lt;br /&gt;
| See [[ARM7_Registers|here]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x64&lt;br /&gt;
| 0x4&lt;br /&gt;
| See [[ARM7_Registers|here]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 0x198&lt;br /&gt;
| Always 0xFF&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=14334</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=14334"/>
		<updated>2015-10-27T02:27:12Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Memory map */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle TWL_FIRM and AGB_FIRM&#039;s ARM7 requirements. This is due to the fact that much of the hardware used by both ARM7 and ARM9 is (evidently) not physically hooked up to ARM11. Thus, ARM11 cannot simply emulate ARM7.&lt;br /&gt;
&lt;br /&gt;
ARM7 has the AGB BIOS implemented in hardware. The BIOS is completely identical to the original AGB BIOS. The system is booted silently by calling SWI 0x1 (RegisterRamReset), followed by jumping to the code that does SWI 0x0 (SoftReset) to finish booting. The boot splash is still in BIOS, however, and can be seen by calling (or replacing one of the previous interrupts with) SWI 0x26 (HardReset).&lt;br /&gt;
= Registers =&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Name&lt;br /&gt;
|  Address&lt;br /&gt;
!  Width&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CNT&lt;br /&gt;
| 0x10018000&lt;br /&gt;
| 0x1 &lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CODE&lt;br /&gt;
| 0x10018080&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_CNT&lt;br /&gt;
| 0x10018104&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_STATUS&lt;br /&gt;
| 0x10018108&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_WRITE_1&lt;br /&gt;
| 0x10018110&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_WRITE_2&lt;br /&gt;
| 0x10018114&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_READ_1&lt;br /&gt;
| 0x10018118&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_READ_2&lt;br /&gt;
| 0x1001811C&lt;br /&gt;
| 0x4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM7_CNT ==&lt;br /&gt;
This indicates (controls?) the mode of the ARM7. 1 = TWL, 2 = AGB.&lt;br /&gt;
&lt;br /&gt;
== ARM7_CODE ==&lt;br /&gt;
This is the first code that will be run after execution begins. TwlProcess9 uses this to put ARM7 in a loop (TWL), and to set the POSTFLG and branch to more copied code (AGB).This doesn&#039;t seem to start execution by itself.&lt;br /&gt;
&lt;br /&gt;
== ARM7_?_READ/WRITE ==&lt;br /&gt;
The values here are read from, stored in the AGB_FIRM [[3DS_Virtual_Console#NAND_Savegame|savegame]], and then written to the respective registers upon save loading. These registers are read after waiting for bit 15 of ARM7_?_STATUS to be set, writing 0x0 and then 0x2 to that register, and then waiting for bit 15 to be set again. If bit 14 is not set afterward, these registers are read from and stored in the save. Otherwise, these values are saved (and restored) as 0x0.&lt;br /&gt;
&lt;br /&gt;
= Memory map =&lt;br /&gt;
The virtual memory mapping for the ARM7 is the same as for the [[Memory_layout#TWL_FIRM_Userland_Memory|other core]]. However, it has additional internal memory mapped to it. Interestingly enough, much of this memory seems to lie within ARM9&#039;s own &amp;quot;internal memory.&amp;quot;&lt;br /&gt;
*0x08060000 -&amp;gt; 0x03800000, ARM7-WRAM (64KB)&lt;br /&gt;
*0x080B0000 -&amp;gt; 0x03000000, GBA on-chip WRAM (32KB)&lt;br /&gt;
*0x080C0000 -&amp;gt; EEPROM/SRAM/Flash (0x10018104 must be set to 1 before reading memory here, and restored to its previous value afterwards)&lt;br /&gt;
*0x01FFC000 -&amp;gt; 0x01000000, ARM9 ITCM under TWL (16KB)&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=14333</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=14333"/>
		<updated>2015-10-27T02:13:53Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: more registers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle TWL_FIRM and AGB_FIRM&#039;s ARM7 requirements. This is due to the fact that much of the hardware used by both ARM7 and ARM9 is (evidently) not physically hooked up to ARM11. Thus, ARM11 cannot simply emulate ARM7.&lt;br /&gt;
&lt;br /&gt;
ARM7 has the AGB BIOS implemented in hardware. The BIOS is completely identical to the original AGB BIOS. The system is booted silently by calling SWI 0x1 (RegisterRamReset), followed by jumping to the code that does SWI 0x0 (SoftReset) to finish booting. The boot splash is still in BIOS, however, and can be seen by calling (or replacing one of the previous interrupts with) SWI 0x26 (HardReset).&lt;br /&gt;
= Registers =&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Name&lt;br /&gt;
|  Address&lt;br /&gt;
!  Width&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CNT&lt;br /&gt;
| 0x10018000&lt;br /&gt;
| 0x1 &lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CODE&lt;br /&gt;
| 0x10018080&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_CNT&lt;br /&gt;
| 0x10018104&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_STATUS&lt;br /&gt;
| 0x10018108&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_WRITE_1&lt;br /&gt;
| 0x10018110&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_WRITE_2&lt;br /&gt;
| 0x10018114&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_READ_1&lt;br /&gt;
| 0x10018118&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_READ_2&lt;br /&gt;
| 0x1001811C&lt;br /&gt;
| 0x4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM7_CNT ==&lt;br /&gt;
This indicates (controls?) the mode of the ARM7. 1 = TWL, 2 = AGB.&lt;br /&gt;
&lt;br /&gt;
== ARM7_CODE ==&lt;br /&gt;
This is the first code that will be run after execution begins. TwlProcess9 uses this to put ARM7 in a loop (TWL), and to set the POSTFLG and branch to more copied code (AGB).This doesn&#039;t seem to start execution by itself.&lt;br /&gt;
&lt;br /&gt;
== ARM7_?_READ/WRITE ==&lt;br /&gt;
The values here are read from, stored in the AGB_FIRM [[3DS_Virtual_Console#NAND_Savegame|savegame]], and then written to the respective registers upon save loading. These registers are read after waiting for bit 15 of ARM7_?_STATUS to be set, writing 0x0 and then 0x2 to that register, and then waiting for bit 15 to be set again. If bit 14 is not set afterward, these registers are read from and stored in the save. Otherwise, these values are saved (and restored) as 0x0.&lt;br /&gt;
&lt;br /&gt;
= Memory map =&lt;br /&gt;
The virtual memory mapping for the ARM7 is the same as for the [[Memory_layout#TWL_FIRM_Userland_Memory|other core]]. However, it has additional internal memory mapped to it. Interestingly enough, much of this memory seems to lie within ARM9&#039;s own &amp;quot;internal memory.&amp;quot;&lt;br /&gt;
*0x08060000 -&amp;gt; 0x03800000, ARM7-WRAM (64KB)&lt;br /&gt;
*0x080B0000 -&amp;gt; 0x03000000, GBA on-chip WRAM (32KB)&lt;br /&gt;
*0x080C0000 -&amp;gt; ? (0x10018104 is set to 1 before changing memory here, and 0 afterwards, save-related?)&lt;br /&gt;
*0x01FFC000 -&amp;gt; 0x01000000, ARM9 ITCM (16KB)&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=14332</id>
		<title>3DS Virtual Console</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=14332"/>
		<updated>2015-10-27T02:02:31Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: AGB NAND savegame format, MAC, etc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There&#039;s two types of VC titles: regular VC titles, and dedicated GBA VC titles.&lt;br /&gt;
&lt;br /&gt;
=Regular VC=&lt;br /&gt;
Regular VC titles: an emulator application + VC ROM in the NCCH [[RomFS]](among other things in the RomFS). The emulator build includes support for all supported VC platforms, not specific to just the included ROM platform.&lt;br /&gt;
&lt;br /&gt;
This emulator includes GBA support, however the GBA emulation for this this is somewhat slow. This was presumably implemented before AGB_FIRM was.&lt;br /&gt;
&lt;br /&gt;
Unlike Wii VC, the 3DS VC ROMs for NES use the &amp;quot;TNES&amp;quot; header.&lt;br /&gt;
&lt;br /&gt;
==RomFS==&lt;br /&gt;
* &amp;quot;rom:/rom/&amp;quot; This directory contains the ROM file(s). Filenames used under here don&#039;t matter: the filename is determined by the emulator app by doing a directory read.&lt;br /&gt;
* &amp;quot;rom:/shaders/&amp;quot; This directory contains GPU shaders used by the emulator app: .shbin, .csdr, and .obj.&lt;br /&gt;
* &amp;quot;rom:/VCM/&amp;quot; This directory contains graphics, audio, and text used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/agb.bin&amp;quot; GBA BIOS.&lt;br /&gt;
* &amp;quot;rom:/buildtime.txt&amp;quot; Emulator app build timestamp.&lt;br /&gt;
* &amp;quot;rom:/config.ini&amp;quot; Emulator configuration .ini, contains sections for all supported 3DS VC platforms.&lt;br /&gt;
* &amp;quot;rom:/&amp;lt;rom_name&amp;gt;.patch&amp;quot; rom_name = filename from the rom directory. This .ini contains patches for the ROM.&lt;br /&gt;
* &amp;quot;rom:/shader.shbin&amp;quot; GPU shader.&lt;br /&gt;
&lt;br /&gt;
=GBA VC=&lt;br /&gt;
GBA VC is run by [[FIRM|AGB_FIRM]]. RomFS isn&#039;t used for GBA VC titles, but can be found empty within GBA VC titles. The NCCH [[ExeFS]] contains the same files as a normal application. The [[ExeFS]]:/.code contains the GBA VC ROM followed by a 0x360 byte long footer.&lt;br /&gt;
&lt;br /&gt;
===Footer===&lt;br /&gt;
All values in the GBA VC footer are little-endian.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x004&lt;br /&gt;
|  0x4&lt;br /&gt;
|  GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x008&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x020&lt;br /&gt;
| 0x1&lt;br /&gt;
| Manufacturer info select (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x024&lt;br /&gt;
| 0x300&lt;br /&gt;
| Unknown, three different types of this data have been observed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x338&lt;br /&gt;
| 0x4&lt;br /&gt;
| GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x344&lt;br /&gt;
| 0x4&lt;br /&gt;
| GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x350&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &#039;.CAA&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x35A&lt;br /&gt;
| 0x2&lt;br /&gt;
| High two bytes of GBA ROM file size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Save types:&lt;br /&gt;
* EEPROM (various sizes, IDs specified in footer): 0x2&lt;br /&gt;
* SRAM/FRAM (128k): 0xE&lt;br /&gt;
* Flash (512k): 0x9&lt;br /&gt;
&lt;br /&gt;
Support for RTC and 1m-flash chips is not implemented in AGB_FIRM.&lt;br /&gt;
&lt;br /&gt;
Manufacturer info:&lt;br /&gt;
GBA games&#039; SDK-provided save code only supports a range of manufacturers from which Nintendo was buying memory from around the time of that game&#039;s development. As such, most games don&#039;t support a generic emulated storage chip. This byte appears to select a manufacturer info set to emulate. This has been observed to be 0x90, 0xC0, and (in one EEPROM-based game), 0x80.&lt;br /&gt;
* SRAM games up to and including V111 use 0xC0. Above use 0x90.&lt;br /&gt;
* FRAM V103 uses 0xC0. V104+ don&#039;t exist, and lower versions also likely use 0xC0.&lt;br /&gt;
* Flash V124 was observed 0x90, V131 was observed 0xC0.&lt;br /&gt;
* EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===NAND Savegame===&lt;br /&gt;
AGB_FIRM saves its active save memory to NAND on exit, this is then immediately picked up by NATIVE_FIRM on reboot by checking [[CONFIG_Registers#CFG_BOOTENV|CFG_BOOTENV]]. From there, this is verified and copied out to SD. The savegame format is as follows:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Magic (&#039;.SAV&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0xC&lt;br /&gt;
| Always 0xFF&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| AES-MAC of the SHA256 hash of 0x30..0x200 + the entire save itself, keyslot 0x24, keyY from process9 .rodata&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x10&lt;br /&gt;
| Always 0xFF&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x40&lt;br /&gt;
| Always 0x1?&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x4&lt;br /&gt;
| ? (observed 0x1, may change though)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x8&lt;br /&gt;
| AGB TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x10&lt;br /&gt;
| eMMC CID from the console the save was made on (verified on load)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save start addr (always 0x200)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save size&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 0x8&lt;br /&gt;
| Always 0xFF (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 0x4&lt;br /&gt;
| See [[ARM7_Registers|here]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x64&lt;br /&gt;
| 0x4&lt;br /&gt;
| See [[ARM7_Registers|here]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 0x198&lt;br /&gt;
| Always 0xFF&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CONFIG9_Registers&amp;diff=14317</id>
		<title>CONFIG9 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CONFIG9_Registers&amp;diff=14317"/>
		<updated>2015-10-26T17:31:51Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: actual usage, clean up some repetition that belongs on the LGY PXI page anyways&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Registers =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Name&lt;br /&gt;
!  Address&lt;br /&gt;
!  Width&lt;br /&gt;
!  Used by&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_SYSPROT9|CFG_SYSPROT9]]&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 1&lt;br /&gt;
| Boot9&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_SYSPROT11|CFG_SYSPROT11]]&lt;br /&gt;
| 0x10000001&lt;br /&gt;
| 1&lt;br /&gt;
| Boot9&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| CFG_DEBUGUNIT&lt;br /&gt;
| 0x10000004&lt;br /&gt;
| 4&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10000008&lt;br /&gt;
| 1&lt;br /&gt;
| TwlProcess9&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_CARDCONF|CFG_CARDCONF]]&lt;br /&gt;
| 0x1000000C&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| &lt;br /&gt;
| 0x10000010&lt;br /&gt;
| 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10000011&lt;br /&gt;
| 1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10000012&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10000014&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10000020&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10000100&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[#CFG_EXTMEMCNT9|CFG_EXTMEMCNT9]]&lt;br /&gt;
| 0x10000200&lt;br /&gt;
| 1&lt;br /&gt;
| NewKernel9&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_MPCORECFG|CFG_MPCORECFG]]&lt;br /&gt;
| 0x10000FFC&lt;br /&gt;
| 4&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_BOOTENV|CFG_BOOTENV]]&lt;br /&gt;
| 0x10010000&lt;br /&gt;
| 4&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_UNITINFO|CFG_UNITINFO]]&lt;br /&gt;
| 0x10010010&lt;br /&gt;
| 1&lt;br /&gt;
| Process9&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG_TWLUNITINFO|CFG_TWLUNITINFO]]&lt;br /&gt;
| 0x10010014&lt;br /&gt;
| 1&lt;br /&gt;
| Process9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CFG_SYSPROT9 == &lt;br /&gt;
Writing values to SYSPROT sets the specified bitmask. The ARM9 [[Memory_layout|bootrom]](+0x8000) is disabled by writing bit0. bit1 is used by NATIVE_FIRM to make sure console-unique TWL AES-keys are only set at hard-boot. It is not possible to set any other bits.&lt;br /&gt;
&lt;br /&gt;
From disassembly of the New3DS process9, it appears that setting bit1 disables the 0x10012000+ region.&lt;br /&gt;
&lt;br /&gt;
== CFG_SYSPROT11 == &lt;br /&gt;
ARM11 bootrom (+0x8000) is disabled by writing bit0. It is not possible to set any other bits.&lt;br /&gt;
&lt;br /&gt;
== CFG_CARDCONF ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 1-0&lt;br /&gt;
| Gamecard active controller select (0=NTRCARD, 1=?, 2=CTRCARD1, 3=CTRCARD2)&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Depending on the gamecard controller that has been selected, one of the following gamecard registers will become active:&lt;br /&gt;
* Selecting NTRCARD will activate the register space at [[NTRCARD|0x10164000]].&lt;br /&gt;
* Selecting CTRCARD1 will activate the register space at [[CTRCARD|0x10004000]].&lt;br /&gt;
* Selecting CTRCARD2 will activate the register space at [[CTRCARD|0x10005000]].&lt;br /&gt;
&lt;br /&gt;
== 0x10000010 ==&lt;br /&gt;
When a gamecard isn&#039;t inserted, this register value is 0x01, otherwise when a gamecard is inserted it&#039;s value 0x08.&lt;br /&gt;
&lt;br /&gt;
== CFG_EXTMEMCNT9 ==&lt;br /&gt;
This register is presumably New3DS-only. Only bit0 is writable: 0 = disable New3DS ARM9 memory at 0x08100000 size 0x80000, 1 = enable.&lt;br /&gt;
&lt;br /&gt;
This bit is set by New3DS ARM9-kernel crt0.&lt;br /&gt;
&lt;br /&gt;
The data in this extended memory doesn&#039;t change when disabling the memory, then re-enabling the memory. Reading this extended memory while disabled results in zeros.&lt;br /&gt;
&lt;br /&gt;
== CFG_MPCORECFG ==&lt;br /&gt;
Identical to [[PDN#PDN_MPCORE_CFG|PDN_MPCORE_CFG]].&lt;br /&gt;
&lt;br /&gt;
== CFG_BOOTENV ==&lt;br /&gt;
This register is used to determine what the previous running FIRM was. Its value is kept following an MCU reboot. Its initial value (on a cold boot) is 0. NATIVE_FIRM [[Development_Services_PXI|sets it to 1]] on shutdown/FIRM launch. [[Legacy_FIRM_PXI|LGY FIRM]] writes value 3 here when launching a TWL title, and writes value 7 when launching an AGB title.&lt;br /&gt;
&lt;br /&gt;
NATIVE_FIRM will only launch titles if this is not value 0, and will only save the [[Flash_Filesystem|AGB_FIRM savegame]] to SD if this is value 7.&lt;br /&gt;
&lt;br /&gt;
== CFG_UNITINFO ==&lt;br /&gt;
This 8-bit register is value zero for retail, non-zero for dev/debug units.&lt;br /&gt;
&lt;br /&gt;
== CFG_TWLUNITINFO ==&lt;br /&gt;
In the console-unique TWL key-init/etc function the ARM9 copies the u8 value from REG_UNITINFO to this register.&lt;br /&gt;
&lt;br /&gt;
This is also used by TWL_FIRM Process9.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mode_Control_Services_PXI&amp;diff=14310</id>
		<title>Mode Control Services PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mode_Control_Services_PXI&amp;diff=14310"/>
		<updated>2015-10-26T11:59:10Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: CFG_BOOTENV note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=&amp;quot;pxi:mc&amp;quot; service=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|  This is sent to the ARM9 by the ARM11 PXI-module, when PXI-module is shutting down due to receiving [[Services|srv]] notification-ID 0x100. This sets [[CONFIG_Registers#CFG_BOOTENV|CFG_BOOTENV]] to the value for CTR (0x1), and is only time it&#039;s set by Process9.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, does nothing...&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, does nothing...&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, does nothing...&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (u8 unkval) Unknown. Used by [[PTM_Services|PTM]] module.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, does nothing...&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, writes uninitialized stack byte to (u8*)(cmdbuf+4).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0008....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, returns 0xE0C0EC03...&lt;br /&gt;
|-&lt;br /&gt;
| 0x0009....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, returns 0xE0C0EC03...&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, does some unnecessary copying to stack...&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed, does some unnecessary copying to stack...&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Back to↓&lt;br /&gt;
&lt;br /&gt;
[[Services API]]&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AES_Registers&amp;diff=14302</id>
		<title>AES Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AES_Registers&amp;diff=14302"/>
		<updated>2015-10-25T17:04:37Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: keyslot 0x24 confirmed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Registers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Name&lt;br /&gt;
!  Address&lt;br /&gt;
!  Width&lt;br /&gt;
!  RW&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_CNT|AES_CNT]]&lt;br /&gt;
| 0x10009000&lt;br /&gt;
| 4&lt;br /&gt;
| RW&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_BLKCNT|AES_BLKCNT]]&lt;br /&gt;
| 0x10009004&lt;br /&gt;
| 4&lt;br /&gt;
| W?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_WRFIFO/AES_RDFIFO|AES_WRFIFO]]&lt;br /&gt;
| 0x10009008&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_WRFIFO/AES_RDFIFO|AES_RDFIFO]]&lt;br /&gt;
| 0x1000900C&lt;br /&gt;
| 4&lt;br /&gt;
| R&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEYSEL&lt;br /&gt;
| 0x10009010&lt;br /&gt;
| 1&lt;br /&gt;
| RW&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_KEYCNT|AES_KEYCNT]]&lt;br /&gt;
| 0x10009011&lt;br /&gt;
| 1&lt;br /&gt;
| RW&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_CTR|AES_CTR]]&lt;br /&gt;
| 0x10009020&lt;br /&gt;
| 16&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#AES_MAC|AES_MAC]]&lt;br /&gt;
| 0x10009030&lt;br /&gt;
| 16&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEY0&lt;br /&gt;
| 0x10009040&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEY1&lt;br /&gt;
| 0x10009070&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEY2&lt;br /&gt;
| 0x100090A0&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEY3&lt;br /&gt;
| 0x100090D0&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEYFIFO&lt;br /&gt;
| 0x10009100&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEYXFIFO&lt;br /&gt;
| 0x10009104&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AES_KEYYFIFO&lt;br /&gt;
| 0x10009108&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AES_CNT ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 4-0&lt;br /&gt;
| Write FIFO count (0-16)&lt;br /&gt;
|-&lt;br /&gt;
| 9-5&lt;br /&gt;
| Read FIFO count (0-16)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Flush write FIFO (1=Clear write FIFO)&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Flush read fifo (1=Clear read FIFO)&lt;br /&gt;
|-&lt;br /&gt;
| 18-16&lt;br /&gt;
| MAC size (encoding = (maclen-2)/2)&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
|? (MAC related)&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| MAC input control (0 = read MAC from FIFO, 1 = read from MAC register)&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| MAC status (0 = invalid, 1 = verified)&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Output endianness (1=Big endian, 0=Little endian)&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Input endianness (1=Big endian, 0=Little endian)&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Output word order (1=Normal order, 0=Reversed order)&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Input word order (1=Normal order, 0=Reversed order)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Update keyslot (selects the keyslot specified by REG_AESKEYSEL when this bit is set)&lt;br /&gt;
|-&lt;br /&gt;
| 29-27&lt;br /&gt;
| Mode (0=CCM decrypt, 1=CCM encrypt, 2=CTR, 3=CTR, 4=CBC decrypt, 5=CBC encrypt, 6=ECB decrypt, 7=ECB encrypt)&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Interrupt enable (1=enable, 0=disable)&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Start (1=enable/busy, 0=idle)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When bit31 is clear, the AES engine will handle keyslot-selection when bit26 is set immediately. When bit31 is set, the AES engine won&#039;t handle bit26 immediately, instead the AES engine will automatically handle the already-set bit26 once bit31 clears(current AES operation finishes).&lt;br /&gt;
&lt;br /&gt;
Clearing bit31 while the AES engine is doing crypto will result in the AES engine stopping crypto, once it finishes processing the current block.&lt;br /&gt;
&lt;br /&gt;
== AES_BLKCNT ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 16-31&lt;br /&gt;
| (Data length)&amp;gt;&amp;gt;4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AES_WRFIFO/AES_RDFIFO ==&lt;br /&gt;
Up to 128 bytes of input data can be buffered.&lt;br /&gt;
&lt;br /&gt;
The input data for the AES crypto operation is written to REG_AESWRFIFO, the output data is read from REG_AESRDFIFO.&lt;br /&gt;
&lt;br /&gt;
Reading from REG_AESRDFIFO when there&#039;s no data available in the RDFIFO will result in reading the last word that was in the RDFIFO.&lt;br /&gt;
&lt;br /&gt;
== AES_KEYCNT ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 5-0&lt;br /&gt;
| Keyslot&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Hardware key-generator type: 0 = 3DS, 1 = DSi.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| This normally has value 1 written here when updating keys. 0 = disable key FIFO flush, 1 = enable key FIFO flush.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit6 is only used when keyslots &amp;gt;=4 are used, value1 has the same affect as doing key-init with the TWL keyslots. Bit6 is only checked when a keyY was completely written, for when the final-normalkey needs updated via the key-generator. Changing bit6 has no affect on the generated normalkey when writing to this bit immediately after writing the last keyY word.&lt;br /&gt;
&lt;br /&gt;
== AES_CTR ==&lt;br /&gt;
This register specifies the counter (CTR mode), nonce (CCM mode) or the initialization vector (CBC mode) depending on the mode of operation.&lt;br /&gt;
For CBC and CTR mode this register takes up the full 16 bytes, but for CCM mode the nonce is only the first 12 bytes.&lt;br /&gt;
The AES engine will automatically increment the counter up to the maximum BLKCNT, after which point it must be manually incremented and set again.&lt;br /&gt;
&lt;br /&gt;
== AES_MAC ==&lt;br /&gt;
This register specifies the message authentication code (MAC) for use in CCM mode.&lt;br /&gt;
&lt;br /&gt;
== AES_KEY0/1/2/3 ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-15&lt;br /&gt;
| Normalkey&lt;br /&gt;
|-&lt;br /&gt;
| 16-31&lt;br /&gt;
| KeyX&lt;br /&gt;
|-&lt;br /&gt;
| 32-47&lt;br /&gt;
| KeyY&lt;br /&gt;
|-}&lt;br /&gt;
&lt;br /&gt;
These registers are the same as they were on TWL, and are likely preserved for compatibility reasons. The keyslot is updated immediately after *any* data(u8/u32/...) is written here, which was used on DSi to [[3DS_System_Flaws|break]] the key-generator.&lt;br /&gt;
&lt;br /&gt;
== Endianness and word order ==&lt;br /&gt;
When writing to the AES_CTR or AES_MAC register, the hardware will process the written data according to the current input endianness specified in AES_CNT. However, the current specified input word order will not be honored for this register, and always defaults to reversed word order. Therefore, for normal word order, the reversal must be carried out manually if required.&lt;br /&gt;
&lt;br /&gt;
== Keyslot ranges ==&lt;br /&gt;
This is approximately a table of what is set by bootrom before booting into FIRM. Often it appears that keyslots in groups of 4 have the same keyX, and sometimes also same keyY set.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Keyslot&lt;br /&gt;
!  Name&lt;br /&gt;
!  KeyX&lt;br /&gt;
!  KeyY/Normal-key&lt;br /&gt;
!  Console unique.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00-0x03&lt;br /&gt;
| TWL keys.&lt;br /&gt;
| Probably unset.&lt;br /&gt;
| Probably unset.&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0x04-0x07&lt;br /&gt;
| NAND partition keys.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Different for all.&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x08-0x0B&lt;br /&gt;
| See below.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Different for all.&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C-0x0F&lt;br /&gt;
| SSL cert key.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| 0x10-0x17&lt;br /&gt;
| -&lt;br /&gt;
| Not set.&lt;br /&gt;
| Not set.&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0x18-0x1B&lt;br /&gt;
| Never used.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C-0x1F&lt;br /&gt;
| Never used.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x20-0x23&lt;br /&gt;
| Never used.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| style=&amp;quot;background: orange&amp;quot; | Normalkey is not. keyX is. keyY unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| Never used.&lt;br /&gt;
| Individually set.&lt;br /&gt;
| Individually set.&lt;br /&gt;
| style=&amp;quot;background: orange&amp;quot; | Normalkey is not. keyX is. keyY unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25-0x27&lt;br /&gt;
| -&lt;br /&gt;
| Not set.&lt;br /&gt;
| Not set.&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0x28-0x2B&lt;br /&gt;
| Never used.&lt;br /&gt;
| Individually set.&lt;br /&gt;
| Individually set.&lt;br /&gt;
| style=&amp;quot;background: orange&amp;quot; | Normalkey is not. keyX is. keyY unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C-0x2F&lt;br /&gt;
| Various uniques.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all, probably.&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| 0x30-0x33&lt;br /&gt;
| Various uniques.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all, probably.&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| 0x34-0x37&lt;br /&gt;
| Various uniques.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Same for all, probably.&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| 0x38-0x3B&lt;br /&gt;
| Various uniques.&lt;br /&gt;
| Same for all.&lt;br /&gt;
| Different for all.&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C-0x3F&lt;br /&gt;
| Various uniques.&lt;br /&gt;
| Individually set.&lt;br /&gt;
| Individually set.&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Keyslot pairs (0x24, 0x28) and (0x38, 0x3C) shares the same normal-key, while at the same time having different keyX&#039;s. This suggests they were set to same normal-key by bootrom.&lt;br /&gt;
&lt;br /&gt;
== Keyslots ==&lt;br /&gt;
There are 0x40 keyslots, each of which stores three keys called keyX, keyY and normalkey. All keys can be set explicitly, but the normalkey can optionally be generated using a hardware key generator instead (see below). There is no way to read the contents of a keyslot.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Keyslot&lt;br /&gt;
!  Description&lt;br /&gt;
!  KeyX&lt;br /&gt;
!  KeyY&lt;br /&gt;
!  Normal-key&lt;br /&gt;
!  Old3DS&lt;br /&gt;
|-&lt;br /&gt;
| 0x00-0x03&lt;br /&gt;
| TWL keys.&lt;br /&gt;
| NATIVE_FIRM hard-boot.&lt;br /&gt;
| NATIVE_FIRM hard-boot.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x04..0x07&lt;br /&gt;
| [[Flash_Filesystem|NAND]] partition keys.&lt;br /&gt;
&lt;br /&gt;
Keyslot is determined by [[NCSD]] partition FS type and encryption type. &lt;br /&gt;
The New3DS Process9 sets the keyY for keyslot 0x05 (New3DS CTRNAND) to a key from .(ro)data. Its keyX is console-unique and set by the bootloader.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| DSiWare export key.&lt;br /&gt;
&lt;br /&gt;
Used for encrypting the all-zero 0x10-byte block in the [[DSiWare_Exports|DSiWare_Exports]] header. Console-unique.&lt;br /&gt;
| See above keyslot info.&lt;br /&gt;
| See above keyslot info.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B&lt;br /&gt;
| This is console-unique. This keyslot is used for the NAND [[Title_Database|dbs]] images AESMACs, and the [[Nand/private/movable.sed]] AESMAC(when used).&lt;br /&gt;
| See above keyslot info.&lt;br /&gt;
| See above keyslot info.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D&lt;br /&gt;
| SSL-certificate key.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]].&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| Temporary keyslot.&lt;br /&gt;
&lt;br /&gt;
Used by FIRM for general normal-key crypto. Also used by the New3DS [[FIRM]] arm9 binary loader.&lt;br /&gt;
| Arm9Loader. &lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| Starting with [[5.0.0-11]], NATIVE_FIRM Process9 now sets the keyY for this to the same one it uses for initializing 3 of the keyslots&#039; keyYs from [[PSPXI:EncryptDecryptAes|here]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM boot.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| Used/initialized by the New3DS arm9 binary loader, see [[FIRM|here]].&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| See previous info for this keyslot.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| Used/initialized by the New3DS arm9 binary loader starting with [[9.5.0-22|9.5.0-X]], see [[FIRM|here]].&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| See previous info for this keyslot.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x18..0x1F&lt;br /&gt;
| These are the New3DS keyslots, where the keyX is generated with keyslot 0x11 by the New3DS arm9 binary [[FIRM|loader]]. As of [[FIRM]] [[9.6.0-24|9.6.0-X]] keyslots 0x1C..0x1F are not yet used by Process9.&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| NATIVE_FIRM / see previous info for these keyslots.&lt;br /&gt;
| See previous info for these keyslots.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| New3DS [[9.3.0-21|9.3.0-X]] [[NCCH]] key, when ncchflag[3] is 0x0A.&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| NATIVE_FIRM&lt;br /&gt;
| -&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x19&lt;br /&gt;
| New3DS gamecard [[Savegames|savedata]] AES-MAC key.&lt;br /&gt;
&lt;br /&gt;
Equivalent of keyslot 0x33, used when a [[NCSD]] flag is set to a certain value (implemented with [[9.3.0-21|9.3.0-X]]).&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| NATIVE_FIRM&lt;br /&gt;
| -&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| New3DS gamecard [[Savegames|savedata]] actual key.&lt;br /&gt;
&lt;br /&gt;
Equivalent of keyslot 0x37, used when a [[NCSD]] flag is set to a certain value (implemented with [[9.3.0-21|9.3.0-X]]).&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| NATIVE_FIRM&lt;br /&gt;
| -&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B&lt;br /&gt;
| New3DS [[9.6.0-24|9.6.0-X]] [[NCCH]] key, when ncchflag[3] is 0x0B.&lt;br /&gt;
| Arm9Loader.&lt;br /&gt;
| NATIVE_FIRM&lt;br /&gt;
| -&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| AGB_FIRM savegame AES-MAC key.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| AGB/NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x25&lt;br /&gt;
| [[7.0.0-13|v7.0]] [[NCCH]] key, when ncchflag[3] is 0x01.&lt;br /&gt;
| NATIVE_FIRM [[Savegames#6.0.0-11_Savegame_keyY|boot]].&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| Original [[NCCH|NCCH]] key, when ncchflag[3] is 0x00 and always for certain NCCH sections.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Process9.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D&lt;br /&gt;
| UDS local-WLAN CCMP key.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E&lt;br /&gt;
| Streetpass key.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F&lt;br /&gt;
| [[Savegames#6.0.0-11_Savegame_keyY|v6.0]] save key.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| SD/NAND AES-MAC key.&lt;br /&gt;
&lt;br /&gt;
This keyY is initialized via [[Nand/private/movable.sed|movable.sed]]. This is used for calculating the AESMACs under SD [[SD_Filesystem|/Nintendo 3DS/&amp;lt;ID0&amp;gt;/&amp;lt;ID1&amp;gt;/]] (except [[DSiWare_Exports]]) and [[Flash_Filesystem|NAND]] /data/.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| APT wrap key.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]]. NATIVE_FIRM sets this keyY to the same one used for keyslot 0x2E.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| Unknown.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| Gamecard [[Savegames|savedata]] AES-MAC.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| SD key.&lt;br /&gt;
&lt;br /&gt;
This keyY is initialized via [[Nand/private/movable.sed|movable.sed]]. This is used for encrypting *all* SD card data under [[SD_Filesystem|/Nintendo 3DS/&amp;lt;ID0&amp;gt;/&amp;lt;ID1&amp;gt;/]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| Movable.sed key.&lt;br /&gt;
&lt;br /&gt;
This is the keyslot used for movable.sed encryption + AES-MAC with the import/export [[FSPXI:ImportIntegrityVerificationSeed|commands]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| Unknown. Used by friends module.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x37&lt;br /&gt;
| Gamecard [[Savegames|savedata]] actual key.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| BOSS key.&lt;br /&gt;
&lt;br /&gt;
See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x39&lt;br /&gt;
| Download Play key, and the actual NFC key for generating retail [[Amiibo]] keys.&lt;br /&gt;
&lt;br /&gt;
This keyslot is used for two different keys. Both are available via [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]]. NATIVE_FIRM sets this keyY to the same one used for keyslot 0x2E.&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A&lt;br /&gt;
| DSiWare export key.&lt;br /&gt;
&lt;br /&gt;
This keyY is initialized via [[Nand/private/movable.sed|movable.sed]]. This is used for calculating the AESMACs for SD [[DSiWare_Exports]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B&lt;br /&gt;
| [[CTRCARD_Registers#CTRCARD_SECSEED|CTR-CARD hardware-crypto seed]] decryption key.&lt;br /&gt;
&lt;br /&gt;
AES-CCM is used, the keyY, nonce and MAC are stored in the [[NCSD#Card_Info_Header|Card Info Header]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D&lt;br /&gt;
| Common key.&lt;br /&gt;
&lt;br /&gt;
Used to decrypt title keys in [[Ticket]].&lt;br /&gt;
| Bootrom.&lt;br /&gt;
| NATIVE_FIRM.&lt;br /&gt;
| -&lt;br /&gt;
| Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Updating keydata ===&lt;br /&gt;
The contents of the keyslot specified in REG_AESKEYCNT can be updated by consecutively writing four words to REG_AESKEYXFIFO (keyX), REG_AESKEYYFIFO(keyY), or REG_AESKEYFIFO (normalkey).&lt;br /&gt;
&lt;br /&gt;
After writing to a keyslot, the keyslot must be selected again(write REG_AESKEYSEL + set REG_AESCNT bit26), even when writing to the same keyslot. Writing the last word to a key FIFO immediately after selecting a keyslot will not affect the keyslot keydata that gets used at that time, the new keydata will not get used until the keyslot gets selected again.&lt;br /&gt;
&lt;br /&gt;
Writing to the key FIFOs with byte writes results in the AES engine converting the byte to a word for setting the key word, with this: word = (byteval) | (byteval&amp;lt;&amp;lt;8) | (byteval&amp;lt;&amp;lt;16) | (byteval&amp;lt;&amp;lt;24). The result is the same regardless of which FIFO register byte was written to.&lt;br /&gt;
&lt;br /&gt;
The TWL keyslots 0x00-0x03 can be set directly by writing to the REG_AESKEY0-REG_AESKEY3 registers.&lt;br /&gt;
&lt;br /&gt;
The key FIFOs can be written simultaneously. For example, executing the following 4 times will result in the keyX and keyY being set to all-zero(unknown for normalkey): memset(0x10009100, 0, 0x100);&lt;br /&gt;
&lt;br /&gt;
Each key FIFO has a 0x10-byte tmp-buffer for storing the words written to that FIFO. Once the last word is written to a key FIFO, the filled tmp-buffer is then written to the key-data for the keyslot selected by REG_AESKEYCNT at the time the last word was written.&lt;br /&gt;
&lt;br /&gt;
=== keyX ===&lt;br /&gt;
The ARM9 bootrom initializes the keyX for certain 3DS keyslots, the ARM9 bootrom may also initialize the keyY for certain keyslots. In certain cases Process9 may also set the keyX.&lt;br /&gt;
&lt;br /&gt;
=== Hardware key generator ===&lt;br /&gt;
A dedicated hardware key generator can be used to generate a keyslot&#039;s normalkey from its keyX and keyY. The hardware key generator is triggered by writing the keyY, which is the only way to trigger it with the 3DS keyslots. The algorithm used for key generation is unknown.&lt;br /&gt;
&lt;br /&gt;
Unless noted otherwise, all keyslots on retail units use the hardware key-generator.&lt;br /&gt;
&lt;br /&gt;
=== FIRM-launch key clearing ===&lt;br /&gt;
Starting with [[9.0.0-20]] the Process9 FIRM-launch code now &amp;quot;clears&amp;quot; the following AES keyslots, with certain keydata by writing the normal-key: 0x15 and 0x18-0x20. These are the keyslots used by the New3DS [[FIRM]] arm9bin loader(minus keyslot 0x11), the New3DS Process9 does this too.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=IO_Registers&amp;diff=14276</id>
		<title>IO Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=IO_Registers&amp;diff=14276"/>
		<updated>2015-10-22T07:05:03Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: N3DS DMA addrs notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Old3DS&lt;br /&gt;
! A9/A11&lt;br /&gt;
! Category&lt;br /&gt;
! Physaddr&lt;br /&gt;
! Used by&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[CONFIG Registers]]&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[IRQ Registers]]&lt;br /&gt;
| 0x10001000&lt;br /&gt;
| Boot9, Process9, Kernel9&lt;br /&gt;
| ARM9 Interrupt Masking&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[NDMA Registers]]&lt;br /&gt;
| 0x10002000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
| DMA Engine&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[TIMER Registers]]&lt;br /&gt;
| 0x10003000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[CTRCARD Registers]]&lt;br /&gt;
| 0x10004000 / 0x10005000&lt;br /&gt;
| Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[EMMC Registers]]&lt;br /&gt;
| 0x10006000 / 0x10007000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
| 0x10007000 is normally not enabled on retail, all-zeros when read.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[PXI Registers]]&lt;br /&gt;
| 0x10008000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[AES Registers]]&lt;br /&gt;
| 0x10009000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[SHA Registers]]&lt;br /&gt;
| 0x1000A000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[RSA Registers]]&lt;br /&gt;
| 0x1000B000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[Corelink DMA Engines|XDMA Registers]]&lt;br /&gt;
| 0x1000C000&lt;br /&gt;
| Boot9, Kernel9&lt;br /&gt;
| [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/index.html CoreLink™ DMA-330] (single-channel).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[SPICARD Registers]]&lt;br /&gt;
| 0x1000D800&lt;br /&gt;
| Process9&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| [[CONFIG Registers]]&lt;br /&gt;
| 0x10010000&lt;br /&gt;
| Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| PRNG Registers&lt;br /&gt;
| 0x10011000&lt;br /&gt;
| Process9&lt;br /&gt;
| Used as entropy-source for seeding random number generators.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| [[OTP Registers]]&lt;br /&gt;
| 0x10012000&lt;br /&gt;
| Kernel9, NewKernel9Loader&lt;br /&gt;
| Top secret.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| [[ARM7|ARM7 Registers]]&lt;br /&gt;
| 0x10018000&lt;br /&gt;
| TwlProcess9&lt;br /&gt;
| Used to setup the ARM7 core for AGB/TWL&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| Debug WIFI SDIO Registers?&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| &lt;br /&gt;
| An SDIO controller is mapped here, NWM references this controller but doesn&#039;t have access to it.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[HASH Registers]]&lt;br /&gt;
| 0x10101000&lt;br /&gt;
| [[Filesystem services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[Camera Registers]]&lt;br /&gt;
| 0x10102000&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| y2r&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[CSND Registers]] / [[DSP Registers]]&lt;br /&gt;
| 0x10103000&lt;br /&gt;
| TwlBg, [[Codec Services]], [[CSND Services]], [[DSP Services]]&lt;br /&gt;
| Sound hardware. For DSP regs, see the &amp;quot;DSi XpertTeak&amp;quot; section in [http://problemkaputt.de/gba.htm no$gba] help.&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| LGYFB0&lt;br /&gt;
| 0x10110000&lt;br /&gt;
| TwlBg&lt;br /&gt;
| IO registers used to access legacy output framebuffer, as well as configure the upscaling filter.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| LGYFB1&lt;br /&gt;
| 0x10111000&lt;br /&gt;
| TwlBg&lt;br /&gt;
| IO registers used to access legacy output framebuffer, as well as configure the upscaling filter.&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[Camera Registers]] &lt;br /&gt;
| 0x10120000&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[Camera Registers]]&lt;br /&gt;
| 0x10121000&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| Mirror of 0x10120000?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[WIFI Registers]]&lt;br /&gt;
| 0x10122000&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
| WIFI SDIO bus registers&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10123000&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
| WIFI?&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10130000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10131000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10132000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[PDN Registers]]&lt;br /&gt;
| 0x10140000&lt;br /&gt;
| Process9, Boot11, Kernel11, TwlBg, [[DSP Services]], [[NWM Services]], [[SPI Services]]&lt;br /&gt;
| Power management. &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[PDN Registers]]&lt;br /&gt;
| 0x10141000&lt;br /&gt;
| Process9, Boot11, Kernel11, TwlBg, [[Codec Services]], [[NWM Services]], [[SPI Services]], [[PDN Services]]&lt;br /&gt;
| Power management&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[SPI Registers]]&lt;br /&gt;
| 0x10142000&lt;br /&gt;
| TwlBg, [[SPI Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[SPI Registers]]&lt;br /&gt;
| 0x10143000&lt;br /&gt;
| TwlBg, dmnt Module&lt;br /&gt;
| Debugger related?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[I2C Registers]]&lt;br /&gt;
| 0x10144000&lt;br /&gt;
| Boot11, Kernel11, TwlBg, [[I2C Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[CODEC Registers]]&lt;br /&gt;
| 0x10145000&lt;br /&gt;
| TwlBg, [[Codec Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[HID Registers]]&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| Boot11, Kernel11, TwlBg, [[HID Services]], dlp Services&lt;br /&gt;
| See [[PAD]].&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[GPIO Registers]]&lt;br /&gt;
| 0x10147000&lt;br /&gt;
| Boot11, TwlBg, [[GPIO Services]], [[DSP Services]](v0)&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[I2C Registers]]&lt;br /&gt;
| 0x10148000&lt;br /&gt;
| TwlBg, [[I2C Services]]&lt;br /&gt;
| &lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[SPI Registers]]&lt;br /&gt;
| 0x10160000&lt;br /&gt;
| Boot9, TwlBg, [[SPI Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[I2C Registers]]&lt;br /&gt;
| 0x10161000&lt;br /&gt;
| Boot11, TwlBg, [[I2C Services]]&lt;br /&gt;
| See [http://problemkaputt.de/gba.htm no$gba] help for some clues maybe.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MIC Registers]]&lt;br /&gt;
| 0x10162000&lt;br /&gt;
| [[MIC Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[PXI Registers]]&lt;br /&gt;
| 0x10163000&lt;br /&gt;
| Boot11, Kernel11, TwlBg, [[PXI Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[NTRCARD Registers]]&lt;br /&gt;
| 0x10164000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10165000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10170000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI Registers, see [http://problemkaputt.de/gbatek.htm#dswirelesscommunications GBATek].&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10171000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI Registers (mirror)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|?&lt;br /&gt;
| 0x10172000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Unused?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|?&lt;br /&gt;
| 0x10173000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Unused?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10174000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI RAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10175000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI RAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10176000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Registers (mirror)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10177000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Registers (mirror)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10178000 - 0x10180000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI WS1 Region&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[Corelink DMA Engines|CDMA]]&lt;br /&gt;
| 0x10200000&lt;br /&gt;
| Boot11, Kernel11&lt;br /&gt;
| [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/index.html CoreLink™ DMA-330]. Only used by bootrom on New3DS.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10201000&lt;br /&gt;
| TwlBg&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[LCD Registers]]&lt;br /&gt;
| 0x10202000&lt;br /&gt;
| TwlBg, Kernel11, [[GSP Services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[DSP Registers]]&lt;br /&gt;
| 0x10203000&lt;br /&gt;
| [[DSP Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10204000&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11&lt;br /&gt;
| [[Corelink DMA Engines|CDMA]]&lt;br /&gt;
| 0x10206000&lt;br /&gt;
| NewKernel11&lt;br /&gt;
| CDMA was moved (mirrored?) here on New 3DS. [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/index.html CoreLink™ DMA-330].&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10207000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| New 3DS only?&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| AXI&lt;br /&gt;
| 0x1020F000&lt;br /&gt;
| TwlBg, [[GSP Services]]&lt;br /&gt;
| [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0422a/CHDGHIID.html CoreLink™ NIC-301 r1p0].&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| DMA region&lt;br /&gt;
| 0x10300000-0x10400000&lt;br /&gt;
|&lt;br /&gt;
| CDMA wants these addresses. Each page in this region corresponds to the same page in the 0x10100000-0x10200000 region. It is unknown if this is just a separate bus and/or if there are any differences in the registers.&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[GPU Registers]]&lt;br /&gt;
| 0x10400000&lt;br /&gt;
| Boot11, Kernel11, [[GSP Services]]&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
IO registers starting at physical address 0x10200000 are not accessible from the ARM9 (which includes all LCD/GPU registers). It seems IO registers below physical address 0x10100000 are not accessible from the ARM11 bus.&lt;br /&gt;
&lt;br /&gt;
ARM11 kernel virtual address mappings for these registers varies for different builds. For ARM11 user mode applications you have:&lt;br /&gt;
 physaddr = virtaddr - 0x1EC00000 + 0x10100000&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Services&amp;diff=13458</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Services&amp;diff=13458"/>
		<updated>2015-09-30T00:17:41Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Notifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Services are an abstraction of ports and are the commonly used way of inter-process communication outside of the kernel. While handles of regular ports are retrieved from [[SVC]](svcConnectToPort), service handles are retrieved through the port &#039;&#039;srv:&#039;&#039; (&amp;quot;service manager&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
When a service is registered, [[SVC|svcCreatePort]] is used without a port-name. This means that the port is inaccessible via the port SVCs outside of sm-module. See below for getting a session handle for sending commands to services.&lt;br /&gt;
&lt;br /&gt;
Processes with PID less than or equal to the number of NATIVE_FIRM built-in modules (fs, sm, pm, pxi, ldr) have access to all services. This value is obtained from [[SVC|svcGetSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
Attempting to use srvGetServiceSession with a service that the process has access to when that service isn&#039;t registered, results in svcSendSyncRequest never returning(the exact cause is unknown).&lt;br /&gt;
&lt;br /&gt;
==Service Manager Port &amp;quot;srv:&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010002&lt;br /&gt;
| Initialize&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020000&lt;br /&gt;
| GetProcSemaphore() (the handle from this gets signaled when notifications for this process gets triggered)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030100&lt;br /&gt;
| RegisterService(8-byte servicename, u32 strlen, u32 max_sessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000400C0&lt;br /&gt;
| UnregisterService(8-byte servicename, u32 strlen)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050100&lt;br /&gt;
| GetServiceSession(8-byte servicename, u32 strlen, u32 flags)&lt;br /&gt;
&lt;br /&gt;
Flags bit0: if not set, return port-handle instead of session-handle(from [[SVC|svcCreateSessionToPort]]) when session-handle unavailable (max sessions/timeout?).&lt;br /&gt;
|-&lt;br /&gt;
| 0x000600C2&lt;br /&gt;
| RegisterPort(8-byte servicename, u32 strlen, Handle client_port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000700C0&lt;br /&gt;
| UnregisterPort(8-byte servicename, u32 strlen)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080100&lt;br /&gt;
| GetPort(8-byte servicename, u32 strlen, u32 flags).&lt;br /&gt;
&lt;br /&gt;
Flags bit0: return 0 instead of port handle if port was found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| Subscribe(u32 notification_id). This enables the specified notificationID for the current process.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0040&lt;br /&gt;
| Unsubscribe(u32 notification_id). This disables the specified notificationID for the current process.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| ReceiveNotification() This returns the notificationID which was triggered, if any(see GetProcSemaphore).&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0080&lt;br /&gt;
| PublishToSubscriber(u32 notification_id, u32 flag). This fires an notification. Bit0: only fire if not already fired, bit1: return error if error happens, else it always returns 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0040&lt;br /&gt;
| This can fire notificationIDs and return the number of fired notificationID&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E00C0&lt;br /&gt;
| HasAccessToService(8-byte servicename, u32 strlen). Returns 1 if your process has access to the service.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Service Manager Process-Manager Port &amp;quot;srv:pm&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header, prior to [[7.0.0-13]]&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04030082&lt;br /&gt;
| RegisterProcess (u32 procid, u32 wordsz, &amp;lt;nowiki&amp;gt;((wordsz&amp;lt;&amp;lt;16) | 2)&amp;lt;/nowiki&amp;gt;, serviceaccesscontrol*).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040040&lt;br /&gt;
| UnregisterProcess (u32 procid).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Register command registers a process with the service-manager, which includes registering the serviceaccesscontrol for the process which normally originates from the [[NCCH/Extended_Header|exheader]].&lt;br /&gt;
&lt;br /&gt;
Prior to to [[7.0.0-13]], the commands listed for &amp;quot;srv:&amp;quot; were also accessible under this port with the same command-headers. Starting with [[7.0.0-13]], the &amp;quot;srv:pm&amp;quot; port was changed to a service. With this change, commandIDs for these commands were changed. &amp;quot;srv:pm&amp;quot; was originally vulnerable, this was fixed with [[7.0.0-13]], see [[3DS_exploits|here]]. Originally any process could use &amp;quot;srv:pm&amp;quot;, however starting with [[7.0.0-13]] only the built-in NATIVE_FIRM sysmodules have access to it. The only system title which uses &amp;quot;srv:pm&amp;quot; is the [[Process_Manager_Services|Process Manager]].&lt;br /&gt;
&lt;br /&gt;
==Notifications==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ID&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| This indicates that all processes must terminate: power-off, reboot, or [[FIRM]]-launch.&lt;br /&gt;
|-&lt;br /&gt;
| 0x104&lt;br /&gt;
| This indicates that the system is entering sleep mode. (PTM:NotifySleepPreparationComplete needed for this and the following?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x105&lt;br /&gt;
| This indicates that the system has exited sleep mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x108&lt;br /&gt;
| error at boot?&lt;br /&gt;
|-&lt;br /&gt;
| 0x202&lt;br /&gt;
| POWER button pressed&lt;br /&gt;
|-&lt;br /&gt;
| 0x204&lt;br /&gt;
| This indicates that the HOME button was pressed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x205&lt;br /&gt;
| HOME button pressed&lt;br /&gt;
|-&lt;br /&gt;
| 0x207&lt;br /&gt;
| SD card inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x208&lt;br /&gt;
| Game cartridge inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x209&lt;br /&gt;
| SD card removed&lt;br /&gt;
|-&lt;br /&gt;
| 0x20A&lt;br /&gt;
| Game cartridge removed&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B&lt;br /&gt;
| Game cartridge inserted or removed&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=13417</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=13417"/>
		<updated>2015-09-27T23:24:54Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* KernelSetState */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  NF ARM11&lt;br /&gt;
!  NF ARM9&lt;br /&gt;
!  TF ARM11&lt;br /&gt;
!  Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; |  Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions)&lt;br /&gt;
| Outaddr is usually the same as the input addr0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x07 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateThread|CreateThread]](Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x09 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| void [[Multi-threading#ExitThread|ExitThread]](void)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| void [[Multi-threading#SleepThread|SleepThread]](s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#GetThreadPriority|GetThreadPriority]](s32* priority, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#SetThreadPriority|SetThreadPriority]](Handle thread, s32 priority)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetThreadAffinityMask|GetThreadAffinityMask]](u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#SetThreadAffinityMask|SetThreadAffinityMask]](Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
| Replaced with a stub in ARM11 NATIVE_FIRM kernel beginning with [[8.0.0-18]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetThreadIdealProcessor|GetThreadIdealProcessor]](s32* processorid, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#SetThreadIdealProcessor|SetThreadIdealProcessor]](Handle thread, s32 processorid)&lt;br /&gt;
| Replaced with a stub in ARM11 NATIVE_FIRM kernel beginning with [[8.0.0-18]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result Run(Handle process, StartupInfo* info)&lt;br /&gt;
| This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateMutex|CreateMutex]](Handle* mutex, bool initialLocked)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#ReleaseMutex|ReleaseMutex]](Handle mutex)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateSemaphore|CreateSemaphore]](Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#ReleaseSemaphore|ReleaseSemaphore]](s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateEvent|CreateEvent]](Handle* event, ResetType resettype)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#SignalEvent|SignalEvent]](Handle event)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#ClearEvent|ClearEvent]](Handle event)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 addr, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value, s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| s64 GetSystemTick(void) (This returns the total CPU ticks elapsed since the CPU was powered-on)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#GetThreadInfo|GetThreadInfo]](s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest1(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest2(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest3(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest4(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#OpenThread|OpenThread]](Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetProcessIdOfThread|GetProcessIdOfThread]](u32* processId, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#GetThreadId|GetThreadId]](u32* threadId, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetThreadContext|GetThreadContext]](ThreadContext* context, Handle thread)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| OutputDebugString(void const, int)&lt;br /&gt;
| Does nothing on non-debug units.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x47 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
| Setting name=NULL creates a private port not accessible from svcConnectToPort.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result BindInterrupt(Interrupt name, Handle syncObject, s32 priority, bool isManualClear)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result UnbindInterrupt(Interrupt name, Handle syncObject)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result InvalidateProcessDataCache(Handle process, void* addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result StoreProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result FlushProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result StartInterProcessDma(Handle* dma, Handle dstProcess, void* dst, Handle srcProcess, const void* src, u32 size, const DmaConfig&amp;amp; config)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result StopDma(Handle dma)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetDmaState(DmaState* state, Handle dma)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x60 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result DebugActiveProcess(Handle* debug, u32 processID)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result BreakDebugProcess(Handle debug)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result TerminateDebugProcess(Handle debug)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessDebugEvent(DebugEventInfo* info, Handle debug)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ContinueDebugEvent(Handle debug, u32 flags)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessList(s32* processCount, u32* processIds, s32 processIdMaxCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetThreadList(s32* threadCount, u32* threadIds, s32 threadIdMaxCount, Handle domain)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetDebugThreadContext(ThreadContext* context, Handle debug, u32 threadId, u32 controlFlags)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetDebugThreadContext(Handle debug, u32 threadId, ThreadContext* context, u32 controlFlags)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result QueryDebugProcessMemory(MemoryInfo* blockInfo, PageInfo* pageInfo, Handle process, u32 addr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReadProcessMemory(void* buffer, Handle debug, u32 addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result WriteProcessMemory(Handle debug, void const* buffer, u32 addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetHardwareBreakPoint(s32 registerId, u32 control, u32 value)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[Multi-threading#GetDebugThreadParam|GetDebugThreadParam]](long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam)&lt;br /&gt;
| Disabled on regular kernel.&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateCodeSet(Handle* handle_out, struct CodeSetInfo, u32 code_ptr, u32 ro_ptr, u32 data_ptr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result RandomStub()&lt;br /&gt;
| Stubbed&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateProcess(Handle* handle_out, Handle codeset_handle, u32 arm11kernelcaps_ptr, u32 arm11kernelcaps_num)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetProcessResourceLimits(Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetResourceLimitValues(Handle res_limit, LimitableResource* resource_type_list, s64* resource_list, u32 count)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AddCodeSegment (unsigned int Addr, unsigned int Size)&lt;br /&gt;
| Stubbed on NATIVE_FIRM beginning with [[2.0.0-2]]. Used during TWL_FIRM boot.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Backdoor(unsigned int CodeAddress)&lt;br /&gt;
| This is used on ARM9 NATIVE_FIRM. No ARM11 processes have access to it without some form of kernelhax.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2)&lt;br /&gt;
| The type determines the meaning of each param&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0xFF&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ???&lt;br /&gt;
| Debug related? The svcaccesscontrol mask doesn&#039;t apply for this SVC. Stubbed on ARM9 NATIVE_FIRM.&lt;br /&gt;
|}&lt;br /&gt;
NF: NATIVE_FIRM. TF: TWL_FIRM.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;stubbed&amp;quot; here means that the SVC only returns an error, as in the following snippet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ROM:FFF04D98                 LDR             R0, =0xF8C007F4&lt;br /&gt;
ROM:FFF04D9C                 BX              LR&amp;lt;/pre&amp;gt;&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x10000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The LINEAR memory-operation indicates that the mapped physical address is always MappedVAddr+0x0C000000, thus this memory can be used for hardware devices&#039; DMA(such as the [[GPU]]). Addr0+size for this must be within the 0x14000000-0x1C000000 range when Addr0 is non-zero(Addr1 must be zero), Addr0 isn&#039;t actually used by svcControlMemory for mapping memory: Addr0 is not used by the kernel after doing address-range checks. The kernel determines what physical-address to use by allocating memory from FCRAM(about the same way as other memory), which is then used to determine the virtual-address.&lt;br /&gt;
&lt;br /&gt;
[[8.0.0-18]] added a new memory mapping(0x30000000-0x38000000) for LINEAR memory, this replaces the original mapping for newer titles. The kernel uses the new mapping when the process memory-region is BASE, or when the process kernel-release-version field is &amp;gt;=0x022c(2.44 / system-version [[8.0.0-18]]).&lt;br /&gt;
&lt;br /&gt;
The input mem-region value for svcControlMemory is only used(when non-zero) when the PID is value 1, for the [[FIRM]] ARM11 &amp;quot;loader&amp;quot; module.&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| R&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| W&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RW&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| X&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RX&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| WX&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| RWX&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base process virtual address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum ArbitrationType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Address arbitration type&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| AQUIRE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| KERNEL2&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| AQUIRE_TIMEOUT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| KERNEL4&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum BreakReason ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Break Reason&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| PANIC&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| ASSERT&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| USER&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct CodeSetInfo ==&lt;br /&gt;
All addresses are given virtual for the process to be created.&lt;br /&gt;
All sizes are given in 0x1000-pages.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Codeset Name&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown, this is written to field 0x5A of KCodeSet&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text addr&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata start&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW addr (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW size (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .text pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .rodata pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total RW pages (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Program ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct DebugEventInfo ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Event type&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Thread ID (not used in all events)&lt;br /&gt;
|-&lt;br /&gt;
| u32[2]&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32[6]&lt;br /&gt;
| Event-specific data (see below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Event type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| PROCESS&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CREATE THREAD&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| EXIT THREAD&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| EXIT PROCESS&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| EXCEPTION&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| DLL LOAD&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| DLL UNLOAD&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| SCHEDULE IN&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| SCHEDULE OUT&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| SYSCALL IN&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| SYSCALL OUT&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| OUTPUT STRING&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 12&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PROCESS event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u64&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| char[8]&lt;br /&gt;
| Process name&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Process ID&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| 0 = newly created process, 1 = attached process&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CREATE THREAD event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Creator thread ID&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address (?)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Entrypoint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== EXIT THREAD/PROCESS events ===&lt;br /&gt;
&lt;br /&gt;
A single u32 reason field is used.&lt;br /&gt;
&lt;br /&gt;
Thread exit reasons:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| (None)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| TERMINATE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| EXIT PROCESS&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| TERMINATE PROCESS&lt;br /&gt;
| 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Process exit reasons:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| (None)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| TERMINATE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| UNHANDLED EXCEPTION&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== EXCEPTION event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Exception type&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Exception address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Argument (type-specific)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exception types:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
!  Argument&lt;br /&gt;
|-&lt;br /&gt;
| UNDEFINED INSTRUCTION&lt;br /&gt;
| 0&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| (Unknown)&lt;br /&gt;
| 1&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| (Unknown, mem-related)&lt;br /&gt;
| 2&lt;br /&gt;
| Address&lt;br /&gt;
|-&lt;br /&gt;
| (Unknown, mem-related)&lt;br /&gt;
| 3&lt;br /&gt;
| Address&lt;br /&gt;
|-&lt;br /&gt;
| ATTACH BREAK&lt;br /&gt;
| 4&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| BREAKPOINT&lt;br /&gt;
| 5&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| USER BREAK&lt;br /&gt;
| 6&lt;br /&gt;
| User break type&lt;br /&gt;
|-&lt;br /&gt;
| DEBUGGER BREAK&lt;br /&gt;
| 7&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| UNDEFINED SYSCALL&lt;br /&gt;
| 8&lt;br /&gt;
| Attempted syscall ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
User break types:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| PANIC&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| ASSERT&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| USER&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SCHEDULER/SYSCALL IN/OUT events ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u64&lt;br /&gt;
| Clock tick&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Syscall (only for SYSCALL events)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== OUTPUT STRING event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| String address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| String size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MAP event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Mapped address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Mapped size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| MemoryState&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=svcSetHardwareBreakPoint=&lt;br /&gt;
This is essentially an interface for writing values to the debug-unit (B/W)RP registers. registerId range 0..5 = breakpoints(BRP0-5), 0x100..0x101 = watchpoints(WRP0-1), anything outside of these ranges will result in an error. This is used for both adding and removing/disabling breakpoints/watchpoints, hence the raw control value parameter.&lt;br /&gt;
&lt;br /&gt;
Here the kernel sets bit15 in the DSCR, to enable monitor-mode debugging.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether this is for a BRP, when bit21 is set in the control input parameter(BRP type = contextID), the kernel will load the target process [[KProcess|contextID]] and use that internally for the value field. The target process is specified via a [[KDebug]] handle passed as the &amp;quot;value&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
Lastly, the kernel disables the specified (B/W)RP, then writes the value parameter / loaded contextID to the (B/W)VR, then writes the input control value to the (B/W)CR.&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread, only if the reference count reaches 0.&lt;br /&gt;
&lt;br /&gt;
Lower priority values give the thread higher priority. For userland apps, priorities between 0x18 and 0x3F are allowed. The priority of the app&#039;s main thread seems to be 0x30.&lt;br /&gt;
&lt;br /&gt;
The thread scheduler is cooperative, therefore if a thread takes up all the CPU time (for example if it enters an endless loop), all the other threads that run on the same CPU core won&#039;t get a chance to run. The main way of yielding another thread is using an address arbiter.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must therefore be &amp;lt;=3, where value zero is used when un-mapping memory. Furthermore it appears that only regular heap pages can be mirrored (it won&#039;t work for TLS, stack, .data, .text, for example).&lt;br /&gt;
&lt;br /&gt;
Bitmask 0xF00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC.&lt;br /&gt;
&lt;br /&gt;
ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
The ARM11 kernel does not allow processes to create shared memory blocks via svcCreateMemoryBlock, when the process memorytype(from the kernel flags stored in the exheader kernel descriptor) is the application memorytype, and when addr=0. It&#039;s unknown how the kernel handles addr=0 when the memorytype is not the application memorytype. When addr is non-zero, it must be located in memory which is already mapped. Furthermore, it appears that only regular heap pages (allocated using svcControlMemory op=COMMIT) are accepted as valid addrs.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory. Type is the MemoryOperation enum, without the memory-type/memory-region. ControlProcessMemory only supports type4, type5, and type6. ControlProcessMemory does not support using the current KProcess handle alias.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
Note that with the MAP MemoryOperation, the kernel will refuse to MAP memory for the specified addr1, when addr1 was already used with another MAP operation as addr1. The kernel also doesn&#039;t allow memory to be freed via the FREE MemoryOperation, when other virtual-memory is mapped to this same memory(when the MAP MemoryOperation was used with this memory with addr1).&lt;br /&gt;
&lt;br /&gt;
= [[DMA]] =&lt;br /&gt;
The CTRSDK code for using svcStartInterProcessDma will execute svcBreak when svcStartInterProcessDma returns an error(except for certain error value(s)). Therefore on retail, triggering a svcStartInterProcessDma via a system-module which results in an error from svcStartInterProcessDma will result in the system-module terminating.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Type&lt;br /&gt;
!  Enabled for the NATIVE_FIRM ARM11 kernel&lt;br /&gt;
!  Enabled for the TWL_FIRM ARM11 kernel&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| This initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 is unused. Param1 is the programID-low, and the programID-high is 0x00040138. Param2 is used only with the [[New_3DS]] kernel, pm-module uses value 0 with this. With New3DS kernel, it forces the programIDlow to be the New3DS NATIVE_FIRM, when the input programIDlow is for the Old3DS NATIVE_FIRM and Param2==0.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Unknown, does nothing with the TWL_FIRM ARM11 kernel.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| This used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Param0-Param3 are unused. This unmaps(?) the following virtual memory by writing value physaddr(where physaddr base is 0x80000000) to the L1 MMU table entries: 0x00300000..0x04300000, 0x08000000..0x0FE00000, and 0x10000000..0xF8000000.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Debug related?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| This triggers an MCU (hard) reboot. Param0-3 are unused. This reboot is triggered via device address 0x4A on the second [[I2C]] bus (the MCU). Register address 0x20 is written to with value 4. This code will not return.&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Alternate unused FIRM launch code-path, with different [[PXI]] FIFO word constants.&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Yes, implemented at some point after system-version v4.5.&lt;br /&gt;
| ?&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| ConfigureNew3DSCPU. Only available for the [[New_3DS]] kernel. Param0 = input value. Only bit0-1 are used here. Bit 0 enables higher core clock, and bit 1 enables additional (L2) cache. This configures the hardware [[PDN_Registers|register]] for the flags listed [[NCCH/Extended_Header#Flag1|here]], among other code which uses the MPCore private memory region registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  SystemInfoType value&lt;br /&gt;
!  s32 param&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| This writes the total used memory size in the following memory regions to out: APPLICATION, SYSTEM, and BASE.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| This writes the total used memory size in the APPLICATION memory region to out.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 2&lt;br /&gt;
| This writes the total used memory size in the SYSTEM memory region to out.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 3&lt;br /&gt;
| This writes the total used memory size in the BASE memory region to out.&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Unused&lt;br /&gt;
| This writes the total number of threads which were directly launched by the kernel, to out.&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Unused&lt;br /&gt;
| This writes the total number of processes which were directly launched by the kernel, to out. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GetProcessInfo =&lt;br /&gt;
Input:&lt;br /&gt;
 R0 = unused&lt;br /&gt;
 R1 = Handle process&lt;br /&gt;
 R2 = ProcessInfoType type&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
 R0 = Result&lt;br /&gt;
 R1 = output value lower word&lt;br /&gt;
 R2 = output value upper word&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  ProcessInfoType value&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 9-19&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| This only returns error 0xD8E007ED.&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| low u32 = (0x20000000 - &amp;lt;LINEAR virtual-memory base for this process&amp;gt;). That is, the output value is the value which can be added to LINEAR memory vaddrs for converting to physical-memory addrs.&lt;br /&gt;
|-&lt;br /&gt;
| 21-23&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| This only returns error 0xE0E01BF4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GetHandleInfo =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  HandleInfoType value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| This returns the time in ticks the KProcess referenced by the handle was created. If a KProcess handle was not given, it will write whatever was in r5, r6 when the svc was called.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Get internal refcount-1 for kernel object (u32), and also a boolean if the refcount-1 is negative (u32).&lt;br /&gt;
|-&lt;br /&gt;
| 0x32107&lt;br /&gt;
| Returns (u64) 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= svc7B Backdoor =&lt;br /&gt;
This saves SVC-mode SP+LR on the user-mode stack, then sets the SVC-mode SP to the user-mode SP. This then calls the specified code in SVC-mode. Once the called code returns, this pops the saved SP+LR off the stack for restoring the SVC-mode SP, then returns from the svc7b handler. Note that this svc7b handler does not disable IRQs, if any IRQs/context-switches occur while the SVC-mode SP is set to the user-mode one here, the ARM11-kernel will crash(which hangs the whole ARM11-side system).&lt;br /&gt;
&lt;br /&gt;
= Kernel error-codes =&lt;br /&gt;
See [[Error codes]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Error-code value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x09401BFE&lt;br /&gt;
| Timeout occurred with svcWaitSynchronization*, when timeout is not ~0.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8601801&lt;br /&gt;
| No more unused/free synchronization objects left to use in a given object&#039;s linked list.  (KEvent, KMutex, KTimer, KSemaphore, KAddressArbiter, KThread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8601802&lt;br /&gt;
| No more unused/free KSharedMemory objects left to use in the KSharedMemory linked list - out of blocks&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8601809&lt;br /&gt;
| No more unused/free KSessions left to use in the KSession linked list - out of sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0xC860180A&lt;br /&gt;
| Not enough free memory available for memory allocation.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC920181A&lt;br /&gt;
| The session was closed by the other process..&lt;br /&gt;
|-&lt;br /&gt;
| 0xD0401834&lt;br /&gt;
| Max connections to port have been exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0xD88007FA&lt;br /&gt;
| Returned if no KObjectName object in the linked list  of such objects matches the port name provided to the svc. &lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E007ED&lt;br /&gt;
| This indicates that a value is outside of the enum being used.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E007F1&lt;br /&gt;
| This error indicates Misaligned address.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E007F7&lt;br /&gt;
| This error indicates that the input handle used with the SVC does not exist in the process handle-table, or that the handle kernel object type does not match the type used by the SVC.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD9000402&lt;br /&gt;
| Invalid memory permissions for input/output buffers, for svcStartInterProcessDma.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD9001814&lt;br /&gt;
| Failed unprivileged load or store - wrong permissions on memory&lt;br /&gt;
|-&lt;br /&gt;
| 0xD9001BF7&lt;br /&gt;
| This error is returned when the kernel retrieves a pointer to a kernel object, but the object type doesn&#039;t match the desired one.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD92007EA&lt;br /&gt;
| This error is returned when a process attempts to use svcCreateMemoryBlock when the process memorytype is the application memorytype, and when addr=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE0E01BF5&lt;br /&gt;
| This indicates an invalid address was used.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF8C007F4&lt;br /&gt;
| Invalid type/param0-param3 input for svcKernelSetState. This is also returned for those syscalls marked as stubs.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Hardware&amp;diff=13312</id>
		<title>Hardware</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Hardware&amp;diff=13312"/>
		<updated>2015-09-18T19:04:45Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: new3DS clock stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists and describes the hardware found inside the Nintendo 3DS. Many of these parts are custom made and are expanded upon here or in other pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common hardware ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ARM11 Processor Core || [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/index.html ARM11 2x MPCore &amp;amp; 2x VFPv2 Co-Processor] 268MHz(~268123480 Hz).&lt;br /&gt;
On New3DS models, there is instead 4x MPCore &amp;amp; 4x VFPv2.&lt;br /&gt;
|-&lt;br /&gt;
| ARM9 Processor Core || [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0201d/index.html ARM946] 134MHz(~134058675 Hz),&lt;br /&gt;
|-&lt;br /&gt;
| GPU || [http://en.wikipedia.org/wiki/PICA200 DMP PICA] 268MHz,&lt;br /&gt;
|-&lt;br /&gt;
| DSP || [https://twitter.com/CEVADSP/status/177172880918986752 CEVA TeakLite]. 134Mhz. 24ch 32728Hz sampling rates.&lt;br /&gt;
|-&lt;br /&gt;
| VRAM || 6 MB within SoC.&lt;br /&gt;
|}&lt;br /&gt;
The above clock-rates were calculated by calling svcGetSystemTick in sets of 5(call it, execute svcSleepThread for 1s, then call it again), then the average of those were calculated. The clock-rate listed above applies for *all* 4 New3DS MPCores.&lt;br /&gt;
&lt;br /&gt;
New3DS exclusives are able to clock the CPU at 804MHz, but this appears to be limited to the currently running application/app cores. (timed by running svcGetSystemTick on either side of a long idle loop to stay in the current process context. svcSleepThread + svcGetSystemTick implies a tick counter running at 268mhz in this mode.)&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! 3DS !! 3DSXL !! 2DS !! N3DS !! N3DSXL&lt;br /&gt;
|-&lt;br /&gt;
| SoC || CPU CTR (1048 0H)&lt;br /&gt;
CPU CTR (1214 32)&lt;br /&gt;
|| CPU CTR A (1226 60)&lt;br /&gt;
CPU CTR (1037 21)&lt;br /&gt;
|| CPU CTR B (??) || CPU LGR A (1444 86) || CPU LGR A (1446 17)&lt;br /&gt;
|-&lt;br /&gt;
| FCRAM || [http://www.fujitsu.com/downloads/MICRO/fma/pdf/MB81EDS516545_e511463.pdf 2x64MB Fujitsu MB82M8080-07L] || Fujitsu MB82DBS16641 || Fujitsu MB82DBS1664 || ?? || Fujitsu MB82MK9A9A&lt;br /&gt;
|-&lt;br /&gt;
| Storage || Toshiba THGBM2G3P1FBAI8 1GB || ?? || Toshiba THGBM4G3P1H8BAIR 1GB || Samsung KLM4G1YEQC 4GB (in 1.3GiB SLC mode)&lt;br /&gt;
Toshiba THGBMBG4P1KBAIT 2GB (MLC)&lt;br /&gt;
|| Samsung KLM4G1YEMD-B031 4GB (in 1.3GiB SLC mode)&lt;br /&gt;
Toshiba THGBMBG4P1KBAIT (MLC)&lt;br /&gt;
|-&lt;br /&gt;
| Audio Codec || TI PAIC3010B 0AA37DW || ?? || ?? || TI AIC3010B 39C4ETW  || TI AIC3010D 48C01JW&lt;br /&gt;
|-&lt;br /&gt;
| Gyroscope || [http://dl-web.dropbox.com/u/20520664/references/PS-ITG-3200-00-01.4.pdf Invensense ITG-3270 MEMS Gyroscope] || ?? || ?? || ?? || ??&lt;br /&gt;
|-&lt;br /&gt;
| Accelerometer || ST Micro 2048 33DH X1MAQ Accelerometer Model LIS331DH || ?? || ?? || ?? || ??&lt;br /&gt;
|-&lt;br /&gt;
| Wifi || Atheros AR6014 || ?? || ?? || ?? || Atheros AR6014G-AL1C&lt;br /&gt;
|-&lt;br /&gt;
| Infrared IC || NXP S750 0803 TSD031C || ?? || ?? || ?? || NXP S750 1603 TSD438C&lt;br /&gt;
|-&lt;br /&gt;
| Custom Microcontroller || Renesas UC CTR || ?? || Renesas UC CTR 324KM47 KG10  || Renesas UC KTR || Renesas UC KTR 442KM13 TK14&lt;br /&gt;
|-&lt;br /&gt;
| PMIC? || TI 93045A4 OAAH86W || ?? || ?? || TI 93045A4 38A6TYW G2 || TI 93045A4 49AF3NW G2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [11] Official Documentation&lt;br /&gt;
&lt;br /&gt;
* [5],[10] According to iFixit.com ([http://www.ifixit.com/Teardown/Nintendo-3DS-Teardown/5029/1#s22696 source]):&lt;br /&gt;
&lt;br /&gt;
* Datasheet for memory is for a chip in the same series, it has less memory than the one inside the 3DS (128mbits vs 512mbits).&lt;br /&gt;
&lt;br /&gt;
* There is a trove of data on the FCC website at [https://fjallfoss.fcc.gov/oetcf/eas/reports/ViewExhibitReport.cfm?mode=Exhibits&amp;amp;RequestTimeout=500&amp;amp;calledFromFrame=N&amp;amp;application_id=462292&amp;amp;fcc_id=%27EW4DWMW028%27].&lt;br /&gt;
&lt;br /&gt;
* [12] This IC is somewhat similar to [http://www.alldatasheet.net/datasheet-pdf/pdf/347838/NXP/SC16IS750IBS.html this].&lt;br /&gt;
&lt;br /&gt;
== FCRAM ==&lt;br /&gt;
&lt;br /&gt;
There is one FCRAM (Fast Cycle RAM) IC in the 3DS, produced by Fujitsu and branded as MB82M8080-07L. The Fujitsu MB82M8080-07L chip internally contains 2 dies, where each die is branded MB81EDS516545 and MB82DBS08645.&lt;br /&gt;
&lt;br /&gt;
The MB81EDS516545 die is a CMOS Fast Cycle Random Access Memory (FCRAM) with Low Power Double Data Rate (LPDDR) SDRAM Interface containing 512MBit storage accessible in a 64-bit format. The MB81EDS516545 is suited for consumer applications requiring high data bandwidth with low power consumption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC ==&lt;br /&gt;
&lt;br /&gt;
The 3DS has much of it&#039;s internals housed in a SoC (System on Chip) just like it&#039;s predecessors. This is done to reduce build costs, cut down on power consumption, as well as make the PCB layout less complex and make the system harder to tamper with. The SoC, branded as the Nintendo 1048 0H, contains the CPU, GPU, DSP and VRAM.&lt;br /&gt;
&lt;br /&gt;
According to official documents, the CPU used is a dual-core ARM11 CPU, clocked at 268MHz. One core is dedicated to system software, while the other is used for application programming, each known as the syscore and appcore, respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPU ==&lt;br /&gt;
&lt;br /&gt;
Designed by Digital Media Professionals Inc. (DMP) and codenamed PICA200, 268Mhz.&lt;br /&gt;
&lt;br /&gt;
Block diagram of an ULTRAY2000 based architecture PICA200:&lt;br /&gt;
&lt;br /&gt;
[[File:Pica200BlockDiagram.png]]&lt;br /&gt;
&lt;br /&gt;
PICA200 is compatible with OpenGL ES 1.1. It furthermore provides unique functionality for:&lt;br /&gt;
* Per-fragment lighting (&amp;quot;Lighting Maestro&amp;quot;)&lt;br /&gt;
* Hard- and soft-shadowing (&amp;quot;Shadow Maestro&amp;quot;)&lt;br /&gt;
* Polygon subdivision (&amp;quot;Figure Maestro&amp;quot;)&lt;br /&gt;
* Bump mapping and procedural textures (&amp;quot;Mapping Maestro&amp;quot;)&lt;br /&gt;
* Rendering of gaseous objects (&amp;quot;Particle Maestro&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Some parts of the extended functionality are provided in hardware by an extended geometry pipeline. Most importantly, PICA200 has three programmable vertex processors. There is furthermore a unit called [[GPU/Primitive_Engine|Primitive Engine]], which is a geometry shader unit (using the same instruction set as vertex shaders) with support for variable-size primitives. The Primitive Engine functionality may be disabled, and the geometry shader unit then acts as a fourth vertex processor. See [[Shader_Instruction_Set]] for more information on the shader instruction set.&lt;br /&gt;
&lt;br /&gt;
[[GPU/Fragment Lighting|Fragment lighting]] is implemented as an optional pipeline step during pixel processing. It&#039;s implemented by having the vertex shader output an additional attribute describing the transformation (represented by a quaternion) to surface-local space. This per-vertex quaternion can then be interpolated across screen space to calculate dot products relevant for lighting (e.g. light vector dot normal vector). To provide support for advanced lighting models, these dot products are used as indices into programmable lookup tables. With this setup, PICA200 in particular supports the shading models Blinn-Phong, Cook-Terrance, Ward, and microfacet-based BRDF-models.&lt;br /&gt;
&lt;br /&gt;
PICA200 supports four texture units, the fourth of which is used exclusively for [[GPU/Procedural Texture Generation|procedural texture generation]].&lt;br /&gt;
&lt;br /&gt;
== SDIO controller ==&lt;br /&gt;
&lt;br /&gt;
Nintendo recommends SD cards up to 32 GB however the internal SDIO controller seems to support SD cards up to 2.19 Terabyte (32-bit sector number). It&#039;s unknown if it really can handle that much. 128 GB was tested and works fine however it causes a major slowdown of the system especially at boot.&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
=== Front ===&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_Front.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[http://guide-images.ifixit.net/igi/ishJaSCOwLkvbLYK High Resolution]&lt;br /&gt;
&lt;br /&gt;
=== Back ===&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_Back.jpg]]&lt;br /&gt;
&lt;br /&gt;
[http://guide-images.ifixit.net/igi/n1CKAdbPrHyNPNuW High Resolution]&lt;br /&gt;
&lt;br /&gt;
=== NAND pinout ===&lt;br /&gt;
&lt;br /&gt;
NAND dumping has been successful, but the image is encrypted.&lt;br /&gt;
&lt;br /&gt;
==== Normal model ====&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_NAND_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
==== XL model ====&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_NAND_pinout_XL.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
==== 2DS ====&lt;br /&gt;
&lt;br /&gt;
[[Image:2DSeMMC.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
==== New 3DS ====&lt;br /&gt;
&lt;br /&gt;
[[Image:N3DSeMMC.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== New 3DS XL ====&lt;br /&gt;
&lt;br /&gt;
[[Image:N3DSXLeMMC.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== WiFi dongle pinout ===&lt;br /&gt;
[[Image:CTR_WiFiDongle_pinout.png|600px]]&lt;br /&gt;
&lt;br /&gt;
SDIO interface is colored red: &lt;br /&gt;
* CLK&lt;br /&gt;
* CMD&lt;br /&gt;
* D0, D1, D2, D3&lt;br /&gt;
&lt;br /&gt;
This is the interface for the &#039;NEW&#039; WiFi module (based on Atheros AR6002) first included in DSi.&lt;br /&gt;
&lt;br /&gt;
The proprietary and by now ancient DS-mode WiFi is colored yellow, pins are unknown.&lt;br /&gt;
&lt;br /&gt;
I2C eeprom is colored blue:&lt;br /&gt;
* SCL&lt;br /&gt;
* SDA&lt;br /&gt;
&lt;br /&gt;
SPI Flash is colored purple:&lt;br /&gt;
* CLK&lt;br /&gt;
* CS#&lt;br /&gt;
* SI&lt;br /&gt;
* SO&lt;br /&gt;
* WP#&lt;br /&gt;
* NC&lt;br /&gt;
&lt;br /&gt;
=== Auxiliary Microntroller ===&lt;br /&gt;
[[Image:CTR_UC.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Monitors HOME button, WiFi switch, 3D slider, volume control slider.&lt;br /&gt;
Controls LEDs, various power supplies.&lt;br /&gt;
&lt;br /&gt;
Devices attached to I2C bus:&lt;br /&gt;
* UC (master?)&lt;br /&gt;
* Accelerometer (slave address 0x18)&lt;br /&gt;
* SoC (master? slave?)&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=FS:UpdateSha256Context&amp;diff=13051</id>
		<title>FS:UpdateSha256Context</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=FS:UpdateSha256Context&amp;diff=13051"/>
		<updated>2015-08-16T08:23:54Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x084E0342]&lt;br /&gt;
|-&lt;br /&gt;
| 1-8&lt;br /&gt;
| Input hash (when updating)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Input data buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Must be non-zero&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Must be non-zero&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| u8, must be non-zero&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| u8, must be non-zero&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| (Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 10&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Input data buffer ptr&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Resultcode&lt;br /&gt;
|-&lt;br /&gt;
| 2-9&lt;br /&gt;
| Output SHA256 hash&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| (Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 10&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Data buffer ptr, same buffer from the input.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This calculates a SHA256 hash using the ARM11 hash engine.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=13048</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=13048"/>
		<updated>2015-08-15T20:50:43Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: This was rough.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  NF ARM11&lt;br /&gt;
!  NF ARM9&lt;br /&gt;
!  TF ARM11&lt;br /&gt;
!  Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; |  Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions)&lt;br /&gt;
| Outaddr is usually the same as the input addr0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x03 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x07 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateThread|CreateThread]](Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x09 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| void [[Multi-threading#ExitThread|ExitThread]](void)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| void [[Multi-threading#SleepThread|SleepThread]](s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#GetThreadPriority|GetThreadPriority]](s32* priority, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#SetThreadPriority|SetThreadPriority]](Handle thread, s32 priority)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetThreadAffinityMask|GetThreadAffinityMask]](u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#SetThreadAffinityMask|SetThreadAffinityMask]](Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
| Replaced with a stub in ARM11 NATIVE_FIRM kernel beginning with [[8.0.0-18]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetThreadIdealProcessor|GetThreadIdealProcessor]](s32* processorid, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#SetThreadIdealProcessor|SetThreadIdealProcessor]](Handle thread, s32 processorid)&lt;br /&gt;
| Replaced with a stub in ARM11 NATIVE_FIRM kernel beginning with [[8.0.0-18]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result Run(Handle process, StartupInfo* info)&lt;br /&gt;
| This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateMutex|CreateMutex]](Handle* mutex, bool initialLocked)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#ReleaseMutex|ReleaseMutex]](Handle mutex)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateSemaphore|CreateSemaphore]](Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#ReleaseSemaphore|ReleaseSemaphore]](s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#CreateEvent|CreateEvent]](Handle* event, ResetType resettype)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#SignalEvent|SignalEvent]](Handle event)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#ClearEvent|ClearEvent]](Handle event)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 addr, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value, s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| s64 GetSystemTick(void) (This returns the total CPU ticks elapsed since the CPU was powered-on)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#GetThreadInfo|GetThreadInfo]](s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest1(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest2(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest3(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest4(Handle session)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#OpenThread|OpenThread]](Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetProcessIdOfThread|GetProcessIdOfThread]](u32* processId, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result [[Multi-threading#GetThreadId|GetThreadId]](u32* threadId, Handle thread)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result [[Multi-threading#GetThreadContext|GetThreadContext]](ThreadContext* context, Handle thread)&lt;br /&gt;
| Stubbed&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| OutputDebugString(void const, int)&lt;br /&gt;
| Does nothing on non-debug units.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x47 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
| Setting name=NULL creates a private port not accessible from svcConnectToPort.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result BindInterrupt(Interrupt name, Handle syncObject, s32 priority, bool isManualClear)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result UnbindInterrupt(Interrupt name, Handle syncObject)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result InvalidateProcessDataCache(Handle process, void* addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result StoreProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result FlushProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result StartInterProcessDma(Handle* dma, Handle dstProcess, void* dst, Handle srcProcess, const void* src, u32 size, const DmaConfig&amp;amp; config)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result StopDma(Handle dma)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Result GetDmaState(DmaState* state, Handle dma)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x60 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result DebugActiveProcess(Handle* debug, u32 processID)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result BreakDebugProcess(Handle debug)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result TerminateDebugProcess(Handle debug)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessDebugEvent(DebugEventInfo* info, Handle debug)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ContinueDebugEvent(Handle debug, u32 flags)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetProcessList(s32* processCount, u32* processIds, s32 processIdMaxCount)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetThreadList(s32* threadCount, u32* threadIds, s32 threadIdMaxCount, Handle domain)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result GetDebugThreadContext(ThreadContext* context, Handle debug, u32 threadId, u32 controlFlags)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetDebugThreadContext(Handle debug, u32 threadId, ThreadContext* context, u32 controlFlags)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result QueryDebugProcessMemory(MemoryInfo* blockInfo, PageInfo* pageInfo, Handle process, u32 addr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ReadProcessMemory(void* buffer, Handle debug, u32 addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result WriteProcessMemory(Handle debug, void const* buffer, u32 addr, u32 size)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetHardwareBreakPoint(s32 registerId, u32 control, u32 value)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[Multi-threading#GetDebugThreadParam|GetDebugThreadParam]](long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam)&lt;br /&gt;
| Disabled on regular kernel.&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateCodeSet(Handle* handle_out, struct CodeSetInfo, u32 code_ptr, u32 ro_ptr, u32 data_ptr)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result RandomStub()&lt;br /&gt;
| Stubbed&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateProcess(Handle* handle_out, Handle codeset_handle, u32 arm11kernelcaps_ptr, u32 arm11kernelcaps_num)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetProcessResourceLimits(Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result SetResourceLimitValues(Handle res_limit, LimitableResource* resource_type_list, s64* resource_list, u32 count)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| AddCodeSegment (unsigned int Addr, unsigned int Size)&lt;br /&gt;
| Stubbed on NATIVE_FIRM beginning with [[2.0.0-2]]. Used during TWL_FIRM boot.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Backdoor(unsigned int CodeAddress)&lt;br /&gt;
| This is used on ARM9 NATIVE_FIRM. No ARM11 processes have access to it without some form of kernelhax.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2)&lt;br /&gt;
| The type determines the meaning of each param&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Result QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0xFF&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ???&lt;br /&gt;
| Debug related? The svcaccesscontrol mask doesn&#039;t apply for this SVC. Stubbed on ARM9 NATIVE_FIRM.&lt;br /&gt;
|}&lt;br /&gt;
NF: NATIVE_FIRM. TF: TWL_FIRM.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;stubbed&amp;quot; here means that the SVC only returns an error, as in the following snippet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ROM:FFF04D98                 LDR             R0, =0xF8C007F4&lt;br /&gt;
ROM:FFF04D9C                 BX              LR&amp;lt;/pre&amp;gt;&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x10000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The LINEAR memory-operation indicates that the mapped physical address is always MappedVAddr+0x0C000000, thus this memory can be used for hardware devices&#039; DMA(such as the [[GPU]]). Addr0+size for this must be within the 0x14000000-0x1C000000 range when Addr0 is non-zero(Addr1 must be zero), Addr0 isn&#039;t actually used by svcControlMemory for mapping memory: Addr0 is not used by the kernel after doing address-range checks. The kernel determines what physical-address to use by allocating memory from FCRAM(about the same way as other memory), which is then used to determine the virtual-address.&lt;br /&gt;
&lt;br /&gt;
[[8.0.0-18]] added a new memory mapping(0x30000000-0x38000000) for LINEAR memory, this replaces the original mapping for newer titles. The kernel uses the new mapping when the process memory-region is BASE, or when the process kernel-release-version field is &amp;gt;=0x022c(2.44 / system-version [[8.0.0-18]]).&lt;br /&gt;
&lt;br /&gt;
The input mem-region value for svcControlMemory is only used(when non-zero) when the PID is value 1, for the [[FIRM]] ARM11 &amp;quot;loader&amp;quot; module.&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| R&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| W&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| RW&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| X&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| RX&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| WX&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| RWX&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base process virtual address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum ArbitrationType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Address arbitration type&lt;br /&gt;
!  Value&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| AQUIRE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| KERNEL2&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| AQUIRE_TIMEOUT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| KERNEL4&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum BreakReason ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Break Reason&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| PANIC&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| ASSERT&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| USER&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct CodeSetInfo ==&lt;br /&gt;
All addresses are given virtual for the process to be created.&lt;br /&gt;
All sizes are given in 0x1000-pages.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Codeset Name&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown, this is written to field 0x5A of KCodeSet&lt;br /&gt;
|-&lt;br /&gt;
| u16&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text addr&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .text size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata start&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| .rodata size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW addr (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| RW size (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .text pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total .rodata pages&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Total RW pages (.data + .bss)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u8[8]&lt;br /&gt;
| Program ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct DebugEventInfo ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Event type&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Thread ID (not used in all events)&lt;br /&gt;
|-&lt;br /&gt;
| u32[2]&lt;br /&gt;
| Unknown/padding&lt;br /&gt;
|-&lt;br /&gt;
| u32[6]&lt;br /&gt;
| Event-specific data (see below)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Event type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| PROCESS&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CREATE THREAD&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| EXIT THREAD&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| EXIT PROCESS&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| EXCEPTION&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| DLL LOAD&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| DLL UNLOAD&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| SCHEDULE IN&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| SCHEDULE OUT&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| SYSCALL IN&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| SYSCALL OUT&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| OUTPUT STRING&lt;br /&gt;
| 11&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 12&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PROCESS event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u64&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| char[8]&lt;br /&gt;
| Process name&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Process ID&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| 0 = newly created process, 1 = attached process&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CREATE THREAD event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Creator thread ID&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address (?)&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Entrypoint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== EXIT THREAD/PROCESS events ===&lt;br /&gt;
&lt;br /&gt;
A single u32 reason field is used.&lt;br /&gt;
&lt;br /&gt;
Thread exit reasons:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| (None)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| TERMINATE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| EXIT PROCESS&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| TERMINATE PROCESS&lt;br /&gt;
| 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Process exit reasons:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| (None)&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| TERMINATE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| UNHANDLED EXCEPTION&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== EXCEPTION event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Exception type&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Exception address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Argument (type-specific)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Exception types:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
!  Argument&lt;br /&gt;
|-&lt;br /&gt;
| UNDEFINED INSTRUCTION&lt;br /&gt;
| 0&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| (Unknown)&lt;br /&gt;
| 1&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| (Unknown, mem-related)&lt;br /&gt;
| 2&lt;br /&gt;
| Address&lt;br /&gt;
|-&lt;br /&gt;
| (Unknown, mem-related)&lt;br /&gt;
| 3&lt;br /&gt;
| Address&lt;br /&gt;
|-&lt;br /&gt;
| ATTACH BREAK&lt;br /&gt;
| 4&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| BREAKPOINT&lt;br /&gt;
| 5&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| USER BREAK&lt;br /&gt;
| 6&lt;br /&gt;
| User break type&lt;br /&gt;
|-&lt;br /&gt;
| DEBUGGER BREAK&lt;br /&gt;
| 7&lt;br /&gt;
| (None)&lt;br /&gt;
|-&lt;br /&gt;
| UNDEFINED SYSCALL&lt;br /&gt;
| 8&lt;br /&gt;
| Attempted syscall ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
User break types:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reason&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| PANIC&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| ASSERT&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| USER&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SCHEDULER/SYSCALL IN/OUT events ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u64&lt;br /&gt;
| Clock tick&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Syscall (only for SYSCALL events)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== OUTPUT STRING event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| String address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| String size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MAP event ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Mapped address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Mapped size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| MemoryPermission&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| MemoryState&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=svcSetHardwareBreakPoint=&lt;br /&gt;
This is essentially an interface for writing values to the debug-unit (B/W)RP registers. registerId range 0..5 = breakpoints(BRP0-5), 0x100..0x101 = watchpoints(WRP0-1), anything outside of these ranges will result in an error. This is used for both adding and removing/disabling breakpoints/watchpoints, hence the raw control value parameter.&lt;br /&gt;
&lt;br /&gt;
Here the kernel sets bit15 in the DSCR, to enable monitor-mode debugging.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether this is for a BRP, when bit21 is set in the control input parameter(BRP type = contextID), the kernel will load the target process [[KProcess|contextID]] and use that internally for the value field. The target process is specified via a [[KDebug]] handle passed as the &amp;quot;value&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
Lastly, the kernel disables the specified (B/W)RP, then writes the value parameter / loaded contextID to the (B/W)VR, then writes the input control value to the (B/W)CR.&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread, only if the reference count reaches 0.&lt;br /&gt;
&lt;br /&gt;
Lower priority values give the thread higher priority. For userland apps, priorities between 0x18 and 0x3F are allowed. The priority of the app&#039;s main thread seems to be 0x30.&lt;br /&gt;
&lt;br /&gt;
The thread scheduler is cooperative, therefore if a thread takes up all the CPU time (for example if it enters an endless loop), all the other threads that run on the same CPU core won&#039;t get a chance to run. The main way of yielding another thread is using an address arbiter.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must therefore be &amp;lt;=3, where value zero is used when un-mapping memory. Furthermore it appears that only regular heap pages can be mirrored (it won&#039;t work for TLS, stack, .data, .text, for example).&lt;br /&gt;
&lt;br /&gt;
Bitmask 0xF00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC.&lt;br /&gt;
&lt;br /&gt;
ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
The ARM11 kernel does not allow processes to create shared memory blocks via svcCreateMemoryBlock, when the process memorytype(from the kernel flags stored in the exheader kernel descriptor) is the application memorytype, and when addr=0. It&#039;s unknown how the kernel handles addr=0 when the memorytype is not the application memorytype. When addr is non-zero, it must be located in memory which is already mapped. Furthermore, it appears that only regular heap pages (allocated using svcControlMemory op=COMMIT) are accepted as valid addrs.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory. Type is the MemoryOperation enum, without the memory-type/memory-region. ControlProcessMemory only supports type4, type5, and type6. ControlProcessMemory does not support using the current KProcess handle alias.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
Note that with the MAP MemoryOperation, the kernel will refuse to MAP memory for the specified addr1, when addr1 was already used with another MAP operation as addr1. The kernel also doesn&#039;t allow memory to be freed via the FREE MemoryOperation, when other virtual-memory is mapped to this same memory(when the MAP MemoryOperation was used with this memory with addr1).&lt;br /&gt;
&lt;br /&gt;
= [[DMA]] =&lt;br /&gt;
The CTRSDK code for using svcStartInterProcessDma will execute svcBreak when svcStartInterProcessDma returns an error(except for certain error value(s)). Therefore on retail, triggering a svcStartInterProcessDma via a system-module which results in an error from svcStartInterProcessDma will result in the system-module terminating.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Type&lt;br /&gt;
!  Enabled for the NATIVE_FIRM ARM11 kernel&lt;br /&gt;
!  Enabled for the TWL_FIRM ARM11 kernel&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| This initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 is unused. Param1 is the programID-low, and the programID-high is 0x00040138. Param2 is used only with the [[New_3DS]] kernel, pm-module uses value 0 with this. With New3DS kernel, it forces the programIDlow to be the New3DS NATIVE_FIRM, when the input programIDlow is for the Old3DS NATIVE_FIRM and Param2==0.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Unknown, does nothing with the TWL_FIRM ARM11 kernel.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| This used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Param0-Param3 are unused. This unmaps(?) the following virtual memory by writing value physaddr(where physaddr base is 0x80000000) to the L1 MMU table entries: 0x00300000..0x04300000, 0x08000000..0x0FE00000, and 0x10000000..0xF8000000.&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Debug related?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| This triggers an MCU (hard) reboot. Param0-3 are unused. This reboot is triggered via device address 0x4A on the second [[I2C]] bus (the MCU). Register address 0x20 is written to with value 4. This code will not return.&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Alternate unused FIRM launch code-path, with different [[PXI]] FIFO word constants.&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Yes, implemented at some point after system-version v4.5.&lt;br /&gt;
| ?&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
| Only available for the [[New_3DS]] kernel. It&#039;s unknown what this is used for.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  SystemInfoType value&lt;br /&gt;
!  s32 param&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
| This writes the total used memory size in the following memory regions to out: APPLICATION, SYSTEM, and BASE.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| This writes the total used memory size in the APPLICATION memory region to out.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 2&lt;br /&gt;
| This writes the total used memory size in the SYSTEM memory region to out.&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 3&lt;br /&gt;
| This writes the total used memory size in the BASE memory region to out.&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Unused&lt;br /&gt;
| This writes the total number of threads which were directly launched by the kernel, to out.&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Unused&lt;br /&gt;
| This writes the total number of processes which were directly launched by the kernel, to out. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GetProcessInfo =&lt;br /&gt;
Input:&lt;br /&gt;
 R0 = unused&lt;br /&gt;
 R1 = Handle process&lt;br /&gt;
 R2 = ProcessInfoType type&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
 R0 = Result&lt;br /&gt;
 R1 = output value lower word&lt;br /&gt;
 R2 = output value upper word&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  ProcessInfoType value&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 9-19&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| This only returns error 0xD8E007ED.&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| low u32 = (0x20000000 - &amp;lt;LINEAR virtual-memory base for this process&amp;gt;). That is, the output value is the value which can be added to LINEAR memory vaddrs for converting to physical-memory addrs.&lt;br /&gt;
|-&lt;br /&gt;
| 21-23&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| This only returns error 0xE0E01BF4.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GetHandleInfo =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  HandleInfoType value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| This writes back two (unknown) u32 fields from the KProcess object. If not a KProcess handle is given, it will write whatever was in r5, r7 when the svc was called.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Get internal refcount-1 for kernel object (u32), and also a boolean if the refcount-1 is negative (u32).&lt;br /&gt;
|-&lt;br /&gt;
| 0x32107&lt;br /&gt;
| Returns (u64) 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= svc7B Backdoor =&lt;br /&gt;
This saves SVC-mode SP+LR on the user-mode stack, then sets the SVC-mode SP to the user-mode SP. This then calls the specified code in SVC-mode. Once the called code returns, this pops the saved SP+LR off the stack for restoring the SVC-mode SP, then returns from the svc7b handler. Note that this svc7b handler does not disable IRQs, if any IRQs/context-switches occur while the SVC-mode SP is set to the user-mode one here, the ARM11-kernel will crash(which hangs the whole ARM11-side system).&lt;br /&gt;
&lt;br /&gt;
= Kernel error-codes =&lt;br /&gt;
See [[Error codes]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Error-code value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x09401BFE&lt;br /&gt;
| Timeout occurred with svcWaitSynchronization*, when timeout is not ~0.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8601801&lt;br /&gt;
| No more unused/free synchronization objects left to use in a given object&#039;s linked list.  (KEvent, KMutex, KTimer, KSemaphore, KAddressArbiter, KThread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8601802&lt;br /&gt;
| No more unused/free KSharedMemory objects left to use in the KSharedMemory linked list - out of blocks&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8601809&lt;br /&gt;
| No more unused/free KSessions left to use in the KSession linked list - out of sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0xC860180A&lt;br /&gt;
| Not enough free memory available for memory allocation.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC920181A&lt;br /&gt;
| The session was closed by the other process..&lt;br /&gt;
|-&lt;br /&gt;
| 0xD0401834&lt;br /&gt;
| Max connections to port have been exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0xD88007FA&lt;br /&gt;
| Returned if no KObjectName object in the linked list  of such objects matches the port name provided to the svc. &lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E007ED&lt;br /&gt;
| This indicates that a value is outside of the enum being used.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E007F1&lt;br /&gt;
| This error indicates Misaligned address.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E007F7&lt;br /&gt;
| This error indicates that the input handle used with the SVC does not exist in the process handle-table, or that the handle kernel object type does not match the type used by the SVC.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD9000402&lt;br /&gt;
| Invalid memory permissions for input/output buffers, for svcStartInterProcessDma.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD9001814&lt;br /&gt;
| Failed unprivileged load or store - wrong permissions on memory&lt;br /&gt;
|-&lt;br /&gt;
| 0xD9001BF7&lt;br /&gt;
| This error is returned when the kernel retrieves a pointer to a kernel object, but the object type doesn&#039;t match the desired one.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD92007EA&lt;br /&gt;
| This error is returned when a process attempts to use svcCreateMemoryBlock when the process memorytype is the application memorytype, and when addr=0.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE0E01BF5&lt;br /&gt;
| This indicates an invalid address was used.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF8C007F4&lt;br /&gt;
| Invalid type/param0-param3 input for svcKernelSetState. This is also returned for those syscalls marked as stubs.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=FIRM&amp;diff=13004</id>
		<title>FIRM</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=FIRM&amp;diff=13004"/>
		<updated>2015-08-08T18:16:16Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* FIRM Launch Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the file format for the [[Title list#00040138 - System Firmware|3DS&#039; Firmware]], it contains four &#039;sections&#039; of ARM code (ARM9 and ARM11). The firmware sections are not encrypted in the FIRM format.&lt;br /&gt;
&lt;br /&gt;
The ARM9 section contains the ARM9 kernel and the ARM9 process(exheader process name is &amp;quot;Process9&amp;quot;). The ARM11 section(s) contains the ARM11 kernel, and the ARM11 process(es). For NATIVE_FIRM/SAFE_MODE_FIRM these ARM11 processes are sm, fs, pm, loader, and pxi. Normally the 4th section is not used. The code loaded from FIRM is constantly running on the system until another FIRM is launched. The ARM11 kernel is hard-coded to always decompress the FIRM ARM11 modules ExeFS .code, the exheader compression bit is not checked.&lt;br /&gt;
&lt;br /&gt;
== FIRM Header ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x000&lt;br /&gt;
|  4&lt;br /&gt;
|  Magic &#039;FIRM&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  0x004&lt;br /&gt;
|  4&lt;br /&gt;
|  Reserved1&lt;br /&gt;
|-&lt;br /&gt;
|  0x008&lt;br /&gt;
|  4&lt;br /&gt;
|  ARM11 Entrypoint&lt;br /&gt;
|-&lt;br /&gt;
|  0x00C&lt;br /&gt;
|  4&lt;br /&gt;
|  ARM9 Entrypoint&lt;br /&gt;
|-&lt;br /&gt;
|  0x010&lt;br /&gt;
|  0x030&lt;br /&gt;
|  Reserved2&lt;br /&gt;
|-&lt;br /&gt;
|  0x040&lt;br /&gt;
|  0x0C0 (0x030*4)&lt;br /&gt;
|  Firmware Section Headers&lt;br /&gt;
|-&lt;br /&gt;
|  0x100&lt;br /&gt;
|  0x100&lt;br /&gt;
|  RSA-2048 signature of the FIRM header, using SHA-256. This is only checked when bootrom/Process9 is doing FIRM-launch, not when installing FIRM to the NAND firm0/firm1 partitions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Firmware Section Headers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x000&lt;br /&gt;
|  4&lt;br /&gt;
|  Offset&lt;br /&gt;
|-&lt;br /&gt;
|  0x004&lt;br /&gt;
|  4&lt;br /&gt;
|  Address&lt;br /&gt;
|-&lt;br /&gt;
|  0x008&lt;br /&gt;
|  4&lt;br /&gt;
|  Size&lt;br /&gt;
|-&lt;br /&gt;
|  0x00C&lt;br /&gt;
|  4&lt;br /&gt;
|  Firmware Type (&#039;0&#039;=ARM9/&#039;1&#039;=ARM11) Process9 doesn&#039;t use this field at all.&lt;br /&gt;
|-&lt;br /&gt;
|  0x010&lt;br /&gt;
|  0x020&lt;br /&gt;
|  SHA-256 Hash of Firmware Section&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[New_3DS]] FIRM ==&lt;br /&gt;
For New3DS firmwares (NATIVE_FIRM, TWL_FIRM, ..), the ARM9 FIRM binary has an additional layer of crypto. At the end of each ARM9 binary, there&#039;s a plaintext loader. The format of the FIRM header is identical to regular 3DS FIRM(the RSA modulo is the same as regular 3DS too).&lt;br /&gt;
&lt;br /&gt;
Before checking 0x10000000 the loader main() does the following:&lt;br /&gt;
* On [[9.5.0-22|9.5.0-X]]: executes a nop instruction with r0=0 and r1=&amp;lt;address of arm9binhdr+0x50&amp;gt;.&lt;br /&gt;
* Clears bit6 in [[AES_Registers|REG_AESKEYCNT]].&lt;br /&gt;
&lt;br /&gt;
If (u8*)0x10000000 bit 1 is clear (which means that this happens only on hard reboots), it does the following things:&lt;br /&gt;
* Clears 0x200-bytes on the stack, then reads [[Flash_Filesystem|NAND]] sector 0x96(NAND image offset 0x12C00), with size 0x200-bytes into that stack buffer.&lt;br /&gt;
* Checks u8 0x10000000 bit1 again, if it&#039;s set then it executes a panic function(set r0-r2=0, execute nop instruction, then execute instruction &amp;quot;bkpt 0x99&amp;quot;). Hashes data from the region [[IO_Registers|0x10012000-0x10012090]] using SHA256 via the [[SHA_Registers|SHA]] hardware.&lt;br /&gt;
* Clears bit6 in [[AES_Registers|REG_AESKEYCNT]]. Initializes AES keyslot 0x11 keyX, keyY to the lower and higher portion of the above hash, respectively. Due to the above hashed data, the keyX+keyY here are console-unique.&lt;br /&gt;
* Decrypts the first 0x10-byte block in the above read NAND sector with keyslot 0x11 using AES-ECB. [[9.6.0-24|9.6.0-X]]: Then it decrypts the 0x10-bytes at offset 0x10 in the sector with keyslot 0x11.&lt;br /&gt;
* Then the normalkey, keyX, and keyY, for keyslot 0x11 are cleared to zero. Runs the TWL key-init/etc code which was originally in the ARM9-kernel, then writes 0x2 to [[CONFIG_Registers|REG_SYSPROT9]].&lt;br /&gt;
* Then it uses the above decrypted block from sector+0 to set the normalkey for keyslot 0x11. Decrypts arm9_bin_buf+0 using keyslot 0x11 with AES-ECB, and initialises keyX for keyslot 0x15 with it.&lt;br /&gt;
* [[9.6.0-24|9.6.0-X]]: Then it uses the above decrypted block from sector+0 to set the normalkey for keyslot 0x11. Decrypts a 0x10-byte block from arm9loader .(ro)data using keyslot 0x11 with AES-ECB, and initializes keyX for keyslot 0x18 with it(same block as previous versions).&lt;br /&gt;
* [[9.6.0-24|9.6.0-X]]: Starting with this version keyslot 0x16 keyX init was moved here, see below for details on this. The code for this is same as  [[9.5.0-22|9.5.0-X]], except the decrypted normalkey from sector+0x10 is used for keyslot 0x11 instead.&lt;br /&gt;
* Initialises KeyX for keyslots 0x18..0x1F(0x19..0x1F with [[9.6.0-24|9.6.0-X]]) with the output of decrypting a 0x10-byte block with AES-ECB using keyslot 0x11. This block was changed to a new one separate from keyslot 0x18, starting with [[9.6.0-24|9.6.0-X]]. The last byte in this 0x10-byte input block is increased by 0x01 after initializing each keyslot. Before doing the crypto each time, the loader sets the normal-key for keyslot 0x11 to the plaintext normalkey from sector+0(+0x10 with [[9.6.0-24|9.6.0-X]]). These are New3DS-specific keys.&lt;br /&gt;
* [[9.5.0-22|9.5.0-X]](moved to above with [[9.6.0-24|9.6.0-X]]): Sets the normal-key for keyslot 0x11 to the same one already decrypted on the stack. Decrypts the 0x10-byte block at arm9binhdr+0x60 with AES-ECB using keyslot 0x11, then sets the keyX for keyslot 0x16 to the output data.&lt;br /&gt;
* [[9.5.0-22|9.5.0-X]]: The normalkey, keyX, and keyY, for keyslot 0x11 are then cleared to zero.&lt;br /&gt;
&lt;br /&gt;
When (u8*)0x10000000 bit 1 is set(which means this happens only when this loader runs again for firm-launch), the normalkey, keyX, and keyY, for keyslot 0x11 are cleared to zero.&lt;br /&gt;
&lt;br /&gt;
It sets KeyY for keyslot 0x15(0x16 with [[9.5.0-22|9.5.0-X]]) to arm9_bin_buf+16, the CTR to arm9_bin_buf+32 (both are unique for every version). It then proceeds to decrypt the binary with AES-CTR. When done, it sets the normal-key for the keyslot used for binary decryption to zeros. It then decrypts arm9_bin_buf+64 using an hardcoded keyY for keyslot 0x15([[9.5.0-22|9.5.0-X]]/[[9.6.0-24|9.6.0-X]] also uses keyslot 0x15), sets the normal-key for this keyslot to zeros again, then makes sure the output block is all zeroes. If it is, it does some cleanup then it jumps to the entrypoint for the decrypted binary. Otherwise it will clear the keyX, keyY, and normal-key for each of the keyslots initialized by this loader (on [[9.6.0-24|9.6.0-X]]+, on older versions this was bugged and cleared keys 0x00..0x07 instead of 0x18..0x1F), do cleanup(same cleanup as when the decrypted block is all-zero) then just loop forever.&lt;br /&gt;
&lt;br /&gt;
Thus, the ARM9 binary has the following header:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x000&lt;br /&gt;
|  16&lt;br /&gt;
|  Encrypted KeyX (same for all FIRM&#039;s)&lt;br /&gt;
|-&lt;br /&gt;
|  0x010&lt;br /&gt;
|  16&lt;br /&gt;
|  KeyY&lt;br /&gt;
|-&lt;br /&gt;
|  0x020&lt;br /&gt;
|  16&lt;br /&gt;
|  CTR&lt;br /&gt;
|-&lt;br /&gt;
|  0x030&lt;br /&gt;
|  8&lt;br /&gt;
|  Size of encrypted binary, as ASCII text?&lt;br /&gt;
|-&lt;br /&gt;
|  0x038&lt;br /&gt;
|  8&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x040&lt;br /&gt;
|  16&lt;br /&gt;
|  Control block&lt;br /&gt;
|-&lt;br /&gt;
|  0x050&lt;br /&gt;
|  16&lt;br /&gt;
|  Added with [[9.5.0-22|9.5.0-X]]. Only used for hardware debugging: a nop instruction is executed with r0=0 and r1=&amp;lt;address of this data&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|  0x060&lt;br /&gt;
|  16&lt;br /&gt;
|  Added with [[9.5.0-22|9.5.0-X]]. Encrypted keyX for keyslot 0x16.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Originally the padding after the header before offset 0x800(start of actual ARM9-binary) was 0xFF bytes, with [[9.5.0-22|9.5.0-X]] this was changed to 0x0.&lt;br /&gt;
&lt;br /&gt;
For the New3DS NATIVE_FIRM arm9-section header, the only difference between the [[8.1.0-0_New3DS]] version and the [[9.0.0-20]] version is that the keyY, CTR, and the block at 0x30 in the header were updated.&lt;br /&gt;
&lt;br /&gt;
===New3DS ARM9 binary loader versions===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  FIRM system version(s)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| [[8.1.0-0_New3DS]] - [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| Initial version.&lt;br /&gt;
|-&lt;br /&gt;
| [[9.5.0-22|9.5.0-X]]&lt;br /&gt;
| Added keyX initialization for keyslot 0x16(see above), and added code for clearing keyslot 0x11 immediately after the code finishes using keyslot 0x11. The keyslot used for arm9bin decryption was changed from 0x15 to 0x16. Added code for clearing keyslot 0x16 when control-block decryption fails. Added code for using arm9bin_hdr+0x50 with a nop instruction, at the very beginning of the main arm9-loader function. Added two new 0x10-blocks to the arm9bin-hdr.&lt;br /&gt;
|-&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| See above and [[9.6.0-24|here]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===New3DS ARM9 kernel===&lt;br /&gt;
The only actual code-difference for the Old3DS/New3DS ARM9-kernels&#039; crt0, besides TWL AES / [[IO_Registers|0x10012000]] related code, is that the New3DS ARM9-kernel writes 0x1 to [[CONFIG_Registers|REG_EXTMEMCNT9]] in the crt0.&lt;br /&gt;
&lt;br /&gt;
===New3DS Process9===&lt;br /&gt;
The following is all of the differences for Old3DS/New3DS Process9 with [[9.3.0-21|9.3.0-X]]:&lt;br /&gt;
* The FIRM-launch code called at the end of the New3DS proc9 main() has different mem-range checks.&lt;br /&gt;
* In the New3DS proc9, the v6.0/v7.0 keyinit function at the very beginning(before the original code) had additional code added for setting [[Flash_Filesystem|CTRNAND]] [[AES_Registers|keyslot]] 0x5, with keydata from .data. After setting the keyY, the keyY in .data is cleared.&lt;br /&gt;
* In New3DS proc9, the functions for getting the gamecard crypto keyslots / NCCH keyslot can return New3DS keyslots when New3DS flags(NCSD/NCCH) are set.&lt;br /&gt;
* The code/data for the binary near the end of arm9mem is slightly different, because of memory-region sizes.&lt;br /&gt;
* The only difference in .data(besides the above code binary) is that the New3DS proc9 has an additional 0x10-byte block for the keyslot 0x5 keyY, see above.&lt;br /&gt;
&lt;br /&gt;
== NATIVE_FIRM and SAFE_MODE_FIRM ==&lt;br /&gt;
NATIVE_FIRM is the FIRM which is installed to the [[Flash_Filesystem|NAND]] firm partitions, which is loaded by bootrom. SAFE_MODE_FIRM and NATIVE_FIRM for the initial versions are exactly the same, except for the system core version fields. SAFE_MODE is used for running the [[System_Settings#System_Updater|System Updater]].&lt;br /&gt;
&lt;br /&gt;
An overview of NATIVE_FIRM versions along with their contentID is given in [[Configuration_Memory#NATIVE_FIRM_Versions|Configuration Memory]].&lt;br /&gt;
&lt;br /&gt;
== TWL_FIRM and  AGB_FIRM ==&lt;br /&gt;
TWL_FIRM handles DS(i) backwards compatibility, while AGB_FIRM handles running GBA VC titles. The ARM9 FIRM section for TWL_FIRM and AGB_FIRM are exactly the same(for TWL_FIRM and AGB_FIRM versions which were updated with the same system-update).&lt;br /&gt;
&lt;br /&gt;
=== TWL_FIRM ===&lt;br /&gt;
The 3DS-mode ARM9 core seems to switch into DSi-mode(for running DSi-mode ARM9 code) by writing to a [[PDN]] register(this changes the memory layout to DSi-mode / etc, therefore this register poke *must* be executed from ITCM). This is the final 3DS-mode register poke before the ARM9 switches into DSi-mode. DS(i)-mode ARM7 code is run on the internal [[ARM7]] core, which is started up during TWL_FIRM boot. Trying to read from the exception-vector region(address 0x0) under this DSi-mode ARM7 seems to only return 0x00/0xFF data. Also note that this DSi-mode ARM7 runs code(stored in TWL_FIRM) which pokes some DSi-mode registers that on the DSi were used for disabling access to the DSi bootROMs, however these registers do not affect the 3DS DSi-mode ARM9/ARM7 &amp;quot;bootrom&amp;quot; region(exceptionvector region + 0x8000) at all.&lt;br /&gt;
&lt;br /&gt;
For shutting down the system, TWL_FIRM writes u8 value 8 to [[I2C]] MCU register 0x20. For returning to 3DS-mode, TWL_FIRM writes value 4 to that MCU register to trigger a hardware system reboot.&lt;br /&gt;
&lt;br /&gt;
The TWL_FIRM ARM11-process includes a TWL bootloader, see [http://dsibrew.org/wiki/Bootloader here] and [[Memory_layout#Detailed_TWL_FIRM_ARM11_Memory|here]] for details.&lt;br /&gt;
&lt;br /&gt;
TWL_FIRM verifies all TWL RSA padding with the following. This is different from the DSi &amp;quot;BIOS&amp;quot; code.&lt;br /&gt;
* The first byte must be 0x0.&lt;br /&gt;
* The second byte must be 0x1 or 0x2.&lt;br /&gt;
* Executes a while(&amp;lt;value of byte at current pos in RSA message&amp;gt;). When the second_byte in the message is 0x1, the byte at curpos must be 0xFF(otherwise the non-zero value of the byte at curpos doesn&#039;t matter). This loop must find a zero byte before offset 0x7F in the message otherwise an error is returned.&lt;br /&gt;
* Returns an address for msg_curpos+1.&lt;br /&gt;
totalhashdatasize = rsasig_bytesize - above position in the message for the hashdata. The actual &amp;quot;totalhashdatasize&amp;quot; in the RSA message must be &amp;lt;= &amp;lt;expected hashdata_size&amp;gt;(0x74 for bootloader). The TWL_FIRM code copies the RSA &amp;quot;hashdata&amp;quot; to the output buffer, using the actual size of the RSA &amp;quot;hashdata&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== FIRM Launch Parameters ==&lt;br /&gt;
The FIRM-launch parameters structure is located at FCRAM+0, size 0x1000-bytes. The ARM11-kernel copies this structure elsewhere, then clears the 0x1000-bytes at FCRAM+0. It will not handle an existing structure at FCRAM+0 if [[CONFIG Registers#CFG_BOOTENV|CFG_BOOTENV]] is zero. The ARM9 kernel writes some values about the boot environment to AXI WRAM during init to enable this.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
| 0x400&lt;br /&gt;
| 0x4&lt;br /&gt;
| Flags&lt;br /&gt;
|-&lt;br /&gt;
| 0x410&lt;br /&gt;
| 0xC&lt;br /&gt;
| This is used for overriding the FIRM_* fields in [[Configuration_Memory]], when the flag listed below is set, in the following order(basically just data-copy from here to 0x1FF80060): &amp;quot;FIRM_?&amp;quot;, FIRM_VERSIONREVISION, FIRM_VERSIONMINOR, FIRM_VERSIONMAJOR, FIRM_SYSCOREVER, and FIRM_CTRSDKVERSION.&lt;br /&gt;
|-&lt;br /&gt;
| 0x438&lt;br /&gt;
| 0x4&lt;br /&gt;
| The kernel checks this field for value 0xFFFF, if it matches the kernel uses the rest of these parameter fields, otherwise FIRM-launch parameters fields are ignored by the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| 0x43C&lt;br /&gt;
| 0x4&lt;br /&gt;
| CRC32, this is calculated starting at FIRM-params offset 0x400, with size 0x140(with this field cleared to zero during calculation). When invalid the kernel clears the entire buffer used for storing the FIRM-params, therefore no actual FIRM-params are handled after that.&lt;br /&gt;
|-&lt;br /&gt;
| 0x440&lt;br /&gt;
| 0x10&lt;br /&gt;
| Titleinfo [[FS:GetProgramLaunchInfo|structure]], used by NS during NS startup, to launch the specified title when the below flag is set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x450&lt;br /&gt;
| 0x10&lt;br /&gt;
| Titleinfo [[FS:GetProgramLaunchInfo|structure]]. This might be used for returning to the specified title, once the above launched title terminates?&lt;br /&gt;
|-&lt;br /&gt;
| 0x460&lt;br /&gt;
| 0x4&lt;br /&gt;
| Bit0: 0 = titleinfo structure isn&#039;t set, 1 = titleinfo structure is set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x480&lt;br /&gt;
| 0x20&lt;br /&gt;
| This can be set via buf1 for [[APT:SendDeliverArg]]/[[APT:StartApplication]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A0&lt;br /&gt;
| 0x10&lt;br /&gt;
| This can be set by [[NSS:SetFIRMParams4A0]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B0&lt;br /&gt;
| 0x14&lt;br /&gt;
| SHA1-HMAC of the banner for TWL/NTR titles. This can be set by [[NSS:SetFIRMParams4B0]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x500&lt;br /&gt;
| 0x40&lt;br /&gt;
| This is used by [[APT:LoadSysMenuArg]] and [[APT:StoreSysMenuArg]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags from offset 0x400:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| This can be used for overriding the default FCRAM [[Memory_layout|memory-regions]] allocation sizes(APPLICATION, SYSTEM, and BASE). The values for this is the same as [[Configuration_Memory#APPMEMTYPE|Configmem-APPMEMTYPE]]. Values 0-1 are handled the same way by the kernel. However for NS, 0=titleinfo structure for launching a title isn&#039;t set, while non-zero=titleinfo structure is set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x3&lt;br /&gt;
| Setting bit0 here enables overriding the FIRM_* fields in [[Configuration_Memory]].&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NS_and_APT_Services&amp;diff=13002</id>
		<title>NS and APT Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=NS_and_APT_Services&amp;diff=13002"/>
		<updated>2015-08-08T07:08:53Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* NS Service &amp;quot;ns:s&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
The NS (&#039;&#039;&#039;N&#039;&#039;&#039;intendo User Interface &#039;&#039;&#039;S&#039;&#039;&#039;hell) system module is the first module launched from a CTR-NAND title after the [[FIRM]] processes are loaded. This module is launched by the pm process, with the titleID loaded from NS state(hard-coded TID initialized during applet TID-array initialization). NS first launches [[ErrDisp]], then the menu. On retail the menu TID is loaded from NS state, while on dev/debug the menu TID is loaded from [[Config_Savegame|config]]. On dev-units if the menu TID block doesn&#039;t exist in [[Config_Savegame|config]], NS will attempt to launch the alternate menu instead. The TID of the launched menu is then written to [[Configuration Memory|ACTIVEMENUTID]]. NS uses [[PMApp:LaunchTitle|pm:app]] to launch titles.&lt;br /&gt;
&lt;br /&gt;
NS will not trigger the [[ErrDisp|fatal-error]] screen when launching the regular/alternate menu fails.&lt;br /&gt;
&lt;br /&gt;
Like home menu NS is constantly running while the system is in 3DS-mode. When attempting to return to home-menu when the home-menu process isn&#039;t running(like when the process terminated/crashed), NS will trigger a [[ErrDisp|fatal]] error.&lt;br /&gt;
&lt;br /&gt;
= Alternate menu =&lt;br /&gt;
When launching the regular menu fails, NS will then attempt to launch the alternate menu. This title could be used as a recovery process, however it&#039;s normally not used after the factory.&lt;br /&gt;
&lt;br /&gt;
At the factory for all 3DS systems, [[3DS Development Unit GUI#Test Menu|Test Menu]] is installed with this TID. On retail this title is eventually deleted during [[Factory Setup]].&lt;br /&gt;
&lt;br /&gt;
= Auto-boot =&lt;br /&gt;
After [[PMApp:GetFIRMLaunchParams|loading]] [[FIRM]] params and prior to launching [[ErrDisp]]/Home Menu, NS handles auto-booting titles. The same code called by [[APT:Reboot]] is used for launching FIRM here. When the [[Configuration_Memory|UPDATEFLAG]] is set, NS will launch SAFE_MODE_FIRM with the application titleID set to the [[System_Settings#System_Updater|System Updater]] titleID for this region. When the UPDATEFLAG is not set, NS can auto-boot the following titles as well if [[Configuration_Memory|0x1FF80016]] bit0 is set.&lt;br /&gt;
&lt;br /&gt;
When bit1 and bit2 are value zero in [[Configuration_Memory|0x1FF80016]], NS will [[NSS:LaunchFIRM|launch]] the title specified by the [[FIRM]] parameters if the title-info is set. This FIRM launch is done after launching [[ErrDisp]] and Home Menu. Otherwise when [[Configuration_Memory|0x1FF80016]] is value 2 and the output u8 from [[PTM|PTMSYSM]] command 0x08140000 is value 0, NS will boot the title specified from the TWL TLNC block from FIRMparams+0x300. This is the same TLNC block which DSi titles wrote to RAM+0x300 for launching other titles via the launcher title. When handling the TLNC block, NS will boot the 3DS System Settings title when the TLNC titleID is the DSi System Settings titleID(the region field in the TLNC TID is not checked/used). When the TLNC titleID is not System Settings, NS will convert the input DSi titleID-high to the 3DS TWL titleID-high(tidhigh = (TLNCtidhigh &amp;amp; 0x7FFF) | 0x48000), then launch TWL_FIRM to run the title. NS does not support launching from gamecard via TLNC.&lt;br /&gt;
&lt;br /&gt;
= NS Workaround =&lt;br /&gt;
A &amp;quot;ns_workaround&amp;quot; was [[5.1.0-11|added]] in NS to workaround the flaw added with [[5.0.0-11]]. When NS is loading before launching any ARM11 processes and certain [[Configuration Memory]] fields are set, NS will launch [[Application_Manager_Services|AM]] then use command [[AM:InstallNATIVEFIRM]]. NS will then execute the code called by [[APT:StartNewestHomeMenu]], the code related to APT:PrepareToStartNewestHomeMenu is not executed here.&lt;br /&gt;
&lt;br /&gt;
NS will only execute this code-path when [[Configuration Memory|0x1FF80016]] is value zero, when KERNEL_VERSIONMAJOR is value 2, and when KERNEL_VERSIONMINOR is less than 35. Therefore, this code-path is only executed when the running NATIVE_FIRM version is prior to [[5.0.0-11]].&lt;br /&gt;
&lt;br /&gt;
= NS Service &amp;quot;ns:s&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:LaunchFIRM|LaunchFIRM]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000200C0&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:LaunchTitle|LaunchTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0003....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Wrapper for [[Process_Manager_Services|PMApp]] command 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0004....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Wrapper for [[Process_Manager_Services|PMApp]] command 0x000500C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000500C0&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:LaunchApplicationFIRM|LaunchApplicationFIRM]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060042&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:SetFIRMParams4A0|SetFIRMParams4A0]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070042&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:CardUpdateInitialize|CardUpdateInitialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| This shuts down the gamecard system update interface: the shared memory is unmapped, the CFA archive is closed, state is cleared, etc.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0009....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0140&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:SetFIRMParams4B0|SetFIRMParams4B0]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Wrapper for &amp;quot;ptm:sysm&amp;quot; service command 0x040700C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| This calls [[APT:AppletUtility]] with fixed input params.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100180&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:RebootSystem|RebootSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0011....&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:TerminateProcessTID|TerminateProcessTID]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0012....&lt;br /&gt;
| ?&lt;br /&gt;
| Uses pm:app cmdA&amp;amp;B&lt;br /&gt;
|-&lt;br /&gt;
| 0x0013....&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0014....&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0015....&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| This triggers a hw-reboot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum sessions that can be used with this service is two, therefore only two processes can use this service at the same time.&lt;br /&gt;
&lt;br /&gt;
=NS Service &amp;quot;ns:p&amp;quot;=&lt;br /&gt;
This was added with [[3.0.0-5]]. The PTM sysmodule connects to this service, and syncs whenever [[PTM|ptm:s GetShellState()]] changes.&lt;br /&gt;
&lt;br /&gt;
=NS Service &amp;quot;ns:c&amp;quot;=&lt;br /&gt;
This was added with [[5.0.0-11]], it&#039;s unknown what this is used for.&lt;br /&gt;
&lt;br /&gt;
=APT Services=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Accessible with APT:U&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetLockHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| &lt;br /&gt;
| See [[APTU:Initialize|here]].&lt;br /&gt;
| [[APTU:Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| Enable&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| Finalize&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetAppletManInfo|GetAppletManInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetAppletInfo|GetAppletInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetLastSignaledAppletId&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| CountRegisteredApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:IsRegistered|IsRegistered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetAttribute&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APTU:GetSignalType|InquireNotification]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0104&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SendParameter|SendParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:ReceiveParameter|ReceiveParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GlanceParameter|GlanceParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0100&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CancelParameter|CancelParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001000C2&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| DebugFunc&lt;br /&gt;
|-&lt;br /&gt;
| 0x001100C0&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:MapProgramIdForDebug|MapProgramIdForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| SetHomeMenuAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetPreparationState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| SetPreparationState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150140&lt;br /&gt;
| &lt;br /&gt;
| No&lt;br /&gt;
| [[APT:PrepareToStartApplication|PrepareToStartApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PreloadLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| FinishPreloadingLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToStartLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToStartSystemApplet|PrepareToStartSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToStartNewestHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B00C4&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:StartApplication|StartApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| WakeupApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| CancelApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E0084&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| StartLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0084&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:StartSystemApplet|StartSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:StartNewestHomeMenu|StartNewestHomeMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00210000&lt;br /&gt;
| &lt;br /&gt;
| No&lt;br /&gt;
| OrderToCloseApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToCloseApplication(bool isJumpToHome)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00230040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToJumpToApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00240044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| JumpToApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x002500C0&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToCloseLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToCloseSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00270044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| CloseApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| CloseLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| CloseSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| OrderToCloseSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToJumpToHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| JumpToHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToLeaveHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E0044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| LeaveHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToLeaveResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00300044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| LeaveResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00310100&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToDoApplicationJump|PrepareToDoApplicationJump]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00320084&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:DoApplicationJump|DoApplicationJump]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00330000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetProgramIdOnApplicationJump&lt;br /&gt;
|-&lt;br /&gt;
| 0x00340084&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SendDeliverArg|SendDeliverArg]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00350080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| ReceiveDeliverArg&lt;br /&gt;
|-&lt;br /&gt;
| 0x00360040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:LoadSysMenuArg|LoadSysMenuArg]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00370042&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:StoreSysMenuArg|StoreSysMenuArg]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00380040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PreloadResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00390040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| PrepareToStartResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x003A0044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| StartResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x003B0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| CancelLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x003C0042&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| SendDspSleep&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0042&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| SendDspWakeUp&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E0080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| ReplySleepQuery&lt;br /&gt;
|-&lt;br /&gt;
| 0x003F0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| ReplySleepNotificationComplete&lt;br /&gt;
|-&lt;br /&gt;
| 0x00400042&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SendCaptureBufferInfo|SendCaptureBufferInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00410040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:ReceiveCaptureBufferInfo|ReceiveCaptureBufferInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00420080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| SleepSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x00430040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| NotifyToWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x00440000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetSharedFont&lt;br /&gt;
|-&lt;br /&gt;
| 0x00450040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| GetWirelessRebootInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00460104&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:Wrap|Wrap]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00470104&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:Unwrap|Unwrap]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00480100&lt;br /&gt;
| &lt;br /&gt;
| No&lt;br /&gt;
| [[APT:GetProgramInfo|GetProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00490180&lt;br /&gt;
| &lt;br /&gt;
| No&lt;br /&gt;
| [[APT:Reboot|Reboot]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004A0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetCaptureInfo|GetCaptureInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004B00C2&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:AppletUtility|AppletUtility]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004C0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| SetFatalErrDispMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x004D0080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetAppletProgramInfo|GetAppletProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004E0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| HardwareResetAsync&lt;br /&gt;
|-&lt;br /&gt;
| 0x004F0080&lt;br /&gt;
| [[2.2.0-X]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SetApplicationCpuTimeLimit|SetApplicationCpuTimeLimit]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00500040&lt;br /&gt;
| [[2.2.0-X]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetApplicationCpuTimeLimit|GetApplicationCpuTimeLimit]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0051....&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| ?&lt;br /&gt;
| Uses pm:app cmdB&lt;br /&gt;
|-&lt;br /&gt;
| 0x00520104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
| Wrap1&lt;br /&gt;
|-&lt;br /&gt;
| 0x00530104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
| Unwrap1&lt;br /&gt;
|-&lt;br /&gt;
| 0x00540040&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00550040&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| Yes&lt;br /&gt;
| This writes the input u8 to a NS state field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00560000&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| Yes&lt;br /&gt;
| This returns an u8 NS state field(which can be set by cmd 0x00550040), at cmdreply+8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00570044&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| ?&lt;br /&gt;
| WakeupApplication2?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00580002&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01010000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| Yes&lt;br /&gt;
| This writes an output u8 to cmdreply indexword[2]. This uses [[PTMSYSM:CheckNew3DS]]. When a certain NS state field is non-zero, the output value is zero, otherwise the output is from [[PTMSYSM:CheckNew3DS]]. Normally this NS state field is zero, however this state field is set to 1 when [[APT:PrepareToStartApplication]] is used with flags bit8 is set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01020000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| Yes&lt;br /&gt;
| Wrapper for [[PTMSYSM:CheckNew3DS]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x01030000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| Yes&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01040000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These &amp;quot;APT:U&amp;quot; and &amp;quot;APT:S&amp;quot; NS services can handle launching titles/&amp;quot;applets&amp;quot;, these services handle signaling for home/power button as well. Only one session for either APT service can be open at a time, normally processes close the service handle immediately once finished using the service. The commands for APT:U and APT:S are exactly the same, however certain commands are only accessible with APT:S(NS module will call [[SVC|svcBreak]] when the command isn&#039;t accessible).&lt;br /&gt;
&lt;br /&gt;
Applets returning to home-menu first use commands APT:PrepareToJumpToHomeMenu and APT:JumpToHomeMenu, followed by these commands to launch home-menu: [[APT:PrepareToStartSystemApplet]] and [[APT:StartSystemApplet]]. [[APT:PrepareToStartSystemApplet]] and [[APT:StartSystemApplet]] are also used for launching the [[Internet Browser]], the camera applet, etc.&lt;br /&gt;
&lt;br /&gt;
Processes launch applications via home-menu, not directly with [[APT:PrepareToStartApplication]] and [[APT:StartApplication]]. Regular applications can&#039;t directly launch applications since [[APT:StartApplication]] launches the process without terminating the currently running application.&lt;br /&gt;
&lt;br /&gt;
APT:PrepareToDoApplicationJump and APT:DoApplicationJump are used by applications, for launching native/&amp;lt;non-NATIVE_FIRM&amp;gt; applications. These commands notify Home Menu that title launching needs done, Home Menu does the actual title launching via NS commands.&lt;br /&gt;
&lt;br /&gt;
=&amp;quot;APT:A&amp;quot; Service=&lt;br /&gt;
This was added with [[7.0.0-13|7.0.0-X]]. Official apps built with the CTRSDK for system-version &amp;gt;=[[7.0.0-13|7.0.0-X]] normally use the &amp;quot;APT:A&amp;quot; service instead of &amp;quot;APT:U&amp;quot;. Those processes also have &amp;quot;APT:A&amp;quot; instead of &amp;quot;APT:U&amp;quot; in the service-access-control. It&#039;s unknown whether there&#039;s anything which is only accessible via &amp;quot;APT:A&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Library Applets=&lt;br /&gt;
Library applets can be launched by applications and regular applets. These library applets render to the screen(s) when running, etc. For example, this includes swkbd for text input. See the below appIDs in the 0x2XX range, the actual appID used is 0x4XX however.&lt;br /&gt;
&lt;br /&gt;
Input data can be sent to the library applet via the NS [[APT:SendParameter|parameter]] buffer, and/or with shared-memory with a shared-mem handle sent to the library applet. Output data from the library applet can be received by [[APT:ReceiveParameter]], the library applet can also use the specified shared-mem for output too.&lt;br /&gt;
&lt;br /&gt;
=AppIDs=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  AppID&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x101&lt;br /&gt;
| Home Menu (menu)&lt;br /&gt;
|-&lt;br /&gt;
| 0x103&lt;br /&gt;
| Alternate Menu&lt;br /&gt;
|-&lt;br /&gt;
| 0x110&lt;br /&gt;
| Camera applet (CtrApp)&lt;br /&gt;
|-&lt;br /&gt;
| 0x112&lt;br /&gt;
| Friends List applet (friend)&lt;br /&gt;
|-&lt;br /&gt;
| 0x113&lt;br /&gt;
| Game Notes applet (Cherry)&lt;br /&gt;
|-&lt;br /&gt;
| 0x114&lt;br /&gt;
| [[Internet Browser]] (spider/SKATER)&lt;br /&gt;
|-&lt;br /&gt;
| 0x115&lt;br /&gt;
| Instruction Manual applet&lt;br /&gt;
|-&lt;br /&gt;
| 0x116&lt;br /&gt;
| Notifications applet (newslist)&lt;br /&gt;
|-&lt;br /&gt;
| 0x117&lt;br /&gt;
| Miiverse applet (olv)&lt;br /&gt;
|-&lt;br /&gt;
| 0x201&lt;br /&gt;
| Software Keyboard (swkbd) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x202&lt;br /&gt;
| Mii Selector (appletEd) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x204&lt;br /&gt;
| Photo Selector (PNOTE_AP) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x205&lt;br /&gt;
| Sound Selector (SNOTE_AP) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x206&lt;br /&gt;
| Error Display (error) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x207&lt;br /&gt;
| eShop applet (mint) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x208&lt;br /&gt;
| Circle Pad Pro Calibrator ([[Extrapad_Applet|extrapad]]) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x209&lt;br /&gt;
| Notepad (memolib) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x300&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x401&lt;br /&gt;
| Software Keyboard (swkbd)&lt;br /&gt;
|-&lt;br /&gt;
| 0x402&lt;br /&gt;
| Mii Selector (appletEd)&lt;br /&gt;
|-&lt;br /&gt;
| 0x404&lt;br /&gt;
| Photo Selector (PNOTE_AP)&lt;br /&gt;
|-&lt;br /&gt;
| 0x405&lt;br /&gt;
| Sound Selector (SNOTE_AP)&lt;br /&gt;
|-&lt;br /&gt;
| 0x406&lt;br /&gt;
| Error Display (error)&lt;br /&gt;
|-&lt;br /&gt;
| 0x407&lt;br /&gt;
| eShop applet (mint)&lt;br /&gt;
|-&lt;br /&gt;
| 0x408&lt;br /&gt;
| Circle Pad Pro Calibrator ([[Extrapad_Applet|extrapad]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x409&lt;br /&gt;
| Notepad (memolib)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF10&lt;br /&gt;
| ProgramID: 0004003000008900.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF11&lt;br /&gt;
| ProgramID: 000400000FFFFD00.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF12&lt;br /&gt;
| ProgramID: 000400000FFFFC00.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF13&lt;br /&gt;
| ProgramID: 000400000FFFFB00.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF14&lt;br /&gt;
| ProgramID: 000400000FFFF900.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF15&lt;br /&gt;
| ProgramID: 000400000FFFF800.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF16&lt;br /&gt;
| ProgramID: 000400000FFFF700.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF17&lt;br /&gt;
| ProgramID: 000400000FFFF600.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF18&lt;br /&gt;
| ProgramID: 000400000FFFF500.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These AppIDs are all for NAND titles, except for 0x300. AppIDs in the 0x1XX range are applets(programID-high 00040030), and the AppIDs in the 0x2XX range are &amp;quot;system libraries&amp;quot;(programID-high 00040030). The 0xFXX AppID range is for development NAND applications, these are not available for retail.&lt;br /&gt;
&lt;br /&gt;
Note that at some point the total AppID entry count was changed from 28 to 27.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NSS:SetTWLBannerHMAC&amp;diff=13001</id>
		<title>NSS:SetTWLBannerHMAC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=NSS:SetTWLBannerHMAC&amp;diff=13001"/>
		<updated>2015-08-08T07:08:37Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x000D0140]&lt;br /&gt;
|-&lt;br /&gt;
| 1-5&lt;br /&gt;
| Input param data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
The input 20-byte data is copied to the NS [[FIRM]] parameter buffer at offset 0x4B0.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=12996</id>
		<title>Filesystem services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Filesystem_services&amp;diff=12996"/>
		<updated>2015-08-06T23:25:30Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: this was orphaned&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Filesystem service &amp;quot;fs:USER&amp;quot; =&lt;br /&gt;
You can at most have 32 FS archive handles.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version &lt;br /&gt;
!  Description&lt;br /&gt;
!   scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; | Required [[NCCH/Extended_Header|exheader]] access info bitmask&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
|?&lt;br /&gt;
| Dummy1&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
|?&lt;br /&gt;
| Control&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010002&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:Initialize|Initialize]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080201C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFile|OpenFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030204&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenFileDirectly|OpenFileDirectly]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteFile|DeleteFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameFile|RenameFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectory|DeleteDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070142&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:DeleteDirectoryRecursively|DeleteDirectoryRecursively]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080202&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateFile|CreateFile]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090182&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CreateDirectory|CreateDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0244&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:RenameDirectory|RenameDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenDirectory|OpenDirectory]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C00C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:OpenArchive|OpenArchive]]&lt;br /&gt;
| Each archive ID code has separate access info bitmasks, if it has any&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0144&lt;br /&gt;
|?&lt;br /&gt;
| ControlArchive&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0080&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CloseArchive|CloseArchive]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0180&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:FormatThisUserSaveData|FormatThisUserSaveData]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100200&lt;br /&gt;
|?&lt;br /&gt;
| CreateSystemSaveData&lt;br /&gt;
| 0x4, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110040&lt;br /&gt;
|?&lt;br /&gt;
| DeleteSystemSaveData&lt;br /&gt;
| 0x1004, for when the input saveID doesn&#039;t match the exheader saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120080&lt;br /&gt;
|?&lt;br /&gt;
| GetFreeBytes&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetCardType|GetCardType]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetSdmcArchiveResource|GetSdmcArchiveResource]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetNandArchiveResource|GetNandArchiveResource]]&lt;br /&gt;
| 0x1007&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160000&lt;br /&gt;
|?&lt;br /&gt;
| GetSdmcFatfsError&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcDetected|IsSdmcDetected]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:IsSdmcWritable|IsSdmcWritable]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190042&lt;br /&gt;
|?&lt;br /&gt;
| GetSdmcCid&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
|?&lt;br /&gt;
| GetNandCid&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B0000&lt;br /&gt;
|?&lt;br /&gt;
| GetSdmcSpeedInfo&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0000&lt;br /&gt;
|?&lt;br /&gt;
| GetNandSpeedInfo&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0042&lt;br /&gt;
|?&lt;br /&gt;
| GetSdmcLog&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0042&lt;br /&gt;
|?&lt;br /&gt;
| GetNandLog&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0000&lt;br /&gt;
|?&lt;br /&gt;
| ClearSdmcLog&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200000&lt;br /&gt;
|?&lt;br /&gt;
| ClearNandLog&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:CardSlotIsInserted|CardSlotIsInserted]]&lt;br /&gt;
| 0x1017&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
|?&lt;br /&gt;
| CardSlotPowerOn&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230000&lt;br /&gt;
|?&lt;br /&gt;
| CardSlotPowerOff&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240000&lt;br /&gt;
|?&lt;br /&gt;
| CardSlotGetCardIFPowerStatus&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250040&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectCommand&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260080&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectCommandWithAddress&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270082&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectRead&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C2&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectReadWithAddress&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290082&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectWrite&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082A00C2&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectWriteWithAddress&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082B00C2&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectRead_4xIO&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082C0082&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectCpuWriteWithoutVerify&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082D0040&lt;br /&gt;
|?&lt;br /&gt;
| CardNorDirectSectorEraseWithoutVerify&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x082E0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProductInfo|GetProductInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x082F0040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetProgramLaunchInfo|GetProgramLaunchInfo]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08300182&lt;br /&gt;
|?&lt;br /&gt;
| CreateExtSaveData&lt;br /&gt;
| 0xC, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08310180&lt;br /&gt;
|?&lt;br /&gt;
| CreateSharedExtSaveData&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08320102&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:ReadExtSaveDataIcon|ReadExtSaveDataIcon]]&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08330082&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:EnumerateExtSaveData|EnumerateExtSaveData]]&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08340082&lt;br /&gt;
|?&lt;br /&gt;
| EnumerateSharedExtSaveData&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08350080&lt;br /&gt;
|?&lt;br /&gt;
| DeleteExtSaveData&lt;br /&gt;
| 0x100D, for when the input extdataID doesn&#039;t match the exheader extdataID&lt;br /&gt;
|-&lt;br /&gt;
| 0x08360080&lt;br /&gt;
|?&lt;br /&gt;
| DeleteSharedExtSaveData&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08370040&lt;br /&gt;
|?&lt;br /&gt;
| SetCardSpiBaudRate&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08380040&lt;br /&gt;
|?&lt;br /&gt;
| SetCardSpiBusMode&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x08390000&lt;br /&gt;
|?&lt;br /&gt;
| SendInitializeInfoTo9&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083A0100&lt;br /&gt;
|?&lt;br /&gt;
| GetSpecialContentIndex&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x083B00C2&lt;br /&gt;
|?&lt;br /&gt;
| GetLegacyRomHeader&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083C00C2&lt;br /&gt;
|?&lt;br /&gt;
| GetLegacyBannerData&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x083D0100&lt;br /&gt;
|?&lt;br /&gt;
| CheckAuthorityToAccessExtSaveData&lt;br /&gt;
| 0x44&lt;br /&gt;
|-&lt;br /&gt;
| 0x083E00C2&lt;br /&gt;
|?&lt;br /&gt;
| QueryTotalQuotaSize&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x083F00C0&lt;br /&gt;
|?&lt;br /&gt;
| GetExtDataBlockSize&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08400040&lt;br /&gt;
|?&lt;br /&gt;
| AbnegateAccessRight&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08410000&lt;br /&gt;
|?&lt;br /&gt;
| DeleteSdmcRoot&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08420040&lt;br /&gt;
|?&lt;br /&gt;
| DeleteAllExtSaveDataOnNand&lt;br /&gt;
| 0x1005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08430000&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:InitializeCtrFileSystem|InitializeCtrFileSystem]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08440000&lt;br /&gt;
|?&lt;br /&gt;
| CreateSeed&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x084500C2&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetFormatInfo|GetFormatInfo]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08460102&lt;br /&gt;
|?&lt;br /&gt;
| GetLegacyRomHeader2&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x08470180&lt;br /&gt;
|?&lt;br /&gt;
| FormatCtrCardUserSaveData&lt;br /&gt;
| 0x6&lt;br /&gt;
|-&lt;br /&gt;
| 0x08480042&lt;br /&gt;
|?&lt;br /&gt;
| GetSdmcCtrRootPath&lt;br /&gt;
| 0x100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08490040&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:GetArchiveResource|GetArchiveResource]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x084A0002&lt;br /&gt;
|?&lt;br /&gt;
| ExportIntegrityVerificationSeed&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084B0002&lt;br /&gt;
|?&lt;br /&gt;
| ImportIntegrityVerificationSeed&lt;br /&gt;
| 0x4000&lt;br /&gt;
|-&lt;br /&gt;
| 0x084C0242&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:FormatSaveData|FormatSaveData]]&lt;br /&gt;
| 0x6, in some cases this write isn&#039;t needed however&lt;br /&gt;
|-&lt;br /&gt;
| 0x084D0102&lt;br /&gt;
|?&lt;br /&gt;
| GetLegacySubBannerData&lt;br /&gt;
| 0x1015&lt;br /&gt;
|-&lt;br /&gt;
| 0x084E0342&lt;br /&gt;
|?&lt;br /&gt;
| [[FS:UpdateSha256Context|UpdateSha256Context]]&lt;br /&gt;
| 0x5&lt;br /&gt;
|-&lt;br /&gt;
| 0x084F0102&lt;br /&gt;
|?&lt;br /&gt;
| ReadSpecialFile&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08500040&lt;br /&gt;
|?&lt;br /&gt;
| GetSpecialFileSize&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08510242&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:CreateExtSaveData|CreateExtSaveData]]&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x08520100&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| DeleteExtSaveData (u32 flags, u64 extdataID)&lt;br /&gt;
| Shared extdata: 0x101005. Regular extdata in certain cases: 0x10100D&lt;br /&gt;
|-&lt;br /&gt;
| 0x08530142&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| ReadExtSaveDataIcon&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x085400C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| GetExtDataBlockSize?&lt;br /&gt;
| 0x10100D (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08550102&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| EnumerateExtSaveData&lt;br /&gt;
| 0x101005&lt;br /&gt;
|-&lt;br /&gt;
| 0x08560200&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| FsCreateSystemSaveData?&lt;br /&gt;
| 0x4 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08570080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| DeleteSystemSaveData&lt;br /&gt;
| 0x1004 (this doesn&#039;t apply in certain cases, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x08580000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:GetMovableSedHashedKeyYRandomData|GetMovableSedHashedKeyYRandomData]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08590200&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| SetMovableSedHashedKeyYRandomData?&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x085A00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| SetArchivePriority(u64 ID,u32 priority)&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085B0080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| GetArchivePriority(u64 ID,u32 *priority)&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x085C00C0&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| SetCtrCardLatencyParameter&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085D0180&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
|?&lt;br /&gt;
| 0x100001&lt;br /&gt;
|-&lt;br /&gt;
| 0x085E0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| ResetCardCompatibilityParameter&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x085F0040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| SwitchCleanupInvalidSaveData&lt;br /&gt;
| 0x12004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08600042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:EnumerateSystemSaveData|EnumerateSystemSaveData]]&lt;br /&gt;
| 0x2004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08610042&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| [[FS:InitializeWithSdkVersion|InitializeWithSdkVersion]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08620040&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| SetPriority&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08630000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| GetPriority&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08640000&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| Obsoleted_4_0_GetNandInfo &lt;br /&gt;
| Stubbed, this returns an error&lt;br /&gt;
|-&lt;br /&gt;
| 0x08650140&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| SetSaveDataSecureValue, this is used with [[Anti Savegame Restore]].&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086600C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| GetSaveDataSecureValue, this is used with [[Anti Savegame Restore]].&lt;br /&gt;
| 0x121004 (in certain cases this doesn&#039;t apply, however)&lt;br /&gt;
|-&lt;br /&gt;
| 0x086700C4&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ControlSecureSave&lt;br /&gt;
| 0x121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08680000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| GetMediaType, This loads the u8 mediatype for the current application from already initialized state, this u8 was originally loaded from the same data used by [[FS:GetProgramLaunchInfo|GetProgramLaunchInfo]]. This then writes the u8 to response-word[2]. This is used with [[Anti Savegame Restore]]&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x08690000&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| Obsoleted_4_0_GetNandEraseCount Stubbed, this returns an error.&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x086A0082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ReadNandReport This is a wrapper for [[Filesystem_services_PXI|FSPXI]] command 0x00550082.&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 0x086B00C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086C00C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00121004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086D0040&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00020004&lt;br /&gt;
|-&lt;br /&gt;
| 0x086E00C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x086F0040&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 0xE&lt;br /&gt;
|-&lt;br /&gt;
| 0x087000C2&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08710100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 0x087201C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x087300C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08740000&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
| 00080004&lt;br /&gt;
|-&lt;br /&gt;
| 0x08750140&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087600C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|None?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08770100&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087800C0&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x087900C2&lt;br /&gt;
| ?&lt;br /&gt;
| Same as GetLegacyBannerData, except for the last parameter this passes u8 value 0x1 instead of 0x0, for the FSPXI command.&lt;br /&gt;
| 0x00101015&lt;br /&gt;
|-&lt;br /&gt;
| 0x087A....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087B....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Wrapper for the code internally used for command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087C....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087D0000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Writes an u32 from state to cmdreply[2]. Probably the total number of titles in the SEEDDB?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087E0042&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;. Writes a list of titleIDs to the outbuf, this is for titles with content-lock-seed(s) stored in SEEDDB. (u32 total_titleids_probably, ((Size&amp;lt;&amp;lt;4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 12), outbufptr)&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x087F....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0880....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0881....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0882....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x08830000&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Writes an output value to cmdreply[2].&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0884....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| Eventually calls same code as command &amp;lt;0x087A....&amp;gt;.&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|-&lt;br /&gt;
| 0x0885....&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| 0x00200000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The question marks from Dummy1 to GetSpecialFileSize on the &amp;quot;available since system version&amp;quot; field are mainly there because I think that most of these are necessary for the main system to function, so theoretically that would mean that since the creation of the 3DS these were available, or since launch if that makes more sense. But because of the peculiar nature of some of the functions, they will remain question marks until they can be confirmed 100%.&lt;br /&gt;
&lt;br /&gt;
When access rights are required for a command, at least one of the bits in the process access info specified in the above table for the command must be set. Error 0xD9004676 is returned when a process attempts to use a command which it doesn&#039;t have access rights for the command. The exheader access info field is all zero&#039;s for most applications. Note that the permissions listed in the above table is for system-version v2.x, therefore permission bit(s) added with newer FIRM may be missing from this.&lt;br /&gt;
&lt;br /&gt;
Each session for fs:USER has separate permissions, initially these are set to all zero&#039;s for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).&lt;br /&gt;
&lt;br /&gt;
=File service=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| Dummy1&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| Control&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| OpenSubFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| [[FSFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| [[FSFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| [[FSFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| [[FSFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| GetAttributes&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070040&lt;br /&gt;
| SetAttributes&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[FSFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| Flush&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0040&lt;br /&gt;
| SetPriority&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| GetPriority&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| OpenLinkFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C010100&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Directory service=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Dummy1&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C4&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Control&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[FSDir:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030040&lt;br /&gt;
| ?&lt;br /&gt;
| SetPriority&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| ?&lt;br /&gt;
| GetPriority&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Filesystem service &amp;quot;fs:LDR&amp;quot; =&lt;br /&gt;
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.&lt;br /&gt;
&lt;br /&gt;
= ProgramRegistry service &amp;quot;fs:REG&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100C6&lt;br /&gt;
| Dummy1&lt;br /&gt;
|-&lt;br /&gt;
| 0x040103C0&lt;br /&gt;
| [[FSReg:Register|Register]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[FSReg:Unregister|Unregister]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040300C0&lt;br /&gt;
| GetProgramInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040100&lt;br /&gt;
| LoadProgram&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050080&lt;br /&gt;
| UnloadProgram&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060080&lt;br /&gt;
| CheckHostLoadId&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only one session can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] using this.&lt;br /&gt;
&lt;br /&gt;
=SEEDDB=&lt;br /&gt;
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.&lt;br /&gt;
&lt;br /&gt;
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Filesystem_services_PXI]].&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NCSD&amp;diff=12983</id>
		<title>NCSD</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=NCSD&amp;diff=12983"/>
		<updated>2015-08-02T01:23:33Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: time to descend into hell in order to properly document this&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
This page documents the format of NCSD.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
There are two known specialisations of the NCSD container format. The CTR Cart Image (CCI) format and the 3DS&#039; raw [[Flash Filesystem#NAND structure|NAND format]]. CCI is the format of game ROM images.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CTR System Update (CSU)&#039;&#039;&#039; is a variant of CCI, where the only difference is in the file extension. This is used with developer System Updates and associated [[3DS Development Unit Software|Tools]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NCSD images start with a NCSD header, followed by up to a maximum of 8 [[NCCH]] partitions.&lt;br /&gt;
&lt;br /&gt;
For CCI images, the partitions are reserved as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  [[NCCH]] Index&lt;br /&gt;
!  Reserved Use&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Executable Content ([[NCCH#CXI|CXI]])&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| E-Manual ([[NCCH#CFA|CFA]])&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| [[Download Play]] Child container ([[NCCH#CFA|CFA]])&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| New3DS [[System_Update_CFA|Update Data]] ([[NCCH#CFA|CFA]])&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| [[System_Update_CFA|Update Data]] ([[NCCH#CFA|CFA]])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The format of partitions can be determined from the partition FS flags (normally these are zero for CCI/CSU NCSD Images).&lt;br /&gt;
&lt;br /&gt;
== NCSD header ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x000&lt;br /&gt;
|  0x100&lt;br /&gt;
|  RSA-2048 SHA-256 signature of the NCSD header&lt;br /&gt;
|-&lt;br /&gt;
|  0x100&lt;br /&gt;
|  4&lt;br /&gt;
|  Magic Number &#039;NCSD&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  0x104&lt;br /&gt;
|  4&lt;br /&gt;
|  Size of the NCSD image, in media units (1 media unit = 0x200 bytes)&lt;br /&gt;
|-&lt;br /&gt;
|  0x108&lt;br /&gt;
|  8&lt;br /&gt;
|  Media ID&lt;br /&gt;
|-&lt;br /&gt;
|  0x110&lt;br /&gt;
|  8&lt;br /&gt;
|  Partitions FS type (0=None, 1=Normal, 3=FIRM, 4=AGB_FIRM save)&lt;br /&gt;
|-&lt;br /&gt;
|  0x118&lt;br /&gt;
|  8&lt;br /&gt;
|  Partitions crypt type &lt;br /&gt;
|-&lt;br /&gt;
|  0x120&lt;br /&gt;
|  0x40=(4+4)*8&lt;br /&gt;
|  Offset &amp;amp; Length partition table, in media units&lt;br /&gt;
|-&lt;br /&gt;
|  0x160&lt;br /&gt;
|  0xA0&lt;br /&gt;
|  ...&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For carts,&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x160&lt;br /&gt;
|  0x20&lt;br /&gt;
|  Exheader SHA-256 hash&lt;br /&gt;
|-&lt;br /&gt;
|  0x180&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Additional header size&lt;br /&gt;
|-&lt;br /&gt;
|  0x184&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Sector zero offset&lt;br /&gt;
|-&lt;br /&gt;
|  0x188&lt;br /&gt;
|  8&lt;br /&gt;
|  Partition Flags (See Below)&lt;br /&gt;
|-&lt;br /&gt;
|  0x190&lt;br /&gt;
|  0x40=8*8&lt;br /&gt;
|  Partition ID table &lt;br /&gt;
|-&lt;br /&gt;
|  0x1C0&lt;br /&gt;
|  0x30&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0&lt;br /&gt;
| 0xE&lt;br /&gt;
| Reserved?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FE&lt;br /&gt;
| 0x1&lt;br /&gt;
| Support for this was implemented with [[9.6.0-24|9.6.0-X]] FIRM. Bit0=1 enables using bits 1-2, it&#039;s unknown what these two bits are actually used for(the value of these two bits get compared with some other value during NCSD verification/loading). This appears to enable a new, likely hardware-based, antipiracy check on cartridges.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF&lt;br /&gt;
| 0x1&lt;br /&gt;
| Support for this was implemented with [[9.6.0-24|9.6.0-X]] FIRM, see below regarding save crypto.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For NAND,&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x160&lt;br /&gt;
|  0x5E&lt;br /&gt;
|  Unknown&lt;br /&gt;
|-&lt;br /&gt;
|  0x1BE&lt;br /&gt;
|  0x42&lt;br /&gt;
|  Encrypted MBR partition-table, for the TWL partitions(key-data used for this keyslot is console-unique).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Partition Flags ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Byte Index&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Backup Write Wait Time (The time to wait to write save to backup after the card is recognized (0-255 seconds)).NATIVE_FIRM loads this flag from the gamecard NCSD header starting with [[6.0.0-11]].&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Media Card Device (1 = NOR Flash, 2 = None, 3 = BT) (SDK 3.X+)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Media Platform Index (1 = CTR)&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Media Type Index (0 = Inner Device, 1 = Card1, 2 = Card2, 3 = Extended Device)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Media Unit Size i.e. u32 MediaUnitSize = 0x200*2^flags[6];&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Media Card Device (1 = NOR Flash, 2 = None, 3 = BT) (Only SDK 2.X)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Partition Flags (In Terms of Save Crypto Determination) ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Byte Index&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Starting with [[6.0.0-11]] NATIVE_FIRM will use this flag to determine the gamecard [[Savegames|savegame]] keyY method, when flag[3] is set. 0 = [[2.0.0-2]] hashed keyY, 1 = [[Savegames|new]] keyY method implemented with [[6.0.0-11]]. 0x0A = implemented with [[9.3.0-21|9.3.0-X]]. On Old3DS this is identical to the [[2.2.0-4]] crypto. On New3DS this is identical to the [[2.2.0-4]] crypto, except with New3DS-only gamecard savedata [[AES|keyslots]].&lt;br /&gt;
Starting with [[9.6.0-24|9.6.0-X]] FIRM, Process9 now sets &amp;lt;savecrypto_stateval&amp;gt; to partitionflag[1] + &amp;lt;the u8 value from NCSD+0x1FF&amp;gt;, instead of just setting it to partitionflag[1].&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Support for this flag was implemented in NATIVE_FIRM with [[2.0.0-2]]. When this flag is set the hashed gamecard [[Savegames|savegame]] keyY method is used, this likely still uses the repeating-CTR however. With [[6.0.0-11]] the system will determine the gamecard savegame keyY method via flag[1], instead of just using the hashed keyY via this flag.&lt;br /&gt;
|-th&lt;br /&gt;
| 7&lt;br /&gt;
| This flag enables using the hashed gamecard [[Savegames|savegame]] keyY method, support for this flag was implemented in NATIVE_FIRM with [[2.2.0-4]]. All games with the NCSD image finalized since [[2.2.0-4]](and contains [[2.2.0-4]]+ in the system update partition) have this flag set, this flag also enables using new CTR method as well.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Starting with [[9.6.0-24|9.6.0-X]] FIRM, Process9 will just write val0 to a state field then return 0, instead of returning an error when the save crypto type isn&#039;t recognized. This was the *only* actual functionality change in the Old3DS Process9 function for gamecard savedata crypto init.&lt;br /&gt;
&lt;br /&gt;
== Card Info Header ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x200&lt;br /&gt;
|  4&lt;br /&gt;
|  CARD2: Writable Address In Media Units (For &#039;On-Chip&#039; Savedata). CARD1: Always 0xFFFFFFFF.&lt;br /&gt;
|-&lt;br /&gt;
|  0x204&lt;br /&gt;
|  4&lt;br /&gt;
|  Card Info Bitmask&lt;br /&gt;
|-&lt;br /&gt;
|  0x208&lt;br /&gt;
|  0xDF8&lt;br /&gt;
|  Reserved1&lt;br /&gt;
|-&lt;br /&gt;
|  0x1000&lt;br /&gt;
|  8&lt;br /&gt;
|  Media ID (same as first NCCH partitionId)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1008&lt;br /&gt;
|  8&lt;br /&gt;
|  Reserved2&lt;br /&gt;
|-&lt;br /&gt;
|  0x1010&lt;br /&gt;
|  0x30&lt;br /&gt;
|  Initial Data&lt;br /&gt;
|-&lt;br /&gt;
|  0x1040&lt;br /&gt;
|  0xC0&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x1100&lt;br /&gt;
|  0x100&lt;br /&gt;
|  Copy of first NCCH header (excluding RSA signature)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development Card Info Header Extension ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  OFFSET&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x1200&lt;br /&gt;
|  0x200&lt;br /&gt;
|  CardDeviceReserved1&lt;br /&gt;
|-&lt;br /&gt;
|  0x1400&lt;br /&gt;
|  0x10&lt;br /&gt;
|  TitleKey&lt;br /&gt;
|-&lt;br /&gt;
|  0x1410&lt;br /&gt;
|  0xF0&lt;br /&gt;
|  CardDeviceReserved2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/3dshax/ctr/tree/master/ctrtool ctrtool] - (CMD)(Windows/Linux) Parsing NCSD files&lt;br /&gt;
&lt;br /&gt;
[[3DSExplorer]] - (GUI)(Windows Only) Parsing NCSD files&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Hardware&amp;diff=12981</id>
		<title>Hardware</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Hardware&amp;diff=12981"/>
		<updated>2015-08-01T06:12:37Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Specifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists and describes the hardware found inside the Nintendo 3DS. Many of these parts are custom made and are expanded upon here or in other pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common hardware ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ARM11 Processor Core || [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/index.html ARM11 2x MPCore &amp;amp; 2x VFPv2 Co-Processor] 268MHz(~268123480 Hz).&lt;br /&gt;
On New3DS models, there is instead 4x MPCore &amp;amp; 4x VFPv2.&lt;br /&gt;
|-&lt;br /&gt;
| ARM9 Processor Core || [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0201d/index.html ARM946] 134MHz(~134058675 Hz),&lt;br /&gt;
|-&lt;br /&gt;
| GPU || [http://en.wikipedia.org/wiki/PICA200 DMP PICA] 268MHz,&lt;br /&gt;
|-&lt;br /&gt;
| DSP || [https://twitter.com/CEVADSP/status/177172880918986752 CEVA TeakLite]. 134Mhz. 24ch 32728Hz sampling rates.&lt;br /&gt;
|-&lt;br /&gt;
| VRAM || 6 MB within SoC.&lt;br /&gt;
|}&lt;br /&gt;
The above clock-rates were calculated by calling svcGetSystemTick in sets of 5(call it, execute svcSleepThread for 1s, then call it again), then the average of those were calculated. The clock-rate listed above applies for *all* 4 New3DS MPCores.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! 3DS !! 3DSXL !! 2DS !! N3DS !! N3DSXL&lt;br /&gt;
|-&lt;br /&gt;
| SoC || CPU CTR (1048 0H)&lt;br /&gt;
CPU CTR (1214 32)&lt;br /&gt;
|| CPU CTR A (1226 60)&lt;br /&gt;
CPU CTR (1037 21)&lt;br /&gt;
|| CPU CTR B (??) || CPU LGR A (1444 86) || CPU LGR A (1446 17)&lt;br /&gt;
|-&lt;br /&gt;
| FCRAM || [http://www.fujitsu.com/downloads/MICRO/fma/pdf/MB81EDS516545_e511463.pdf 2x64MB Fujitsu MB82M8080-07L] || Fujitsu MB82DBS16641 || Fujitsu MB82DBS1664 || ?? || Fujitsu MB82MK9A9A&lt;br /&gt;
|-&lt;br /&gt;
| Storage || Toshiba THGBM2G3P1FBAI8 1GB || ?? || Toshiba THGBM4G3P1H8BAIR 1GB || Samsung KLM4G1YEQC 4GB (in 1.3GiB SLC mode)&lt;br /&gt;
Toshiba THGBMBG4P1KBAIT 2GB (MLC)&lt;br /&gt;
|| Samsung KLM4G1YEMD-B031 4GB (in 1.3GiB SLC mode)&lt;br /&gt;
Toshiba THGBMBG4P1KBAIT (MLC)&lt;br /&gt;
|-&lt;br /&gt;
| Audio Codec || TI PAIC3010B 0AA37DW || ?? || ?? || TI AIC3010B 39C4ETW  || TI AIC3010D 48C01JW&lt;br /&gt;
|-&lt;br /&gt;
| Gyroscope || [http://dl-web.dropbox.com/u/20520664/references/PS-ITG-3200-00-01.4.pdf Invensense ITG-3270 MEMS Gyroscope] || ?? || ?? || ?? || ??&lt;br /&gt;
|-&lt;br /&gt;
| Accelerometer || ST Micro 2048 33DH X1MAQ Accelerometer Model LIS331DH || ?? || ?? || ?? || ??&lt;br /&gt;
|-&lt;br /&gt;
| Wifi || Atheros AR6014 || ?? || ?? || ?? || Atheros AR6014G-AL1C&lt;br /&gt;
|-&lt;br /&gt;
| Infrared IC || NXP S750 0803 TSD031C || ?? || ?? || ?? || NXP S750 1603 TSD438C&lt;br /&gt;
|-&lt;br /&gt;
| Custom Microcontroller || Renesas UC CTR || ?? || Renesas UC CTR 324KM47 KG10  || Renesas UC KTR || Renesas UC KTR 442KM13 TK14&lt;br /&gt;
|-&lt;br /&gt;
| PMIC? || TI 93045A4 OAAH86W || ?? || ?? || TI 93045A4 38A6TYW G2 || TI 93045A4 49AF3NW G2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [11] Official Documentation&lt;br /&gt;
&lt;br /&gt;
* [5],[10] According to iFixit.com ([http://www.ifixit.com/Teardown/Nintendo-3DS-Teardown/5029/1#s22696 source]):&lt;br /&gt;
&lt;br /&gt;
* Datasheet for memory is for a chip in the same series, it has less memory than the one inside the 3DS (128mbits vs 512mbits).&lt;br /&gt;
&lt;br /&gt;
* There is a trove of data on the FCC website at [https://fjallfoss.fcc.gov/oetcf/eas/reports/ViewExhibitReport.cfm?mode=Exhibits&amp;amp;RequestTimeout=500&amp;amp;calledFromFrame=N&amp;amp;application_id=462292&amp;amp;fcc_id=%27EW4DWMW028%27].&lt;br /&gt;
&lt;br /&gt;
* [12] This IC is somewhat similar to [http://www.alldatasheet.net/datasheet-pdf/pdf/347838/NXP/SC16IS750IBS.html this].&lt;br /&gt;
&lt;br /&gt;
== FCRAM ==&lt;br /&gt;
&lt;br /&gt;
There is one FCRAM (Fast Cycle RAM) IC in the 3DS, produced by Fujitsu and branded as MB82M8080-07L. The Fujitsu MB82M8080-07L chip internally contains 2 dies, where each die is branded MB81EDS516545 and MB82DBS08645.&lt;br /&gt;
&lt;br /&gt;
The MB81EDS516545 die is a CMOS Fast Cycle Random Access Memory (FCRAM) with Low Power Double Data Rate (LPDDR) SDRAM Interface containing 512MBit storage accessible in a 64-bit format. The MB81EDS516545 is suited for consumer applications requiring high data bandwidth with low power consumption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC ==&lt;br /&gt;
&lt;br /&gt;
The 3DS has much of it&#039;s internals housed in a SoC (System on Chip) just like it&#039;s predecessors. This is done to reduce build costs, cut down on power consumption, as well as make the PCB layout less complex and make the system harder to tamper with. The SoC, branded as the Nintendo 1048 0H, contains the CPU, GPU, DSP and VRAM.&lt;br /&gt;
&lt;br /&gt;
According to official documents, the CPU used is a dual-core ARM11 CPU, clocked at 268MHz. One core is dedicated to system software, while the other is used for application programming, each known as the syscore and appcore, respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPU ==&lt;br /&gt;
&lt;br /&gt;
Designed by Digital Media Professionals Inc. (DMP) and codenamed PICA200, 268Mhz.&lt;br /&gt;
&lt;br /&gt;
Block diagram of an ULTRAY2000 based architecture PICA200:&lt;br /&gt;
&lt;br /&gt;
[[File:Pica200BlockDiagram.png]]&lt;br /&gt;
&lt;br /&gt;
PICA200 is compatible with OpenGL ES 1.1. It furthermore provides unique functionality for:&lt;br /&gt;
* Per-fragment lighting (&amp;quot;Lighting Maestro&amp;quot;)&lt;br /&gt;
* Hard- and soft-shadowing (&amp;quot;Shadow Maestro&amp;quot;)&lt;br /&gt;
* Polygon subdivision (&amp;quot;Figure Maestro&amp;quot;)&lt;br /&gt;
* Bump mapping and procedural textures (&amp;quot;Mapping Maestro&amp;quot;)&lt;br /&gt;
* Rendering of gaseous objects (&amp;quot;Particle Maestro&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Some parts of the extended functionality are provided in hardware by an extended geometry pipeline. Most importantly, PICA200 has three programmable vertex processors. There is furthermore a unit called Primitive Engine, which is a geometry shader unit (using the same instruction set as vertex shaders) with support for variable-size primitives. The Primitive Engine functionality may be disabled, and the geometry shader unit then acts as a fourth vertex processor. See [[Shader_Instruction_Set]] for more information on the shader instruction set.&lt;br /&gt;
&lt;br /&gt;
Fragment lighting is implemented as an optional pipeline step during pixel processing. It&#039;s implemented by having the vertex shader output an additional attribute describing the transformation (represented by a quaternion) to surface-local space. This per-vertex quaternion can then be interpolated across screen space to calculate dot products relevant for lighting (e.g. light vector dot normal vector). To provide support for advanced lighting models, these dot products are used as indices into programmable lookup tables. With this setup, PICA200 in particular supports the shading models Blinn-Phong, Cook-Terrance, Ward, and microfacet-based BRDF-models.&lt;br /&gt;
&lt;br /&gt;
== SDIO controller ==&lt;br /&gt;
&lt;br /&gt;
Nintendo recommends SD cards up to 32 GB however the internal SDIO controller seems to support SD cards up to 2.19 Terabyte (32-bit sector number). It&#039;s unknown if it really can handle that much. 128 GB was tested and works fine however it causes a major slowdown of the system especially at boot.&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
=== Front ===&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_Front.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[http://guide-images.ifixit.net/igi/ishJaSCOwLkvbLYK High Resolution]&lt;br /&gt;
&lt;br /&gt;
=== Back ===&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_Back.jpg]]&lt;br /&gt;
&lt;br /&gt;
[http://guide-images.ifixit.net/igi/n1CKAdbPrHyNPNuW High Resolution]&lt;br /&gt;
&lt;br /&gt;
=== NAND pinout ===&lt;br /&gt;
&lt;br /&gt;
NAND dumping has been successful, but the image is encrypted.&lt;br /&gt;
&lt;br /&gt;
==== Normal model ====&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_NAND_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
==== XL model ====&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_NAND_pinout_XL.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
==== 2DS ====&lt;br /&gt;
&lt;br /&gt;
[[Image:2DSeMMC.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
==== New 3DS ====&lt;br /&gt;
&lt;br /&gt;
[[Image:N3DSeMMC.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== New 3DS XL ====&lt;br /&gt;
&lt;br /&gt;
[[Image:N3DSXLeMMC.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== WiFi dongle pinout ===&lt;br /&gt;
[[Image:CTR_WiFiDongle_pinout.png|600px]]&lt;br /&gt;
&lt;br /&gt;
SDIO interface is colored red: &lt;br /&gt;
* CLK&lt;br /&gt;
* CMD&lt;br /&gt;
* D0, D1, D2, D3&lt;br /&gt;
&lt;br /&gt;
This is the interface for the &#039;NEW&#039; WiFi module (based on Atheros AR6002) first included in DSi.&lt;br /&gt;
&lt;br /&gt;
The proprietary and by now ancient DS-mode WiFi is colored yellow, pins are unknown.&lt;br /&gt;
&lt;br /&gt;
I2C eeprom is colored blue:&lt;br /&gt;
* SCL&lt;br /&gt;
* SDA&lt;br /&gt;
&lt;br /&gt;
SPI Flash is colored purple:&lt;br /&gt;
* CLK&lt;br /&gt;
* CS#&lt;br /&gt;
* SI&lt;br /&gt;
* SO&lt;br /&gt;
* WP#&lt;br /&gt;
* NC&lt;br /&gt;
&lt;br /&gt;
=== Auxiliary Microntroller ===&lt;br /&gt;
[[Image:CTR_UC.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Monitors HOME button, WiFi switch, 3D slider, volume control slider.&lt;br /&gt;
Controls LEDs, various power supplies.&lt;br /&gt;
&lt;br /&gt;
Devices attached to I2C bus:&lt;br /&gt;
* UC (master?)&lt;br /&gt;
* Accelerometer (slave address 0x18)&lt;br /&gt;
* SoC (master? slave?)&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=12939</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=12939"/>
		<updated>2015-07-15T14:55:39Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Memory map */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle TWL_FIRM and AGB_FIRM&#039;s ARM7 requirements. This is due to the fact that much of the hardware used by both ARM7 and ARM9 is (evidently) not physically hooked up to ARM11. Thus, ARM11 cannot simply emulate ARM7.&lt;br /&gt;
&lt;br /&gt;
ARM7 has the AGB BIOS implemented in hardware. The BIOS is completely identical to the original AGB BIOS. The system is booted silently by calling SWI 0x1 (RegisterRamReset), followed by jumping to the code that does SWI 0x0 (SoftReset) to finish booting. The boot splash is still in BIOS, however, and can be seen by calling (or replacing one of the previous interrupts with) SWI 0x26 (HardReset).&lt;br /&gt;
= Registers =&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Name&lt;br /&gt;
|  Address&lt;br /&gt;
!  Width&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CNT&lt;br /&gt;
| 0x10018000&lt;br /&gt;
| 0x1 &lt;br /&gt;
|-&lt;br /&gt;
| ARM7_CODE&lt;br /&gt;
| 0x10018080&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?_STATE&lt;br /&gt;
| 0x10018104&lt;br /&gt;
| 0x1&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?&lt;br /&gt;
| 0x10018108&lt;br /&gt;
| 0x2&lt;br /&gt;
|-&lt;br /&gt;
| ARM7_?&lt;br /&gt;
| 0x10018110&lt;br /&gt;
| 0x8?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM7_CNT ==&lt;br /&gt;
This indicates (controls?) the mode of the ARM7. 1 = TWL, 2 = AGB.&lt;br /&gt;
&lt;br /&gt;
== ARM7_CODE ==&lt;br /&gt;
This is the first code that will be run after execution begins. TwlProcess9 uses this to put ARM7 in a loop (TWL), and to set the POSTFLG and branch to more copied code (AGB).This doesn&#039;t seem to start execution by itself.&lt;br /&gt;
&lt;br /&gt;
= Memory map =&lt;br /&gt;
The virtual memory mapping for the ARM7 is the same as for the [[Memory_layout#TWL_FIRM_Userland_Memory|other core]]. However, it has additional internal memory mapped to it. Interestingly enough, much of this memory seems to lie within ARM9&#039;s own &amp;quot;internal memory.&amp;quot;&lt;br /&gt;
*0x08060000 -&amp;gt; 0x03800000, ARM7-WRAM (64KB)&lt;br /&gt;
*0x080B0000 -&amp;gt; 0x03000000, GBA on-chip WRAM (32KB)&lt;br /&gt;
*0x080C0000 -&amp;gt; ? (0x10018104 is set to 1 before changing memory here, and 0 afterwards, save-related?)&lt;br /&gt;
*0x01FFC000 -&amp;gt; 0x01000000, ARM9 ITCM (16KB)&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=12937</id>
		<title>Memory layout</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=12937"/>
		<updated>2015-07-15T13:19:35Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: more aes keys&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ARM11 Physical memory regions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Old 3DS&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x00000000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom (super secret code/data @ 0x8000)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom mirror&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|?&lt;br /&gt;
| [[IO]] memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x17E00000&lt;br /&gt;
| 0x00002000&lt;br /&gt;
| MPCore private memory region&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x17E10000&lt;br /&gt;
| 0x00001000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM (divided in two banks, VRAM and VRAMB)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x00400000&lt;br /&gt;
| [[New_3DS]] additional memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| DSP memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| AXI WRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| FCRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x28000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| [[New_3DS]] FCRAM extension&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom mirror&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=ARM9 Physical memory regions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Old 3DS&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x00000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Instruction TCM, repeating each 0x8000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 0x00008000&lt;br /&gt;
| Instruction TCM (Accessed by the kernel and process by this address)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x07FF8000&lt;br /&gt;
| 0x00008000&lt;br /&gt;
| Instruction TCM (Accessed by bootrom by this address)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| ARM9-only internal memory (ARM7&#039;s internal regions are mapped here as well)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x08100000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| [[New_3DS]] ARM9-only extension, only enabled when a certain [[CONFIG_Registers|CONFIG]] register is set.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| [[IO]] memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM (divided in two banks, VRAM and VRAMB) &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| DSP memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| AXI WRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| FCRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x28000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| [[New_3DS]] FCRAM extension&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0xFFF00000&lt;br /&gt;
| 0x00004000&lt;br /&gt;
| Data TCM (Mapped during bootrom)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom, the main region is at +0x8000, which is disabled during system boot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ARM9 MPU regions==&lt;br /&gt;
For the below instruction permissions: RO = memory is executable, while None = not-executable.&lt;br /&gt;
&lt;br /&gt;
===NATIVE_FIRM/SAFE_MODE_FIRM ARM9 kernel===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Region&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Privileged-mode data permissions&lt;br /&gt;
!  User-mode data permissions&lt;br /&gt;
!  Privileged-mode instruction permissions&lt;br /&gt;
!  User-mode instruction permissions&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 1MB/0x100000. &amp;gt;=[[8.0.0-18|8.0.0-X]]: 2MB/0x200000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 512KB/0x80000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 128MB/0x8000000. &amp;gt;=[[8.0.0-18|8.0.0-X]]: 256MB/0x10000000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| &amp;lt;[[3.0.0-5]]: 64KB/0x10000. &amp;gt;=[[3.0.0-5]]: 32KB/0x8000.&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The above is the MPU region settings setup by the ARM9-kernel in the crt0.&lt;br /&gt;
&lt;br /&gt;
The New3DS ARM9-kernel MPU region settings are the same as the Old3DS MPU region settings for &amp;gt;=[[8.0.0-18|8.0.0-X]].&lt;br /&gt;
&lt;br /&gt;
At the start of the Process9 function executed in kernel-mode via svc7b during firm-launching, it changes some MPU region settings. At the end of that function, before it uses the ARM9/ARM11 entrypoint fields, it disables MPU.&lt;br /&gt;
&lt;br /&gt;
===New3DS [[FIRM|ARM9-loader]]===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Region&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Privileged-mode data permissions&lt;br /&gt;
!  User-mode data permissions&lt;br /&gt;
!  Privileged-mode instruction permissions&lt;br /&gt;
!  User-mode instruction permissions&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 2MB/0x200000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
MPU regions 4-7 are disabled. Note that the entire ARM9-loader runs in SVC-mode.&lt;br /&gt;
&lt;br /&gt;
===TWL_FIRM/AGB_FIRM ARM9 kernel===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Region&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Privileged-mode data permissions&lt;br /&gt;
!  User-mode data permissions&lt;br /&gt;
!  Privileged-mode instruction permissions&lt;br /&gt;
!  User-mode instruction permissions&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 1MB/0x100000. New3DS: 2MB/0x200000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 2MB/0x200000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 512KB/0x80000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 128MB/0x8000000. New3DS: 256MB/0x10000000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| &amp;lt;[[3.0.0-5|3.0.0-X]]: 256KB/0x40000. &amp;gt;=[[3.0.0-5|3.0.0-X]]: 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ARM9 ITCM==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ITCM mirror address&lt;br /&gt;
!  ITCM bootrom mirror address&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| &lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x3700&lt;br /&gt;
| Uninitialized memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB700&lt;br /&gt;
| 0x07FFB700&lt;br /&gt;
| 0x3700&lt;br /&gt;
| 0x100&lt;br /&gt;
| The unprotected ARM9-bootrom code copies code from unprotected bootrom to 0x07FFB700(ITCM mirror) size 0x100, then calls the code at 0x07FFB700. The code located here is the code used for disabling access to the bootroms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB800&lt;br /&gt;
| &lt;br /&gt;
| 0x3800&lt;br /&gt;
| 0x4&lt;br /&gt;
| This is always 0xDEADB00F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB804&lt;br /&gt;
| &lt;br /&gt;
| 0x3804&lt;br /&gt;
| 0x4&lt;br /&gt;
| This is the u32 DeviceId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB808&lt;br /&gt;
| &lt;br /&gt;
| 0x3808&lt;br /&gt;
| 0x10&lt;br /&gt;
| This is the fall-back keyY used for movable.sed keyY when movable.sed doesn&#039;t exist in NAND(the last two words here are used on retail for generating console-unique TWL keydata/etc). This is also used for &amp;quot;LocalFriendCodeSeed&amp;quot;, etc.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB818&lt;br /&gt;
| &lt;br /&gt;
| 0x3818&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB819&lt;br /&gt;
| &lt;br /&gt;
| 0x3819&lt;br /&gt;
| 0x1&lt;br /&gt;
| This is the [[CTCert]] issuer type: 0 = retail &amp;quot;Nintendo CA - G3_NintendoCTR2prod&amp;quot;, non-zero = dev &amp;quot;Nintendo CA - G3_NintendoCTR2dev&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB81A&lt;br /&gt;
| &lt;br /&gt;
| 0x381A&lt;br /&gt;
| 0x6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB820&lt;br /&gt;
| &lt;br /&gt;
| 0x3820&lt;br /&gt;
| 0x4&lt;br /&gt;
| This is the CTCert ECDSA exponent, this is byte-swapped when *((u8*)(0x01FFB800+0x18)) is &amp;gt;=5.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB824&lt;br /&gt;
| &lt;br /&gt;
| 0x3824&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB826&lt;br /&gt;
| &lt;br /&gt;
| 0x3826&lt;br /&gt;
| 0x1E&lt;br /&gt;
| This is the CTCert ECDSA privk.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB844&lt;br /&gt;
| &lt;br /&gt;
| 0x3844&lt;br /&gt;
| 0x3C&lt;br /&gt;
| This is the CTCert ECDSA signature.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB880&lt;br /&gt;
| &lt;br /&gt;
| 0x3880&lt;br /&gt;
| 0x80&lt;br /&gt;
| This is all-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB900&lt;br /&gt;
| &lt;br /&gt;
| 0x3900&lt;br /&gt;
| 0x200&lt;br /&gt;
| This is the 0x200-bytes from NAND sector0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFBB00&lt;br /&gt;
| &lt;br /&gt;
| 0x3B00&lt;br /&gt;
| 0x200&lt;br /&gt;
| This is the 0x200-bytes from the plaintext NAND firm partition FIRM header, read by bootrom.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFBD00&lt;br /&gt;
| &lt;br /&gt;
| 0x3D00&lt;br /&gt;
| 0x200&lt;br /&gt;
| Unknown, not used by [[FIRM]]. Probably RSA related going by the data right after this? These are not console-unique.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFBF00&lt;br /&gt;
| &lt;br /&gt;
| 0x3F00&lt;br /&gt;
| 0x100&lt;br /&gt;
| This is the RSA-2048 modulo for [[RSA_Registers|RSA]]-engine slot2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFC000&lt;br /&gt;
| &lt;br /&gt;
| 0x4000&lt;br /&gt;
| 0x100&lt;br /&gt;
| This is the RSA-2048 modulo for RSA-engine slot3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFC100&lt;br /&gt;
| &lt;br /&gt;
| 0x4100&lt;br /&gt;
| 0x800&lt;br /&gt;
| Unknown, not console-unique.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFC900&lt;br /&gt;
| 0x07FFC900&lt;br /&gt;
| 0x4900&lt;br /&gt;
| 0x400&lt;br /&gt;
| The unprotected ARM9-bootrom copies data to 0x07FFC900(mirror of 0x01FFC900) size 0x400. This data is copied from AXI WRAM, initialized by ARM11-bootrom(the addr used for the src is determined by [[CONFIG_Registers|REG_UNITINFO]]). These are RSA modulus: retailsrcptr = 0x1FFFD000, devsrvptr = 0x1FFFD400.&lt;br /&gt;
* The first 0x100-bytes here is the RSA-2048 modulo for the CFA NCCH header, and for the gamecard NCSD header.&lt;br /&gt;
* 0x01FFCA00 is the RSA-2048 modulo for the CXI accessdesc signature, written to rsaengine keyslot1 by NATIVE_FIRM.&lt;br /&gt;
* 0x01FFCB00 size 0x200 is unknown, probably RSA related, these aren&#039;t used by [[FIRM]](these are not console-unique).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFCD00&lt;br /&gt;
| &lt;br /&gt;
| 0x4D00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Unknown, not used by [[FIRM]]. This isn&#039;t console-unique.&lt;br /&gt;
The first 0x10-bytes are checked by the v6.0/v7.0 NATIVE_FIRM keyinit function, when non-zero it clears this block and continues to do the key generation. Otherwise when this block was already all-zero, it immediately returns.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFCD80&lt;br /&gt;
| &lt;br /&gt;
| 0x4D80&lt;br /&gt;
| 0x64&lt;br /&gt;
| 0x01FFCD84 size 0x10-bytes is the NAND CID(the 0x64-byte region at 0x01FFCD80 is initialized by Process9 + ARM9-bootrom). The u32 at 0x01FFCDC4 is the total number of NAND sectors, read from a MMC command.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFCDE4&lt;br /&gt;
| &lt;br /&gt;
| 0x4DE4&lt;br /&gt;
| 0x21C&lt;br /&gt;
| Uninitialized memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFD000&lt;br /&gt;
| 0x07FFD000&lt;br /&gt;
| 0x5000&lt;br /&gt;
| 0x2470&lt;br /&gt;
| The unprotected ARM9-bootrom copies 0x1FFFA000(AXIWRAM mem initialized by ARM11-bootrom) size 0x2470 to 0x07FFD000(mirror of 0x01FFD000). This block contains DSi keys.&lt;br /&gt;
* 0x01FFD000 is the RSA-1024 modulus for the retail System Menu&lt;br /&gt;
* 0x01FFD080 is the RSA-1024 modulus for DSi Wifi firmware and DSi Sound&lt;br /&gt;
* 0x01FFD100 is the RSA-1024 modulus for base DSi apps (Settings, Shop, etc.)&lt;br /&gt;
* 0x01FFD180 is the RSA-1024 modulus for DSiWare and RSA-signed cartridge headers&lt;br /&gt;
* 0x01FFD210 is the keyY for per-console-encrypted ES blocks&lt;br /&gt;
* 0x01FFD220 is the keyY for fixed-keyX ES blocks&lt;br /&gt;
* 0x01FFD300 is the DSi common (normal)key&lt;br /&gt;
* 0x01FFD350 is a normalkey set on keyslot 0x02, and is likely only used during boot&lt;br /&gt;
* 0x01FFD380 is the keyslot 0x00 keyX and the first half of the retail keyY for modcrypt crypto &amp;quot;Nintendo&amp;quot;&lt;br /&gt;
* 0x01FFD398 is the keyX used for &#039;Tad&#039; crypto, usually in keyslot 0x02 &amp;quot;Nintendo DS&amp;quot;, ..&lt;br /&gt;
* 0x01FFD3A8 is set as the middle two words of keyslot 0x03&#039;s keyX, before being overwritten &amp;quot;NINTENDO&amp;quot;&lt;br /&gt;
* 0x01FFD3BC is the first 3 words of keyslot 0x01&#039;s keyY, see below&lt;br /&gt;
* 0x01FFD3C8 is the fixed keyY used for eMMC partition crypto on retail DSi, see below (keyslot 0x03)&lt;br /&gt;
* 0x01FFD3E0 is the 0x1048-byte Blowfish data for DSi cart crypto&lt;br /&gt;
* 0x01FFE428 is the 0x1048-byte Blowfish data for DS cart crypto&lt;br /&gt;
On the 3DS, keyslots 0x02 and 0x03 have the last word set as 0xE1A00005 instead of the original DSi retail keyYs.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFF470&lt;br /&gt;
| &lt;br /&gt;
| 0x7470&lt;br /&gt;
| 0xB90&lt;br /&gt;
| Uninitialized memory.&lt;br /&gt;
0x01FFFC00 size 0x100-bytes starting with [[9.5.0-22|9.5.0-X]] is the FIRM header used during FIRM-launching.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=[[New_3DS]] physical 0x1F000000 memory=&lt;br /&gt;
This area is used by [[QTM Services]](starting at offset 0x200000, size 0x180000). This area is not accessible to the GPU on the old 3DS. The old 3DS and New 3DS GSP module has vaddr-&amp;gt;physaddr conversion code for this entire region. On the New 3DS, only the first 0x200000-bytes (half of this memory) are accessible to the GPU.&lt;br /&gt;
&lt;br /&gt;
=Memory map by firmware=&lt;br /&gt;
* [[Virtual address mapping FW0B]]&lt;br /&gt;
* [[Virtual address mapping FW1F]]&lt;br /&gt;
* [[Virtual address mapping FW25]]&lt;br /&gt;
* [[Virtual address mapping FW2E]]&lt;br /&gt;
* [[Virtual address mapping FW37]]&lt;br /&gt;
* [[Virtual address mapping FW38‎]]&lt;br /&gt;
* [[Virtual address mapping FW3F]]&lt;br /&gt;
* FW49([[9.6.0-24|9.6.0-X]]) ARM11-kernel vmem mapping is identical to FW40([[9.5.0-22|9.5.0-X]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Virtual address mapping TWLFIRM04]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Virtual address mapping New3DS v8.1]]&lt;br /&gt;
* [[Virtual address mapping New3DS v9.0]]&lt;br /&gt;
* [[Virtual address mapping New3DS v9.2]]&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed physical memory map=&lt;br /&gt;
 18000000 - 18600000: VRAM&lt;br /&gt;
 &lt;br /&gt;
 1FF80000 - 1FFAB000: Kernel code&lt;br /&gt;
 1FFAB000 - 1FFF0000: SlabHeap [temporarily contains boot processes]&lt;br /&gt;
 1FFF0000 - 1FFF1000: ?&lt;br /&gt;
 1FFF1000 - 1FFF2000: ?&lt;br /&gt;
 1FFF2000 - 1FFF3000: ?&lt;br /&gt;
 1FFF3000 - 1FFF4000: ?&lt;br /&gt;
 1FFF4000 - 1FFF5000: Exception vectors&lt;br /&gt;
 1FFF5000 - 1FFF5800: Unused?&lt;br /&gt;
 1FFF5800 - 1FFF5C00: 256-entry L2 MMU table for VA FF4xx000&lt;br /&gt;
 1FFF5C00 - 1FFF6000: 256-entry L2 MMU table for VA FF5xx000&lt;br /&gt;
 1FFF6000 - 1FFF6400: 256-entry L2 MMU table for VA FF6xx000&lt;br /&gt;
 1FFF6400 - 1FFF6800: 256-entry L2 MMU table for VA FF7xx000&lt;br /&gt;
 1FFF6800 - 1FFF6C00: 256-entry L2 MMU table for VA FF8xx000&lt;br /&gt;
 1FFF6C00 - 1FFF7000: 256-entry L2 MMU table for VA FF9xx000&lt;br /&gt;
 1FFF7000 - 1FFF7400: 256-entry L2 MMU table for VA FFAxx000&lt;br /&gt;
 1FFF7400 - 1FFF7800: 256-entry L2 MMU table for VA FFBxx000&lt;br /&gt;
 1FFF7800 - 1FFF7C00: MMU table but unused?&lt;br /&gt;
 1FFF7C00 - 1FFF8000: 256-entry L2 MMU table for VA FFFxx000 &lt;br /&gt;
 1FFF8000 - 1FFFC000: 4096-entry L1 MMU table for VA xxx00000 (CPU 0)&lt;br /&gt;
 1FFFC000 - 20000000: 4096-entry L1 MMU table for VA xxx00000 (CPU 1)&lt;br /&gt;
 20000000 - 28000000: Main memory&lt;br /&gt;
&lt;br /&gt;
The entire FCRAM is cleared during NATIVE_FIRM boot. This is probably done by the ARM11 kernel(after loading [[FIRM]] launch parameters from FCRAM)?&lt;br /&gt;
&lt;br /&gt;
== FCRAM memory-regions layout ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  [[Configuration_Memory#APPMEMTYPE|Configmem-APPMEMTYPE]] Value&lt;br /&gt;
!  Base address relative to FCRAM+0, for APPLICATION mem-region&lt;br /&gt;
!  Region size, for APPLICATION mem-region&lt;br /&gt;
!  Base address relative to FCRAM+0, for SYSTEM mem-region&lt;br /&gt;
!  Region size, for SYSTEM mem-region&lt;br /&gt;
!  Base address relative to FCRAM+0, for BASE mem-region&lt;br /&gt;
!  Region size, for BASE mem-region&lt;br /&gt;
|-&lt;br /&gt;
| 0 (default with regular 3DS kernel, used when the type is not 2-5)&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x04000000(64MB)&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| 0x02C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x06000000(96MB)&lt;br /&gt;
| 0x06000000&lt;br /&gt;
| 0x00C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x05000000(80MB)&lt;br /&gt;
| 0x05000000&lt;br /&gt;
| 0x01C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x04800000(72MB)&lt;br /&gt;
| 0x04800000&lt;br /&gt;
| 0x02400000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x02000000(32MB)&lt;br /&gt;
| 0x02000000&lt;br /&gt;
| 0x04C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 6 (This is the default on New3DS. With [[New_3DS]] kernel this is the type used when the value is not 7)&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x07C00000(124MB)&lt;br /&gt;
| 0x07C00000&lt;br /&gt;
| 0x06400000&lt;br /&gt;
| 0x0E000000&lt;br /&gt;
| 0x02000000&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x0B200000(178MB)&lt;br /&gt;
| 0x0B200000&lt;br /&gt;
| 0x02E00000&lt;br /&gt;
| 0x0E000000&lt;br /&gt;
| 0x02000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The SYSTEM mem-region size is calculated with: size = FCRAMTOTALSIZE - (APPLICATION_MEMREGIONSIZE + BASE_MEMREGIONSIZE).&lt;br /&gt;
&lt;br /&gt;
Support for type6/7 was [[NCCH/Extended Header|implemented]] in [[NS]] with [[8.0.0-18]], these are only supported in the [[New_3DS]] ARM11-kernel not the regular 3DS kernel. These two types are the only ones supported by the New3DS kernel.&lt;br /&gt;
&lt;br /&gt;
All memory allocated by the kernel itself for kernel use is located under BASE. Most system-modules run under the BASE memregion too.&lt;br /&gt;
&lt;br /&gt;
Free/used memory on [[4.5.0-10]] with Home Menu / Internet Browser, with the default APPMEMTYPE on retail:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Region&lt;br /&gt;
!  Base address relative to FCRAM+0&lt;br /&gt;
!  Region size&lt;br /&gt;
!  Used memory once [[Home Menu]] finishes loading for system boot, on [[4.5.0-10]]&lt;br /&gt;
!  Used memory with [[Internet Browser]] running instead of [[Home Menu]], on [[4.5.0-10]]&lt;br /&gt;
!  Free memory once [[Home Menu]] finishes loading for system boot, on [[4.5.0-10]]&lt;br /&gt;
!  Free memory with [[Internet Browser]] running instead of [[Home Menu]], on [[4.5.0-10]]&lt;br /&gt;
|-&lt;br /&gt;
| APPLICATION&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| 0x0&lt;br /&gt;
| &lt;br /&gt;
| 0x04000000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SYSTEM&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| 0x02C00000&lt;br /&gt;
| 0x01488000&lt;br /&gt;
| 0x02A50000&lt;br /&gt;
| 0x01778000&lt;br /&gt;
| 0x001B0000&lt;br /&gt;
|-&lt;br /&gt;
| BASE&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
| 0x01202000&lt;br /&gt;
| 0x01236000&lt;br /&gt;
| 0x001FE000&lt;br /&gt;
| 0x001CA000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed virtual memory map=&lt;br /&gt;
(valid only for FW0B, see [[#Memory map by firmware|Memory map by firmware]] for subsequent versions)&lt;br /&gt;
&lt;br /&gt;
 E8000000 - E8600000: mapped VRAM (18000000 - 18600000)&lt;br /&gt;
 &lt;br /&gt;
 EFF00000 - F0000000: mapped Internal memory (1FF00000 - 20000000)&lt;br /&gt;
 F0000000 - F8000000: mapped Main memory&lt;br /&gt;
 &lt;br /&gt;
 FF401000 - FF402000: mapped ? (27FC7000 - 27FC8000)&lt;br /&gt;
 &lt;br /&gt;
 FF403000 - FF404000: mapped ? (27FC2000 - 27FC3000)&lt;br /&gt;
 &lt;br /&gt;
 FF405000 - FF406000: mapped ? (27FBB000 - 27FBC000)&lt;br /&gt;
 &lt;br /&gt;
 FF407000 - FF408000: mapped ? (27FB3000 - 27FB4000)&lt;br /&gt;
 &lt;br /&gt;
 FF409000 - FF40A000: mapped ? (27F8E000 - 27F8F000)&lt;br /&gt;
 &lt;br /&gt;
 FFF00000 - FFF45000: mapped SlabHeap &lt;br /&gt;
 &lt;br /&gt;
 FFF60000 - FFF8B000: mapped Kernel code&lt;br /&gt;
 &lt;br /&gt;
 FFFCC000 - FFFCD000: mapped IO [[I2C|I2C]] second bus (10144000 - 10145000)&lt;br /&gt;
 &lt;br /&gt;
 FFFCE000 - FFFCF000: mapped IO PDC([[LCD]]) (10400000 - 10401000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD0000 - FFFD1000: mapped IO PDN (10141000 - 10142000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD2000 - FFFD3000: mapped IO PXI (10163000 - 10164000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD4000 - FFFD5000: mapped IO PAD (10146000 - 10147000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD6000 - FFFD7000: mapped IO LCD (10202000 - 10203000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD8000 - FFFD9000: mapped IO DSP (10140000 - 10141000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDA000 - FFFDB000: mapped IO XDMA (10200000 - 10201000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDC000 - FFFE0000: mapped ? (1FFF8000 - 1FFFC000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE1000 - FFFE2000: mapped ? (1FFF0000 - 1FFF1000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE3000 - FFFE4000: mapped ? (1FFF2000 - 1FFF3000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE5000 - FFFE9000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFEA000 - FFFEB000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEC000 - FFFED000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEE000 - FFFF0000: mapped IO IRQ (17E00000 - 17E02000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF0000 - FFFF1000: mapped Exception vectors&lt;br /&gt;
 &lt;br /&gt;
 FFFF2000 - FFFF6000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFF7000 - FFFF8000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF9000 - FFFFA000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFFB000 - FFFFE000: mapped L2 MMU tables (1FFF5000 - 1FFF8000)&lt;br /&gt;
&lt;br /&gt;
==0xFF4XX000==&lt;br /&gt;
Each [[KThread|thread]] is allocated a 0x1000-byte page in this region: the first page at 0xFF401000 is for the first created thread, 0xFF403000 for the second thread. This region is used to store the SVC-mode stack for the thread, and thread context data used for context switching. When the IRQ handler, prefetch/data abort handlers, and undefined instruction handler are entered where the SPSR-mode=user, these handlers then store LR+SPSR for the current mode on the SVC-mode stack, then these handlers switch to SVC-mode.&lt;br /&gt;
&lt;br /&gt;
This page does not contain a dedicated block for storing R0-PC(etc). For user-mode, the user-mode regs are instead saved on the SVC-mode stack when IRQs such as timers for context switching are triggered.&lt;br /&gt;
&lt;br /&gt;
Structure of this page, relative to page_endaddr-0xC8:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| &lt;br /&gt;
| SVC-mode stack-top. The 0x10-byte SVC-access-control for this thread is also located here, which is checked by the SVC-handler.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x28&lt;br /&gt;
| SVC-mode saved registers, stored/loaded during context switches: R4-R9, SL, FP, SP, LR. After loading these registers, the context switch code will jump to the loaded LR.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0&lt;br /&gt;
| 4&lt;br /&gt;
| fpexc from vmrs, used during context switches with the above saved registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For NATIVE_FIRM the memory pages for this region are located in FCRAM, however for TWL_FIRM these are located in AXI WRAM. For TWL_FIRM v6704 the first thread&#039;s page for this region is located at physical address 0x1FF93000, the next one at 0x1FF92000, etc.&lt;br /&gt;
&lt;br /&gt;
=ARM11 User-land memory regions=&lt;br /&gt;
==NATIVE_FIRM/SAFE_MODE_FIRM Userland Memory==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Virtual Address Base&lt;br /&gt;
!  Physical Address Base&lt;br /&gt;
!  Region Max Size&lt;br /&gt;
!  Address-range available for svcMapMemoryBlock&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000 / 0x14000000&lt;br /&gt;
| &lt;br /&gt;
| 0x03F00000&lt;br /&gt;
| No&lt;br /&gt;
| The [[ExeFS]]:/.code is loaded here, executables must be loaded to the 0x00100000 region when the exheader &amp;quot;special memory&amp;quot; flag is clear. The 0x03F00000-byte size restriction only applies when this flag is clear. Executables are usually loaded to 0x14000000 when the exheader &amp;quot;special memory&amp;quot; flag is set, however this address can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Used for mapping buffers during IPC, see [[IPC Command Structure]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Main stack physaddr - &amp;lt;heap size for the allocated vaddr 0x08000000 memory&amp;gt;&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Yes&lt;br /&gt;
| Heap mapped by [[SVC|ControlMemory]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000-StackSize&lt;br /&gt;
| .bss physical address - total stack pages&lt;br /&gt;
| StackSize from process exheader&lt;br /&gt;
| &lt;br /&gt;
| Stack for the main-thread, initialized by the ARM11 kernel. The StackSize from the exheader is usually 0x4000, therefore the stack-bottom is usually 0x0FFFC000. The stack for the other threads is normally located in the process .data section however this can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| &lt;br /&gt;
| 0x04000000&lt;br /&gt;
| Yes&lt;br /&gt;
| [[SVC|Shared]] memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x14000000&lt;br /&gt;
| FCRAM+0&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| No&lt;br /&gt;
| Can be mapped by [[SVC|ControlMemory]], this is used for processes&#039; [[SVC|LINEAR]]/GSP heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E800000&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x00400000&lt;br /&gt;
| No&lt;br /&gt;
| [[New_3DS]] additional memory, access to this is specified by the exheader. Added with [[8.0.0-18]], see above section regarding this memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EC00000&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 0x01000000&lt;br /&gt;
| No&lt;br /&gt;
| [[IO]] registers, the mapped IO pages which each process can access is specified in the [[NCCH#CXI|CXI]] exheader.(Applications normally don&#039;t have access to registers in this range)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| No&lt;br /&gt;
| VRAM, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| No&lt;br /&gt;
| DSP memory, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| FCRAM memory page allocated by the ARM11 kernel.&lt;br /&gt;
| 0x1000&lt;br /&gt;
| No&lt;br /&gt;
| [[Configuration Memory]], all processes have read-only access to this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF81000&lt;br /&gt;
| FCRAM memory page allocated by the ARM11 kernel.&lt;br /&gt;
| 0x1000&lt;br /&gt;
| No&lt;br /&gt;
| [[Configuration Memory|Shared]] page, all processes have read-access to this. Write access to this is specified by the exheader &amp;quot;Shared page writing&amp;quot; kernel flag.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF82000&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| [[Thread Local Storage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x30000000&lt;br /&gt;
| FCRAM+0&lt;br /&gt;
| 0x08000000(Old3DS) / 0x10000000([[New_3DS]])&lt;br /&gt;
| No&lt;br /&gt;
| This LINEAR memory mapping was added with [[8.0.0-18]], see [[SVC#enum_MemoryOperation|here]]. This replaces the original 0x14000000 mapping, for system(memory-region=BASE)/newer titles. The Old3DS kernel uses size 0x08000000 for LINEAR-memory address range checks, while the New3DS kernel uses size 0x10000000 for those range checks. Old3DS/New3DS system-module code doing vaddr-&amp;gt;phys-addr conversion uses size 0x10000000.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20000000 / 0x40000000&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| This is the end-address of userland memory, memory under this address is process-unique. Memory starting at this address is only accessible in privileged-mode. This address was changed from 0x20000000 to 0x40000000 with [[8.0.0-18]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All executable pages are read-only, and data pages have the execute-never permission set. Normally .text from the loaded ExeFS:/.code is the only mapped executable memory. Executable [[RO Services|CROs]] can be loaded into memory, once loaded the CRO .text section memory page permissions are changed via [[SVC|ControlProcessMemory]] from RW- to R-X. The address and size of each ExeFS:/.code section is stored in the exheader, the permissions for each section is: .text R-X, .rodata R--, .data RW-, and .bss RW-. The loaded .code is mapped to the addresses specified in the exheader by the ARM11 kernel. The stack permissions is initialized by the ARM11 kernel: RW-. The heap permissions is normally RW-.&lt;br /&gt;
&lt;br /&gt;
All userland memory is mapped with RW permissions for privileged-mode. However, normally the ARM11 kernel only uses userland read/write instructions(or checks that the memory can be written from userland first) for accessing memory specified by [[SVC|SVCs]].&lt;br /&gt;
&lt;br /&gt;
Processes can&#039;t directly access memory for other processes. When service [[Services API|commands]] are used, the kernel maps memory in the destination process for input/output buffers, where the addresses in the command received by the process is replaced by this mapped memory. When this is an input buffer, the buffer data is copied to the mapped memory. When this is an output buffer, the data stored in the mapped memory is copied to the destination buffer specified in the command.&lt;br /&gt;
&lt;br /&gt;
The physical address which memory for the application memory-type is mapped to begins at FCRAM+0, the total memory allocated for this memory-type is stored in [[Configuration_Memory]]. Applications&#039; .text + .rodata + .data under the application memory-type is mapped at FCRAM + APPMEMALLOC - (aligned page-size for .text + .rodata + .data). The application .bss is mapped at CODEADDR - .bss size aligned down to the page size.&lt;br /&gt;
&lt;br /&gt;
==TWL_FIRM Userland Memory==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Virtual Address Base&lt;br /&gt;
!  Physical Address Base&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| 0x1FFAB000 (with newer TWL_FIRM such as v6704 this is located at 0x1FFAC000)&lt;br /&gt;
| 0x00055000&lt;br /&gt;
| Code + .(ro)data copied from the process 0x00300000 region is located here(.bss is located here as well).&lt;br /&gt;
|-&lt;br /&gt;
| 0x00155000&lt;br /&gt;
| 0x18555000&lt;br /&gt;
| 0x000AB000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x00200000&lt;br /&gt;
| 0x18500000&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x00300000&lt;br /&gt;
| 0x24000000&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| The beginning of the ARM11 process .text is located here.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x07E00000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1EC00000&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 0x00400000&lt;br /&gt;
| [[IO]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| This is mapped to the DSP memory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The above regions are mapped by the ARM11 kernel. Later when the ARM11 process uses [[SVC|svcKernelSetState]] with type4, the kernel unmaps(?) the following regions: 0x00300000..0x04300000, 0x08000000..0x0FE00000, and 0x10000000..0xF8000000.&lt;br /&gt;
&lt;br /&gt;
=== Detailed TWL_FIRM ARM11 Memory ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Process Virtual Address&lt;br /&gt;
!  Physical Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x01000000*4&lt;br /&gt;
| DS(i) 0x02000000 RAM. Vaddr = (DSRAMOffset*4) + 0x08000000, where DSRAMOffset is DSRAMAddr-0x02000000.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0FC00000&lt;br /&gt;
| 0x27C00000&lt;br /&gt;
| &lt;br /&gt;
| Loaded SRL binary, initially the dev DSi launcher SRL is located here(copied here by the ARM11 process).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0FD00000&lt;br /&gt;
| 0x27D00000&lt;br /&gt;
| &lt;br /&gt;
| The data located here is copied to here by the ARM11 process. The data located here is a TWL NAND [http://dsibrew.org/wiki/Bootloader bootloader] image, using the same format+encryption/verification methods as the DSi NAND bootloader(stage2). The keyX for this bootloader keyslot is initially set to the retail DSi key-data, however when TWL_FIRM is launched this keyX key-data is replaced with a separate keyX. TWL_FIRM can use either the retail DSi bootloader RSA-1024 modulo, or a seperate modulo: normally only the latter is used(the former is only used when loading the image from FS instead of FCRAM). When using the image from FCRAM(default code-path), TWL_FIRM will not calculate+check the hashes for the bootloader code binaries(this is done when loading from FS however).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0FDF7000&lt;br /&gt;
| 0x27DF7000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| SRL header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System memory details  =&lt;br /&gt;
 0xFFFF9000 Pointer to the current KThread instance&lt;br /&gt;
 0xFFFF9004 Pointer to the current KProcess instance&lt;br /&gt;
 0xFFFF9008 Pointer to the current KScheduler instance&lt;br /&gt;
 0xFFFF9010 Pointer to the last KThread to encounter an exception&lt;br /&gt;
&lt;br /&gt;
 0x8000040 Pointer to the current KThread instance on the ARM9&lt;br /&gt;
 0x8000044 Pointer to the current KProcess instance on the ARM9&lt;br /&gt;
 0x8000048 Pointer to the current KScheduler instance on the ARM9&lt;br /&gt;
&lt;br /&gt;
= Handles =&lt;br /&gt;
 The handle 0xFFFF8001 is a reference to the current KProcess.&lt;br /&gt;
 The handle 0xFFFF8000 is a reference to the current KThread.&lt;br /&gt;
&lt;br /&gt;
= IO Process/Kernel virtual addressing equivalence = &lt;br /&gt;
It seems an IO register&#039;s process virtual address can be calculated by adding 0xEB00000 to its physical address.&lt;br /&gt;
&lt;br /&gt;
= VRAM Map While Running System Applets =&lt;br /&gt;
*0x1E6000-0x22C500 -- top screen 3D left framebuffer 0(240x400x3) (The &amp;quot;3D right first-framebuf&amp;quot; addr stored in the LCD register is set to this, when the 3D is set to &amp;quot;off&amp;quot;)&lt;br /&gt;
*0x22C800-0x272D00 -- top screen 3D left framebuffer 1(240x400x3)&lt;br /&gt;
*0x273000-0x2B9500 -- top screen 3D right framebuffer 0(240x400x3)&lt;br /&gt;
*0x2B9800-0x2FFD00 -- top screen 3D right framebuffer 1(240x400x3)&lt;br /&gt;
*0x48F000-0x4C7400 -- bottom screen framebuffer 0(240x320x3)&lt;br /&gt;
*0x4C7800-0x4FF800 -- bottom screen framebuffer 1(240x320x3)&lt;br /&gt;
&lt;br /&gt;
These LCD framebuffer addresses are not changed by the system when launching regular applications, the application itself handles that if needed. These VRAM framebuffers are cleared when launching regular applications.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=OTP_Registers&amp;diff=12930</id>
		<title>OTP Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=OTP_Registers&amp;diff=12930"/>
		<updated>2015-07-14T13:09:43Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Keys seem to be stored here? Access to this region is disabled once the ARM9 writes 0x2 to [[CONFIG|REG_SYSPROT9]].&lt;br /&gt;
&lt;br /&gt;
Originally the console-unique TWL keyinit + region disable was done by Kernel9. However, with the [[New_3DS]] FIRM ARM9 binary this is now done in the [[FIRM]] ARM9 binary loader, which also uses the 0x10012000 region for key generation.&lt;br /&gt;
&lt;br /&gt;
On development units ([[CONFIG|UNITINFO]]!=0) ARM9 uses the first 8-bytes from 0x10012000 for the TWL Console ID. This region doesn&#039;t seem to be used by NATIVE_FIRM on retail at all, besides New3DS key-generation in the [[FIRM|ARM9-loader]]. It is unknown if bootrom reads from it, but it is likely.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| Console-unique data. This data appears appears to be random, even when multiple consoles&#039; dumps from this area are XORed. None of the raw data here seems to match any of the console-unique keys (tested: keyX, keyY and normal-key, both big and little u32 endianness for all keyslots) for the AES engine. It&#039;s unknown whether there&#039;s any encryption on this area.&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 0x8&lt;br /&gt;
| Before writing REG_SYSPROT9 bit1, the ARM9 copies the 8-byte TWL Console ID here. This sets the registers at 0x4004D00 for ARM7.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=12929</id>
		<title>Memory layout</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=12929"/>
		<updated>2015-07-14T13:04:17Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* ARM9 ITCM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ARM11 Physical memory regions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Old 3DS&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x00000000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom (super secret code/data @ 0x8000)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom mirror&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|?&lt;br /&gt;
| [[IO]] memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x17E00000&lt;br /&gt;
| 0x00002000&lt;br /&gt;
| MPCore private memory region&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x17E10000&lt;br /&gt;
| 0x00001000&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM (divided in two banks, VRAM and VRAMB)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x00400000&lt;br /&gt;
| [[New_3DS]] additional memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| DSP memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| AXI WRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| FCRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x28000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| [[New_3DS]] FCRAM extension&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom mirror&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=ARM9 Physical memory regions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Old 3DS&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x00000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Instruction TCM, repeating each 0x8000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 0x00008000&lt;br /&gt;
| Instruction TCM (Accessed by the kernel and process by this address)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x07FF8000&lt;br /&gt;
| 0x00008000&lt;br /&gt;
| Instruction TCM (Accessed by bootrom by this address)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| ARM9-only internal memory (ARM7&#039;s internal regions are mapped here as well)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x08100000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| [[New_3DS]] ARM9-only extension, only enabled when a certain [[CONFIG_Registers|CONFIG]] register is set.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| [[IO]] memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM (divided in two banks, VRAM and VRAMB) &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| DSP memory&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| AXI WRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| FCRAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 0x28000000&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| [[New_3DS]] FCRAM extension&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0xFFF00000&lt;br /&gt;
| 0x00004000&lt;br /&gt;
| Data TCM (Mapped during bootrom)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 0x00010000&lt;br /&gt;
| Bootrom, the main region is at +0x8000, which is disabled during system boot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ARM9 MPU regions==&lt;br /&gt;
For the below instruction permissions: RO = memory is executable, while None = not-executable.&lt;br /&gt;
&lt;br /&gt;
===NATIVE_FIRM/SAFE_MODE_FIRM ARM9 kernel===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Region&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Privileged-mode data permissions&lt;br /&gt;
!  User-mode data permissions&lt;br /&gt;
!  Privileged-mode instruction permissions&lt;br /&gt;
!  User-mode instruction permissions&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 1MB/0x100000. &amp;gt;=[[8.0.0-18|8.0.0-X]]: 2MB/0x200000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 512KB/0x80000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 128MB/0x8000000. &amp;gt;=[[8.0.0-18|8.0.0-X]]: 256MB/0x10000000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x08020000&lt;br /&gt;
| &amp;lt;[[3.0.0-5]]: 64KB/0x10000. &amp;gt;=[[3.0.0-5]]: 32KB/0x8000.&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The above is the MPU region settings setup by the ARM9-kernel in the crt0.&lt;br /&gt;
&lt;br /&gt;
The New3DS ARM9-kernel MPU region settings are the same as the Old3DS MPU region settings for &amp;gt;=[[8.0.0-18|8.0.0-X]].&lt;br /&gt;
&lt;br /&gt;
At the start of the Process9 function executed in kernel-mode via svc7b during firm-launching, it changes some MPU region settings. At the end of that function, before it uses the ARM9/ARM11 entrypoint fields, it disables MPU.&lt;br /&gt;
&lt;br /&gt;
===New3DS [[FIRM|ARM9-loader]]===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Region&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Privileged-mode data permissions&lt;br /&gt;
!  User-mode data permissions&lt;br /&gt;
!  Privileged-mode instruction permissions&lt;br /&gt;
!  User-mode instruction permissions&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 2MB/0x200000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
MPU regions 4-7 are disabled. Note that the entire ARM9-loader runs in SVC-mode.&lt;br /&gt;
&lt;br /&gt;
===TWL_FIRM/AGB_FIRM ARM9 kernel===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Region&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Privileged-mode data permissions&lt;br /&gt;
!  User-mode data permissions&lt;br /&gt;
!  Privileged-mode instruction permissions&lt;br /&gt;
!  User-mode instruction permissions&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xFFFF0000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| 32KB/0x8000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 1MB/0x100000. New3DS: 2MB/0x200000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| 2MB/0x200000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 512KB/0x80000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 128MB/0x8000000. New3DS: 256MB/0x10000000.&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| &amp;lt;[[3.0.0-5|3.0.0-X]]: 256KB/0x40000. &amp;gt;=[[3.0.0-5|3.0.0-X]]: 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| None&lt;br /&gt;
| RO&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| 128KB/0x20000&lt;br /&gt;
| RW&lt;br /&gt;
| RW&lt;br /&gt;
| RO&lt;br /&gt;
| RO&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ARM9 ITCM==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ITCM mirror address&lt;br /&gt;
!  ITCM bootrom mirror address&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FF8000&lt;br /&gt;
| &lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x3700&lt;br /&gt;
| Uninitialized memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB700&lt;br /&gt;
| 0x07FFB700&lt;br /&gt;
| 0x3700&lt;br /&gt;
| 0x100&lt;br /&gt;
| The unprotected ARM9-bootrom code copies code from unprotected bootrom to 0x07FFB700(ITCM mirror) size 0x100, then calls the code at 0x07FFB700. The code located here is the code used for disabling access to the bootroms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB800&lt;br /&gt;
| &lt;br /&gt;
| 0x3800&lt;br /&gt;
| 0x4&lt;br /&gt;
| This is always 0xDEADB00F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB804&lt;br /&gt;
| &lt;br /&gt;
| 0x3804&lt;br /&gt;
| 0x4&lt;br /&gt;
| This is the u32 DeviceId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB808&lt;br /&gt;
| &lt;br /&gt;
| 0x3808&lt;br /&gt;
| 0x10&lt;br /&gt;
| This is the fall-back keyY used for movable.sed keyY when movable.sed doesn&#039;t exist in NAND(the last two words here are used on retail for generating console-unique TWL keydata/etc). This is also used for &amp;quot;LocalFriendCodeSeed&amp;quot;, etc.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB818&lt;br /&gt;
| &lt;br /&gt;
| 0x3818&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB819&lt;br /&gt;
| &lt;br /&gt;
| 0x3819&lt;br /&gt;
| 0x1&lt;br /&gt;
| This is the [[CTCert]] issuer type: 0 = retail &amp;quot;Nintendo CA - G3_NintendoCTR2prod&amp;quot;, non-zero = dev &amp;quot;Nintendo CA - G3_NintendoCTR2dev&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB81A&lt;br /&gt;
| &lt;br /&gt;
| 0x381A&lt;br /&gt;
| 0x6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB820&lt;br /&gt;
| &lt;br /&gt;
| 0x3820&lt;br /&gt;
| 0x4&lt;br /&gt;
| This is the CTCert ECDSA exponent, this is byte-swapped when *((u8*)(0x01FFB800+0x18)) is &amp;gt;=5.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB824&lt;br /&gt;
| &lt;br /&gt;
| 0x3824&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB826&lt;br /&gt;
| &lt;br /&gt;
| 0x3826&lt;br /&gt;
| 0x1E&lt;br /&gt;
| This is the CTCert ECDSA privk.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB844&lt;br /&gt;
| &lt;br /&gt;
| 0x3844&lt;br /&gt;
| 0x3C&lt;br /&gt;
| This is the CTCert ECDSA signature.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB880&lt;br /&gt;
| &lt;br /&gt;
| 0x3880&lt;br /&gt;
| 0x80&lt;br /&gt;
| This is all-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFB900&lt;br /&gt;
| &lt;br /&gt;
| 0x3900&lt;br /&gt;
| 0x200&lt;br /&gt;
| This is the 0x200-bytes from NAND sector0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFBB00&lt;br /&gt;
| &lt;br /&gt;
| 0x3B00&lt;br /&gt;
| 0x200&lt;br /&gt;
| This is the 0x200-bytes from the plaintext NAND firm partition FIRM header, read by bootrom.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFBD00&lt;br /&gt;
| &lt;br /&gt;
| 0x3D00&lt;br /&gt;
| 0x200&lt;br /&gt;
| Unknown, not used by [[FIRM]]. Probably RSA related going by the data right after this? These are not console-unique.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFBF00&lt;br /&gt;
| &lt;br /&gt;
| 0x3F00&lt;br /&gt;
| 0x100&lt;br /&gt;
| This is the RSA-2048 modulo for [[RSA_Registers|RSA]]-engine slot2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFC000&lt;br /&gt;
| &lt;br /&gt;
| 0x4000&lt;br /&gt;
| 0x100&lt;br /&gt;
| This is the RSA-2048 modulo for RSA-engine slot3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFC100&lt;br /&gt;
| &lt;br /&gt;
| 0x4100&lt;br /&gt;
| 0x800&lt;br /&gt;
| Unknown, not console-unique.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFC900&lt;br /&gt;
| 0x07FFC900&lt;br /&gt;
| 0x4900&lt;br /&gt;
| 0x400&lt;br /&gt;
| The unprotected ARM9-bootrom copies data to 0x07FFC900(mirror of 0x01FFC900) size 0x400. This data is copied from AXI WRAM, initialized by ARM11-bootrom(the addr used for the src is determined by [[CONFIG_Registers|REG_UNITINFO]]). These are RSA modulus: retailsrcptr = 0x1FFFD000, devsrvptr = 0x1FFFD400.&lt;br /&gt;
* The first 0x100-bytes here is the RSA-2048 modulo for the CFA NCCH header, and for the gamecard NCSD header.&lt;br /&gt;
* 0x01FFCA00 is the RSA-2048 modulo for the CXI accessdesc signature, written to rsaengine keyslot1 by NATIVE_FIRM.&lt;br /&gt;
* 0x01FFCB00 size 0x200 is unknown, probably RSA related, these aren&#039;t used by [[FIRM]](these are not console-unique).&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFCD00&lt;br /&gt;
| &lt;br /&gt;
| 0x4D00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Unknown, not used by [[FIRM]]. This isn&#039;t console-unique.&lt;br /&gt;
The first 0x10-bytes are checked by the v6.0/v7.0 NATIVE_FIRM keyinit function, when non-zero it clears this block and continues to do the key generation. Otherwise when this block was already all-zero, it immediately returns.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFCD80&lt;br /&gt;
| &lt;br /&gt;
| 0x4D80&lt;br /&gt;
| 0x64&lt;br /&gt;
| 0x01FFCD84 size 0x10-bytes is the NAND CID(the 0x64-byte region at 0x01FFCD80 is initialized by Process9 + ARM9-bootrom). The u32 at 0x01FFCDC4 is the total number of NAND sectors, read from a MMC command.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFCDE4&lt;br /&gt;
| &lt;br /&gt;
| 0x4DE4&lt;br /&gt;
| 0x21C&lt;br /&gt;
| Uninitialized memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFD000&lt;br /&gt;
| 0x07FFD000&lt;br /&gt;
| 0x5000&lt;br /&gt;
| 0x2470&lt;br /&gt;
| The unprotected ARM9-bootrom copies 0x1FFFA000(AXIWRAM mem initialized by ARM11-bootrom) size 0x2470 to 0x07FFD000(mirror of 0x01FFD000). This block contains DSi keys.&lt;br /&gt;
* 0x1FFD000 is the RSA-1024 modulus for the retail System Menu&lt;br /&gt;
* 0x1FFD080 is the RSA-1024 modulus for DSi Wifi firmware and DSi Sound&lt;br /&gt;
* 0x1FFD100 is the RSA-1024 modulus for base DSi apps (Settings, Shop, etc.)&lt;br /&gt;
* 0x1FFD180 is the RSA-1024 modulus for DSiWare and RSA-signed cartridge headers&lt;br /&gt;
* 0x1FFD210 is the keyY for per-console-encrypted ES blocks&lt;br /&gt;
* 0x1FFD220 is the keyY for fixed-keyX ES blocks&lt;br /&gt;
* 0x1FFD300 is the DSi common (normal)key&lt;br /&gt;
* 0x1FFD380 is the first half of the retail keyY for modcrypt crypto &amp;quot;Nintendo&amp;quot;&lt;br /&gt;
* 0x1FFD398 is the keyX used for &#039;Tad&#039; crypto, usually in keyslot 0x02 &amp;quot;Nintendo DS&amp;quot;, ..&lt;br /&gt;
* 0x1FFD3C8 is the fixed keyY used for eMMC partition crypto (keyslot 0x03)&lt;br /&gt;
* 0x1FFD3E0 is the 0x1048-byte Blowfish data for DSi cart crypto&lt;br /&gt;
* 0x1FFE420 is the 0x1048-byte Blowfish data for DS cart crypto&lt;br /&gt;
|-&lt;br /&gt;
| 0x01FFF470&lt;br /&gt;
| &lt;br /&gt;
| 0x7470&lt;br /&gt;
| 0xB90&lt;br /&gt;
| Uninitialized memory.&lt;br /&gt;
0x01FFFC00 size 0x100-bytes starting with [[9.5.0-22|9.5.0-X]] is the FIRM header used during FIRM-launching.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=[[New_3DS]] physical 0x1F000000 memory=&lt;br /&gt;
This area is used by [[QTM Services]](starting at offset 0x200000, size 0x180000). This area is not accessible to the GPU on the old 3DS. The old 3DS and New 3DS GSP module has vaddr-&amp;gt;physaddr conversion code for this entire region. On the New 3DS, only the first 0x200000-bytes (half of this memory) are accessible to the GPU.&lt;br /&gt;
&lt;br /&gt;
=Memory map by firmware=&lt;br /&gt;
* [[Virtual address mapping FW0B]]&lt;br /&gt;
* [[Virtual address mapping FW1F]]&lt;br /&gt;
* [[Virtual address mapping FW25]]&lt;br /&gt;
* [[Virtual address mapping FW2E]]&lt;br /&gt;
* [[Virtual address mapping FW37]]&lt;br /&gt;
* [[Virtual address mapping FW38‎]]&lt;br /&gt;
* [[Virtual address mapping FW3F]]&lt;br /&gt;
* FW49([[9.6.0-24|9.6.0-X]]) ARM11-kernel vmem mapping is identical to FW40([[9.5.0-22|9.5.0-X]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Virtual address mapping TWLFIRM04]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Virtual address mapping New3DS v8.1]]&lt;br /&gt;
* [[Virtual address mapping New3DS v9.0]]&lt;br /&gt;
* [[Virtual address mapping New3DS v9.2]]&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed physical memory map=&lt;br /&gt;
 18000000 - 18600000: VRAM&lt;br /&gt;
 &lt;br /&gt;
 1FF80000 - 1FFAB000: Kernel code&lt;br /&gt;
 1FFAB000 - 1FFF0000: SlabHeap [temporarily contains boot processes]&lt;br /&gt;
 1FFF0000 - 1FFF1000: ?&lt;br /&gt;
 1FFF1000 - 1FFF2000: ?&lt;br /&gt;
 1FFF2000 - 1FFF3000: ?&lt;br /&gt;
 1FFF3000 - 1FFF4000: ?&lt;br /&gt;
 1FFF4000 - 1FFF5000: Exception vectors&lt;br /&gt;
 1FFF5000 - 1FFF5800: Unused?&lt;br /&gt;
 1FFF5800 - 1FFF5C00: 256-entry L2 MMU table for VA FF4xx000&lt;br /&gt;
 1FFF5C00 - 1FFF6000: 256-entry L2 MMU table for VA FF5xx000&lt;br /&gt;
 1FFF6000 - 1FFF6400: 256-entry L2 MMU table for VA FF6xx000&lt;br /&gt;
 1FFF6400 - 1FFF6800: 256-entry L2 MMU table for VA FF7xx000&lt;br /&gt;
 1FFF6800 - 1FFF6C00: 256-entry L2 MMU table for VA FF8xx000&lt;br /&gt;
 1FFF6C00 - 1FFF7000: 256-entry L2 MMU table for VA FF9xx000&lt;br /&gt;
 1FFF7000 - 1FFF7400: 256-entry L2 MMU table for VA FFAxx000&lt;br /&gt;
 1FFF7400 - 1FFF7800: 256-entry L2 MMU table for VA FFBxx000&lt;br /&gt;
 1FFF7800 - 1FFF7C00: MMU table but unused?&lt;br /&gt;
 1FFF7C00 - 1FFF8000: 256-entry L2 MMU table for VA FFFxx000 &lt;br /&gt;
 1FFF8000 - 1FFFC000: 4096-entry L1 MMU table for VA xxx00000 (CPU 0)&lt;br /&gt;
 1FFFC000 - 20000000: 4096-entry L1 MMU table for VA xxx00000 (CPU 1)&lt;br /&gt;
 20000000 - 28000000: Main memory&lt;br /&gt;
&lt;br /&gt;
The entire FCRAM is cleared during NATIVE_FIRM boot. This is probably done by the ARM11 kernel(after loading [[FIRM]] launch parameters from FCRAM)?&lt;br /&gt;
&lt;br /&gt;
== FCRAM memory-regions layout ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  [[Configuration_Memory#APPMEMTYPE|Configmem-APPMEMTYPE]] Value&lt;br /&gt;
!  Base address relative to FCRAM+0, for APPLICATION mem-region&lt;br /&gt;
!  Region size, for APPLICATION mem-region&lt;br /&gt;
!  Base address relative to FCRAM+0, for SYSTEM mem-region&lt;br /&gt;
!  Region size, for SYSTEM mem-region&lt;br /&gt;
!  Base address relative to FCRAM+0, for BASE mem-region&lt;br /&gt;
!  Region size, for BASE mem-region&lt;br /&gt;
|-&lt;br /&gt;
| 0 (default with regular 3DS kernel, used when the type is not 2-5)&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x04000000(64MB)&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| 0x02C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x06000000(96MB)&lt;br /&gt;
| 0x06000000&lt;br /&gt;
| 0x00C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x05000000(80MB)&lt;br /&gt;
| 0x05000000&lt;br /&gt;
| 0x01C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x04800000(72MB)&lt;br /&gt;
| 0x04800000&lt;br /&gt;
| 0x02400000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x02000000(32MB)&lt;br /&gt;
| 0x02000000&lt;br /&gt;
| 0x04C00000&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
|-&lt;br /&gt;
| 6 (This is the default on New3DS. With [[New_3DS]] kernel this is the type used when the value is not 7)&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x07C00000(124MB)&lt;br /&gt;
| 0x07C00000&lt;br /&gt;
| 0x06400000&lt;br /&gt;
| 0x0E000000&lt;br /&gt;
| 0x02000000&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x0B200000(178MB)&lt;br /&gt;
| 0x0B200000&lt;br /&gt;
| 0x02E00000&lt;br /&gt;
| 0x0E000000&lt;br /&gt;
| 0x02000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The SYSTEM mem-region size is calculated with: size = FCRAMTOTALSIZE - (APPLICATION_MEMREGIONSIZE + BASE_MEMREGIONSIZE).&lt;br /&gt;
&lt;br /&gt;
Support for type6/7 was [[NCCH/Extended Header|implemented]] in [[NS]] with [[8.0.0-18]], these are only supported in the [[New_3DS]] ARM11-kernel not the regular 3DS kernel. These two types are the only ones supported by the New3DS kernel.&lt;br /&gt;
&lt;br /&gt;
All memory allocated by the kernel itself for kernel use is located under BASE. Most system-modules run under the BASE memregion too.&lt;br /&gt;
&lt;br /&gt;
Free/used memory on [[4.5.0-10]] with Home Menu / Internet Browser, with the default APPMEMTYPE on retail:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Region&lt;br /&gt;
!  Base address relative to FCRAM+0&lt;br /&gt;
!  Region size&lt;br /&gt;
!  Used memory once [[Home Menu]] finishes loading for system boot, on [[4.5.0-10]]&lt;br /&gt;
!  Used memory with [[Internet Browser]] running instead of [[Home Menu]], on [[4.5.0-10]]&lt;br /&gt;
!  Free memory once [[Home Menu]] finishes loading for system boot, on [[4.5.0-10]]&lt;br /&gt;
!  Free memory with [[Internet Browser]] running instead of [[Home Menu]], on [[4.5.0-10]]&lt;br /&gt;
|-&lt;br /&gt;
| APPLICATION&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| 0x0&lt;br /&gt;
| &lt;br /&gt;
| 0x04000000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| SYSTEM&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| 0x02C00000&lt;br /&gt;
| 0x01488000&lt;br /&gt;
| 0x02A50000&lt;br /&gt;
| 0x01778000&lt;br /&gt;
| 0x001B0000&lt;br /&gt;
|-&lt;br /&gt;
| BASE&lt;br /&gt;
| 0x06C00000&lt;br /&gt;
| 0x01400000&lt;br /&gt;
| 0x01202000&lt;br /&gt;
| 0x01236000&lt;br /&gt;
| 0x001FE000&lt;br /&gt;
| 0x001CA000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed virtual memory map=&lt;br /&gt;
(valid only for FW0B, see [[#Memory map by firmware|Memory map by firmware]] for subsequent versions)&lt;br /&gt;
&lt;br /&gt;
 E8000000 - E8600000: mapped VRAM (18000000 - 18600000)&lt;br /&gt;
 &lt;br /&gt;
 EFF00000 - F0000000: mapped Internal memory (1FF00000 - 20000000)&lt;br /&gt;
 F0000000 - F8000000: mapped Main memory&lt;br /&gt;
 &lt;br /&gt;
 FF401000 - FF402000: mapped ? (27FC7000 - 27FC8000)&lt;br /&gt;
 &lt;br /&gt;
 FF403000 - FF404000: mapped ? (27FC2000 - 27FC3000)&lt;br /&gt;
 &lt;br /&gt;
 FF405000 - FF406000: mapped ? (27FBB000 - 27FBC000)&lt;br /&gt;
 &lt;br /&gt;
 FF407000 - FF408000: mapped ? (27FB3000 - 27FB4000)&lt;br /&gt;
 &lt;br /&gt;
 FF409000 - FF40A000: mapped ? (27F8E000 - 27F8F000)&lt;br /&gt;
 &lt;br /&gt;
 FFF00000 - FFF45000: mapped SlabHeap &lt;br /&gt;
 &lt;br /&gt;
 FFF60000 - FFF8B000: mapped Kernel code&lt;br /&gt;
 &lt;br /&gt;
 FFFCC000 - FFFCD000: mapped IO [[I2C|I2C]] second bus (10144000 - 10145000)&lt;br /&gt;
 &lt;br /&gt;
 FFFCE000 - FFFCF000: mapped IO PDC([[LCD]]) (10400000 - 10401000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD0000 - FFFD1000: mapped IO PDN (10141000 - 10142000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD2000 - FFFD3000: mapped IO PXI (10163000 - 10164000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD4000 - FFFD5000: mapped IO PAD (10146000 - 10147000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD6000 - FFFD7000: mapped IO LCD (10202000 - 10203000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD8000 - FFFD9000: mapped IO DSP (10140000 - 10141000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDA000 - FFFDB000: mapped IO XDMA (10200000 - 10201000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDC000 - FFFE0000: mapped ? (1FFF8000 - 1FFFC000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE1000 - FFFE2000: mapped ? (1FFF0000 - 1FFF1000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE3000 - FFFE4000: mapped ? (1FFF2000 - 1FFF3000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE5000 - FFFE9000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFEA000 - FFFEB000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEC000 - FFFED000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEE000 - FFFF0000: mapped IO IRQ (17E00000 - 17E02000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF0000 - FFFF1000: mapped Exception vectors&lt;br /&gt;
 &lt;br /&gt;
 FFFF2000 - FFFF6000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFF7000 - FFFF8000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF9000 - FFFFA000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFFB000 - FFFFE000: mapped L2 MMU tables (1FFF5000 - 1FFF8000)&lt;br /&gt;
&lt;br /&gt;
==0xFF4XX000==&lt;br /&gt;
Each [[KThread|thread]] is allocated a 0x1000-byte page in this region: the first page at 0xFF401000 is for the first created thread, 0xFF403000 for the second thread. This region is used to store the SVC-mode stack for the thread, and thread context data used for context switching. When the IRQ handler, prefetch/data abort handlers, and undefined instruction handler are entered where the SPSR-mode=user, these handlers then store LR+SPSR for the current mode on the SVC-mode stack, then these handlers switch to SVC-mode.&lt;br /&gt;
&lt;br /&gt;
This page does not contain a dedicated block for storing R0-PC(etc). For user-mode, the user-mode regs are instead saved on the SVC-mode stack when IRQs such as timers for context switching are triggered.&lt;br /&gt;
&lt;br /&gt;
Structure of this page, relative to page_endaddr-0xC8:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| &lt;br /&gt;
| SVC-mode stack-top. The 0x10-byte SVC-access-control for this thread is also located here, which is checked by the SVC-handler.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x28&lt;br /&gt;
| SVC-mode saved registers, stored/loaded during context switches: R4-R9, SL, FP, SP, LR. After loading these registers, the context switch code will jump to the loaded LR.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0&lt;br /&gt;
| 4&lt;br /&gt;
| fpexc from vmrs, used during context switches with the above saved registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For NATIVE_FIRM the memory pages for this region are located in FCRAM, however for TWL_FIRM these are located in AXI WRAM. For TWL_FIRM v6704 the first thread&#039;s page for this region is located at physical address 0x1FF93000, the next one at 0x1FF92000, etc.&lt;br /&gt;
&lt;br /&gt;
=ARM11 User-land memory regions=&lt;br /&gt;
==NATIVE_FIRM/SAFE_MODE_FIRM Userland Memory==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Virtual Address Base&lt;br /&gt;
!  Physical Address Base&lt;br /&gt;
!  Region Max Size&lt;br /&gt;
!  Address-range available for svcMapMemoryBlock&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000 / 0x14000000&lt;br /&gt;
| &lt;br /&gt;
| 0x03F00000&lt;br /&gt;
| No&lt;br /&gt;
| The [[ExeFS]]:/.code is loaded here, executables must be loaded to the 0x00100000 region when the exheader &amp;quot;special memory&amp;quot; flag is clear. The 0x03F00000-byte size restriction only applies when this flag is clear. Executables are usually loaded to 0x14000000 when the exheader &amp;quot;special memory&amp;quot; flag is set, however this address can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| Used for mapping buffers during IPC, see [[IPC Command Structure]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Main stack physaddr - &amp;lt;heap size for the allocated vaddr 0x08000000 memory&amp;gt;&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Yes&lt;br /&gt;
| Heap mapped by [[SVC|ControlMemory]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000-StackSize&lt;br /&gt;
| .bss physical address - total stack pages&lt;br /&gt;
| StackSize from process exheader&lt;br /&gt;
| &lt;br /&gt;
| Stack for the main-thread, initialized by the ARM11 kernel. The StackSize from the exheader is usually 0x4000, therefore the stack-bottom is usually 0x0FFFC000. The stack for the other threads is normally located in the process .data section however this can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| &lt;br /&gt;
| 0x04000000&lt;br /&gt;
| Yes&lt;br /&gt;
| [[SVC|Shared]] memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x14000000&lt;br /&gt;
| FCRAM+0&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| No&lt;br /&gt;
| Can be mapped by [[SVC|ControlMemory]], this is used for processes&#039; [[SVC|LINEAR]]/GSP heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E800000&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x00400000&lt;br /&gt;
| No&lt;br /&gt;
| [[New_3DS]] additional memory, access to this is specified by the exheader. Added with [[8.0.0-18]], see above section regarding this memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EC00000&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 0x01000000&lt;br /&gt;
| No&lt;br /&gt;
| [[IO]] registers, the mapped IO pages which each process can access is specified in the [[NCCH#CXI|CXI]] exheader.(Applications normally don&#039;t have access to registers in this range)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| No&lt;br /&gt;
| VRAM, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| No&lt;br /&gt;
| DSP memory, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| FCRAM memory page allocated by the ARM11 kernel.&lt;br /&gt;
| 0x1000&lt;br /&gt;
| No&lt;br /&gt;
| [[Configuration Memory]], all processes have read-only access to this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF81000&lt;br /&gt;
| FCRAM memory page allocated by the ARM11 kernel.&lt;br /&gt;
| 0x1000&lt;br /&gt;
| No&lt;br /&gt;
| [[Configuration Memory|Shared]] page, all processes have read-access to this. Write access to this is specified by the exheader &amp;quot;Shared page writing&amp;quot; kernel flag.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF82000&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| No&lt;br /&gt;
| [[Thread Local Storage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x30000000&lt;br /&gt;
| FCRAM+0&lt;br /&gt;
| 0x08000000(Old3DS) / 0x10000000([[New_3DS]])&lt;br /&gt;
| No&lt;br /&gt;
| This LINEAR memory mapping was added with [[8.0.0-18]], see [[SVC#enum_MemoryOperation|here]]. This replaces the original 0x14000000 mapping, for system(memory-region=BASE)/newer titles. The Old3DS kernel uses size 0x08000000 for LINEAR-memory address range checks, while the New3DS kernel uses size 0x10000000 for those range checks. Old3DS/New3DS system-module code doing vaddr-&amp;gt;phys-addr conversion uses size 0x10000000.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20000000 / 0x40000000&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| This is the end-address of userland memory, memory under this address is process-unique. Memory starting at this address is only accessible in privileged-mode. This address was changed from 0x20000000 to 0x40000000 with [[8.0.0-18]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All executable pages are read-only, and data pages have the execute-never permission set. Normally .text from the loaded ExeFS:/.code is the only mapped executable memory. Executable [[RO Services|CROs]] can be loaded into memory, once loaded the CRO .text section memory page permissions are changed via [[SVC|ControlProcessMemory]] from RW- to R-X. The address and size of each ExeFS:/.code section is stored in the exheader, the permissions for each section is: .text R-X, .rodata R--, .data RW-, and .bss RW-. The loaded .code is mapped to the addresses specified in the exheader by the ARM11 kernel. The stack permissions is initialized by the ARM11 kernel: RW-. The heap permissions is normally RW-.&lt;br /&gt;
&lt;br /&gt;
All userland memory is mapped with RW permissions for privileged-mode. However, normally the ARM11 kernel only uses userland read/write instructions(or checks that the memory can be written from userland first) for accessing memory specified by [[SVC|SVCs]].&lt;br /&gt;
&lt;br /&gt;
Processes can&#039;t directly access memory for other processes. When service [[Services API|commands]] are used, the kernel maps memory in the destination process for input/output buffers, where the addresses in the command received by the process is replaced by this mapped memory. When this is an input buffer, the buffer data is copied to the mapped memory. When this is an output buffer, the data stored in the mapped memory is copied to the destination buffer specified in the command.&lt;br /&gt;
&lt;br /&gt;
The physical address which memory for the application memory-type is mapped to begins at FCRAM+0, the total memory allocated for this memory-type is stored in [[Configuration_Memory]]. Applications&#039; .text + .rodata + .data under the application memory-type is mapped at FCRAM + APPMEMALLOC - (aligned page-size for .text + .rodata + .data). The application .bss is mapped at CODEADDR - .bss size aligned down to the page size.&lt;br /&gt;
&lt;br /&gt;
==TWL_FIRM Userland Memory==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Virtual Address Base&lt;br /&gt;
!  Physical Address Base&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| 0x1FFAB000 (with newer TWL_FIRM such as v6704 this is located at 0x1FFAC000)&lt;br /&gt;
| 0x00055000&lt;br /&gt;
| Code + .(ro)data copied from the process 0x00300000 region is located here(.bss is located here as well).&lt;br /&gt;
|-&lt;br /&gt;
| 0x00155000&lt;br /&gt;
| 0x18555000&lt;br /&gt;
| 0x000AB000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x00200000&lt;br /&gt;
| 0x18500000&lt;br /&gt;
| 0x00100000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x00300000&lt;br /&gt;
| 0x24000000&lt;br /&gt;
| 0x04000000&lt;br /&gt;
| The beginning of the ARM11 process .text is located here.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x07E00000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1EC00000&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 0x00400000&lt;br /&gt;
| [[IO]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| This is mapped to the DSP memory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The above regions are mapped by the ARM11 kernel. Later when the ARM11 process uses [[SVC|svcKernelSetState]] with type4, the kernel unmaps(?) the following regions: 0x00300000..0x04300000, 0x08000000..0x0FE00000, and 0x10000000..0xF8000000.&lt;br /&gt;
&lt;br /&gt;
=== Detailed TWL_FIRM ARM11 Memory ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Process Virtual Address&lt;br /&gt;
!  Physical Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x01000000*4&lt;br /&gt;
| DS(i) 0x02000000 RAM. Vaddr = (DSRAMOffset*4) + 0x08000000, where DSRAMOffset is DSRAMAddr-0x02000000.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0FC00000&lt;br /&gt;
| 0x27C00000&lt;br /&gt;
| &lt;br /&gt;
| Loaded SRL binary, initially the dev DSi launcher SRL is located here(copied here by the ARM11 process).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0FD00000&lt;br /&gt;
| 0x27D00000&lt;br /&gt;
| &lt;br /&gt;
| The data located here is copied to here by the ARM11 process. The data located here is a TWL NAND [http://dsibrew.org/wiki/Bootloader bootloader] image, using the same format+encryption/verification methods as the DSi NAND bootloader(stage2). The keyX for this bootloader keyslot is initially set to the retail DSi key-data, however when TWL_FIRM is launched this keyX key-data is replaced with a separate keyX. TWL_FIRM can use either the retail DSi bootloader RSA-1024 modulo, or a seperate modulo: normally only the latter is used(the former is only used when loading the image from FS instead of FCRAM). When using the image from FCRAM(default code-path), TWL_FIRM will not calculate+check the hashes for the bootloader code binaries(this is done when loading from FS however).&lt;br /&gt;
|-&lt;br /&gt;
| 0x0FDF7000&lt;br /&gt;
| 0x27DF7000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| SRL header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= System memory details  =&lt;br /&gt;
 0xFFFF9000 Pointer to the current KThread instance&lt;br /&gt;
 0xFFFF9004 Pointer to the current KProcess instance&lt;br /&gt;
 0xFFFF9008 Pointer to the current KScheduler instance&lt;br /&gt;
 0xFFFF9010 Pointer to the last KThread to encounter an exception&lt;br /&gt;
&lt;br /&gt;
 0x8000040 Pointer to the current KThread instance on the ARM9&lt;br /&gt;
 0x8000044 Pointer to the current KProcess instance on the ARM9&lt;br /&gt;
 0x8000048 Pointer to the current KScheduler instance on the ARM9&lt;br /&gt;
&lt;br /&gt;
= Handles =&lt;br /&gt;
 The handle 0xFFFF8001 is a reference to the current KProcess.&lt;br /&gt;
 The handle 0xFFFF8000 is a reference to the current KThread.&lt;br /&gt;
&lt;br /&gt;
= IO Process/Kernel virtual addressing equivalence = &lt;br /&gt;
It seems an IO register&#039;s process virtual address can be calculated by adding 0xEB00000 to its physical address.&lt;br /&gt;
&lt;br /&gt;
= VRAM Map While Running System Applets =&lt;br /&gt;
*0x1E6000-0x22C500 -- top screen 3D left framebuffer 0(240x400x3) (The &amp;quot;3D right first-framebuf&amp;quot; addr stored in the LCD register is set to this, when the 3D is set to &amp;quot;off&amp;quot;)&lt;br /&gt;
*0x22C800-0x272D00 -- top screen 3D left framebuffer 1(240x400x3)&lt;br /&gt;
*0x273000-0x2B9500 -- top screen 3D right framebuffer 0(240x400x3)&lt;br /&gt;
*0x2B9800-0x2FFD00 -- top screen 3D right framebuffer 1(240x400x3)&lt;br /&gt;
*0x48F000-0x4C7400 -- bottom screen framebuffer 0(240x320x3)&lt;br /&gt;
*0x4C7800-0x4FF800 -- bottom screen framebuffer 1(240x320x3)&lt;br /&gt;
&lt;br /&gt;
These LCD framebuffer addresses are not changed by the system when launching regular applications, the application itself handles that if needed. These VRAM framebuffers are cleared when launching regular applications.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=9.9.0-26&amp;diff=12925</id>
		<title>9.9.0-26</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=9.9.0-26&amp;diff=12925"/>
		<updated>2015-07-14T03:29:39Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: Created page with &amp;quot;The Old3DS+New3DS 9.9.0-26 system update was released on July 13, 2015 for all available regions.  == Change-log == Official change-log: * Further improvements to overall system ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Old3DS+New3DS 9.9.0-26 system update was released on July 13, 2015 for all available regions.&lt;br /&gt;
&lt;br /&gt;
== Change-log ==&lt;br /&gt;
Official change-log:&lt;br /&gt;
* Further improvements to overall system stability, system security, and other minor adjustments have been made to enhance the user experience&lt;br /&gt;
&lt;br /&gt;
==System Titles==&lt;br /&gt;
All of the following titles were updated for Old3DS+New3DS: [[Home Menu]], [[CVer]], and [[NVer]].&lt;br /&gt;
&lt;br /&gt;
Both platforms&#039; browsers ([[Internet_Browser|spider and SKATER]]) were updated. The wording in the changelog would seem to imply that webkit received bugfixes or was otherwise updated.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
System update reports:&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=News/Archive&amp;diff=12924</id>
		<title>News/Archive</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=News/Archive&amp;diff=12924"/>
		<updated>2015-07-14T03:17:51Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*&#039;&#039;&#039;23 March 15&#039;&#039;&#039; Nintendo released system update [[9.6.0-24]].&lt;br /&gt;
*&#039;&#039;&#039;2 March 15&#039;&#039;&#039; Nintendo released system update [[9.5.0-23]].&lt;br /&gt;
*&#039;&#039;&#039;15 February 15&#039;&#039;&#039; WinterMute released [http://devkitpro.org/viewtopic.php?f=13&amp;amp;t=8409 devkitARM release 44].&lt;br /&gt;
*&#039;&#039;&#039;2 February 15&#039;&#039;&#039; Nintendo released system update [[9.5.0-22]], which fixes [[3DS System Flaws|firmlaunch-hax]].&lt;br /&gt;
*&#039;&#039;&#039;16 January 15&#039;&#039;&#039; smea released regionthree [https://github.com/smealum/regionthree/blob/master/README.md], enabling region free gaming on latest firmware.&lt;br /&gt;
*&#039;&#039;&#039;24 December 14&#039;&#039;&#039; smea released [[Ninjhax]] 1.1 (&#039;&#039;&#039;NOT&#039;&#039;&#039; a fix for firmware [[9.3.0-21]] or [[9.4.0-21]]).&lt;br /&gt;
*&#039;&#039;&#039;11 December 14&#039;&#039;&#039; Nintendo released system update [[9.4.0-21]].&lt;br /&gt;
*&#039;&#039;&#039;8 December 14&#039;&#039;&#039; Nintendo released system update [[9.3.0-21]], which fixes [[3DS System Flaws|rohax]].&lt;br /&gt;
*&#039;&#039;&#039;20 November 14&#039;&#039;&#039; smea released [[Ninjhax]], the first public [[Homebrew Exploits|homebrew exploit]] compatible with system-versions [[4.0.0-7]]-[[9.2.0-20]].&lt;br /&gt;
*&#039;&#039;&#039;29 October 14&#039;&#039;&#039; Nintendo released system update [[9.2.0-20]].&lt;br /&gt;
*&#039;&#039;&#039;10 October 14&#039;&#039;&#039; Nintendo released system update [[9.1.0-20J]].&lt;br /&gt;
*&#039;&#039;&#039;6 October 14&#039;&#039;&#039; Nintendo released system update [[9.0.0-20]].&lt;br /&gt;
*&#039;&#039;&#039;29 August 14&#039;&#039;&#039; Nintendo announced [[New 3DS]].&lt;br /&gt;
*&#039;&#039;&#039;7 August 14&#039;&#039;&#039; Nintendo released system update [[8.1.0-19]].&lt;br /&gt;
*&#039;&#039;&#039;24 July 14&#039;&#039;&#039; Nintendo released system update [[8.1.0-18]].&lt;br /&gt;
*&#039;&#039;&#039;7 July 14&#039;&#039;&#039; Nintendo released system update [[8.0.0-18]].&lt;br /&gt;
*&#039;&#039;&#039;12 May 14&#039;&#039;&#039; Nintendo released system update [[7.2.0-17]].&lt;br /&gt;
*&#039;&#039;&#039;26 February 14&#039;&#039;&#039; Nintendo released system update [[7.1.0-16]].&lt;br /&gt;
*&#039;&#039;&#039;22 January 14&#039;&#039;&#039; Nintendo released system update [[7.1.0-15]].&lt;br /&gt;
*&#039;&#039;&#039;19 December 13&#039;&#039;&#039; Nintendo released system update [[7.1.0-14]].&lt;br /&gt;
*&#039;&#039;&#039;9 December 13&#039;&#039;&#039; Nintendo released system update [[7.0.0-13]].&lt;br /&gt;
*&#039;&#039;&#039;13 September 13&#039;&#039;&#039; Nintendo released system update [[6.3.0-12]].&lt;br /&gt;
*&#039;&#039;&#039;20 August 13&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.5.3]] updated by [[User:Elisherer|Elisherer]] (Enable trimming NCSD)&lt;br /&gt;
*&#039;&#039;&#039;6 August 13&#039;&#039;&#039; Nintendo released system update [[6.2.0-12]].&lt;br /&gt;
*&#039;&#039;&#039;11 July 13&#039;&#039;&#039; Nintendo released system update [[6.1.0-12U]] for only USA.&lt;br /&gt;
*&#039;&#039;&#039;27 June 13&#039;&#039;&#039; Nintendo released system update [[6.1.0-11]] (6.1.0-12 for all regions except USA).&lt;br /&gt;
*&#039;&#039;&#039;17 June 13&#039;&#039;&#039; Nintendo released system update [[6.0.0-11]] (6.0.0-12 for all regions except USA).&lt;br /&gt;
*&#039;&#039;&#039;4 April 13&#039;&#039;&#039; Nintendo released system update [[5.1.0-11]].&lt;br /&gt;
*&#039;&#039;&#039;25 March 13&#039;&#039;&#039; Nintendo released system update [[5.0.0-11]].&lt;br /&gt;
*&#039;&#039;&#039;14 January 13&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.5.1]] updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;4 December 12&#039;&#039;&#039; Nintendo released system update [[4.5.0-10]].&lt;br /&gt;
*&#039;&#039;&#039;1 December 12&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.4]] updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;2 November 12&#039;&#039;&#039; Added page for [[Fundraiser|Chip decapping fundraiser]]&lt;br /&gt;
*&#039;&#039;&#039;8 January 13&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.5]] updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;23 September 12&#039;&#039;&#039; [[005tools|005tools v0.1b]] by [[User:McHaggis|McHaggis]]&lt;br /&gt;
*&#039;&#039;&#039;19 September 12&#039;&#039;&#039; Nintendo released system update [[4.4.0-10]].&lt;br /&gt;
*&#039;&#039;&#039;17 August 12&#039;&#039;&#039; Nintendo released New Super Mario Bros. 2, the first 3DS title released simultaneously in stores and as an [[eShop]] download.&lt;br /&gt;
*&#039;&#039;&#039;28 July 12&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.3]] (modified by 3DSGuy) updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;24 July 12&#039;&#039;&#039; Nintendo released system update [[4.3.0-10]].&lt;br /&gt;
*&#039;&#039;&#039;26 June 12&#039;&#039;&#039; Nintendo released system update [[4.2.0-9]].&lt;br /&gt;
*&#039;&#039;&#039;19 May 12&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.2.1]] updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;15 May 12&#039;&#039;&#039; Nintendo released its first implementation of 3DS &#039;[[Title list#0004000E - Add-on Content|Add-on Content]]&#039; with the Mario Kart 1.1 update.&lt;br /&gt;
*&#039;&#039;&#039;14 May 12&#039;&#039;&#039; Nintendo released system update [[4.1.0-8]].&lt;br /&gt;
*&#039;&#039;&#039;24 April 12&#039;&#039;&#039; Nintendo released system update [[4.0.0-7]].&lt;br /&gt;
*&#039;&#039;&#039;08 February 12&#039;&#039;&#039; [[CiTRUS|CiTRUS v0.2]] updated by [[User:Xcution|Xcution]]&lt;br /&gt;
*&#039;&#039;&#039;04 February 12&#039;&#039;&#039; [[CiTRUS|CiTRUS v0.1]] released by [[User:Xcution|Xcution]]&lt;br /&gt;
*&#039;&#039;&#039;02 February 12&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.2]] updated by [[User:Elisherer|elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;26 January 12&#039;&#039;&#039; [[Crappy Tiny Reader|CTR - Crappy Tiny Reader v0.07]] updated by [[User:PsyKopaT|PsyKo]]&lt;br /&gt;
*&#039;&#039;&#039;05 January 12&#039;&#039;&#039; [[Crappy Tiny Reader|CTR - Crappy Tiny Reader v0.06]] updated by [[User:PsyKopaT|PsyKo]]&lt;br /&gt;
*&#039;&#039;&#039;21 December 11&#039;&#039;&#039; Nintendo released system update [[3.0.0-6]]&lt;br /&gt;
*&#039;&#039;&#039;21 December 11&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.1.1]] updated by [[User:Elisherer|elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;7 December 11&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v0.96]] updated by [[User:Elisherer|elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;4 September 11&#039;&#039;&#039; [[3DSViewer|3DSViewer v0.1]] released by [[User:Elisherer|elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;1 August 11&#039;&#039;&#039; [[3DS Save DeEncrypter3DS|Save DeEncrypter v1.0]] released by [[User:Blite|Blite]]&lt;br /&gt;
*&#039;&#039;&#039;25 July 11&#039;&#039;&#039; Nintendo released system update [[2.1.0-4]].&lt;br /&gt;
*&#039;&#039;&#039;15 June 11&#039;&#039;&#039; Nintendo released system update [[2.1.0-3]].&lt;br /&gt;
*&#039;&#039;&#039;6 June 11&#039;&#039;&#039; Nintendo released system update [[2.0.0-2]].&lt;br /&gt;
*&#039;&#039;&#039;6 April 11&#039;&#039;&#039; [[DSaveManager|DSaveManager v0.1]] released by [[User:Crediar|crediar]]&lt;br /&gt;
*&#039;&#039;&#039;4 April 11&#039;&#039;&#039; [[3DSaveTool|3DSaveTool v0.2b]] released by [[User:Crediar|crediar]]&lt;br /&gt;
*&#039;&#039;&#039;2 April 11&#039;&#039;&#039; [[3DSaveTool|3DSaveTool v0.1]] released by [[User:Crediar|crediar]]&lt;br /&gt;
*&#039;&#039;&#039;28 March 11&#039;&#039;&#039; Fixed 3DBrew wiki issues, now fully operational!&lt;br /&gt;
*&#039;&#039;&#039;18 March 11&#039;&#039;&#039; 3DBrew launched.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 3DBrew International ==&lt;br /&gt;
Our community is an international community.&lt;br /&gt;
&lt;br /&gt;
We have freedom, and we will express it in our language (but you have to write it in English before ;)!&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=News&amp;diff=12923</id>
		<title>News</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=News&amp;diff=12923"/>
		<updated>2015-07-14T03:16:33Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
==Adding an item==&lt;br /&gt;
* Log in to the wiki. Editing is disabled if you don&#039;t have an account.&lt;br /&gt;
* Add the news event to the top of the list, using this format for the date: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&#039;&amp;lt;/nowiki&amp;gt;{{#time: d F y}}&amp;lt;nowiki&amp;gt;&#039;&#039;&#039; &amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Please include the application&#039;s creator, version number, and a link to a page on 3DBrew about the application. No external links please.&lt;br /&gt;
* &#039;&#039;&#039;Move the last entry to the [[:News/Archive|news archive]]. There should be no more than 4 entrees in the list.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Archives==&lt;br /&gt;
For older news, see the [[:News/Archive|news archive]].&lt;br /&gt;
&lt;br /&gt;
=== News ===&lt;br /&gt;
&amp;lt;!-- Add news below --&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;13 July 15&#039;&#039;&#039; Nintendo released system update [[9.9.0-26]].&lt;br /&gt;
*&#039;&#039;&#039;1 June 15&#039;&#039;&#039; Nintendo released system update [[9.8.0-25]].&lt;br /&gt;
*&#039;&#039;&#039;03 May 15&#039;&#039;&#039; smea released regionFOUR [https://github.com/smealum/regionFOUR/blob/master/README.md], enabling region free gaming on latest firmware. (again)&lt;br /&gt;
*&#039;&#039;&#039;20 April 15&#039;&#039;&#039; Nintendo released system update [[9.7.0-25]].&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=EShop&amp;diff=12905</id>
		<title>EShop</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=EShop&amp;diff=12905"/>
		<updated>2015-07-04T23:01:43Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: the entire link actually varies between regions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Nintendo 3DS eShop was added in the June 2011 update for JP/EUR/USA.&lt;br /&gt;
&lt;br /&gt;
From here, you can download Virtual Console games, 3D Classics, DSiware software, view screenshots, and 3D trailers for upcoming 3DS titles.&lt;br /&gt;
&lt;br /&gt;
eShop uses the following domains over HTTPS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* cp3s-auth.c.shop.nintendowifi.net&lt;br /&gt;
* a248.e.akamai.net&lt;br /&gt;
* ninja.ctr.shop.nintendo.net&lt;br /&gt;
* samurai.ctr.shop.nintendo.net&lt;br /&gt;
* ccif.ctr.shop.nintendo.net&lt;br /&gt;
* eou.c.shop.nintendowifi.net&lt;br /&gt;
&lt;br /&gt;
These domains are used by [[NIM_Services|NIM]]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* nus.c.shop.nintendowifi.net&lt;br /&gt;
* ecs.c.shop.nintendowifi.net&lt;br /&gt;
* cas.c.shop.nintendowifi.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While eShop is loading, eShop will use command [[NIMS:CheckSysupdateAvailableSOAP]]. If a system update is available where title installation for system titles still needs finalized (or when the updated titles were not downloaded at all), eShop will then display the &amp;quot;system update is available&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
The eShop application uses command [[AMNet:FinishInstallToMedia]] to finalize the SD title install (if the whole title is downloaded while eShop is still running), however, before using that command the eShop application also uses [[AMNet:FinishInstallToMedia]] to finalize installing all system titles (from system updates).&lt;br /&gt;
&lt;br /&gt;
== eShop QR Codes ==&lt;br /&gt;
eShop QR Codes can be scanned with the camera, allowing one to quickly navigate to the desired eShop title with just two clicks. The QR Codes themselves is a simple text/url QR, started with &amp;quot;ESHOP://&amp;quot; string followed by a decimal eShop content link id(same IDs used internally by eShop for all content) and then some special data, delimited by a dot symbol, which can be ommited.&lt;br /&gt;
&lt;br /&gt;
In order for the QR-code string data to be valid for eShop, it must begin with &amp;quot;ESHOP://5&amp;quot;, with the first ID being all decimal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! QR Code source&lt;br /&gt;
! Region&lt;br /&gt;
! Title&lt;br /&gt;
! Serial&lt;br /&gt;
! Title ID&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000000201.PEAALL000000 || EUR || Nintendogs &amp;amp; Cats Demo || ADA/B/C || 0004000200030c01&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000007870.PEAALL000000 || EUR || Crush 3D || A??P || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008009.PEAALL000000 || EUR || Resident Evil Revelations Demo || ABRE || 000400020005ee01&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008123.J00101Z00095 || JPN || Rhythm Thief And The Emperor&#039;s Treasure Demo || ARTJ || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008404.PEAALL000000 || EUR || Mario And Sonic At The London 2012 Olympic Games Demo || ACMP [http://mediacontent.nintendo-europe.com/NOE/images/game_content/ACMP-MarioAndSonicAtTheLondon2012OlympicGames-QRCode-EA_ALL_000_001.bmp] || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008447.J00101Z00094 || JPN || Resident Evil Revelations Demo || ABRJ || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008449.J00101Z00082 || JPN || Swapnote || JFRJ ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008561 || USA || Swapnote || JFRE || 0004000000051700&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008647.J00101Z00096 || JPN || Metal Gear Solid Snake Eater 3D Demo || AMGJ || 0004000200048101&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008648.J00101Z00097 || JPN || Theatrythm Final Fantasy || ATHJ ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008782.PEAALL000000 || EUR || Metal Gear Solid Snake Eater 3D Demo || AMGE || 0004000200082401&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008842.PEAALL000000 || EUR || Rhythm Thief And The Emperor&#039;s Treasure Demo || ARTP [http://mediacontent.nintendo-europe.com/NOE/images/game_content/ARTP-RhythmThief_TheEmperorsTreasure-QRCode-EA_ALL_000_001.bmp] || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009084.J00101Z00121 || JPN || Hatsune Miku And Future Stars: Project Mirai Demo || AM9J || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009102.J00101Z00106 || JPN || Denpa Ningen RPG || JD8J ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009161.J00101Z00118 || JPN || Dillon&#039;s Rolling Western || JAMJ || 00040000&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009261 || USA || Dillon&#039;s Rolling Western || JAME? || 00040000&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009401.J00101Z00120 || JPN || Kingdom Hearts 3D Video Download || JZ8J ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009403.J00101Z00119 || JPN || DQM 3D Video Download || JZ7J ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009575.PEAALL000000 || EUR || Kid Icarus: Of Myths And Monsters (Virtual Console) ||? ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009846 || USA || Ketzal&#039;s Corridors ||? ||?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* New QR Code for Japanese &amp;quot;Photos with Super Mario&amp;quot; has a different code string: ESHOP://50010000013120.J00108Z00001.CD588EAE95A3A68D15C647DA2AC0945FD88F70AB8A31149E51C4B05FB927B0B8&lt;br /&gt;
&lt;br /&gt;
* There is a link in the Japanese eShop &amp;lt;nowiki&amp;gt;[http://www.nintendo.co.jp/3ds/eshop/qrCode.html?####]&amp;lt;/nowiki&amp;gt; where you can replace the #### with the Japanese eShop title&#039;s serial and you will get it&#039;s QR code. (i.e. http://www.nintendo.co.jp/3ds/eshop/qrCode.html?jcaj will get you the pushmo QR code)&lt;br /&gt;
&lt;br /&gt;
* You could use Google&#039;s Chart API to create a QR code from the codes above: https://chart.googleapis.com/chart?chs=150x150&amp;amp;cht=qr&amp;amp;chl=ESHOP (replace the ESHOP text with the ESHOP:// link from one of the above)&lt;br /&gt;
&lt;br /&gt;
== NS eShop application parameters ==&lt;br /&gt;
This section describes the 0x1C-byte structure stored at the application parameters from [[APT:StartApplication]], under the 0x300-byte buffer listed there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown, usually 0x3?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown, usually 0x0?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 binary eShop content ID, same ID from the first string in eShop QR-codes except in binary form.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| This is the last string from the QR-code(if any), no NUL-termination.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ExtData ==&lt;br /&gt;
The ExtData [[Extdata#Filesystem|File System]] for eShop is as follows:&lt;br /&gt;
&lt;br /&gt;
 root&lt;br /&gt;
 ├── icon&lt;br /&gt;
 ├── boss&lt;br /&gt;
 │   └── TIGER100.tmp&lt;br /&gt;
 └── user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  File&lt;br /&gt;
!  Details&lt;br /&gt;
!  Size&lt;br /&gt;
!  Firmware Introduced&lt;br /&gt;
!  Plain text&lt;br /&gt;
|-&lt;br /&gt;
|  icon&lt;br /&gt;
|  Duplicate from application ExeFS. Always image 00000002&lt;br /&gt;
|  0x36C0 Bytes&lt;br /&gt;
|  [[2.0.0-2]]&lt;br /&gt;
|  [https://dl.dropboxusercontent.com/u/60710927/CTR/Sample/eShopExtdata/icon Download_EUR]&lt;br /&gt;
|-&lt;br /&gt;
|  TIGER100.tmp&lt;br /&gt;
|  Always image 00000003.&lt;br /&gt;
|  0xCE47 bytes (varies?)&lt;br /&gt;
|  [[2.0.0-2]]&lt;br /&gt;
|  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Music ==&lt;br /&gt;
The eShop pulls its music from a static, region-specific link in a format similar to the following: &lt;br /&gt;
&lt;br /&gt;
https:// a248.e.akamai.net/f/248/103046/10m/npdl.c.app.nintendowifi.net/p01/nsa/CtfKXACbUPl8s7lk/BGM1/US_BGM1 ,&lt;br /&gt;
where region is one of the primary system regions (JP, US, EU, KR, etc.) Support also exists for &#039;BGM2&#039;, but this seems to be unused.&lt;br /&gt;
The music is held in a [[SpotPass|BOSS]] container. &lt;br /&gt;
&lt;br /&gt;
The format consists of a brief XML header describing the audio (including the date it was set as the main eShop theme, loop times, size, etc) followed by a raw AAC stream. Tools such as FFmpeg can handle rebuilding this stream with ADTS headers for proper time info and such.&lt;br /&gt;
&lt;br /&gt;
The [[Home_Menu|Home Menu]] uses nearly the same format for the Theme Shop&#039;s background music.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=EShop&amp;diff=12904</id>
		<title>EShop</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=EShop&amp;diff=12904"/>
		<updated>2015-07-04T22:30:37Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: eShop music format stuff (captcha is broken for me, sorry for bad link)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Nintendo 3DS eShop was added in the June 2011 update for JP/EUR/USA.&lt;br /&gt;
&lt;br /&gt;
From here, you can download Virtual Console games, 3D Classics, DSiware software, view screenshots, and 3D trailers for upcoming 3DS titles.&lt;br /&gt;
&lt;br /&gt;
eShop uses the following domains over HTTPS:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* cp3s-auth.c.shop.nintendowifi.net&lt;br /&gt;
* a248.e.akamai.net&lt;br /&gt;
* ninja.ctr.shop.nintendo.net&lt;br /&gt;
* samurai.ctr.shop.nintendo.net&lt;br /&gt;
* ccif.ctr.shop.nintendo.net&lt;br /&gt;
* eou.c.shop.nintendowifi.net&lt;br /&gt;
&lt;br /&gt;
These domains are used by [[NIM_Services|NIM]]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* nus.c.shop.nintendowifi.net&lt;br /&gt;
* ecs.c.shop.nintendowifi.net&lt;br /&gt;
* cas.c.shop.nintendowifi.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While eShop is loading, eShop will use command [[NIMS:CheckSysupdateAvailableSOAP]]. If a system update is available where title installation for system titles still needs finalized (or when the updated titles were not downloaded at all), eShop will then display the &amp;quot;system update is available&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
The eShop application uses command [[AMNet:FinishInstallToMedia]] to finalize the SD title install (if the whole title is downloaded while eShop is still running), however, before using that command the eShop application also uses [[AMNet:FinishInstallToMedia]] to finalize installing all system titles (from system updates).&lt;br /&gt;
&lt;br /&gt;
== eShop QR Codes ==&lt;br /&gt;
eShop QR Codes can be scanned with the camera, allowing one to quickly navigate to the desired eShop title with just two clicks. The QR Codes themselves is a simple text/url QR, started with &amp;quot;ESHOP://&amp;quot; string followed by a decimal eShop content link id(same IDs used internally by eShop for all content) and then some special data, delimited by a dot symbol, which can be ommited.&lt;br /&gt;
&lt;br /&gt;
In order for the QR-code string data to be valid for eShop, it must begin with &amp;quot;ESHOP://5&amp;quot;, with the first ID being all decimal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! QR Code source&lt;br /&gt;
! Region&lt;br /&gt;
! Title&lt;br /&gt;
! Serial&lt;br /&gt;
! Title ID&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000000201.PEAALL000000 || EUR || Nintendogs &amp;amp; Cats Demo || ADA/B/C || 0004000200030c01&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000007870.PEAALL000000 || EUR || Crush 3D || A??P || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008009.PEAALL000000 || EUR || Resident Evil Revelations Demo || ABRE || 000400020005ee01&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008123.J00101Z00095 || JPN || Rhythm Thief And The Emperor&#039;s Treasure Demo || ARTJ || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008404.PEAALL000000 || EUR || Mario And Sonic At The London 2012 Olympic Games Demo || ACMP [http://mediacontent.nintendo-europe.com/NOE/images/game_content/ACMP-MarioAndSonicAtTheLondon2012OlympicGames-QRCode-EA_ALL_000_001.bmp] || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008447.J00101Z00094 || JPN || Resident Evil Revelations Demo || ABRJ || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008449.J00101Z00082 || JPN || Swapnote || JFRJ ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008561 || USA || Swapnote || JFRE || 0004000000051700&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008647.J00101Z00096 || JPN || Metal Gear Solid Snake Eater 3D Demo || AMGJ || 0004000200048101&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008648.J00101Z00097 || JPN || Theatrythm Final Fantasy || ATHJ ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008782.PEAALL000000 || EUR || Metal Gear Solid Snake Eater 3D Demo || AMGE || 0004000200082401&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000008842.PEAALL000000 || EUR || Rhythm Thief And The Emperor&#039;s Treasure Demo || ARTP [http://mediacontent.nintendo-europe.com/NOE/images/game_content/ARTP-RhythmThief_TheEmperorsTreasure-QRCode-EA_ALL_000_001.bmp] || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009084.J00101Z00121 || JPN || Hatsune Miku And Future Stars: Project Mirai Demo || AM9J || 00040002&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009102.J00101Z00106 || JPN || Denpa Ningen RPG || JD8J ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009161.J00101Z00118 || JPN || Dillon&#039;s Rolling Western || JAMJ || 00040000&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009261 || USA || Dillon&#039;s Rolling Western || JAME? || 00040000&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009401.J00101Z00120 || JPN || Kingdom Hearts 3D Video Download || JZ8J ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009403.J00101Z00119 || JPN || DQM 3D Video Download || JZ7J ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009575.PEAALL000000 || EUR || Kid Icarus: Of Myths And Monsters (Virtual Console) ||? ||?&lt;br /&gt;
|-&lt;br /&gt;
| ESHOP://50010000009846 || USA || Ketzal&#039;s Corridors ||? ||?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* New QR Code for Japanese &amp;quot;Photos with Super Mario&amp;quot; has a different code string: ESHOP://50010000013120.J00108Z00001.CD588EAE95A3A68D15C647DA2AC0945FD88F70AB8A31149E51C4B05FB927B0B8&lt;br /&gt;
&lt;br /&gt;
* There is a link in the Japanese eShop &amp;lt;nowiki&amp;gt;[http://www.nintendo.co.jp/3ds/eshop/qrCode.html?####]&amp;lt;/nowiki&amp;gt; where you can replace the #### with the Japanese eShop title&#039;s serial and you will get it&#039;s QR code. (i.e. http://www.nintendo.co.jp/3ds/eshop/qrCode.html?jcaj will get you the pushmo QR code)&lt;br /&gt;
&lt;br /&gt;
* You could use Google&#039;s Chart API to create a QR code from the codes above: https://chart.googleapis.com/chart?chs=150x150&amp;amp;cht=qr&amp;amp;chl=ESHOP (replace the ESHOP text with the ESHOP:// link from one of the above)&lt;br /&gt;
&lt;br /&gt;
== NS eShop application parameters ==&lt;br /&gt;
This section describes the 0x1C-byte structure stored at the application parameters from [[APT:StartApplication]], under the 0x300-byte buffer listed there.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown, usually 0x3?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown, usually 0x0?&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 binary eShop content ID, same ID from the first string in eShop QR-codes except in binary form.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| This is the last string from the QR-code(if any), no NUL-termination.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ExtData ==&lt;br /&gt;
The ExtData [[Extdata#Filesystem|File System]] for eShop is as follows:&lt;br /&gt;
&lt;br /&gt;
 root&lt;br /&gt;
 ├── icon&lt;br /&gt;
 ├── boss&lt;br /&gt;
 │   └── TIGER100.tmp&lt;br /&gt;
 └── user&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  File&lt;br /&gt;
!  Details&lt;br /&gt;
!  Size&lt;br /&gt;
!  Firmware Introduced&lt;br /&gt;
!  Plain text&lt;br /&gt;
|-&lt;br /&gt;
|  icon&lt;br /&gt;
|  Duplicate from application ExeFS. Always image 00000002&lt;br /&gt;
|  0x36C0 Bytes&lt;br /&gt;
|  [[2.0.0-2]]&lt;br /&gt;
|  [https://dl.dropboxusercontent.com/u/60710927/CTR/Sample/eShopExtdata/icon Download_EUR]&lt;br /&gt;
|-&lt;br /&gt;
|  TIGER100.tmp&lt;br /&gt;
|  Always image 00000003.&lt;br /&gt;
|  0xCE47 bytes (varies?)&lt;br /&gt;
|  [[2.0.0-2]]&lt;br /&gt;
|  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Music ==&lt;br /&gt;
The eShop pulls its music from a static, region-specific link in the following format: &lt;br /&gt;
&lt;br /&gt;
https:// a248.e.akamai.net/f/248/103046/10m/npdl.c.app.nintendowifi.net/p01/nsa/CtfKXACbUPl8s7lk/BGM1/REGION_BGM1 ,&lt;br /&gt;
where region is one of the primary system regions (JP, US, EU, KR, etc.) Support also exists for &#039;BGM2&#039;, but this seems to be unused.&lt;br /&gt;
The music is held in a [[SpotPass|BOSS]] container. &lt;br /&gt;
&lt;br /&gt;
The format consists of a brief XML header describing the audio (including the date it was set as the main eShop theme, loop times, size, etc) followed by a raw AAC stream. Tools such as FFmpeg can handle rebuilding this stream with ADTS headers for proper time info and such.&lt;br /&gt;
&lt;br /&gt;
The [[Home_Menu|Home Menu]] uses nearly the same format for the Theme Shop&#039;s background music.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SpotPass&amp;diff=12828</id>
		<title>SpotPass</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SpotPass&amp;diff=12828"/>
		<updated>2015-06-14T10:27:57Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Content Container */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;SpotPass&#039;&#039;&#039; is a Nintendo 3DS feature that allows the 3DS to automatically download content, notifications, and software when it&#039;s in standby mode.(SpotPass may download/upload some content while the 3DS is in &amp;quot;active&amp;quot; mode, but *only* if the currently active app uses SpotPass) SpotPass can upload content as well. Software downloaded with SpotPass is stored on SD card.&lt;br /&gt;
&lt;br /&gt;
SpotPass Internet communications are mostly HTTPS transfers.&lt;br /&gt;
&lt;br /&gt;
In System Settings, you can disable SpotPass automatic title downloading, but it states that important software will still downloaded.(This only disables downloading of free titles via SpotPass)&lt;br /&gt;
&lt;br /&gt;
&#039;nasc.nintendowifi.net&#039; confirmed usages:(not SpotPass related)&lt;br /&gt;
&lt;br /&gt;
*Friends List applet requires this server to be &#039;Online&#039; (most likely the reason for regular requests to this server)&lt;br /&gt;
*Required for initialization of [[eShop]], (for first time eShop users). Not required for using eShop after first use.&lt;br /&gt;
&lt;br /&gt;
Every time the system connects to the wifi AP, the BOSS(SpotPass) module itself will download the cleartext xml policylist: &amp;quot;https://nppl.c.app.nintendowifi.net/p01/policylist/3/&amp;lt;countrycode&amp;gt;&amp;quot;. This policylist contains a list of SpotPass tasks for certain titles. This policylist can control whether the specified tasks are processed at all. The default user-agent used for SpotPass HTTPS requests(including this policylist) is: &amp;quot;PBOS-5.0/&amp;lt;printed hex u64 [[CfgS:GetLocalFriendCodeSeed|LocalFriendCodeSeed]]&amp;gt;-&amp;lt;hex u64 obtained via the friends service&amp;gt;/&amp;lt;text [[CVer|system]] [[NVer|version]]&amp;gt;/&amp;lt;unknown decimal value&amp;gt;/0&amp;quot;. No user-agent is used for plaintext HTTP requests with SpotPass.&lt;br /&gt;
&lt;br /&gt;
In some cases the BOSS module will add the following URL parameter to HTTPS requests, when connected to a [[Nintendo Zone]] AP: &amp;quot;ap=&amp;lt;NZoneApNum&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Titles Spotpass usage ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Title&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[Home Menu]]&lt;br /&gt;
| Home Menu uses SpotPass for system notifications, and for uploading data from home-menu shared extdata.&lt;br /&gt;
|-&lt;br /&gt;
| [[System Settings]]&lt;br /&gt;
| System Settings uses SpotPass for uploading data, with this URL: https://npul.c.app.nintendowifi.net/p01/recv/&amp;lt;RegionID&amp;gt;/sendcfg This RegionID is separate from the RegionIDs home-menu uses.&lt;br /&gt;
|-&lt;br /&gt;
| ?&lt;br /&gt;
| Unknown log data is uploaded with this URL: https://logus-p.est.c.app.nintendowifi.net/LogServer_us_live/Upload&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Automatic System Update Download ==&lt;br /&gt;
See [[Automatic System Update Download]].&lt;br /&gt;
&lt;br /&gt;
== Content Container ==&lt;br /&gt;
&lt;br /&gt;
SpotPass content can use this container to encrypt the payload and sign it, however SpotPass also supports downloading raw content without this container. The cleartext content is stored in [[extdata]]. The format of these headers is big-endian.&lt;br /&gt;
&lt;br /&gt;
=== BOSS 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 Number &amp;quot;boss&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic Number 0x10001&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Big-endian filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 release date (UNIX timestamp)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x2&lt;br /&gt;
| Must always be 0x1&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x2&lt;br /&gt;
| Content header hash type, always 0x2 for SHA-256&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A&lt;br /&gt;
| 0x2&lt;br /&gt;
| Content header RSA size, always 0x2 for RSA-2048 (X&amp;lt;&amp;lt;7)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0xC&lt;br /&gt;
| First 12 bytes of the CTR&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Data following the BOSS header is encrypted with AES-CTR. The first 12 bytes of the CTR are from offset 0x1C of the header, while the last word of the CTR in big-endian is 0x1. The CTR from the header is random per file, and an unique random CTR is used each time the content is updated. The cleartext data begins with the content header.&lt;br /&gt;
&lt;br /&gt;
=== Content 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;
| 0x10&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| FileID used for the extdata filename&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x20&lt;br /&gt;
| SHA-256 hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 0x100&lt;br /&gt;
| RSA-2048 signature over the above hash&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first 0x10-bytes are all-zero except the first byte which is usually 0x80. It&#039;s unknown what the first 0x10-bytes are used for.&lt;br /&gt;
&lt;br /&gt;
The hash at offset 0x12 hashes the 0x12-byte data at offset 0x0 followed by a zero u16. The RSA signature is signed by Nintendo. Following this header is the actual content payload, which is written to a cleartext file under the [[extdata]] /boss directory. The data following the payload header is written to extdata, but it&#039;s unknown what data is written to the extdata file before the content payload.&lt;br /&gt;
&lt;br /&gt;
=== Payload Content 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;
| 0x8&lt;br /&gt;
| ProgramID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Usually zero?&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Usually 0x10001? (observed 0x20001 in eShop strings)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Size of the payload after this header&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Extdata FileID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x20&lt;br /&gt;
| SHA-256 hash, unknown what this hashes&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0x100&lt;br /&gt;
| RSA-2048 signature over the previous SHA-256 hash&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This signature is signed by Nintendo with the same key-pair as the content header.&lt;br /&gt;
&lt;br /&gt;
[[Category:Nintendo Software]]&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CIA&amp;diff=12827</id>
		<title>CIA</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CIA&amp;diff=12827"/>
		<updated>2015-06-14T04:44:53Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* CIA Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
CIA stands for &#039;&#039;&#039;C&#039;&#039;&#039;TR &#039;&#039;&#039;I&#039;&#039;&#039;mportable &#039;&#039;&#039;A&#039;&#039;&#039;rchive. This format allows the installation titles to the 3DS. CIA files and titles on [[Title list|Nintendo&#039;s CDN]] contain identical data. As a consequence, valid CIA files can be generated from CDN content. This also means CIA files can contain anything that titles on Nintendo&#039;s CDN can contain. &lt;br /&gt;
&lt;br /&gt;
Under normal circumstances CIA files are used where downloading a title is impractical or not possible. Such as distributing a [[Download Play]] child, or installing forced Gamecard updates. Those CIA(s) are stored by the titles in question, in an auxiliary [[NCCH#CFA|CFA]] file.&lt;br /&gt;
&lt;br /&gt;
Development Units, are capable of manually installing CIA files via the [[3DS Development Unit Software#Dev Menu|Dev Menu]].&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
This is the current version of the CIA format, it was finalised in late 2010. (Older versions of the CIA format can be viewed on the [[Talk:CIA|Talk]] page)&lt;br /&gt;
&lt;br /&gt;
The CIA format has a similar structure to the [http://wiibrew.org/wiki/Wad WAD format].&lt;br /&gt;
&lt;br /&gt;
The file is represented in little-endian.&lt;br /&gt;
&lt;br /&gt;
The data is aligned in 64 byte blocks (if a content ends at the middle of the block, the next content will begin from a new block).&lt;br /&gt;
&lt;br /&gt;
=== CIA Header ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x00&lt;br /&gt;
|  0x04 &lt;br /&gt;
|  Archive Header Size (Usually = 0x2020 bytes)&lt;br /&gt;
|-&lt;br /&gt;
|  0x04&lt;br /&gt;
|  0x02&lt;br /&gt;
|  Type&lt;br /&gt;
|-&lt;br /&gt;
|  0x06&lt;br /&gt;
|  0x02&lt;br /&gt;
|  Version&lt;br /&gt;
|- &lt;br /&gt;
|  0x08     &lt;br /&gt;
|  0x04&lt;br /&gt;
|  Certificate chain size  &lt;br /&gt;
|-&lt;br /&gt;
|  0x0C      &lt;br /&gt;
|  0x04&lt;br /&gt;
|  [[Ticket]] size&lt;br /&gt;
|-&lt;br /&gt;
|  0x10     &lt;br /&gt;
|  0x04&lt;br /&gt;
|  [[TMD]] file size&lt;br /&gt;
|-&lt;br /&gt;
|  0x14     &lt;br /&gt;
|  0x04&lt;br /&gt;
|  Meta size (0 if no Meta data is present)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18     &lt;br /&gt;
|  0x08&lt;br /&gt;
|  Content size&lt;br /&gt;
|-&lt;br /&gt;
|  0x20&lt;br /&gt;
|  0x2000&lt;br /&gt;
|  Content Index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The order of the sections in the CIA file:&lt;br /&gt;
* certificate chain&lt;br /&gt;
* Ticket&lt;br /&gt;
* TMD file data&lt;br /&gt;
* Content file data&lt;br /&gt;
* Meta file data (Not a necessary component) &lt;br /&gt;
&lt;br /&gt;
The contents (NCCH/SRL) are encrypted using 128-bit AES-CBC. The encryption uses the decrypted titlekey from the [[Ticket#Structure|ticket]], and the content index from the TMD padded with zeros as the IV.&lt;br /&gt;
&lt;br /&gt;
=== Certificate Chain ===&lt;br /&gt;
&lt;br /&gt;
There are three [[Certificates|certificates]] in this chain:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  CERTIFICATE&lt;br /&gt;
!  SIGNATURE TYPE&lt;br /&gt;
!  RETAIL CERT NAME&lt;br /&gt;
!  DEBUG CERT NAME&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  CA&lt;br /&gt;
|  RSA-4096&lt;br /&gt;
|  CA00000003&lt;br /&gt;
|  CA00000004&lt;br /&gt;
|  Used to verify the Ticket/TMD Certificates&lt;br /&gt;
|-&lt;br /&gt;
|  Ticket&lt;br /&gt;
|  RSA-2048&lt;br /&gt;
|  XS0000000c&lt;br /&gt;
|  XS00000009&lt;br /&gt;
|  Used to verify the Ticket signature&lt;br /&gt;
|-&lt;br /&gt;
|  TMD&lt;br /&gt;
|  RSA-2048&lt;br /&gt;
|  CP0000000b&lt;br /&gt;
|  CP0000000a&lt;br /&gt;
|  Used to verify the TMD signature&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The CA certificate is issued by &#039;Root&#039;, the public key for which is stored in NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=== Meta ===&lt;br /&gt;
&lt;br /&gt;
The structure of this data is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x00&lt;br /&gt;
|  0x180&lt;br /&gt;
|  Title ID dependency list - Taken from the application&#039;s [[NCCH#Extended Header|ExHeader]]&lt;br /&gt;
|-&lt;br /&gt;
|  0x180&lt;br /&gt;
|  0x180&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x300&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Core Version&lt;br /&gt;
|-&lt;br /&gt;
|  0x304&lt;br /&gt;
|  0xFC&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x400&lt;br /&gt;
|  0x36C0&lt;br /&gt;
|  [[SMDH|Icon Data]](.ICN) - Taken from the application&#039;s [[ExeFS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Obviously this section is not present in TWL CIA files, or any other CIA file which does not contain a [[NCCH#CXI|CXI]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/3dshax/ctr/tree/master/ctrtool ctrtool] - Reading/Extraction of CIA files. This can only decrypt the title-key for development CIAs, since retail CIAs use the [[AES]] hardware key-scrambler for the common-key keyslot.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ctrdev/ctrsdk/tree/master/tools/make_cia make_cia] - Generating CIA files. Requires CommonKey and ticket/TMD RSA-2048 private exponents.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ctrdev/ctrsdk/tree/master/tools/make_cdn_cia make_cdn_cia] - (CMD)(Windows/Linux) Generates CIA files from CDN Content &lt;br /&gt;
&lt;br /&gt;
== Title Key Encryption ==&lt;br /&gt;
&lt;br /&gt;
The unencrypted Title Key is used to encrypt the data in a CIA. The encrypted Title Key of a CIA can be found at offset 0x1BF in a CIA&#039;s Ticket.&lt;br /&gt;
Each Title Key is encrypted with AES-CBC to get the encrypted Title Key.&lt;br /&gt;
&lt;br /&gt;
To encrypt an unencrypted title key, you need:&lt;br /&gt;
&lt;br /&gt;
* Common key (as byte array)&lt;br /&gt;
* Title ID (as ulong)&lt;br /&gt;
* (and of course the unencrypted title key you want to encrypt) (as byte array)&lt;br /&gt;
&lt;br /&gt;
The title key encryption process starts by converting the ulong (Title ID) into a byte array using by retrieving the bytes of the Title ID using BitConverter.GetBytes().&lt;br /&gt;
If the converted bytes (title ID) are in Little Endian, reverse those bytes. (in C# it would be Array.Reverse(byte_array_from_bitconverter))&lt;br /&gt;
This process makes the Title Key encryption IV.&lt;br /&gt;
&lt;br /&gt;
Next, after you&#039;ve gotten your Title Key&#039;s IV, you can start your cryptography transformation. Using AESManaged, where:&lt;br /&gt;
&lt;br /&gt;
Key  = Common Key&lt;br /&gt;
&lt;br /&gt;
IV   = the byte array found in the conversion process above&lt;br /&gt;
&lt;br /&gt;
Mode = CipherMode.CBC&lt;br /&gt;
&lt;br /&gt;
Create the encryptor (AesManaged.CreateEncryptor(key, iv)) where the key and IV are both the same as above.&lt;br /&gt;
&lt;br /&gt;
Then, create a CryptoStream and a MemoryStream. The Crypto stream should start with the arguments (memorystream, aes_transform_from_above, CryptoStreamMode.Write).&lt;br /&gt;
&lt;br /&gt;
Write to the CryptoStream where buffer=unencrypted_titlekey, offset=0, and count=the length of the unencrypted title key.&lt;br /&gt;
&lt;br /&gt;
Use FlushFinalBlock() on the CryptoStream.&lt;br /&gt;
&lt;br /&gt;
Finally, then, the encrypted title key will be available from your memory &lt;br /&gt;
stream. (to output the calculated encrypted title key as a byte array, you can use memorystream.ToArray(), for example)&lt;br /&gt;
&lt;br /&gt;
Example function: (C#)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        public static byte[] EncryptMyTitleKey(byte[] commonKey, byte[] titleKey, ulong titleId)&lt;br /&gt;
        {&lt;br /&gt;
            // Make encryption IV&lt;br /&gt;
            byte[] titleidasbytes = new byte[0x10];&lt;br /&gt;
            for (int i = 0; i &amp;lt; 0x10; i++)&lt;br /&gt;
            {&lt;br /&gt;
                titleidasbytes[i] = 0;&lt;br /&gt;
            }&lt;br /&gt;
            byte[] bitBytes = BitConverter.GetBytes(titleId);&lt;br /&gt;
            if (BitConverter.IsLittleEndian)&lt;br /&gt;
            {&lt;br /&gt;
                Array.Reverse(bitBytes);&lt;br /&gt;
            }&lt;br /&gt;
            bitBytes.CopyTo(titleidasbytes, 0);&lt;br /&gt;
            // Encrypt&lt;br /&gt;
            ICryptoTransform transform = new AesManaged { Key = commonKey, IV = titleidasbytes, Mode = CipherMode.CBC }.CreateEncryptor(commonKey, titleidasbytes);&lt;br /&gt;
            MemoryStream memstream = new MemoryStream();&lt;br /&gt;
            CryptoStream cryptostream = new CryptoStream(memstream, transform, CryptoStreamMode.Write);&lt;br /&gt;
            cryptostream.Write(titleKey, 0, titleKey.Length);&lt;br /&gt;
            cryptostream.FlushFinalBlock();&lt;br /&gt;
            return memstream.ToArray();&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Services&amp;diff=12821</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Services&amp;diff=12821"/>
		<updated>2015-06-12T04:39:09Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Services are an abstraction of ports and are the commonly used way of inter-process communication outside of the kernel. While handles of regular ports are retrieved from [[SVC]](svcConnectToPort), service handles are retrieved through the port &#039;&#039;srv:&#039;&#039; (&amp;quot;service manager&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
When a service is registered, [[SVC|svcCreatePort]] is used without a port-name. This means that the port is inaccessible via the port SVCs outside of sm-module. See below for getting a session handle for sending commands to services.&lt;br /&gt;
&lt;br /&gt;
Processes with PID less than or equal to the number of NATIVE_FIRM built-in modules (fs, sm, pm, pxi, ldr) have access to all services. This value is obtained from [[SVC|svcGetSystemInfo]].&lt;br /&gt;
&lt;br /&gt;
Attempting to use srvGetServiceSession with a service that the process has access to when that service isn&#039;t registered, results in svcSendSyncRequest never returning(the exact cause is unknown).&lt;br /&gt;
&lt;br /&gt;
==Service Manager Port &amp;quot;srv:&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010002&lt;br /&gt;
| Initialize&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020000&lt;br /&gt;
| GetProcSemaphore() (the handle from this gets signaled when notifications for this process gets triggered)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030100&lt;br /&gt;
| RegisterService(8-byte servicename, u32 strlen, u32 max_sessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000400C0&lt;br /&gt;
| UnregisterService(8-byte servicename, u32 strlen)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050100&lt;br /&gt;
| GetServiceSession(8-byte servicename, u32 strlen, u32 flags)&lt;br /&gt;
&lt;br /&gt;
Flags bit0: if not set, return port-handle instead of session-handle(from [[SVC|svcCreateSessionToPort]]) when session-handle unavailable (max sessions/timeout?).&lt;br /&gt;
|-&lt;br /&gt;
| 0x000600C2&lt;br /&gt;
| RegisterPort(8-byte servicename, u32 strlen, Handle client_port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000700C0&lt;br /&gt;
| UnregisterPort(8-byte servicename, u32 strlen)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080100&lt;br /&gt;
| GetPort(8-byte servicename, u32 strlen, u32 flags).&lt;br /&gt;
&lt;br /&gt;
Flags bit0: return 0 instead of port handle if port was found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| Subscribe(u32 notification_id). This enables the specified notificationID for the current process.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0040&lt;br /&gt;
| Unsubscribe(u32 notification_id). This disables the specified notificationID for the current process.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| ReceiveNotification() This returns the notificationID which was triggered, if any(see GetProcSemaphore).&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0080&lt;br /&gt;
| PublishToSubscriber(u32 notification_id, u32 flag). This fires an notification. Bit0: only fire if not already fired, bit1: return error if error happens, else it always returns 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0040&lt;br /&gt;
| This can fire notificationIDs and return the number of fired notificationID&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E00C0&lt;br /&gt;
| HasAccessToService(8-byte servicename, u32 strlen). Returns 1 if your process has access to the service.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Service Manager Process-Manager Port &amp;quot;srv:pm&amp;quot;==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header, prior to [[7.0.0-13]]&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x04030082&lt;br /&gt;
| RegisterProcess (u32 procid, u32 wordsz, &amp;lt;nowiki&amp;gt;((wordsz&amp;lt;&amp;lt;16) | 2)&amp;lt;/nowiki&amp;gt;, serviceaccesscontrol*).&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040040&lt;br /&gt;
| UnregisterProcess (u32 procid).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Register command registers a process with the service-manager, which includes registering the serviceaccesscontrol for the process which normally originates from the [[NCCH/Extended_Header|exheader]].&lt;br /&gt;
&lt;br /&gt;
Prior to to [[7.0.0-13]], the commands listed for &amp;quot;srv:&amp;quot; were also accessible under this port with the same command-headers. Starting with [[7.0.0-13]], the &amp;quot;srv:pm&amp;quot; port was changed to a service. With this change, commandIDs for these commands were changed. &amp;quot;srv:pm&amp;quot; was originally vulnerable, this was fixed with [[7.0.0-13]], see [[3DS_exploits|here]]. Originally any process could use &amp;quot;srv:pm&amp;quot;, however starting with [[7.0.0-13]] only the built-in NATIVE_FIRM sysmodules have access to it. The only system title which uses &amp;quot;srv:pm&amp;quot; is the [[Process_Manager_Services|Process Manager]].&lt;br /&gt;
&lt;br /&gt;
==Notifications==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  ID&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| This indicates that all processes must terminate: power-off, reboot, or [[FIRM]]-launch.&lt;br /&gt;
|-&lt;br /&gt;
| 0x105&lt;br /&gt;
| This indicates that the system is entering sleep mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x108&lt;br /&gt;
| error at boot?&lt;br /&gt;
|-&lt;br /&gt;
| 0x202&lt;br /&gt;
| POWER button pressed&lt;br /&gt;
|-&lt;br /&gt;
| 0x204&lt;br /&gt;
| This indicates that the HOME button was pressed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x205&lt;br /&gt;
| HOME button pressed&lt;br /&gt;
|-&lt;br /&gt;
| 0x207&lt;br /&gt;
| SD card inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x208&lt;br /&gt;
| Game cartridge inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x209&lt;br /&gt;
| SD card removed&lt;br /&gt;
|-&lt;br /&gt;
| 0x20A&lt;br /&gt;
| Game cartridge removed&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B&lt;br /&gt;
| Game cartridge inserted or removed&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Error_codes&amp;diff=12820</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Error_codes&amp;diff=12820"/>
		<updated>2015-06-11T01:49:45Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All system error codes follow a shared format.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-9&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 10-17&lt;br /&gt;
| Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-26&lt;br /&gt;
| Summary&lt;br /&gt;
|-&lt;br /&gt;
| 27-31&lt;br /&gt;
| Level&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Description ranges:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Num&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 100-179&lt;br /&gt;
| Not found&lt;br /&gt;
|-&lt;br /&gt;
| 180-199&lt;br /&gt;
| Exists already&lt;br /&gt;
|-&lt;br /&gt;
| 200-219&lt;br /&gt;
| Not enough space&lt;br /&gt;
|-&lt;br /&gt;
| 220-229&lt;br /&gt;
| Invalidated archive&lt;br /&gt;
|-&lt;br /&gt;
| 230-339&lt;br /&gt;
| Unacceptable&lt;br /&gt;
|-&lt;br /&gt;
| 390-399&lt;br /&gt;
| Verification failure&lt;br /&gt;
|-&lt;br /&gt;
| 760-779&lt;br /&gt;
| Not supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Description values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Num&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Invalid memory permissions (kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Invalid ticket version (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Invalid string length. This error is returned when service name length is greater than 8 or zero. (srv)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Access denied. This error is returned when you request a service that you don&#039;t have access to. (srv)&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| String size does not match string contents. This error is returned when service name contains an unexpected null byte. (srv)&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Camera already in use/busy (qtm).&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Not enough memory (os)&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Session closed by remote (os)&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| Invalid NCCH? (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| Invalid title version (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 43&lt;br /&gt;
| Database doesn&#039;t exist/failed to open (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 44&lt;br /&gt;
| Trying to uninstall system-app (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 101&lt;br /&gt;
| Archive not mounted/mount-point not found (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 105&lt;br /&gt;
| Request timed out (http)&lt;br /&gt;
|-&lt;br /&gt;
| 106&lt;br /&gt;
| Invalid signature/CIA? (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 120&lt;br /&gt;
| Title/object not found? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 141&lt;br /&gt;
| Gamecard not inserted? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 230&lt;br /&gt;
| Invalid open-flags / permissions? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 271&lt;br /&gt;
| Invalid configuration (mvd).&lt;br /&gt;
|-&lt;br /&gt;
| 391&lt;br /&gt;
| NCCH hash-check failed? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 392&lt;br /&gt;
| RSA/AES-MAC verification failed? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 393&lt;br /&gt;
| Invalid database? (AM)&lt;br /&gt;
|-&lt;br /&gt;
| 395&lt;br /&gt;
| RomFS/Savedata hash-check failed? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 630&lt;br /&gt;
| Command not allowed / missing permissions? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 702&lt;br /&gt;
| Invalid path? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 761&lt;br /&gt;
| Incorrect read-size for ExeFS? (fs)&lt;br /&gt;
|-&lt;br /&gt;
| 1000&lt;br /&gt;
| Invalid selection&lt;br /&gt;
|-&lt;br /&gt;
| 1001&lt;br /&gt;
| Too large&lt;br /&gt;
|-&lt;br /&gt;
| 1002&lt;br /&gt;
| Not authorized&lt;br /&gt;
|-&lt;br /&gt;
| 1003&lt;br /&gt;
| Already done&lt;br /&gt;
|-&lt;br /&gt;
| 1004&lt;br /&gt;
| Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 1005&lt;br /&gt;
| Invalid enum value&lt;br /&gt;
|-&lt;br /&gt;
| 1006&lt;br /&gt;
| Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 1007&lt;br /&gt;
| No data&lt;br /&gt;
|-&lt;br /&gt;
| 1008&lt;br /&gt;
| Busy&lt;br /&gt;
|-&lt;br /&gt;
| 1009&lt;br /&gt;
| Misaligned address&lt;br /&gt;
|-&lt;br /&gt;
| 1010&lt;br /&gt;
| Misaligned size&lt;br /&gt;
|-&lt;br /&gt;
| 1011&lt;br /&gt;
| Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 1012&lt;br /&gt;
| Not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 1013&lt;br /&gt;
| Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 1014&lt;br /&gt;
| Invalid pointer&lt;br /&gt;
|-&lt;br /&gt;
| 1015&lt;br /&gt;
| Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 1016&lt;br /&gt;
| Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 1017&lt;br /&gt;
| Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 1018&lt;br /&gt;
| Not found&lt;br /&gt;
|-&lt;br /&gt;
| 1019&lt;br /&gt;
| Cancel requested&lt;br /&gt;
|-&lt;br /&gt;
| 1020&lt;br /&gt;
| Already exists&lt;br /&gt;
|-&lt;br /&gt;
| 1021&lt;br /&gt;
| Out of range&lt;br /&gt;
|-&lt;br /&gt;
| 1022&lt;br /&gt;
| Timeout&lt;br /&gt;
|-&lt;br /&gt;
| 1023&lt;br /&gt;
| Invalid result value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Summary values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Num&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Nothing happened&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Would block&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Out of resource&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Not found&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Invalid state&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Not supported&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Wrong argument&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Canceled&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Status changed&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Internal&lt;br /&gt;
|-&lt;br /&gt;
| 63&lt;br /&gt;
| Invalid result value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Module values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Num&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Common&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Util&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| File server&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Loader server&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| TCB&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| OS&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| DBG&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| DMNT&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| PDN&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| GX&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| I2C&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| GPIO&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| DD&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| CODEC&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| SPI&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| PXI&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| FS&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| DI&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| HID&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| CAM&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| PI&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| PM&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| PM_LOW&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| FSI&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| SRV&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| NDM&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| NWM&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| SOC&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| LDR&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| ACC&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| RomFS&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| AM&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| HIO&lt;br /&gt;
|-&lt;br /&gt;
| 34&lt;br /&gt;
| Updater&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
| MIC&lt;br /&gt;
|-&lt;br /&gt;
| 36&lt;br /&gt;
| FND&lt;br /&gt;
|-&lt;br /&gt;
| 37&lt;br /&gt;
| MP&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| MPWL&lt;br /&gt;
|-&lt;br /&gt;
| 39&lt;br /&gt;
| AC&lt;br /&gt;
|-&lt;br /&gt;
| 40&lt;br /&gt;
| HTTP&lt;br /&gt;
|-&lt;br /&gt;
| 41&lt;br /&gt;
| DSP&lt;br /&gt;
|-&lt;br /&gt;
| 42&lt;br /&gt;
| SND&lt;br /&gt;
|-&lt;br /&gt;
| 43&lt;br /&gt;
| DLP&lt;br /&gt;
|-&lt;br /&gt;
| 44&lt;br /&gt;
| HIO_LOW&lt;br /&gt;
|-&lt;br /&gt;
| 45&lt;br /&gt;
| CSND&lt;br /&gt;
|-&lt;br /&gt;
| 46&lt;br /&gt;
| SSL&lt;br /&gt;
|-&lt;br /&gt;
| 47&lt;br /&gt;
| AM_LOW&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| NEX&lt;br /&gt;
|-&lt;br /&gt;
| 49&lt;br /&gt;
| Friends&lt;br /&gt;
|-&lt;br /&gt;
| 50&lt;br /&gt;
| RDT&lt;br /&gt;
|-&lt;br /&gt;
| 51&lt;br /&gt;
| Applet&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| NIM&lt;br /&gt;
|-&lt;br /&gt;
| 53&lt;br /&gt;
| PTM&lt;br /&gt;
|-&lt;br /&gt;
| 54&lt;br /&gt;
| MIDI&lt;br /&gt;
|-&lt;br /&gt;
| 55&lt;br /&gt;
| MC&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| SWC&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| FatFS&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| NGC&lt;br /&gt;
|-&lt;br /&gt;
| 59&lt;br /&gt;
| CARD&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| CARDNOR&lt;br /&gt;
|-&lt;br /&gt;
| 61&lt;br /&gt;
| SDMC&lt;br /&gt;
|-&lt;br /&gt;
| 62&lt;br /&gt;
| BOSS&lt;br /&gt;
|-&lt;br /&gt;
| 63&lt;br /&gt;
| DBM&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| Config&lt;br /&gt;
|-&lt;br /&gt;
| 65&lt;br /&gt;
| PS&lt;br /&gt;
|-&lt;br /&gt;
| 66&lt;br /&gt;
| CEC&lt;br /&gt;
|-&lt;br /&gt;
| 67&lt;br /&gt;
| IR&lt;br /&gt;
|-&lt;br /&gt;
| 68&lt;br /&gt;
| UDS&lt;br /&gt;
|-&lt;br /&gt;
| 69&lt;br /&gt;
| PL&lt;br /&gt;
|-&lt;br /&gt;
| 70&lt;br /&gt;
| CUP&lt;br /&gt;
|-&lt;br /&gt;
| 71&lt;br /&gt;
| Gyroscope&lt;br /&gt;
|-&lt;br /&gt;
| 72&lt;br /&gt;
| MCU&lt;br /&gt;
|-&lt;br /&gt;
| 73&lt;br /&gt;
| NS&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| News&lt;br /&gt;
|-&lt;br /&gt;
| 75&lt;br /&gt;
| RO&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| GD&lt;br /&gt;
|-&lt;br /&gt;
| 77&lt;br /&gt;
| Card SPI&lt;br /&gt;
|-&lt;br /&gt;
| 78&lt;br /&gt;
| EC&lt;br /&gt;
|-&lt;br /&gt;
| 79&lt;br /&gt;
| Web Browser&lt;br /&gt;
|-&lt;br /&gt;
| 80&lt;br /&gt;
| Test&lt;br /&gt;
|-&lt;br /&gt;
| 81&lt;br /&gt;
| ENC&lt;br /&gt;
|-&lt;br /&gt;
| 82&lt;br /&gt;
| PIA&lt;br /&gt;
|-&lt;br /&gt;
| 92&lt;br /&gt;
| MVD&lt;br /&gt;
|-&lt;br /&gt;
| 96&lt;br /&gt;
| QTM&lt;br /&gt;
|-&lt;br /&gt;
| 254&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 255&lt;br /&gt;
| Invalid result value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Level values:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Num&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Info&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Status&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Temporary&lt;br /&gt;
|-&lt;br /&gt;
| 27&lt;br /&gt;
| Permanent&lt;br /&gt;
|-&lt;br /&gt;
| 28&lt;br /&gt;
| Usage&lt;br /&gt;
|-&lt;br /&gt;
| 29&lt;br /&gt;
| Reinitialize&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Reset&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Fatal&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Loader_Services&amp;diff=12793</id>
		<title>Loader Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Loader_Services&amp;diff=12793"/>
		<updated>2015-06-06T21:59:15Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Loader service &amp;quot;Loader&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
= Loader service &amp;quot;Loader&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010080&lt;br /&gt;
| LoadProcess(u64 titlehandle). This maps 0x10000000 and reads ExeFS:/.code there, then decompresses it if needed. This then uses [[SVC|svcCreateProcess]] and svcSetupProcess. Once finished this writes the KProcess handle to cmdreply[3].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020200&lt;br /&gt;
| RegisterProgram. Writes u64 titlehandle starting at cmdreply[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| UnregisterProgram&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| GetExheader(u64 titlehandle)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Services_API&amp;diff=12780</id>
		<title>Services API</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Services_API&amp;diff=12780"/>
		<updated>2015-06-05T04:21:15Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nintendo provides application developers with an API, which communicate with certain services. Services, in this sense, are system processes running in the background which wait for incoming requests. When a process wants to communicate with a service, it first needs to get a handle to the named service, and then it can communicate with the service via interprocess communication. Each service has a name up to 8 characters, for example &amp;quot;nim:u&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Handles for services are retrieved from the service manager port, &amp;quot;srv:&amp;quot;. Services are an abstraction of ports, they operate the same way except regular ports can have their handles retrieved directly from a SVC.&lt;br /&gt;
&lt;br /&gt;
For a description of how commands and arguments are passed to services, see [[IPC Command Structure]].&lt;br /&gt;
&lt;br /&gt;
List of services:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Old3ds&lt;br /&gt;
!  Services&lt;br /&gt;
!  Service names&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; |  Notes&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Filesystem services‎]]&lt;br /&gt;
| fs:USER, fs:LDR, fs:REG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Process Services‎]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[PXI Services‎]]&lt;br /&gt;
| PxiFS0, PxiFS1, PxiFSB, PxiFSR, PxiPM, pxi:am9, pxi:dev, pxi:mc, pxi:ps9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Application Manager Services]]&lt;br /&gt;
| am:app, am:net, am:u, am:sys, am:pipe&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Process Manager Services]]&lt;br /&gt;
| pm:app, pm:dbg&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NIM Services]]&lt;br /&gt;
| nim:aoc, nim:ndm, nim:s, nim:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Config Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NS|NS and APT Services]]&lt;br /&gt;
| ns:s, ns:p, ns:c, APT:A, APT:S, APT:U&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[RO Services]]&lt;br /&gt;
| ldr:ro&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NDM Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[CSND Services]]&lt;br /&gt;
| csnd:SND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| cam:u, y2r:u, cam:s, cam:c, cam:q (New3DS only)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Codec Services]]&lt;br /&gt;
| cdc:HID, cdc:MIC, cdc:CSN, cdc:DSP, cdc:LGY, cdc:CHK&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[DLP Services]]&lt;br /&gt;
| dlp:CLNT, dlp:FKCL, dlp:SRVR&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[DSP Services]]&lt;br /&gt;
| dsp::DSP&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[GSP Services]]&lt;br /&gt;
| gsp::Lcd, gsp::Gpu&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[BOSS Services]]&lt;br /&gt;
| boss:U&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[IR Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[I2C Services]]&lt;br /&gt;
| i2c::MCU, i2c::CAM, i2c::LCD, i2c::DEB, i2c::HID, i2c::IR, i2c::EEP&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[GPIO Services]]&lt;br /&gt;
| gpio:CDC, gpio:MCU, gpio:HID, gpio:NWM, gpio:IR&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[HID Services]]&lt;br /&gt;
| hid:NFC, hid:QTM, hid:SPVR, hid:USER &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[PTM Services]]&lt;br /&gt;
| ptm:gets, ptm:play, ptm:s, ptm:sets, ptm:sysm, ptm:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
| nwm::UDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[HTTP Services]]&lt;br /&gt;
| http:C&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[SSL Services]]&lt;br /&gt;
| ssl:C&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Socket Services]]&lt;br /&gt;
| soc:P, soc:U&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[AC Services]]&lt;br /&gt;
| ac:i, ac:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Friend Services]]&lt;br /&gt;
| frd:a, frd:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[News Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[PDN Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[SPI Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Loader Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[MCU Services]]&lt;br /&gt;
| mcu::CAM, mcu::GPU, mcu::HID, mcu::RTC, mcu::SND, mcu::NWM, mcu::HWC, mcu::PLS, mcu::CDC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[MIC Services]]&lt;br /&gt;
| mic:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[ACT Services]]&lt;br /&gt;
| act:a, act:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[NFC Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[QTM Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
List of PXI services:&lt;br /&gt;
* [[Filesystem services PXI]]&lt;br /&gt;
* [[Process Services PXI]]&lt;br /&gt;
* [[Application Manager Services PXI]]&lt;br /&gt;
* [[Process Manager Services PXI]]&lt;br /&gt;
* [[Development Services PXI]]&lt;br /&gt;
* [[Gamecard Services PXI]]&lt;br /&gt;
* [[Legacy FIRM PXI]] (TWL_FIRM/AGB_FIRM)&lt;br /&gt;
&lt;br /&gt;
List of ports:&lt;br /&gt;
* [[ErrDisp]]&lt;br /&gt;
* [[Services]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See [[Error codes]].&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=12744</id>
		<title>3DS Virtual Console</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=12744"/>
		<updated>2015-06-02T03:44:37Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* GBA VC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There&#039;s two types of VC titles: regular VC titles, and dedicated GBA VC titles.&lt;br /&gt;
&lt;br /&gt;
=Regular VC=&lt;br /&gt;
Regular VC titles: an emulator application + VC ROM in the NCCH [[RomFS]](among other things in the RomFS). The emulator build includes support for all supported VC platforms, not specific to just the included ROM platform.&lt;br /&gt;
&lt;br /&gt;
This emulator includes GBA support, however the GBA emulation for this this is somewhat slow. This was presumably implemented before AGB_FIRM was.&lt;br /&gt;
&lt;br /&gt;
Unlike Wii VC, the 3DS VC ROMs for NES use the &amp;quot;TNES&amp;quot; header.&lt;br /&gt;
&lt;br /&gt;
==RomFS==&lt;br /&gt;
* &amp;quot;rom:/rom/&amp;quot; This directory contains the ROM file(s). Filenames used under here don&#039;t matter: the filename is determined by the emulator app by doing a directory read.&lt;br /&gt;
* &amp;quot;rom:/shaders/&amp;quot; This directory contains GPU shaders used by the emulator app: .shbin, .csdr, and .obj.&lt;br /&gt;
* &amp;quot;rom:/VCM/&amp;quot; This directory contains graphics, audio, and text used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/agb.bin&amp;quot; GBA BIOS.&lt;br /&gt;
* &amp;quot;rom:/buildtime.txt&amp;quot; Emulator app build timestamp.&lt;br /&gt;
* &amp;quot;rom:/config.ini&amp;quot; Emulator configuration .ini, contains sections for all supported 3DS VC platforms.&lt;br /&gt;
* &amp;quot;rom:/&amp;lt;rom_name&amp;gt;.patch&amp;quot; rom_name = filename from the rom directory. This .ini contains patches for the ROM.&lt;br /&gt;
* &amp;quot;rom:/shader.shbin&amp;quot; GPU shader.&lt;br /&gt;
&lt;br /&gt;
=GBA VC=&lt;br /&gt;
GBA VC is run by [[FIRM|AGB_FIRM]]. RomFS isn&#039;t used for GBA VC titles, but can be found empty within GBA VC titles. The NCCH [[ExeFS]] contains the same files as a normal application. The [[ExeFS]]:/.code contains the GBA VC ROM followed by a 0x360 byte long footer.&lt;br /&gt;
&lt;br /&gt;
===Footer===&lt;br /&gt;
All values in the GBA VC footer are little-endian.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x004&lt;br /&gt;
|  0x4&lt;br /&gt;
|  GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x008&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save type (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x020&lt;br /&gt;
| 0x1&lt;br /&gt;
| Manufacturer info select (see below)&lt;br /&gt;
|-&lt;br /&gt;
| 0x024&lt;br /&gt;
| 0x300&lt;br /&gt;
| Unknown, three different types of this data have been observed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x338&lt;br /&gt;
| 0x4&lt;br /&gt;
| GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x344&lt;br /&gt;
| 0x4&lt;br /&gt;
| GBA ROM Filesize&lt;br /&gt;
|-&lt;br /&gt;
| 0x350&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &#039;.CAA&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x35A&lt;br /&gt;
| 0x2&lt;br /&gt;
| High two bytes of GBA ROM file size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Save types:&lt;br /&gt;
* EEPROM (various sizes, IDs specified in footer): 0x2&lt;br /&gt;
* SRAM/FRAM (128k): 0xE&lt;br /&gt;
* Flash (512k): 0x9&lt;br /&gt;
&lt;br /&gt;
Support for RTC and 1m-flash chips is not implemented in AGB_FIRM.&lt;br /&gt;
&lt;br /&gt;
Manufacturer info:&lt;br /&gt;
GBA games&#039; SDK-provided save code only supports a range of manufacturers from which Nintendo was buying memory from around the time of that game&#039;s development. As such, most games don&#039;t support a generic emulated storage chip. This byte appears to select a manufacturer info set to emulate. This has been observed to be 0x90, 0xC0, and (in one EEPROM-based game), 0x80.&lt;br /&gt;
* SRAM games up to and including V111 use 0xC0. Above use 0x90.&lt;br /&gt;
* FRAM V103 uses 0xC0. V104+ don&#039;t exist, and lower versions also likely use 0xC0.&lt;br /&gt;
* Flash V124 was observed 0x90, V131 was observed 0xC0.&lt;br /&gt;
* EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=IO_Registers&amp;diff=12712</id>
		<title>IO Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=IO_Registers&amp;diff=12712"/>
		<updated>2015-05-28T10:13:07Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Old3DS&lt;br /&gt;
! A9/A11&lt;br /&gt;
! Category&lt;br /&gt;
! Physaddr&lt;br /&gt;
! Used by&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[CONFIG Registers]]&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[IRQ Registers]]&lt;br /&gt;
| 0x10001000&lt;br /&gt;
| Boot9, Process9, Kernel9&lt;br /&gt;
| ARM9 Interrupt Masking&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[NDMA Registers]]&lt;br /&gt;
| 0x10002000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
| DMA Engine&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[TIMER Registers]]&lt;br /&gt;
| 0x10003000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[CTRCARD Registers]]&lt;br /&gt;
| 0x10004000 / 0x10005000&lt;br /&gt;
| Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[EMMC Registers]]&lt;br /&gt;
| 0x10006000 / 0x10007000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
| 0x10007000 is normally not enabled on retail, all-zeros when read.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[PXI Registers]]&lt;br /&gt;
| 0x10008000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[AES Registers]]&lt;br /&gt;
| 0x10009000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[SHA Registers]]&lt;br /&gt;
| 0x1000A000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[RSA Registers]]&lt;br /&gt;
| 0x1000B000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[XDMA Registers]]&lt;br /&gt;
| 0x1000C000&lt;br /&gt;
| Boot9, Kernel9&lt;br /&gt;
| [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/index.html CoreLink™ DMA-330] (single-channel).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A9&lt;br /&gt;
| [[SPICARD Registers]]&lt;br /&gt;
| 0x1000D800&lt;br /&gt;
| Process9&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| [[CONFIG Registers]]&lt;br /&gt;
| 0x10010000&lt;br /&gt;
| Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| PRNG Registers&lt;br /&gt;
| 0x10011000&lt;br /&gt;
| Process9&lt;br /&gt;
| Used as entropy-source for seeding random number generators.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| [[OTP Registers]]&lt;br /&gt;
| 0x10012000&lt;br /&gt;
| Kernel9, NewKernel9Loader&lt;br /&gt;
| Top secret.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| [[ARM7|ARM7 Registers]]&lt;br /&gt;
| 0x10018000&lt;br /&gt;
| TwlProcess9&lt;br /&gt;
| Used to setup the ARM7 core for AGB/TWL&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[HASH Registers]]&lt;br /&gt;
| 0x10101000&lt;br /&gt;
| [[Filesystem services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[Camera Registers]]&lt;br /&gt;
| 0x10102000&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| y2r&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[CSND Registers]] / [[DSP Registers]]&lt;br /&gt;
| 0x10103000&lt;br /&gt;
| TwlBg, [[Codec Services]], [[CSND Services]], [[DSP Services]]&lt;br /&gt;
| Sound hardware. For DSP regs, see the &amp;quot;DSi XpertTeak&amp;quot; section in [http://problemkaputt.de/gba.htm no$gba] help.&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| LGYFB0&lt;br /&gt;
| 0x10110000&lt;br /&gt;
| TwlBg&lt;br /&gt;
| IO registers used to access legacy output framebuffer, as well as configure the upscaling filter.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| LGYFB1&lt;br /&gt;
| 0x10111000&lt;br /&gt;
| TwlBg&lt;br /&gt;
| IO registers used to access legacy output framebuffer, as well as configure the upscaling filter.&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[Camera Registers]] &lt;br /&gt;
| 0x10120000&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[Camera Registers]]&lt;br /&gt;
| 0x10121000&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| Mirror of 0x10120000?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|?&lt;br /&gt;
| 0x10122000&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
| WIFI?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|?&lt;br /&gt;
| 0x10123000&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
| WIFI?&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10130000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10131000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10132000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[PDN Registers]]&lt;br /&gt;
| 0x10140000&lt;br /&gt;
| Process9, Boot11, Kernel11, TwlBg, [[DSP Services]], [[NWM Services]], [[SPI Services]]&lt;br /&gt;
| Power management. &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[PDN Registers]]&lt;br /&gt;
| 0x10141000&lt;br /&gt;
| Process9, Boot11, Kernel11, TwlBg, [[Codec Services]], [[NWM Services]], [[SPI Services]], [[PDN Services]]&lt;br /&gt;
| Power management&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[SPI Registers]]&lt;br /&gt;
| 0x10142000&lt;br /&gt;
| TwlBg, [[SPI Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[SPI Registers]]&lt;br /&gt;
| 0x10143000&lt;br /&gt;
| TwlBg, dmnt Module&lt;br /&gt;
| Debugger related?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[I2C Registers]]&lt;br /&gt;
| 0x10144000&lt;br /&gt;
| Boot11, Kernel11, TwlBg, [[I2C Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[CODEC Registers]]&lt;br /&gt;
| 0x10145000&lt;br /&gt;
| TwlBg, [[Codec Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[HID Registers]]&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| Boot11, Kernel11, TwlBg, [[HID Services]], dlp Services&lt;br /&gt;
| See [[PAD]].&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[GPIO Registers]]&lt;br /&gt;
| 0x10147000&lt;br /&gt;
| Boot11, TwlBg, [[GPIO Services]], [[DSP Services]](v0)&lt;br /&gt;
| &lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[I2C Registers]]&lt;br /&gt;
| 0x10148000&lt;br /&gt;
| TwlBg, [[I2C Services]]&lt;br /&gt;
| &lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[SPI Registers]]&lt;br /&gt;
| 0x10160000&lt;br /&gt;
| Boot9, TwlBg, [[SPI Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[I2C Registers]]&lt;br /&gt;
| 0x10161000&lt;br /&gt;
| Boot11, TwlBg, [[I2C Services]]&lt;br /&gt;
| See [http://problemkaputt.de/gba.htm no$gba] help for some clues maybe.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MIC Registers]]&lt;br /&gt;
| 0x10162000&lt;br /&gt;
| [[MIC Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[PXI Registers]]&lt;br /&gt;
| 0x10163000&lt;br /&gt;
| Boot11, Kernel11, TwlBg, [[PXI Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[NTRCARD Registers]]&lt;br /&gt;
| 0x10164000&lt;br /&gt;
| Boot9, Process9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10165000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10170000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI Registers, see [http://problemkaputt.de/gbatek.htm#dswirelesscommunications GBATek].&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10171000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI Registers (mirror)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|?&lt;br /&gt;
| 0x10172000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Unused?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|?&lt;br /&gt;
| 0x10173000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Unused?&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10174000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI RAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10175000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI RAM&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10176000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Registers (mirror)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
|  [[MP Registers]]&lt;br /&gt;
| 0x10177000&lt;br /&gt;
|?&lt;br /&gt;
| NTR WIFI Registers (mirror)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11/A9&lt;br /&gt;
| [[MP Registers]]&lt;br /&gt;
| 0x10178000 - 0x10180000&lt;br /&gt;
| [[MP Services]]&lt;br /&gt;
| NTR WIFI WS1 Region&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| CDMA&lt;br /&gt;
| 0x10200000&lt;br /&gt;
| Boot11, Kernel11&lt;br /&gt;
| [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/index.html CoreLink™ DMA-330]. Not used on New3DS.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10201000&lt;br /&gt;
| TwlBg&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[LCD Registers]]&lt;br /&gt;
| 0x10202000&lt;br /&gt;
| TwlBg, Kernel11, [[GSP Services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[DSP Registers]]&lt;br /&gt;
| 0x10203000&lt;br /&gt;
| [[DSP Services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10204000&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11&lt;br /&gt;
| CDMA&lt;br /&gt;
| 0x10206000&lt;br /&gt;
| NewKernel11&lt;br /&gt;
| CDMA was moved here on New 3DS. [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0424d/index.html CoreLink™ DMA-330].&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| A11&lt;br /&gt;
| [[MVD Registers]]&lt;br /&gt;
| 0x10207000&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| New 3DS only?&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| AXI&lt;br /&gt;
| 0x1020F000&lt;br /&gt;
| TwlBg, [[GSP Services]]&lt;br /&gt;
| [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0422a/CHDGHIID.html CoreLink™ NIC-301 r1p0].&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| MIRROR&lt;br /&gt;
| 0x10300000-0x10400000&lt;br /&gt;
|&lt;br /&gt;
| Mirror of 0x10100000-0x10200000 (faster bus?), CDMA wants these addresses&lt;br /&gt;
|-style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| A11&lt;br /&gt;
| [[GPU Registers]]&lt;br /&gt;
| 0x10400000&lt;br /&gt;
| Boot11, Kernel11, [[GSP Services]]&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
IO registers starting at physical address 0x10200000 are not accessible from the ARM9 (which includes all LCD/GPU registers). It seems IO registers below physical address 0x10100000 are not accessible from the ARM11 bus.&lt;br /&gt;
&lt;br /&gt;
ARM11 kernel virtual address mappings for these registers varies for different builds. For ARM11 user mode applications you have:&lt;br /&gt;
 physaddr = virtaddr - 0x1EC00000 + 0x10100000&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Application_Manager_Services_PXI&amp;diff=12711</id>
		<title>Application Manager Services PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Application_Manager_Services_PXI&amp;diff=12711"/>
		<updated>2015-05-27T19:58:57Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Available since system version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTitleCount|GetTitleCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTitleList|GetTitleList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030084&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTitleInfo|GetTitleInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000400C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeleteTitle|DeleteTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000500C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTitleProductCode|GetTitleProductCode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000600C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8, unknown_u64)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8, unknown_u32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallFIRM|InstallFIRM]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTikBegin&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTikWrite (size, ptr, ptrsize)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTikAbort&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTikFinish&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u64)&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| GetTitleAllCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| GetTitleAllList&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100100&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTitleBegin (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTitleAbort (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120100&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTitleResume (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTmdBegin (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTmdWrite|InstallTmdWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTmdFinish (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallContentBegin|InstallContentBegin]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallContentWrite|InstallContentWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallContentAbort (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallContentResume|InstallContentResume]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallContentFinish|InstallContentFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8, unknown_u32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E00C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_entrycount, unknown_u8, unknown_u32, ptr, ptrsize)&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0084&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTitleTemporaryInfo|GetTitleTemporaryInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002000C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8, unknown_u64)&lt;br /&gt;
|-&lt;br /&gt;
| 0x002100C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8, unknown_u64)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220102&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (count, unknown_u8, unknown_u64, ptrsize_count_mul_2, ptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00230104&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (count, unknown_u8, unknown_u64, ptr1size_count_mul_2, ptr1, ptr2size_count_mul_24, ptr2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00240102&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (count, unknown_u8, unknown_u64, ptrsize_count_mul2, ptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00250000&lt;br /&gt;
| [[1.0.0-0]] &lt;br /&gt;
| GetContentCount (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| GetContentIds (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00270044&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| GetContentInfoForIds (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallTitleFinish (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A00C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8, count, unknown_u8, ptrsize_count_mul_8, ptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0030....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0031....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0032....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0033....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0034....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0035....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0036....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0037....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0038....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00390146&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (size2, size3, unknown_u64, size1, ptr1size_size1, ptr1, ptr2size_size2, ptr2, ptr3size_size3, ptr3)&lt;br /&gt;
|-&lt;br /&gt;
| 0x003A0146&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u64, size1, size2, size3, ptr1size_size1, ptr1, ptr2size_size2, ptr2, ptr3size_size3, ptr3)&lt;br /&gt;
|-&lt;br /&gt;
| 0x003B0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetCTCert|GetCTCert]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003C0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0108&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (size1, size2, size3, size4, ptr1size, ptr1, ptr2size, ptr2, ptr3size, ptr3, ptr4size, ptr4)&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (size, ptrsize, ptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x003F0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (unknown_u8)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00400040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| FinishInstallToMedia (u8 mediatype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00410000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00420142&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallCommit&lt;br /&gt;
|-&lt;br /&gt;
| 0x004301C8&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:VerifyDSiWareFooter|VerifyDSiWareFooter]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004400C4&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| This does basically nothing: after checking the two buffers&#039; mem-ranges successfully(on failure it executes svcBreak like all other Process9 code for that), this just returns 0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00450108&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (size1, size3, size2, unknown_u8, ptr1size, ptr1, ptr2size, ptr2, ptr3size, ptr3, ptr4size_size2, ptr4) (DecryptDSiWareData)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00460182&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:WriteTWLSavedata|WriteTWLSavedata]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00470080&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (unknown_u8, unknown_u8)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00480040&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:ReloadDBS|ReloadDBS]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00490080&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (unknown_u64)&lt;br /&gt;
|-&lt;br /&gt;
| 0x004A0102&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (count, unknown_u64, unknown_u8, ptrsize_count_mul_8, ptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x004B0100&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (unknown_u64, unknown_u64)&lt;br /&gt;
|-&lt;br /&gt;
| 0x004C0042&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (count, ptrsize_count_mul_24, ptr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x004D0144&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:ExportDSiWare|ExportDSiWare]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x004E00C0&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (unknown_u64, unknown_u8)&lt;br /&gt;
|-&lt;br /&gt;
| 0x004F00C0&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:GetDSiWareExportSize|GetDSiWareExportSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00500044&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (count, ptr1size_count_mul_8, ptr1, ptr2size_count_mul_4, ptr2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00510000&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00520040&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (unknown_u8)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00530084&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:ValidateDSiWareMovableSedHash|ValidateDSiWareMovableSedHash]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00540000&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005500C4&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| [[AMPXI:ValidateDSiWareSectionMAC|ValidateDSiWareSectionMAC]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005600C0&lt;br /&gt;
| [[2.0.0-2]]&lt;br /&gt;
| (unknown_u64, unknown_u16)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00570042&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0058....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00590104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005A0142&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005B....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005C0044&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005D0082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005E0102&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x005F....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00600102&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00610142&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00620044&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00630042&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0064....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0065....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0066....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| Stubbed starting with [[4.0.0-7]], this only returns zero for the command result-code.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00670082&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x006801C2&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0069....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x006A....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x006B0142&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x006C....&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| (u8 [[Mediatypes|Mediatype]], u64 programID)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Error-code&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8A0802B&lt;br /&gt;
| This indicates the the [[Title_Database|dbs]] image(.db) does not exist, or opening the .db file failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8E083FC&lt;br /&gt;
| This error indicates that the title is already installed, with the same title-version as the title being installed?&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08027&lt;br /&gt;
| Invalid title-version, or the title-version of the title being installed is older than the currently installed title-version.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A08004&lt;br /&gt;
| Invalid ticket title version.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08025&lt;br /&gt;
| Invalid NCCH. returned from InstallContentFinish&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A08029&lt;br /&gt;
| Error-type 1&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065&lt;br /&gt;
| Error-type -1&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+1 / 0xD8E08066&lt;br /&gt;
| Error-type -2&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+2 / 0xD8E08067&lt;br /&gt;
| Error-type -3&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+3 / 0xD8E08068&lt;br /&gt;
| Error-type -4&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+4 / 0xD8E08069&lt;br /&gt;
| Error-type -5&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+5 / 0xD8E0806A&lt;br /&gt;
| Error-type -6. Returned when a function returns error -2011: signature or hash check for cert(TMD/TIK/cert-chain, ...) failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+6 / 0xD8E0806B&lt;br /&gt;
| Error-type -7&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+7 / 0xD8E0806C&lt;br /&gt;
| Error-type -8&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+8 / 0xD8E0806D&lt;br /&gt;
| Error-type -9&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+9 / 0xD8E0806E&lt;br /&gt;
| Error-type -10&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+10 / 0xD8E0806F&lt;br /&gt;
| Error-type -11&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+11 / 0xD8E08070&lt;br /&gt;
| Error-type -12&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+12 / 0xD8E08071&lt;br /&gt;
| Error-type -13&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08065+13 / 0xD8E08072&lt;br /&gt;
| Error-type -14&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8A083FA&lt;br /&gt;
| Invalid titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE0E0802C&lt;br /&gt;
| AM module returns this error when the system-title bit is set for the input CTR/TWL titleID-high, for [[AM:DeleteApplicationTitle]].&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CIA&amp;diff=12709</id>
		<title>CIA</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CIA&amp;diff=12709"/>
		<updated>2015-05-27T09:45:57Z</updated>

		<summary type="html">&lt;p&gt;WulfyStylez: this was super wrong&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
CIA stands for &#039;&#039;&#039;C&#039;&#039;&#039;TR &#039;&#039;&#039;I&#039;&#039;&#039;mportable &#039;&#039;&#039;A&#039;&#039;&#039;rchive. This format allows the installation titles to the 3DS. CIA files and titles on [[Title list|Nintendo&#039;s CDN]] contain identical data. As a consequence, valid CIA files can be generated from CDN content. This also means CIA files can contain anything that titles on Nintendo&#039;s CDN can contain. &lt;br /&gt;
&lt;br /&gt;
Under normal circumstances CIA files are used where downloading a title is impractical or not possible. Such as distributing a [[Download Play]] child, or installing forced Gamecard updates. Those CIA(s) are stored by the titles in question, in an auxiliary [[NCCH#CFA|CFA]] file.&lt;br /&gt;
&lt;br /&gt;
Development Units, are capable of manually installing CIA files via the [[3DS Development Unit Software#Dev Menu|Dev Menu]].&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
This is the current version of the CIA format, it was finalised in late 2010. (Older versions of the CIA format can be viewed on the [[Talk:CIA|Talk]] page)&lt;br /&gt;
&lt;br /&gt;
The CIA format has a similar structure to the [http://wiibrew.org/wiki/Wad WAD format].&lt;br /&gt;
&lt;br /&gt;
The file is represented in little-endian.&lt;br /&gt;
&lt;br /&gt;
The data is aligned in 64 byte blocks (if a content ends at the middle of the block, the next content will begin from a new block).&lt;br /&gt;
&lt;br /&gt;
=== CIA Header ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x00&lt;br /&gt;
|  0x04 &lt;br /&gt;
|  Archive Header Size (Usually = 0x2020 bytes)&lt;br /&gt;
|-&lt;br /&gt;
|  0x04&lt;br /&gt;
|  0x02&lt;br /&gt;
|  Type&lt;br /&gt;
|-&lt;br /&gt;
|  0x06&lt;br /&gt;
|  0x02&lt;br /&gt;
|  Version&lt;br /&gt;
|- &lt;br /&gt;
|  0x08     &lt;br /&gt;
|  0x04&lt;br /&gt;
|  Certificate chain size  &lt;br /&gt;
|-&lt;br /&gt;
|  0x0C      &lt;br /&gt;
|  0x04&lt;br /&gt;
|  [[Ticket]] size&lt;br /&gt;
|-&lt;br /&gt;
|  0x10     &lt;br /&gt;
|  0x04&lt;br /&gt;
|  [[TMD]] file size&lt;br /&gt;
|-&lt;br /&gt;
|  0x14     &lt;br /&gt;
|  0x04&lt;br /&gt;
|  Meta size (0 if no Meta data is present)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18     &lt;br /&gt;
|  0x08&lt;br /&gt;
|  Content size&lt;br /&gt;
|-&lt;br /&gt;
|  0x20&lt;br /&gt;
|  0x2000&lt;br /&gt;
|  Content Index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The order of the sections in the CIA file:&lt;br /&gt;
* certificate chain&lt;br /&gt;
* Ticket&lt;br /&gt;
* TMD file data&lt;br /&gt;
* Content file data&lt;br /&gt;
* Meta file data (Not a necessary component) &lt;br /&gt;
&lt;br /&gt;
The contents (NCCH/SRL) are encrypted using 128-bit AES-CBC. The encryption uses the decrypted titlekey from the [[Ticket#Structure|ticket]], and the individual content ID padded with zeros as the IV.&lt;br /&gt;
&lt;br /&gt;
=== Certificate Chain ===&lt;br /&gt;
&lt;br /&gt;
There are three [[Certificates|certificates]] in this chain:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  CERTIFICATE&lt;br /&gt;
!  SIGNATURE TYPE&lt;br /&gt;
!  RETAIL CERT NAME&lt;br /&gt;
!  DEBUG CERT NAME&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  CA&lt;br /&gt;
|  RSA-4096&lt;br /&gt;
|  CA00000003&lt;br /&gt;
|  CA00000004&lt;br /&gt;
|  Used to verify the Ticket/TMD Certificates&lt;br /&gt;
|-&lt;br /&gt;
|  Ticket&lt;br /&gt;
|  RSA-2048&lt;br /&gt;
|  XS0000000c&lt;br /&gt;
|  XS00000009&lt;br /&gt;
|  Used to verify the Ticket signature&lt;br /&gt;
|-&lt;br /&gt;
|  TMD&lt;br /&gt;
|  RSA-2048&lt;br /&gt;
|  CP0000000b&lt;br /&gt;
|  CP0000000a&lt;br /&gt;
|  Used to verify the TMD signature&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The CA certificate is issued by &#039;Root&#039;, the public key for which is stored in NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=== Meta ===&lt;br /&gt;
&lt;br /&gt;
The structure of this data is as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  START&lt;br /&gt;
!  SIZE&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
|  0x00&lt;br /&gt;
|  0x180&lt;br /&gt;
|  Title ID dependency list - Taken from the application&#039;s [[NCCH#Extended Header|ExHeader]]&lt;br /&gt;
|-&lt;br /&gt;
|  0x180&lt;br /&gt;
|  0x180&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x300&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Core Version&lt;br /&gt;
|-&lt;br /&gt;
|  0x304&lt;br /&gt;
|  0xFC&lt;br /&gt;
|  Reserved&lt;br /&gt;
|-&lt;br /&gt;
|  0x400&lt;br /&gt;
|  0x36C0&lt;br /&gt;
|  [[SMDH|Icon Data]](.ICN) - Taken from the application&#039;s [[ExeFS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Obviously this section is not present in TWL CIA files, or any other CIA file which does not contain a [[NCCH#CXI|CXI]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/3dshax/ctr/tree/master/ctrtool ctrtool] - Reading/Extraction of CIA files. This can only decrypt the title-key for development CIAs, since retail CIAs use the [[AES]] hardware key-scrambler for the common-key keyslot.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ctrdev/ctrsdk/tree/master/tools/make_cia make_cia] - Generating CIA files. Requires CommonKey and ticket/TMD RSA-2048 private exponents.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ctrdev/ctrsdk/tree/master/tools/make_cdn_cia make_cdn_cia] - (CMD)(Windows/Linux) Generates CIA files from CDN Content &lt;br /&gt;
&lt;br /&gt;
== Title Key Encryption ==&lt;br /&gt;
&lt;br /&gt;
The unencrypted Title Key is used to encrypt the data in a CIA. The encrypted Title Key of a CIA can be found at offset 0x1BF in a CIA&#039;s Ticket.&lt;br /&gt;
Each Title Key is encrypted with AES-CBC to get the encrypted Title Key.&lt;br /&gt;
&lt;br /&gt;
To encrypt an unencrypted title key, you need:&lt;br /&gt;
&lt;br /&gt;
* Common key (as byte array)&lt;br /&gt;
* Title ID (as ulong)&lt;br /&gt;
* (and of course the unencrypted title key you want to encrypt) (as byte array)&lt;br /&gt;
&lt;br /&gt;
The title key encryption process starts by converting the ulong (Title ID) into a byte array using by retrieving the bytes of the Title ID using BitConverter.GetBytes().&lt;br /&gt;
If the converted bytes (title ID) are in Little Endian, reverse those bytes. (in C# it would be Array.Reverse(byte_array_from_bitconverter))&lt;br /&gt;
This process makes the Title Key encryption IV.&lt;br /&gt;
&lt;br /&gt;
Next, after you&#039;ve gotten your Title Key&#039;s IV, you can start your cryptography transformation. Using AESManaged, where:&lt;br /&gt;
&lt;br /&gt;
Key  = Common Key&lt;br /&gt;
&lt;br /&gt;
IV   = the byte array found in the conversion process above&lt;br /&gt;
&lt;br /&gt;
Mode = CipherMode.CBC&lt;br /&gt;
&lt;br /&gt;
Create the encryptor (AesManaged.CreateEncryptor(key, iv)) where the key and IV are both the same as above.&lt;br /&gt;
&lt;br /&gt;
Then, create a CryptoStream and a MemoryStream. The Crypto stream should start with the arguments (memorystream, aes_transform_from_above, CryptoStreamMode.Write).&lt;br /&gt;
&lt;br /&gt;
Write to the CryptoStream where buffer=unencrypted_titlekey, offset=0, and count=the length of the unencrypted title key.&lt;br /&gt;
&lt;br /&gt;
Use FlushFinalBlock() on the CryptoStream.&lt;br /&gt;
&lt;br /&gt;
Finally, then, the encrypted title key will be available from your memory &lt;br /&gt;
stream. (to output the calculated encrypted title key as a byte array, you can use memorystream.ToArray(), for example)&lt;br /&gt;
&lt;br /&gt;
Example function: (C#)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        public static byte[] EncryptMyTitleKey(byte[] commonKey, byte[] titleKey, ulong titleId)&lt;br /&gt;
        {&lt;br /&gt;
            // Make encryption IV&lt;br /&gt;
            byte[] titleidasbytes = new byte[0x10];&lt;br /&gt;
            for (int i = 0; i &amp;lt; 0x10; i++)&lt;br /&gt;
            {&lt;br /&gt;
                titleidasbytes[i] = 0;&lt;br /&gt;
            }&lt;br /&gt;
            byte[] bitBytes = BitConverter.GetBytes(titleId);&lt;br /&gt;
            if (BitConverter.IsLittleEndian)&lt;br /&gt;
            {&lt;br /&gt;
                Array.Reverse(bitBytes);&lt;br /&gt;
            }&lt;br /&gt;
            bitBytes.CopyTo(titleidasbytes, 0);&lt;br /&gt;
            // Encrypt&lt;br /&gt;
            ICryptoTransform transform = new AesManaged { Key = commonKey, IV = titleidasbytes, Mode = CipherMode.CBC }.CreateEncryptor(commonKey, titleidasbytes);&lt;br /&gt;
            MemoryStream memstream = new MemoryStream();&lt;br /&gt;
            CryptoStream cryptostream = new CryptoStream(memstream, transform, CryptoStreamMode.Write);&lt;br /&gt;
            cryptostream.Write(titleKey, 0, titleKey.Length);&lt;br /&gt;
            cryptostream.FlushFinalBlock();&lt;br /&gt;
            return memstream.ToArray();&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>WulfyStylez</name></author>
	</entry>
</feed>