<?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=Riley</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=Riley"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Riley"/>
	<updated>2026-04-15T09:04:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Userland_Flaws&amp;diff=22477</id>
		<title>3DS Userland Flaws</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_Userland_Flaws&amp;diff=22477"/>
		<updated>2024-01-05T12:31:38Z</updated>

		<summary type="html">&lt;p&gt;Riley: /* Non-system applications */ might as well finally document this CGB trl vuln. may the 3DS VC escape become reality someday.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists vulnerabilities / exploits for 3DS applications and applets. Exploiting these initially results in ROP, from that ROP one can then for example try exploiting [[3DS_System_Flaws|system]] flaw(s).&lt;br /&gt;
&lt;br /&gt;
=Non-system applications=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Application name&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed in app/system version&lt;br /&gt;
!  Last app/system version this flaw was checked for&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this vuln was discovered&lt;br /&gt;
!  Vuln discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Cubic Ninja&lt;br /&gt;
| Map-data stack smash&lt;br /&gt;
| See [[Ninjhax|here]] regarding Ninjhax.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[10.4.0-29]].&lt;br /&gt;
| Ninjhax release&lt;br /&gt;
| July 2014&lt;br /&gt;
| [[User:smea|smea]]&lt;br /&gt;
|-&lt;br /&gt;
| The Legend of Zelda: Ocarina of Time 3D&lt;br /&gt;
| UTF-16 name string buffer overflow via unchecked u8 length field&lt;br /&gt;
| The u8 at offset 0x2C in the savefile is the character-length of the UTF-16 string at offset 0x1C. When copying this string, it&#039;s essentially a memory-copy with lenval*2, not a string-copy. This can be used to trigger buffer overflows at various locations depending on the string length.&lt;br /&gt;
* When value is &amp;gt;=0x6E it crashes when saving the saveslot, this causes a stack-smash however it normally crashes before it returns from the function which had the stack-frame overwritten.&lt;br /&gt;
* With value &amp;gt;=0x9A, it crashes via stack-smash in-game once any dialogs are opened(touching buttons on the touch-screen can trigger it too).&lt;br /&gt;
* Length value&amp;gt;=0xCD causes a crash while loading the saveslot, via a heap buffer overflow. This buf-overflow overwrites a heap memchunk following the allocated buffer. When the first 16-bits overwriting that heap memchunk is not the memchunk magic-number(0x7373), the mem-alloc code will just return a NULL ptr which later results in a crash. When the magic-number is valid, the mem-alloc code will continue to attempt to parse the memchunk, which may crash depending on the data which overwrote the memchunk. This heap code is separate from the CTRSDK heap code. Exploiting this doesn&#039;t seem to be possible: since the heap code actually verifies that the magic-number for the next/prev memchunk ptrs are correct(unlike CTRSDK), it&#039;s not possible to change those ptrs to useful arbitrary addresses outside of savedata(like with triggering a write to a c++ object ptr which later is used with a vtable func-call, this is what one would do with CTRSDK heap here).&lt;br /&gt;
&lt;br /&gt;
On March 11, 2015, an exploit using this vuln was released, that one was intended for warez/etc. The following exploit wasn&#039;t released before then mainly because doing so would (presumably) result in the vuln being fixed. The following old exploit was released on March 14, 2015: [https://github.com/yellows8/oot3dhax].&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[10.6.0-31]].&lt;br /&gt;
| March 11, 2015&lt;br /&gt;
| Around October 22, 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Super Smash Bros 3DS&lt;br /&gt;
| Buffer overflow in local-multiplayer beacon handling.&lt;br /&gt;
| See [[smashbroshax|here]].&lt;br /&gt;
| App: v1.1.3&lt;br /&gt;
| See [[smashbroshax|here]]. System: [[10.3.0-28]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| See [[smashbroshax|here]].&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Super Mystery Dungeon&lt;br /&gt;
| Heap overflow within linear memory via unchecked save file length&lt;br /&gt;
| Pokemon Super Mystery Dungeon uses zlib compression for most of its save files, possibly due to the save files being larger than its predecessor, Gates to Infinity. When a save file is being prepared to be loaded and read from, only a 0x32000 large buffer is allocated for file reading, and a 0x3e800-large buffer for decompression is also allocated before the file is read. However, the game does not limit the size of the file read to this allocation bound, allowing for the file to overflow into the linear memory heap and into the next allocation. Since Pokemon Super Mystery Dungeon stores allocation memchunks directly before the allocation, overwriting the next memchunk with a corrupted one allows for arbitrary writes of linear heap pointers when the next buffer is allocated or arbitrary writes of any pointer within writable memory when the corrupted buffer is freed.&lt;br /&gt;
| None&lt;br /&gt;
| O3DS: [[11.3.0-36]]. N3DS: [[11.4.0-37]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| April 14, 2016&lt;br /&gt;
| [[User:Shinyquagsire23|Shiny Quagsire]]&lt;br /&gt;
|-&lt;br /&gt;
| VVVVVV&lt;br /&gt;
| Buffer overflow in XML save file array parsing&lt;br /&gt;
| VVVVVV utilizes several XML files (renamed with a .vvv extension) to store level save data, stats and settings. Within these XML files are several tags containing an array of data which, when parsed, is not properly checked to be of proper length for the tag being parsed from. This allows for an overflow of 16-bit array values from the location where the array is parsed. With unlock.vvv, XML data is parsed to the stack, and with level saves the heap. This allows for the pointer where the level save worldmap tag array should be parsed into to be overwritten with a stack address, allowing for ROP from within the XML array parsing function on the next level load.&lt;br /&gt;
| App: v1.1&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Shinyquagsire23|Shiny Quagsire]]&lt;br /&gt;
|-&lt;br /&gt;
| Citizens of Earth&lt;br /&gt;
| Save file read stack smash&lt;br /&gt;
| Citizens of Earth also uses &amp;quot;XML&amp;quot; files for saves, which are actually entirely binary data (not XML at all) with no checksums. These files are read from the filesystem on to a fixed size stack buffer which leads to an incredibly trivial stack smash. When using the autosave slot for this, the save is parsed when the user selects &amp;quot;continue&amp;quot;. When using one of the dedicated save slots (1-3), the save is parsed shortly after the company splash screens fade. Note that the save is read quite high (descending) on the stack - when exploiting this, one would likely need to move SP due to almost instantly overflowing the physical stack.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| May 5, 2016&lt;br /&gt;
| [[User:Dazzozo|Dazzozo]]&lt;br /&gt;
|-&lt;br /&gt;
| SmileBASIC 3.x&lt;br /&gt;
| Poor parameter validation on &amp;quot;BGSCREEN&amp;quot; command&lt;br /&gt;
| The SmileBASIC &amp;quot;BGSCREEN&amp;quot; command&#039;s second parameter is not properly validated as being within range.  As a result, one can set the screen size to an absurdly large value.  This means that the &amp;quot;BGGET&amp;quot; and &amp;quot;BGPUT&amp;quot; commands can then be used on out-of-range values to read and write a significant chunk of the interpreter&#039;s address space.&lt;br /&gt;
With a series of carefully-designed BGPUT commands, one can build a ROP chain and cause it to be executed.&lt;br /&gt;
| App: 3.3.2.&lt;br /&gt;
| System: [[11.0.0-33]].&lt;br /&gt;
| July 20, 2016&lt;br /&gt;
| Around June 26, 2016&lt;br /&gt;
| slackerSnail, 12Me12, incvoid&lt;br /&gt;
Exploited by MrNbaYoh and [[User:Plutooo|plutoo]].&lt;br /&gt;
|-&lt;br /&gt;
| SmileBASIC 3.x&lt;br /&gt;
| Subscripted TIME$/DATE$ allow write access to DATA/BSS&lt;br /&gt;
| Utf-16 characters can be assigned to subscripted TIME$/DATE$ interpreter sysvars which results in write-only access to all of DATA and some BSS in userland.&lt;br /&gt;
TIME$[0]/DATE$[0] actually point to somewhere in rodata, and an overly large subscript can be used to write well past it and into the aforementioned areas. Demo [https://github.com/zoogie/smilehax-IIe here.]&lt;br /&gt;
| App: 3.6.2 (3.6.0 latest for US/EU, JP appvers. can be downgraded)&lt;br /&gt;
| System: [[11.13.0-45]].&lt;br /&gt;
| April 2020&lt;br /&gt;
| February 2020&lt;br /&gt;
| bug publicly documented [https://translate.google.com/translate?sl=auto&amp;amp;tl=en&amp;amp;u=http%3A%2F%2Fsmilebasic.com%2Fdebug%2Farchive%2F here.]&lt;br /&gt;
Exploited by Zoogie&lt;br /&gt;
|-&lt;br /&gt;
| The Legend of Zelda: Tri Force Heroes&lt;br /&gt;
| [[3DS_System_Flaws#General.2FCTRSDK|CTRSDK]] CTPK buffer overflow combined with game&#039;s usage of SpotPass&lt;br /&gt;
| During the very first screen displayed by the game during boot(&amp;quot;Loading...&amp;quot;), just seconds after title launch, the game loads CTPK from the [[BOSS_Services|stored]] SpotPass content. Hence, this game could be exploited via the vulnerable CTRSDK CTPK code &#039;&#039;if&#039;&#039; one could get custom SpotPass data into extdata somehow(ctr-httpwn &amp;gt;=v1.2 with bosshaxx allows this).&lt;br /&gt;
&lt;br /&gt;
The code for this runs from a thread separate from the main-thread, with the stack in linearmem heap. This SpotPass handling triggers before the game ever opens the regular savedata archive. The extdata is opened at some point before this: it opens a file for checking if it exists, then immediately closes it.&lt;br /&gt;
&lt;br /&gt;
The two SpotPass URLs for this have always(?) returned HTTP 404 as of November 2016. It appears these were intended for use as textures for additional costumes(and never got used publicly), but this wasn&#039;t tested.&lt;br /&gt;
&lt;br /&gt;
This is used by [https://github.com/yellows8/ctpkpwn ctpkpwn_tfh].&lt;br /&gt;
| None&lt;br /&gt;
| App: v2.1.0&lt;br /&gt;
| November 18, 2016&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pixel Paint&lt;br /&gt;
| Buffer overflow via unchecked extdata file length&lt;br /&gt;
| Pixel Paint loads pictures saved by the user from extdatas. The file is read to a fixed size buffer but the file length remains unchecked, so with a large enough file, one can overwrite pointers in memory and gain control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[11.2.0-35]].&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| November 5, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Steel Diver : Sub Wars&lt;br /&gt;
| Heap overflow / arbitrary memcpy&lt;br /&gt;
| Savefile datas are stored as key/value pairs, a large enough string key makes the game overwrite a memcpy source/destination addresses and size arguments. So one can actually memcpy a rop on the stack and gain control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| System: [[11.2.0-35]].&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| Around July 15, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], Vegaroxas&lt;br /&gt;
|-&lt;br /&gt;
| 1001 Spikes&lt;br /&gt;
| Buffer overflow via unchecked array-indexes in XML savefile parsing&lt;br /&gt;
| The savefiles are stored as renamed .xml files, which contain several tags with attributes like &#039;array-index=&amp;quot;array-value&amp;quot;&#039;, where both of these are converted from ASCII strings to integers as signed-int32, and the array-value given blindly written to an array inside a structure using the (unchecked) index given. With several of these attributes, one can overwrite the stack starting from the stored lr of the function that does this parsing, and write a ROP chain there. Testing used the &amp;quot;LevelAttempts&amp;quot; tag which is the last such tag parsed in that function.&lt;br /&gt;
| None&lt;br /&gt;
| App: v1.2.0 (TMD v2096)&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| Around November 2, 2016&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Omega Ruby/Alpha Sapphire&lt;br /&gt;
| Secret base team name heap overflow&lt;br /&gt;
| When the player wants to edit the team name, it is copied over the heap, however its length is not verified. So with a large enough team name one can overwrite some pointers and get two arbitrary jumps and then get control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| App: 1.4. System: [[11.2.0-35]].&lt;br /&gt;
| December 30, 2016&lt;br /&gt;
| June, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Swapdoodle&lt;br /&gt;
| Heap buffer overflow via unchecked size&lt;br /&gt;
| The letter file format used by doodlebomb is composed of multiple chunks. Each chunks is described in the header of the file where the name, size and CRC of each chunk are stored. Some chunks are meant to be headers, every header&#039;s size should be 0x80, however the length of the STAHED1 chunk remains unchecked and the game memcpy the chunk to a 0x80 byte buffer with the length provided in the file. This way one is able to overwrite some pointers and get control of the execution flow.&lt;br /&gt;
| App: &amp;gt; v1.1.1&lt;br /&gt;
| App: v1.1.1&lt;br /&gt;
| April 24, 2017&lt;br /&gt;
| February, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Picross&lt;br /&gt;
| Arbitrary memcpy via unchecked size&lt;br /&gt;
| When reading the savefile, the game handles some lists of buffers that are copied to memory. These buffers should always be 0x14-bytes long but the game uses the size provided in the savefile to copy them. These buffers are copied in some structs and thus with a big enough length value, one can overwrite the next struct which contains a size and a destination address for a memcpy.&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| May 29, 2017&lt;br /&gt;
| June, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| RPG Maker Fes/Player&lt;br /&gt;
| Buffer overflow on .bss section&lt;br /&gt;
| When loading a project, the game copies multiple chunks over the BSS section. However the number of chunks to copy is not checked, thus a large amount of chunk result in a buffer overflow. There&#039;s multiple way to exploit this flaw to gain an arbitrary memcpy or an arbitrary jump.&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| August 28, 2017&lt;br /&gt;
| August, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| RPG Maker Fes/Player&lt;br /&gt;
| Buffer overflow via unchecked file size&lt;br /&gt;
| When loading a project, the game loads the file to a 0x200000 bytes long buffer. However the size remains unchecked, so with a big enough file one can overflow the buffer and overwrite a thread stack and then achieve ROP.&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| August 29, 2017&lt;br /&gt;
| August, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], [[User: ChampionLeake|ChampionLeake]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Omega Ruby/Alpha Sapphire&lt;br /&gt;
| PSS data heap/stack overflow&lt;br /&gt;
| When launching the game, multiple chunks from the save file are parsed and copied to a large heap buffer. When parsing PSS data (acquaintances, passerby) the game copies each entry to the heap buffer, the number of entries to copy is read from the end of the multiple pss data chunks and is not checked, leading to an overflow. The &amp;quot;PSS data - friends&amp;quot; chunk is vulnerable too, but the overflow occurs on the stack and unfortunately this isn&#039;t exploitable because of a 4 bytes uncontrolled value (in each entry) that gets written on sensitive data.&lt;br /&gt;
| None&lt;br /&gt;
| App: 1.4. System: [[11.6.0]].&lt;br /&gt;
| October 1, 2017&lt;br /&gt;
| June, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| RPG Maker Fes/Player&lt;br /&gt;
| OOB write&lt;br /&gt;
| When handling events in a map, the indices of &amp;quot;buttons&amp;quot; are not checked. This results in an out of bound bit write, one can thus write a rop directly on the stack (bit by bit).&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| August 5, 2018&lt;br /&gt;
| &lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Unholy Heights&lt;br /&gt;
| Buffer overflow via unchecked string size&lt;br /&gt;
| The game stores some utf-16 messages in the savefile. Right before the message is the length(u32) for the string, the game uses this size to memcpy the message from the savefile to the stack without checking the length. This allows one to overwrite some function addresses on the stack and form a rop chain.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial Version&lt;br /&gt;
| September 13, 2018&lt;br /&gt;
| August, 2018&lt;br /&gt;
| Kartik&lt;br /&gt;
|-&lt;br /&gt;
| Mononoke Forest&lt;br /&gt;
| String Buffer Overflow via unchecked string length&lt;br /&gt;
| The game stores plaintext profile names in the savefile. The profile names are strcpy/memcpy to different areas of the game&#039;s functions in the stack. Using a large extensive profile name, a user can overwrite some stack-registers and point to stack buffer addresses to eventually gain control of the stack to lead and form a rop-chain. &lt;br /&gt;
| None&lt;br /&gt;
| App: v1.0.0&lt;br /&gt;
| August 14, 2019&lt;br /&gt;
| February 8, 2019&lt;br /&gt;
| [[User: ChampionLeake|ChampionLeake]] and [[User: Kartik|Kartik]]&lt;br /&gt;
|-&lt;br /&gt;
| Picross 3D: Round 2&lt;br /&gt;
| Out of bounds array access allowing to point to fabricated objects and vtable&lt;br /&gt;
| Game only checks save header. With the last interacted save slot index at +0xb270 in the save data unchecked we can achieve a predictable out of bounds access, as well inserting ROP data without detecting save corruption. Game references an object from an array of 3 elements and passes it to a function that will read object pointers and hit a vtable call. With a copy save data left in memory and a properly calculated index, we can point to a fake object position in the save, vtable jump to a stack pivot and start the ROP chain.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version&lt;br /&gt;
| September 10, 2020&lt;br /&gt;
| August 24, 2020&lt;br /&gt;
| [[User: Luigoalma|Luigoalma]] and [[User: Kartik|Kartik]]&lt;br /&gt;
|-&lt;br /&gt;
| Me and My Pets 3D&lt;br /&gt;
| String buffer overflow&lt;br /&gt;
| The game stores some strings in the savegame. Using a large enough string, once can overwrite addresses on the stack and form a ropchain.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial Version&lt;br /&gt;
| June 24, 2022&lt;br /&gt;
| June 12, 2022&lt;br /&gt;
| [[User: Kartik|Kartik]]&lt;br /&gt;
|-&lt;br /&gt;
| trl CGB emulator (GBC Virtual Console)&lt;br /&gt;
| HDMA heap buffer overflow&lt;br /&gt;
| trl&#039;s CGB emulation implements normal mode HDMA by a straight memcpy, failing to correctly bounds check the provided pointers/length. (hblank mode HDMA does perform proper bounds checks after each 0x10 byte memcpy)&lt;br /&gt;
In addition, each area of memory (ROM, SRAM, VRAM, WRAM, SRAM, OAM, MMIO+HRAM) are allocated seperately, from the CTR-SDK heap.&lt;br /&gt;
&lt;br /&gt;
Thus, doing HDMA to an area past the end of VRAM (VRAM bank 1 must be set here) would cause heap overflow. The maximum possible memcpy here would be 0x800 bytes to the end of VRAM less 0x10 bytes.&lt;br /&gt;
&lt;br /&gt;
This is hard to exploit. The heap buffers get freed when choosing to close the game from the Home Menu, with the Home Menu holding the GPU. It may be possible to make calls to APT in ROP in this state to get Home Menu to release the GPU.&lt;br /&gt;
&lt;br /&gt;
To exploit this, SM83 code execution inside the emulator would need to be obtained. This could be done by human-viable or remote (emulated link-cable) code execution exploits (for example Pokémon Yellow (non-JP)/Gold/Silver/Crystal); by crafting SRAM (where the game itself has a savegame exploit); or by crafting an emulator save-state (for games where save-states are enabled).&lt;br /&gt;
&lt;br /&gt;
DMG (mono Game Boy) games are not exploitable; the bug is in CGB-specific functionality which is disabled in mono Game Boy games (determined by ROM header).&lt;br /&gt;
| None&lt;br /&gt;
| trl as included in Pokémon Crystal VC&lt;br /&gt;
| January 2024&lt;br /&gt;
| ~2017&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Flipnote Studio 3D==&lt;br /&gt;
&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;
!  Fixed in app/system version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Flaw discovered by&lt;br /&gt;
|-&lt;br /&gt;
| KFH frame count overflow&lt;br /&gt;
| The KFH frame count field should not be &amp;gt;= 0x3E8, but it wasn&#039;t checked and so uncontrolled data were written over pointers, causing an unexploitable crash.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KMI paper color overflow&lt;br /&gt;
| Paper color field (and similar color fields) in KMI chunks was not checked, a too high value caused a jump to an uncontrolled location.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KSN BGM data size overflow&lt;br /&gt;
| The size of the BGM data in the KSN chunk was not checked, it was used in a memcpy so with a big enough size one could overwrite a thread stack on linear mem and achieve ROP (notehax v1).&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KMC chunk unchecked&lt;br /&gt;
| The KMC chunk was not verified at all, the CRC32 and the size were not checked. A big enough size caused an integer overflow and made the game read the file backward.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KMI layer size unchecked&lt;br /&gt;
| The 3 layer size fields in KMI chunks were not checked, leading to some crashes in the editor.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Bad &amp;quot;queue&amp;quot; implementation&lt;br /&gt;
| When a KWZ was parsed, frames were copied in a kind of queue, bounds were not checked obviously, so with the KMI layer size flaw one was able to fill completely the queue, then write past the buffer and overwrite a heap chunk header (notehax v2). This is not possible anymore, the queue cannot be filled because layer sizes are checked. Moreover each time an element is removed from the queue, the whole content is memmoved *facepalm*.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Useless crashes / applications which were fuzzed==&lt;br /&gt;
* Pushmo (3DSWare), QR codes: level name is properly limited to 16 characters, game doesn&#039;t crash with a longer name. The only possible crashes are triggered by out-of-bounds array index values, these crashes are not exploitable due to the index value being 8bit.&lt;br /&gt;
&lt;br /&gt;
* [[Pyramids (3DSWare)]], QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
&lt;br /&gt;
* [[Pyramids 2 (3DSWare)]], QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/yellows8/mm3d_re The Legend of Zelda: Majora&#039;s Mask 3D]&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;The Legend of Zelda: A Link Between Worlds&amp;quot; and &amp;quot;The Legend of Zelda: Tri Force Heroes&amp;quot;: these games don&#039;t crash at all when the entire save-file(minus constant header data) is overwritten with /dev/random output / 0xFF-bytes. All of the CRC32s were updated for this of course.  Note that this refers to the regular save file: Tri Force Heroes can be exploited via BOSS extdata - see above.&lt;br /&gt;
&lt;br /&gt;
* Pokemon Mystery Dungeon: Gates to Infinity has the same unchecked file bounds as Pokemon Super Mystery Dungeon, however since save compression was introduced in Pokemon Super Mystery Dungeon, it only allocates one buffer within the application heap instead of several within the linear heap, resulting in nothing to corrupt or overwrite even if the file&#039;s length is extended past its allocation.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Kid Icarus: Uprising&amp;quot;: Overwriting the entire savedata results in various crashes, nothing useful.&lt;br /&gt;
&lt;br /&gt;
* Savedata/extdata for &amp;quot;Super Smash Bros 3DS&amp;quot;: Overwriting the various files stored under savedata/extdata results in useless crashes.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;StarFox 64 3D&amp;quot;: Doesn&#039;t crash at all with the entire savedata overwritten.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Frogger 3D&amp;quot;: Overwriting a savefile with random-data results in *nothing* crashing.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Mutant Mudds&amp;quot;: Overwriting the savefile with random data results in a crash&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Worcle Worlds&amp;quot;: Overwriting the savefile with 0xFF results in a crash due to an out of bound read&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Animal Crossing: New Leaf&amp;quot;: Creating a QR code from random data results in a valid QR code and a random design. In some very rare cases(which aren&#039;t always reproducible?) a crash/etc may occur, but this isn&#039;t known to be useful.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Angry Birds Star Wars&amp;quot;: Strings in the savefile are preceded by their lengths. These strings are never stored on the stack and are memcpy&#039;d into heap memory. If the size is invalid the alloc will fail and thus the memcpy will operate on a nullptr resulting in a useless data abort.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Gem Smashers&amp;quot;: Overwriting the savefile with random bytes results in useless crashes.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Luxor:&amp;quot; Strings/plaintext in the savefile are present and these&#039;s no checks. Overwriting the whole save (excluding the header), with /dev/random cause a useless crash.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Luv Me Buddies Wonderland:&amp;quot; Doesn&#039;t crash at all with the entire savedata overwritten. Overwriting some areas, points to useless nulls&lt;br /&gt;
&lt;br /&gt;
==Crashes needing investigation==&lt;br /&gt;
* Disney Infinity crashes when all savedata overwritten with /dev/urandom. No checksums. 0xFF bytes don&#039;t cause a crash.&lt;br /&gt;
&lt;br /&gt;
* Football Up Online / Soccer Up Online and Football Up 3D / Soccer Up 3D crash when teamname(UTF-16) length = 0x48 AND 0x20 null bytes are removed after just the name or if teamname length is way longer than 0x48.&lt;br /&gt;
&lt;br /&gt;
=System applications=&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;
!  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;
| 3DS [[System Settings]] DS profile string stack-smash&lt;br /&gt;
| Too long or corrupted strings (01Ah  2   Nickname length in characters     050h  2   Message length in characters) in the NVRAM DS user settings (System Settings-&amp;gt;Other Settings-&amp;gt;Profile-&amp;gt;Nintendo DS Profile) cause it to crash in 3DS-mode due to a stack-smash. The DSi is not vulnerable to this, DSi launcher(menu) and DSi System Settings will reset the NVRAM user-settings if the length field values are too long(same result as when the CRCs are invalid). TWL_FIRM also resets the NVRAM user-settings when the string-length(s) are too long.&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Ichfly|Ichfly]]&lt;br /&gt;
|-&lt;br /&gt;
| 3DS [[System Settings]] stack smash via title strings in [[DSiWare_Exports]]&lt;br /&gt;
| DSiWare export banners contain 16 consecutive 0x100 byte, utf-16 game title strings for different languages. Nintendo correctly limits the string&#039;s max length by placing a NULL at str[127] before it&#039;s copied to the stack. However, they didn&#039;t allocate enough space for all 128 wchars (char/wchar type confusion?), so an attacker can craft a valid full-length string that will crash the stack at about str+0xEC. ROP execution can then be obtained from this crash in DSiWare Data Management as demonstrated [https://github.com/zoogie/Bannerbomb3 here].&lt;br /&gt;
&lt;br /&gt;
Interesting note: A line feed wchar (00 0A) at any point in the string before the crash offset will prevent the crash from occurring.&lt;br /&gt;
| [[11.17.0-50]]&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| Dec. 2018&lt;br /&gt;
| Zoogie&lt;br /&gt;
|-&lt;br /&gt;
| 3DS SAFE_MODE [https://www.3dbrew.org/wiki/System_Settings#System_Updater System Updater] stack smash from proxy-url string&lt;br /&gt;
| During [[Recovery Mode]] and after all 3 wifi slots fail to find an access point for sysupdate, a user is permitted to access the wifi settings mode to make changes. Here, if the proxy-url field string&#039;s NULL terminator had been altered beforehand, a stack smash can occur when the user selects Proxy Settings -&amp;gt; Detailed Setup and the corrupted url string is displayed.&lt;br /&gt;
&lt;br /&gt;
This is a difficult crash to control because the url string is converted from ascii to utf-16 between the slot and stack, effectively reducing the available gadgets to 0.4% of the normal amount. It&#039;s possible to improvise an &amp;quot;escape&amp;quot; using an eoreq pc w/shift gadget to combine registers and form a jump that can access 1/2 of all available gadgets.&lt;br /&gt;
&lt;br /&gt;
Because this exploit runs *under* SAFE_MODE, it&#039;s possible to run safehax with one&#039;s choice of k11 and arm9 hax. Prerequisite: a userland exploit with cfg:s/i access to modify the wifi slot. A demonstration can be viewed [https://github.com/zoogie/unSAFE_MODE here].&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| Jan. 2020&lt;br /&gt;
| Zoogie&lt;br /&gt;
|-&lt;br /&gt;
| [[Nintendo 3DS Sound]]&lt;br /&gt;
| When a .m4a is loaded, the song name is copied to a 256 byte buffer. When the song name begins with a Unicode BOM marker, it memcpy&#039;s the tag using the user-provided length. This gives an arbitrary write which can be used to achieve ROP.&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
| June/July 2016&lt;br /&gt;
| [[User:nedwill|nedwill]]&lt;br /&gt;
|-&lt;br /&gt;
| [[EShop]]&lt;br /&gt;
| When creating an audio decoder object for the moflex movie player, if the audio codec is PCM16, the application uses an uninitialized value as a pointer. One can spray the heap to get control of that pointer and achieve ROP.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=System applets=&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;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Introduced with version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Webkit/web-browser bugs&lt;br /&gt;
| spider has had at least three different code-execution exploits. Majority of them are use-after-free issues. See also [[browserhax|here]].&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| 2013?&lt;br /&gt;
|&lt;br /&gt;
| A lot of people.&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS/New3DS [[Internet_Browser|Browser-version-check]] bypass&lt;br /&gt;
| When the browser-version-check code runs where the savedata for it was never initialized(such as when the user used the &amp;quot;Initialize savedata&amp;quot; option), it will use base_timestamp=0 instead of the timestamp loaded from savedata. This is then used with &amp;quot;if(cur_timestamp - base_timestamp &amp;gt;= &amp;lt;24h timestamp&amp;gt;){Run browser-version-check HTTPS request code}&amp;quot;.&lt;br /&gt;
Hence, if the savedata was just initialized, and if the system datetime is set to before January 2, 2000, the browser-version-check will be skipped. This includes January 1, 2000, 00:00, because that&#039;s the epoch(timestamp value 0x0) used with this timestamp.&lt;br /&gt;
&lt;br /&gt;
See [http://yls8.mtheall.com/3dsbrowserhax.php here] for bypass usage instructions.&lt;br /&gt;
&lt;br /&gt;
This was fixed with [[10.7.0-32|10.7.0-32]], see [[Internet_Browser|here]] for details.&lt;br /&gt;
| [[10.7.0-32|10.7.0-32]]&lt;br /&gt;
| &lt;br /&gt;
| [[9.9.0-26|9.9.0-26]]&lt;br /&gt;
| February 25, 2016&lt;br /&gt;
| November 2, 2015 (Exactly one week after the browser version pages were initially updated server-side)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Skater - Bookmark OOB write&lt;br /&gt;
| Each bookmark has an id that should not exceed 0x63 (99), however ids are not checked, this results in an OOB write on the stack, but only the value 0x01 can be written.&lt;br /&gt;
| &lt;br /&gt;
| [[11.6.0-39|11.6.0-39]]&lt;br /&gt;
| &lt;br /&gt;
| May 21, 2018&lt;br /&gt;
| May 20, 2018&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| MicroSD Management - malformed security blob causes stack buffer overflow (mhax) &lt;br /&gt;
| The MicroSD Management application&#039;s parsing of Windows NTLM security blobs in the SMB/CIFS protocol doesn&#039;t verify that the client&#039;s specified NT domain name is less than 32 UTF-16 characters.  When it&#039;s longer, a stack buffer overrun occurs, leading to a ROP chain and complete control of the mcopy application.&lt;br /&gt;
&lt;br /&gt;
The malformed security blob can be sent by an attacker within the SMB_COM_SESSION_SETUP_ANDX (0x73) packet.&lt;br /&gt;
| [[11.8.0-41|11.8.0-41]]&lt;br /&gt;
| [[11.8.0-41|11.8.0-41]]&lt;br /&gt;
| [[9.0.0-20|9.0.0-20]]&lt;br /&gt;
| August 12, 2018&lt;br /&gt;
| 2018&lt;br /&gt;
| smea&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Home Menu==&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;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Introduced with version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| u8 brightness setting OOB index (menuhax67)&lt;br /&gt;
| Config block 0x50001, which contains a u8 brightness setting that indexes a table of u32 addresses, can be set to an out-of-bounds index (it&#039;s normally 1-5). Located within cfg block 0x50009, there exists a single controllable u32 that&#039;s located within the u8&#039;s range. With these set properly, one can eventually redirect a function pointer to an address of their choice. This is triggered after the Home Menu quick launch tab is activated. POC [https://github.com/zoogie/menuhax67 here].&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| &lt;br /&gt;
| October 4, 2020&lt;br /&gt;
| September, 2020&lt;br /&gt;
| Zoogie&lt;br /&gt;
|-&lt;br /&gt;
| bossbannerhax&lt;br /&gt;
| After successfully loading [[Extended_Banner|extended-banner]] data(done when selecting an icon), Home Menu attempts to load &amp;quot;[[CBMD]]&amp;quot; data into a 0x100000-byte heap buffer from the [[BOSS_Services|stored]] SpotPass content. When successful and the magic-number is CBMD, Home Menu then decompresses the exbanner sections into another fixed-size heap buffer, without checking the outsize at all. The main CBMD CGFX code with ExeFS checks the size, but this code doesn&#039;t(however this is exbanner &amp;quot;CBMD&amp;quot;, not a &amp;quot;normal&amp;quot; CBMD).&lt;br /&gt;
&lt;br /&gt;
Used with menuhax as of v3.2.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[1.0.0-0|1.0.0-0]]&lt;br /&gt;
| November 18, 2016&lt;br /&gt;
| December 23, 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| sdiconhax&lt;br /&gt;
| This is basically the same as nandiconhax, the vulnerable SD/NAND functions are &#039;&#039;identical&#039;&#039; minus the file-buffer offsets. Exploitation is different due to different heap-buffer location though. Unlike nandiconhax, the icon buffer for SD is located in linearmem(with recent Home Menu versions at least). This is used by [[menuhax]].&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7|4.0.0-X]]&lt;br /&gt;
| July 27, 2016&lt;br /&gt;
| October 23, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[System_SaveData|NAND-savedata]] Launcher.dat icons (nandiconhax)&lt;br /&gt;
| The homemenu code processing the titleid list @ launcherdat+8 copies those titleIDs to another buffer, where the offset relative to that buffer is calculated using the corresponding s8/s16 entries. Those two values are not range checked at all. Hence, one can use this to write u64(s) with arbitrary values to before/after this allocated output buffer. See [[Home_Menu|here]] regarding Launcher.dat structure.&lt;br /&gt;
&lt;br /&gt;
This can be exploited(with Launcher.dat loading at startup at least) by using a s16 for the icon entry with value 0xFFEC(-20)(and perhaps more icons with similar s16 values to write multiple u64s). The result is that the u64 value is written to outbuf-0xA0, which overwrites object+0(vtable) and object+4(doesn&#039;t matter here) for an object that gets used a bit after the vulnerable function triggers. The low 32bits of the u64 can then be set to the address of controlled memory(either outbuf in regular heap or the entire launcherdat buffer in linearmem), for use as a fake vtable in order to get control of PC. From there one can begin ROP via vtable funcptrs to do a stack-pivot(r4=objectaddr at the time the above object gets used).&lt;br /&gt;
&lt;br /&gt;
Originally this vuln could only be triggered via Launcher.dat at Home Menu startup, right after Launcher.dat gets loaded + memory gets allocated, once the file-format version code is finished running. Starting with v9.6 this can be triggered when loading layouts from SD extdata as well. The vuln itself triggers before the layout data is written to Launcher.dat, but it doesn&#039;t seem to be possible to overwrite anything which actually gets used before the function which writes Launcher.dat into the layout gets called.&lt;br /&gt;
&lt;br /&gt;
Home Menu has some sort of fail-safe system(or at least on v9.7) when Home Menu crashes due to Launcher.dat(this also applies for other things with Home Menu): after crashing once, Home Menu resets Launcher.dat to a state where it no longer crashes anymore. However, note that any exploits using this which hang/etc without crashing will still brick the system. &#039;&#039;&#039;Hence, attempting anything with this on physnand without hw-nand-access isn&#039;t really recommended.&#039;&#039;&#039;&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7|4.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| May 14, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Theme-data decompression buffer overflow ([[menuhax|themehax]])&lt;br /&gt;
| The only func-call size parameter used by the theme decompression function is one for the compressed size, none for the decompressed size. The decompressed-size value from the LZ header is used by this function to check when to stop decompressing, but this function itself has nothing to verify the decompressed_size with. The code calling this function does not check or even use the decompressed size from the header either.&lt;br /&gt;
&lt;br /&gt;
This function is separate from the rest of the Home Menu code: the function used for decompressing themes is *only* used for decompressing themes, nothing else. There&#039;s a separate decompression function in Home Menu used for decompressing everything else.&lt;br /&gt;
&lt;br /&gt;
That other decompression function in Home Menu handles decompression size properly(decompressed size check for max buffer size is done by code calling the other function, not in the function itself). Unlike the other function, the theme function supports multiple LZ algorithms, but the one which actually gets used in official themes is the same one supported by the other function anyway.&lt;br /&gt;
&lt;br /&gt;
See also [[menuhax|here]].&lt;br /&gt;
&lt;br /&gt;
With [[10.2.0-28|10.2.0-X]] Home Menu, the only code change was that the following was added right after theme-load and before actual decompression: &amp;quot;if(&amp;lt;get_lzheader_decompressed_size&amp;gt;(compressed_buf) &amp;gt; 0x150000)&amp;lt;exit&amp;gt;;&amp;quot;. This fixed the vuln.&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| &amp;lt;Old3DS/New3DS version which added initial theme support&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| December 22, 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]] independently (~spring 2015)&lt;br /&gt;
|-&lt;br /&gt;
| Shuffle body-data buffer overflow ([[menuhax|shufflehax]])&lt;br /&gt;
| See [[menuhax|here]].&lt;br /&gt;
| [[10.6.0-31|10.6.0-X]]&lt;br /&gt;
| [[10.6.0-31|10.6.0-X]]&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| January 3, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Extdata file-data loading buffer overflow&lt;br /&gt;
| The extdata file-reading code allocates a fixed-size heap buffer for the expected filesize, then reads the filedata into this buffer using the actual FS filesize. Before v5.0 the filesize used here wasn&#039;t validated, hence if the filesize is larger than alloc_size a buffer overflow would occur. &#039;&#039;After&#039;&#039; doing the file-read it does validate that the actual_readsize matches the alloc_size, but at this point the buffer overflow has already occurred.&lt;br /&gt;
&lt;br /&gt;
This affected at least the following: SaveData.dat and Cache.dat.&lt;br /&gt;
&lt;br /&gt;
This can be triggered with SaveData.dat by installing a &amp;lt;v4.0 Home Menu version, with Home Menu extdata from &amp;gt;=v4.0 still on SD. When this is done with v2.0 Home Menu, a kernelpanic occurs when processing an AM command(it appears a buffer ptr which is then passed to a command was overwritten with 0x0 - of course other SaveData.dat filesizes may result in different behaviour).&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| June 9, 2016&lt;br /&gt;
| June 9, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The icon data arrays used with {sd/nand}iconhax were added to SaveData.dat/Launcher.dat with [[4.0.0-7|4.0.0-X]], hence the vulnerable functions were added with that same version.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;=v4.0 the SaveData.dat buffer is located in the regular heap. It&#039;s unknown when exactly it was moved to linearmem, which is where it&#039;s located with recent versions. It&#039;s located in linearmem for KOR &amp;gt;=v9.6 for example.&lt;br /&gt;
&lt;br /&gt;
The SaveData.dat/Launcher.dat icon vulns were fixed by doing various unsigned &amp;gt;=60/&amp;gt;=360 checks on the loaded values. When these checks fail, it just skips over handling this icon entry. Hence, the original value can&#039;t be negative / out-of-bounds any more.&lt;br /&gt;
&lt;br /&gt;
==Useless crashes==&lt;br /&gt;
Old3DS system web-browser:&lt;br /&gt;
* 2^32 characters long string(&#039;&#039;finally&#039;&#039; fixed with v10.6): this is similar to the vulnerability fixed [http://git.chromium.org/gitweb/?p=external/Webkit.git;a=commitdiff;h=ec471f16fbd1f879cb631f9b022fd16acd75f4d4 here], concat-large-strings-crash2.html triggers a crash which is about the same as the one triggered by a 2^32 string. Most of the time this vulnerability will cause a memory page permissions fault, since the WebKit code attempts to copy the string text data to the output buffer located in read-only [[CRO0|CRO]] heap memory. The only difference between a crash triggered by a 2^32 string and the concat-large-strings-crash2.html crash is at the former copies the string data using the original string length(like 1 text character for &amp;quot;x&amp;quot;, 4 for &amp;quot;xxxx&amp;quot;) while the latter attempts to copy &amp;gt;12MB. In some &#039;&#039;very&#039;&#039; rare cases a thread separate from the string data-copy thread will crash, this might be exploitable. However, this is mostly useless since it rarely crashes this way.&lt;br /&gt;
&lt;br /&gt;
* Trying to directly load a page via the browser &amp;quot;URL&amp;quot; option with [https://github.com/yellows8/3ds_browserhax_common webkitdebug] setup, causes a crash to trigger in oss.cro due to an use-after-free being caught with webkitdebug. This is presumably some sort of realloc() issue in the libcurl version used by the &amp;lt;={v10.2-v10.3} browser. This happens with *every* *single* *page* one tries to load via the &amp;quot;URL&amp;quot; option, but not when loading links on the current page, hence this is probably useless. A different use-after-free with realloc triggers with loading any page at all regardless of method too(libcurl probably).&lt;br /&gt;
&lt;br /&gt;
* This WebKit build has &#039;&#039;a lot&#039;&#039; of crash-trigger bugs that only happen with [https://github.com/yellows8/3ds_browserhax_common webkitdebug] completely setup(addr accesses near 0x0), with &#039;&#039;just&#039;&#039; trying to load any page at all.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=22436</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=22436"/>
		<updated>2023-11-20T13:00:21Z</updated>

		<summary type="html">&lt;p&gt;Riley: &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;
* In the early days of 3DS hacking, Neimod was working on a RAM dumping setup for a while. He has de-soldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039;s PCB up to a custom RAM dumping setup. He &#039;&#039;has&#039;&#039; published photos showing his setup to be working quite well, with the 3DS successfully booting up, but however, his flickr stream is now private along with most of his work and this method has been unreleased. RAM dumping can be done through homebrew now, making this method obsolete regardless.&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). A 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 uninitialized 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;
The vulnerable timing range is about 100 CPU cycles after they start (which happens after the PLLs have stabilized after power-up). A glitch needs to be injected during one of these 100 cycles for the attack to succeed.&lt;br /&gt;
&lt;br /&gt;
It has been exploited by derrek to dump the ARM9 bootrom as of Summer 2015.&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;
| RSA keyslots don&#039;t clear exponent when setting modulus&lt;br /&gt;
| The [[RSA_Registers|RSA keyslots]] are set by boot ROM to have four private RSA keys.  The exponent value in the RSA registers is write-only and not readable.&lt;br /&gt;
&lt;br /&gt;
However, when setting a keyslot&#039;s modulus, the RSA hardware leaves the exponent alone.  This allows retrieving the exponent by doing a discrete logarithm of the output.&lt;br /&gt;
&lt;br /&gt;
By setting the modulus to a prime number whose modular multiplicative order is &amp;quot;smooth&amp;quot; (that is, p-1 is divisible by only small prime numbers), discrete logarithms can be calculated quickly using the [[wikipedia:Pohlig-Hellman algorithm|Pohlig-Hellman algorithm]].  If the prime chosen is greater than the modulus, but the same bit size, the discrete logarithm is the private exponent.&lt;br /&gt;
&lt;br /&gt;
This exploit&#039;s usefulness is limited: RSA keyslot 0 is only used in current firmware for deriving the 6.x save and 7.x NCCH keys, which were already known, and the other three keyslots are entirely unused.  Additionally, with a boot ROM dump, this exploit is moot; these private keys are located in the protected ARM9 boot ROM.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2016&lt;br /&gt;
| [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] allowing acccess to AXIWRAM/FCRAM-BASE-memregion&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] can be configured by anything with access to it to allow the GPU to access the entire AXIWRAM+FCRAM. For example, this is an issue for any sysmodule that gets exploited and has access to this register memory-page(include one that&#039;s listed below).&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;kernelhax via gspwn&amp;quot; below.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Boot ROM ==&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;
| FIRM partitions known-plaintext&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are encrypted with AES-CTR without a MAC. 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;
However it is most commonly used to install arbitrary FIRMs (usually boot9strap), thanks to sighax.&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;
| Boot9 AES keyinit function issues&lt;br /&gt;
| [[Bootloader|Boot9]] seems to have two bugs in the AES key-init function, see [[AES_Registers#AES_key-init|here]].&lt;br /&gt;
| None&lt;br /&gt;
| BootROM issue.&lt;br /&gt;
| 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| New3DS has same boot ROM as Old3DS&lt;br /&gt;
| The New3DS has the exact same boot ROM as the Old3DS.  This means, among other things, that all the same boot ROM flaws are present.  Also, this meant that it is possible to boot Old3DS firmware on New3DS (see &amp;quot;CFG9_SYSPROT9 bit1 not set by Kernel9&amp;quot;).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| October 2014&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| sighax: Boot9 improper validation of FIRM partition RSA signatures&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are signed with RSA-2048 using SHA-256 and PKCS #1 v1.5 padding.  Boot9, however, improperly validates the padding in three ways:&lt;br /&gt;
# Boot9 permits block type 02, meant for encrypted messages, to be used for signatures.  Only 01, for signatures, should have been permitted.  As a result, when using block type 02, a signature block is not required to have a long string of FF bytes as padding, but rather any nonzero random values suffice.&lt;br /&gt;
# Boot9 does not require that the length of the padding fill out the signature block completely.  As a result, there is considerable freedom in the layout of a signature.&lt;br /&gt;
# Boot9 fails to do bounds checking in its parsing of the DER-encoded hash algorithm type and hash value; the length values given in DER are permitted to point outside the signature block.&lt;br /&gt;
Flaw 3 allows the DER encoding to be such that boot9 believes that the signature&#039;s hash value is outside the range of the block itself, somewhere on the stack.  This can be pointed at the correct hash value it computes.  Boot9 then memcmp&#039;s the calculated hash against itself, and thinks that the hash is valid.&lt;br /&gt;
&lt;br /&gt;
As a result of the above, we estimate that one in 2&amp;lt;sup&amp;gt;43&amp;lt;/sup&amp;gt; (~8.8 trillion) random fake signatures will be considered by Boot9 to be valid.  This is well within the range of brute force, particularly with an optimized GPU implementation.  An Nvidia GTX 1080 Ti would take about one week to find a match.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| July 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| Boot9 FIRM loading doesn&#039;t blacklist memory-mapped I/O&lt;br /&gt;
| [[Bootloader|Boot9]]&#039;s FIRM loading blacklists Boot9 data regions, but forgets to do other important regions, including Memory-mapped I/O. Combined with sighax, a malicious FIRM can be used to overwrite:&lt;br /&gt;
a) boot9 data-abort handler, coupled with a 4th section that tries to NDMA copy to NULL, causing a data abort&lt;br /&gt;
&lt;br /&gt;
b) boot9 IRQ handler (this has the disadvantage that you must restore the original handler, then call it manually when your payload runs)&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2015(?)&lt;br /&gt;
| [[User:Derrek|derrek]] (2015?), [[User:Normmatt|Normmatt]] and [[User:SciresM|SciresM]] independently (January 2017).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;superhax&amp;quot;: Boot9 FIRM loading blacklist check is flawed&lt;br /&gt;
| Boot9 only makes sure the &#039;&#039;&#039;start&#039;&#039;&#039; and &#039;&#039;&#039;end&#039;&#039;&#039; address of each section is not covered by a blacklisted region. Thus, it is possible to overwrite blacklisted regions (e.g. ARM9 Exception Vectors) by choosing a FIRM section range that encloses an entire blacklisted region. The vulnerable code looks like this: if(blRegions[i].start &amp;lt;= sectionStart &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionStart &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; blRegions[i].start &amp;lt;= sectionEnd &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionEnd) return false; // failure&lt;br /&gt;
The boot9 vector table (0x08000000) contains 6 entries, each 8-bytes wide (0x30 bytes); Only 0x08000000 through 0x08000040 are blacklisted, and boot9 doesn&#039;t use the region after the vector table (this is convenient because we can put any payload we want after it and not worry about overwriting chunks of boot9 code)&lt;br /&gt;
&lt;br /&gt;
To exploit this, craft a FIRM section payload that&#039;s loaded a few bytes before 0x08000000, add padding to get to 0x08000000 and overwrite the vector table; You could overwrite the data-abort vector and craft a 4th FIRM section that causes a data-abort OR you can just overwrite the IRQ function pointer at 0x08000004 (make sure your payload replaces the original boot9 function pointer); you can point the rest of the vectors to infinite loops since they shouldn&#039;t be triggered.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2015&lt;br /&gt;
| [[User:Plutoo|plutoo]], [[User:Yellows8|yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
&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;
| Generating the keysector console-unique keys with ITCM+Boot9&lt;br /&gt;
| [[Bootloader|Boot9]] decrypts the 0x100-byte [[OTP_Registers|OTP]] using AES-CBC with keydata stored in Boot9. If hash verification is successful, the plaintext of the first 0x90-bytes are copied into [[Memory_layout|ITCM]]. This is the &#039;&#039;exact&#039;&#039; &#039;&#039;same&#039;&#039; region hashed by arm9loader when generating the console-unique keys for decrypting the keysector, except arm9loader uses the raw encrypted OTP.&lt;br /&gt;
&lt;br /&gt;
Therefore, with the OTP keydata+IV from Boot9 you can: encrypt the 0x90-bytes from ITCM, then hash the output to get the console-unique keys for the system&#039;s keysector. This can even be done for Old3DS which doesn&#039;t have the arm9loader keysector officially.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown why arm9loader only used the first 0x90-bytes of OTP. Using more data from OTP would&#039;ve prevented this. Fixing this would require doing exactly that, but that would also mean updating the NAND keysector(which is dangerous).&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| &lt;br /&gt;
| 2015&lt;br /&gt;
| January 6, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Rearrangable keys in the NAND keystore&lt;br /&gt;
| Due to the keystore being encrypted with AES-ECB, one can rearrange blocks and still have the NAND keystore decrypt in a deterministic way. &lt;br /&gt;
&lt;br /&gt;
Using 10.0 FIRM it is possible to rearrange keys such that ARM9 memory is executed. As such using existing ARM9 execution 10.0 FIRM can be written to NAND and a payload written to memory, with the payload to be executed post-K9L using an MCU reboot.&lt;br /&gt;
| arm9loaderhax given existing ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Early 2016&lt;br /&gt;
| 27 September 2016&lt;br /&gt;
| Myria, [[User:Dark samus|dark_samus]]; mathieulh (independently); [[User:Plutooo|plutoo]] (independently) + others&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;
| [[11.3.0-36|11.3.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 [[User:Derrek|derrek]].&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loaderhax: Missing verification block for the 9.6 keys&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, access to uncleared OTP hash keydata&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loader runs on Old3DS&lt;br /&gt;
| Despite being written only for New3DS, all of arm9loader runs fine on Old3DS.  It&#039;s not until booting Kernel9 that a New3DS FIRM partition would crash on an Old3DS.  As a result, if a bug exists in arm9loader to get control, it can be exploited on Old3DS by writing New3DS FIRM to the FIRM partitions.  Thus, arm9loaderhax works on both Old3DS and New3DS.&lt;br /&gt;
| arm9loader bugs also compromise Old3DS&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Sometime in 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]] presumably&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;
| Leak of normal-key matching a key-generator key&lt;br /&gt;
| During the 3DS&#039; development (June/July 2010) Nintendo added support installing encrypted content ([[CIA]]). Common-key index1 was intended to be a [[AES|hardware generated key]]. However while they added code to generate the key in hardware, they forgot to remove the normal-key for index1 (used elsewhere, likely old debug code). Nintendo later removed the normal key sometime before the first non-prototype firmware release.&lt;br /&gt;
&lt;br /&gt;
Knowing the keyY and the normal-key for common-key index1, the devkit key-generator algorithm can be deduced (see &amp;quot;Hardware&amp;quot; above). Additionally the remaining devkit common-keys can be generated once the common-key keyX is recovered.&lt;br /&gt;
&lt;br /&gt;
Note that the devkit key-generator was discovered to be the same as the retail key-generator.&lt;br /&gt;
| Deducing the keyX for keyslot 0x3D and hardware key-generator algorithm. Generate remaining devkit common-keys.&lt;br /&gt;
| pre-[[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| Shortly after the key-generator was revealed to be flawed at the 32c3 3ds talk&lt;br /&gt;
| January 20, 2016&lt;br /&gt;
| [[User:Jakcron|jakcron]]&lt;br /&gt;
|-&lt;br /&gt;
| Factory firmware is vulnerable to sighax&lt;br /&gt;
| During the 3DS&#039;s development, presumably boot9 was written (including the sighax vulnerability). This vulnerability is also present in factory firmware (and earlier, including 0.11). This was fixed in version 1.0.0-0.&lt;br /&gt;
| Deducing the mechanics of the sighax vulnerability in boot9 without having a dump of protected boot9. ARM9 code execution on factory/earlier firmware.&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| May 9, 2017&lt;br /&gt;
| May 19, 2017&lt;br /&gt;
| [[User:SciresM|SciresM]], [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| safecerthax &lt;br /&gt;
| O3DS &amp;amp; O2DS SAFE_FIRM is still vulnerable to the PXIAM:ImportCertificates flaw fixed in [[5.0.0-11]] and to SSLoth fixed in [[11.14.0-46]]. It makes it possible to spoof the official NUS update server and remotely trigger the vulnerability in SAFE_FIRM.&lt;br /&gt;
| Remote Arm9 code execution in O3DS/O2DS SAFE_FIRM&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| twlhax: Corrupted SRL header leads to memory overwrite&lt;br /&gt;
| During TWL_FIRM boot, the ARM11 process TwlBg puts launcher.srl, the DSi bootloader, into FCRAM.  TWL_FIRM Process9 then parses the [http://dsibrew.org/wiki/NDS_Format SRL header] to place launcher.srl&#039;s code where DSi mode can execute it.&lt;br /&gt;
&lt;br /&gt;
DSi-mode memory is in FCRAM, but interleaved.  Each byte of DSi-mode memory also exists at some address in 3DS FCRAM space.&lt;br /&gt;
&lt;br /&gt;
Process9 does not validate the RSA signature on launcher.srl, unlike SRLs loaded from cartridge or NAND (DSiWare).  A compromised ARM11 can, in a manner similar to firmlaunchhax, send a launcher.srl with a modified SRL header.  By setting the SRL header&#039;s ARM7/ARM9 load addresses and sizes carefully, accounting for the different memory map and for DSi mode&#039;s interleaved memory, it is possible to overwrite part of Process9&#039;s stack and take control with a ROP chain.&lt;br /&gt;
&lt;br /&gt;
Fixed in 11.8.0-X by... (fill me in)&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| August 11, 2018&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| agbhax&lt;br /&gt;
| This is the same issue as twlhax above. Legacy FIRMs share the same OS code (Arm9-side OS, Arm11 kernel), and therefore, the outdated AGB_FIRM can be tricked into executing the still vulnerable PrepareArm9ForTwl function.&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| December 17, 2020&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax&lt;br /&gt;
| SAFE_MODE_FIRM is almost never updated(even when NATIVE_FIRM is updated for vuln fixes), this can be noticed by &#039;&#039;just&#039;&#039; checking 3dbrew/ninupdates title-listings.&lt;br /&gt;
&lt;br /&gt;
The fix for firmlaunch-hax was only applied to NATIVE_FIRM in [[9.5.0-22|9.5.0-X]], leaving SAFE_FIRM exploitable. With ARM11-kernel execution, one can trigger FIRM-launch in to SAFE_FIRM, do Kernel9 &amp;lt;=&amp;gt; Kernel11 sync, PXI sync and then repeat the original attack on SAFE_FIRM instead.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012-2013?&lt;br /&gt;
| Wiki: January 2, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax 1.1&lt;br /&gt;
| Nintendo&#039;s original safefirmhax fix was flawed -- they added a global boolean that got set to true whenever a non-sysmodule title got launched (except for a hardcoded repair title id), and panic()&#039;d if that boolean was true to prevent launching safefirm after hax was active. However, because the boolean was initially false after firmlaunch -- With ARM11-kernel execution, one could FIRM-launch into NATIVE_FIRM, and then immediately FIRM-launch again into SAFE_FIRM early in NATIVE_FIRM boot before the boolean got set to true to repeat the safehax attack.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding additional CFG9_BOOTENV checks to firmlaunch code in 11.4.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| safefirmhax fix&lt;br /&gt;
| Wiki: April 10, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| When reading the banner of a NTR title, Process9 relies on a hardware register to know when the banner was fully read.&lt;br /&gt;
However that register is shared between the ARM9 and the ARM11.&lt;br /&gt;
An attacker with k11 control can so make Process9 believe the banner continues forever and so trigger a buffer overflow.&lt;br /&gt;
With a custom banner for a NTR flashcart, this leads to code execution in Process9.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding bound checks on the read data.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| &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;
&lt;br /&gt;
[[11.0.0-33|11.0.0-X]] fixed this for key system titles (MSET, Home Menu, spider, ErrDisp, SKATER, NATIVE_FIRM, and every retail system module), by checking the version of the title to install against a hard-coded list of (titleID, minimumVersionRequired) pairs.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], for key system titles.&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| Anti-downgrade list did not include all system titles initially&lt;br /&gt;
| The anti-downgrade list did not include legacy FIRMs until [[11.8.0-41|11.8.0-X]]. Therefore, legacy FIRMs could still be downgraded.&lt;br /&gt;
| Downgrading legacy FIRMs; allowing to exploit bugs in older legacy FIRMs (of which at least one exists, see below).&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| ?&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| TWL_FIRM cmd-9 unchecked offset&lt;br /&gt;
| In [[1.0.0-0|1.0.0-X]]&#039;s TWL_FIRM, cmds 8 and 9 were not stubbed (whereas in the corresponding NATIVE_FIRM, they were).&lt;br /&gt;
Command 8 does the Process9 initialisation for NTR carts if an NTR cart is inserted (NTR, not TWL, judged by chipid).&lt;br /&gt;
&lt;br /&gt;
Command 9 takes (u32 offset_read, u32 offset_write, u32 offset_read_end), and basically just copies (offset_read_end - offset_read) bytes starting at (offset_read) of [NTR cart header in arm9mem, NTR secure area in fcram, TWL secure area in fcram], to 0x18001000 + offset_write + offset_read.&lt;br /&gt;
&lt;br /&gt;
offset_write is not checked at all, thus this leads to ARM9 code execution as long as any NTR cart, including flashcarts that would normally be blocked by TWL_FIRM, is inserted.&lt;br /&gt;
&lt;br /&gt;
In [[2.0.0-2|2.0.0-X]] TWL_FIRM, those commands were stubbed out.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| January 2018&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|-&lt;br /&gt;
| FIRM launch doesn&#039;t check target FIRM version&lt;br /&gt;
| When executing a FIRM launch, Process9 doesn&#039;t validate that the target FIRM isn&#039;t an old version.  This allows booting an exploitable FIRM from a newer FIRM, if you can get the exploitable FIRM installed.  ([[11.0.0-33|11.0.0-X]] now prevents installing old versions of system titles, but this doesn&#039;t affect titles already installed.)&lt;br /&gt;
&lt;br /&gt;
This had a use after [[9.6.0-24|9.6.0-X]]: on a compromised 3DS running 9.2.0, you could install the 9.6.0 NATIVE_FIRM to FIRM0/FIRM1, but avoid putting it into the NATIVE_FIRM title.  This would boot the 9.2.0 system software but with the 9.6.0 Process9 and Kernel11.  With a user-mode exploit in a sufficiently-privileged application (e.g. mset), you could trigger a FIRM launch back to NATIVE_FIRM, which would load the 9.2.0 Process9 and Kernel11.&lt;br /&gt;
&lt;br /&gt;
9.6.0&#039;s keyslots 0x15 and 0x16 are unknown to 9.2.0, so 9.2.0 would not clear them.  You then could do firmlaunchhax against 9.2.0 to get ARM9 access with keyslots 0x15 and 0x16 set to their proper 9.6.0 values, allowing decrypting 9.6.0&#039;s encrypted titles.  Once the New3DS keystore was dumped, this became moot.&lt;br /&gt;
| Decrypting 9.6.0 NCCH files without dumping New3DS keystore&lt;br /&gt;
| None (but now moot)&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| August 12, 2018&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]]&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;
| [[FS:EnumerateExtSaveData]] crashes process9 when trying to parse a file as an extdata directory in Data Management (MSET9)&lt;br /&gt;
| In the implementation for FSPXI:EnumerateExtSaveData (called by [[System_Settings|MSET]] to parse 3DS extdata IDs for Data Management), the return value of the P9 internal function call to open a directory (when enumerating contents of the extdata directory) was not checked. Therefore, if the call fails, an uninitialised pointer on stack will be used for a vtable call.&lt;br /&gt;
&lt;br /&gt;
As such, a file that starts with 8 hex digits can crash process9 if placed directly inside the extdata directory. It can crash in various ways based on subtle differences in the way the user triggers the crash event.&lt;br /&gt;
&lt;br /&gt;
While mostly leading to null derefs, in one specific context, process9 jumps directly to an ID1 string being held in ARM9 memory. Surprisingly, the 3DS doesn&#039;t discern what characters are used for the ID1 directory name on the SD, only requiring exactly 32 chars. This allows the attacker to insert arm instructions into the unicode ID1 dirname and take control of the ARM9, and thus, full control of the 3DS.&lt;br /&gt;
| ARM9 code execution (primary)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.17.0-50|11.17.0-X]]&lt;br /&gt;
| April 2022&lt;br /&gt;
| August 7, 2023&lt;br /&gt;
| zoogie&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;
| [[11.3.0-36|11.3.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;
| [[11.3.0-36|11.3.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 this is used in conjunction with seedminer to be able to decrypt &amp;amp; modify DSiWare TAD containers and inject them with exploitable DSiWare titles such as sudoku (sudokuhax) and Flipnote JPN (ugopwn)&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;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| seedminer: movable.sed keyY vulnerable to brute-force&lt;br /&gt;
| Half of the movable.sed keyY&#039;s 128 bits are leaked through the [[Nandrw/sys/LocalFriendCodeSeed_B|LFCS]], which is available in userland and below. The LFCS itself also leaks almost half of the remaining bits by following the ratio: u32 keyY[3]=1/5(LFCS). The remaining keyY[3] uncertainty of about ±2000 can be greatly reduced by plotting expected error margins with several keyYs. This results in a final uncertainty of about 2^40, easily within practical brute force range of an average modern PC.&lt;br /&gt;
| Knowing the keyY of a given 3ds allows for modification of DSiWare export contents, and chained with several other public vulns, ultimately arm9 execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.8.0-X&lt;br /&gt;
| December 2017&lt;br /&gt;
| January 2018&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| Improper validation of DSiWare title SRLs&lt;br /&gt;
| The 3DS does not verify if the actual SRL embedded in the title&#039;s directory matches the titleID in the TMD before launching it or importing it from an sd DSiWare export. &lt;br /&gt;
| This allows embedding older, exploitable DSiWare titles in completely different, unexploitable DSiWare titles. Since DSiWare has raw NAND RW, this can result in arm9 control through FIRM known-plaintext and sighax attacks.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| 2015?&lt;br /&gt;
| December 2016&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| DSiWare import/export functions allow TWL system titles as arguments&lt;br /&gt;
| AM ImportTwlBackup/ExportTwlBackup unnecessarily allow TWL system titles such as DS Download Play to import/export from userland and System Settings -&amp;gt; Data Management (only am:sys is needed for userland). This is difficult to abuse for dsihax injection because no TWL system title has a save file, and any import with a save included will result in FS err C8804464. However, there is at least one dsihax primary that can load a payload from a non-NAND source, and not error if it can&#039;t access its public.sav (JPN Flipnote Studio v0).&lt;br /&gt;
| When combined with other public vulns, arm9 code execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| May 2018&lt;br /&gt;
| Sept 2018&lt;br /&gt;
| zoogie&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]]:ImportCertificates (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#CFG9_SYSPROT9|CFG9_SYSPROT9]] bit1 not set by Kernel9&lt;br /&gt;
| Old versions of Kernel9 never set bit1 of [[CONFIG Registers#CFG9_SYSPROT9|CFG9_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.&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, which is exploitable through a hardware + software vulnerability (see arm9loaderhax / description).&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 (see enhanced-arm9loaderhax / description). This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (0x05 -&amp;gt; 0x04, see partition encryption types [[Flash_Filesystem#NAND_structure|here]]) and using an Old3DS [[NCSD#NCSD_header|NCSD Header]], it is possible to boot a New3DS using Old3DS firmware 1.0-2.x to retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping the [[OTP Registers|OTP]] area.&lt;br /&gt;
Decrypting New3DS sector 0x96 keyblock.&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|svcUnbindInterrupt]] double free when irqId = 15&lt;br /&gt;
| svcBindInterrupt and svcUnbindInterrupt give special treatment to irqId 15 (FIQ helper): the access control list is bypassed and the provided KInterruptEvent (event or semaphore, via handle) is stored inside a singleton static object after having its refcount increased by 1.&lt;br /&gt;
&lt;br /&gt;
svcUnbindInterrupt assumes that the user-provided handle is what is stored in the singleton and will decref the user-provided KInterruptEvent twice, causing a use-after-free if the attacker didn&#039;t actually provide an handle to the same event or semaphore.&lt;br /&gt;
&lt;br /&gt;
This was &amp;quot;fixed&amp;quot; on [[11.14.0-46|11.14.0-X]] by preventing irqId 15 to be bound on retail units altogether (in both functions).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]] (only on retail units)&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]], maybe others&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcKernelSetState]] op=3 could map the NULL page&lt;br /&gt;
| svcKernelSetState op=3 param1=1 maps the firmlaunch parameters page to the user-specified VA.&lt;br /&gt;
&lt;br /&gt;
It had previously no check, allowing the attacker to map data at VA 0.&lt;br /&gt;
&lt;br /&gt;
Starting from [[11.14.0-46|11.14.0-X]], the VA must be in the standard 0x10000000-0x14000000 address range.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcMapProcessMemory]] can map the NULL page&lt;br /&gt;
| svcMapProcessMemory&#039;s destination VA is unchecked.&lt;br /&gt;
&lt;br /&gt;
By passing a big enough &amp;quot;size&amp;quot; parameter, an attacker can map chunks of data at VA 0 in the destination (caller) process.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| Resource limit use-after-free&lt;br /&gt;
| When assigning a KResourceLimit to a KProcess, the reslimit&#039;s refcounter doesn&#039;t get incremented. This essentially means all KResourceLimit get freed if pm gets somehow terminated.&lt;br /&gt;
&lt;br /&gt;
It turns out it is possible to ask pm (via ns:s or pm:app) to terminate itself along all other KIPs simply by passing TID 0004000100001000.&lt;br /&gt;
&lt;br /&gt;
Calling [[SVC|svcGetResourceLimit]] afterwards triggers a use-after-free. This is rather difficult to exploit, however: there is one slot left in the reslimit slabheap. An attacker either has to map the NULL page as R(W)X (svcControlProcessMemory vuln fixed on [[11.8.0-41|11.8.0-X]]), or use one of the map-null exploits above while having access to svcCreateResourceLimit (with the only one that is easy enough to use in that context having been fixed on [[11.14.0-46|11.14.0-X]], anyway).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| None (although near impossible to exploit on [[11.14.0-46|11.14.0-X]])&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcSetProcessIdealProcessor]] reference count overflow and therefore use-after-free.&lt;br /&gt;
| The SVC receive two arguments: handle and idealprocessor. The handle is used to get the KProcess object and the KProcess-&amp;gt;refCnt gets incremented,later the function check if the KProcess-&amp;gt;mem_type != BASE and if yes, it checks for idealprocessor == 2 or idealprocessor != 3. The problem here is that if you pass the idealprocessor = 3 it won&#039;t meet any condition and return the error 0xD9001BEA without decrement the reference count. &lt;br /&gt;
It can be abused to overflow the KProcess reference count that will lead to an Use-after-free. &lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free.&lt;br /&gt;
| &lt;br /&gt;
| [[11.6.0-39|11.6.0-X]]&lt;br /&gt;
| November 2, 2017&lt;br /&gt;
| [[User:st4rk|st4rk]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcGetThreadList]] process reference leak&lt;br /&gt;
| When given a valid process handle (including &amp;lt;code&amp;gt;0xFFFF8001&amp;lt;/code&amp;gt;), svcGetThreadList forgets to decrement the reference count of the underlying [[KProcess]] instance, after having finished using it.&lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free, but this UAF was most likely not exploitable&lt;br /&gt;
| &lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| April 3, 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| kernelhax via gspwn&lt;br /&gt;
| Originally the kernel didn&#039;t initialize [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]]. Since it&#039;s 0 at hard-boot, this allowed the GPU to access the entire FCRAM + AXIWRAM.&lt;br /&gt;
| Entire FCRAM+AXIWRAM R/W.&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] partly&lt;br /&gt;
|-&lt;br /&gt;
| fasthax&lt;br /&gt;
| When a KTimer is created in pulse mode, the kernel calls a virtual function to reset the timer each time it pulses. The scheduler is locked for that core to avoid race conditions, but another core can call CloseHandle on the timer and free it, leading to a UAF vtable call.&lt;br /&gt;
| See description.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| May 2016&lt;br /&gt;
| nedwill&lt;br /&gt;
|-&lt;br /&gt;
| ipctakeover&lt;br /&gt;
| When sending cmdreplies, it does not validate that the src_addr and src_size match the equivalent dst_addr and dst_size. With a modified addr/size specified in a cmdreply for an output buffer, the data-copy for the first/last pages could be used to overwrite data outside of the buffer specified by the original process.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This can be used to takeover processes where the process is using your service session. Like HTTPC -&amp;gt; BOSS, for bosshaxx above. NIM takeover can be done too(actual stack buffer overflow can trigger), etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 26, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Using IPC input buffers as output buffers&lt;br /&gt;
| When sending cmdreplies, it does not validate that the cmdreply descriptor type matches the equivalent cmdreq descriptor type. This could be used by an exploited sysmodule to use what was intended as an input-buffer as an output-buffer, and also combine other IPC vuln(s) with this.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| [[11.3.0-36|11.3.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) required patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]] (deleted)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| veryslowpidhax&lt;br /&gt;
| &#039;&#039;&#039;This is completely different from the kernelmode-code-execution vuln described in the below separate entry.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When updating the kernel global PID counter under [[SVC|svcCreateProcess]] the kernel does not check for wraparound to 0x0(the PID for the very first process). This only matters because [[Services|SM-module]] allows processes with PID value less than &amp;lt;total ARM11 FIRM modules&amp;gt; to access &#039;&#039;all&#039;&#039; services, without checking exheader service-access-control; and because Kernel11 checks for the PID to be 1 (loader) to use the input mem-region value on ControlMemory. This alone does not affect access the [[SVC|SVCs]] access table at all.&lt;br /&gt;
&lt;br /&gt;
Inlined ldrex+strex code is used for updating the above counter. [[11.2.0-35|11.2.0-X]] had changes for similar code, but it was only for dedicated ldrex+strex functions(mainly for kernel objects) and hence this PID code was not affected.&lt;br /&gt;
&lt;br /&gt;
With launching+terminating a sysmodule repeatedly with this via ns:s, it would take weeks to finish(if not at least about a month?).&lt;br /&gt;
| Access to all [[Services_API|services]], ControlMemory on any given mem-region.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| 2012 maybe?&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|  slowhax/waithax&lt;br /&gt;
|  svcWaitSynchronizationN does not decrement the references to valid handles in an array before returning an error when it encounters an invalid handle. This allows one to (slowly) overflow the reference count for a handle object to zero.&lt;br /&gt;
| ARM11 kernel-mode code execution&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| 2016&lt;br /&gt;
| nedwill, [[User:Derrek|derrek]]&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;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2.1&lt;br /&gt;
| Nintendo&#039;s fix for memchunkhax2 in [[10.4.0-29|10.4.0-X]] did not fix the GPU case: one may cause the requisite ToCToU race using gspwn, bypassing the new validation.&lt;br /&gt;
derrek&#039;s original 32c3 presentation for memchunkhax2 commented that a GPU-based attack was possible, but would be difficult.  However, memchunkhax2.1 showed that it was possible to do fairly reliably.&lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]], aliaspider&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2&lt;br /&gt;
| When allocating a block of memory, the &amp;quot;next&amp;quot; pointer of the [[Memory_Management#MemoryBlockHeader|memchunkhdr]] is accessed without being checked after being mapped to userland.&lt;br /&gt;
This allows a race condition, where the process can change the next pointer just before it&#039;s accessed. By pointing the next pointer to a crafted memchunckhdr in the kernel SlabHeap, some of the SlabHeap is allocated to the calling process, allowing to change vtables of kernel objects. &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]] (partially, see memchunkhax2.1)&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| heaphax&lt;br /&gt;
| Can change the size of free memchunk structures stored in FCRAM using DMA, which leads to the ability to allocate memory chunks over already-allocated memory. This can be used in the SYSTEM region to allocate RW memory over any part of the NS system module, which is enough to take it over.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading) Code execution within any applet.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| snshax&lt;br /&gt;
| Can force creation of Safe NS process into gspwn-able memory, allowing for takeover.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading)&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&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;
| Useless [[SM]] off-by-one write&lt;br /&gt;
| After accepting a new session, [[SM]] writes a (handler ID (0 for srv: sessions (max. 64), 1 for the srv:pm one), pointer to session context structure in BSS) pair in a global array. However that array is only 64-entry-big instead of 65 (as it ought to be), and no bound check is done in that regard.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, as of [[11.4.0-37]], the overwritten fields are totally unused after their initialization by &amp;lt;code&amp;gt;__libc_init_array&amp;lt;/code&amp;gt;.&lt;br /&gt;
| Not currently exploitable&lt;br /&gt;
| None&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| smpwn&lt;br /&gt;
| When registering a new service (or &amp;quot;port&amp;quot;), no bound checks are done on the service table. One can simply call RegisterPort repeatedly to overflow that table: it will overflow into the command replay structure.&lt;br /&gt;
&lt;br /&gt;
Combined with a other minor bugs in the sysmodule, it is possible to take over [[SM]] with this nevertheless difficult-to-exploit vulnerability.&lt;br /&gt;
| Code execution under [[SM]], etc.&lt;br /&gt;
| [[11.16.0-48]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| July 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]] (independently), presumably ichfly before &lt;br /&gt;
|-&lt;br /&gt;
| PXI cmdbuf buffer overrun &lt;br /&gt;
| Like its Arm9 counterpart, before version [[5.0.0-11|5.0.0-X]], the PXI system module did not check the command sizes. This makes it possible to get ROP under the PXI sysmodule from a pwned Process9.&lt;br /&gt;
safecerthax uses it to takeover the Arm11 processor after directly getting remote code execution on the Arm9 side. Though, is useless in classic Arm11 -&amp;gt; Arm9 chains.&lt;br /&gt;
| ROP under [[PXI_Services|PXI]]&lt;br /&gt;
| probably [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| &lt;br /&gt;
| Everyone&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;
| [[CSND_Services|CSND]] sysmodule crash due to out of bounds parameters.&lt;br /&gt;
| The CSND command [[CSND:PlaySoundDirectly|PlaySoundDirectly (0x00040080)]] takes a channel ID as the first parameter. Any value outside the range [0-3] makes the system module become unstable or crash due to an out of bounds memory read. &lt;br /&gt;
| Out of bounds memory read, probably not exploitable. More research needed.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| January 2021&lt;br /&gt;
| January 22, 2021&lt;br /&gt;
| [[User:PabloMK7|PabloMK7]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SSLoth: [[SSL_Services|SSL]] sysmodule improper certificate verification&lt;br /&gt;
| Initially, the SSL sysmodule missed the R_VERIFY_RES_SIGNATURE entry in the &amp;quot;resource list&amp;quot; provided to the RSA BSAFE library. Consequently, it did not check signatures when validating certificate chains. &lt;br /&gt;
| Forge fake certificates, spoof official servers and perform MitM attacks on SSL/TLS connections.&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], shutterbug2000 (independently)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD:ndm]] SetNZoneMacFilter (cmd8) stack smashing&lt;br /&gt;
| The length of the mac filter is not checked before being copied to a fixed-size buffer on stack.&lt;br /&gt;
| ROP under [[CECD_Services|CECD]] sysmodule&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| 2020&lt;br /&gt;
| July 20, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] message box access &lt;br /&gt;
| CECD allows any process to write to any message box, thus allowing to write Streetpass data to the message box of any title.&lt;br /&gt;
| Install exploit for any title having a vulnerability in Streetpass data parsers (see CTRSDK Streetpass parser vulnerability).&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
| ?&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| Everyone?&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] packet type 0x32/0x34 stack-smashing&lt;br /&gt;
| When parsing Streetpass packets of type 0x32 and 0x34, CECD copies a list without checking the number of entries. The packet length is limited to 0x400 bytes, which is not enough to reach the end of the stack frame and overwrite the return address. However, the buffer located just next to the packet buffer is actually filled with data sent just before, hence actually allowing to overwrite the whole stack frame with conrolled data.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] TMP files parser multiple vulnerabilities&lt;br /&gt;
| When parsing &amp;quot;TMP_XXX&amp;quot; files, CECD does not check the number of messages contained in the file. This allows to overflow the array of message pointers and message sizes on the stack. Pointers aren&#039;t controlled and sizes are limited (one cannot send gigabytes of data...), yet the last message size can be an arbitrary value (the current message pointer goes outside the file buffer and the parsing loop is broken). This allows to overwrite a pointer to a lock object on the stack and decrement an arbitrary value in memory. One can change the TMP file parsing mode to have CECD trying to free all the message buffers after parsing the next TMP file. The parsing mode is usually restored when parsing a new TMP file, but an invalid TMP file allows to make a function returns an error before the mode is restored , the return value is not checked and the parser consider the file valid. The message pointers and sizes arrays are not updated though, this is not a problem since the previous TMP file buffer is reused for the new TMP file in memory. Thus the message pointers actually points to controlled data. This allows to get a bunch of fake heap chunk freed, thus a bunch of unsafe unlink arbitrary writes.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Config_Services|CFG]]:CreateConfigInfoBlk integer underflow&lt;br /&gt;
| When creating a new block it checks the size of the block is &amp;lt;= 0x8000, but it doesn&#039;t check that the block size is less than the remaining space. This induces an integer underflow (remaining_space-block_size), the result is then used for another check (buf_start+current_offset+constant &amp;lt;= remaining_space-block_size) and then in a mempcy call (dest = buf_start+(u16)(remaining_space-block_size), size =block_size). This allow for writing past the buffer, however because of the u16 cast in the memcpy call memory has to be mapped from buf_start to buf_start+0x10000 (cannot write backward).&lt;br /&gt;
| Theoritically ROP under CFG services, but BSS section is to small (size &amp;lt;= 0x10000) so it only results in a crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.8.0-41]]&lt;br /&gt;
| November, 2018&lt;br /&gt;
| November 24, 2018&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP:SendDataFrame]] missing input array index validation&lt;br /&gt;
| [[MP:SendDataFrame]] doesn&#039;t validate the input index at cmdreq[1], unless the function for flag=non-zero is executed. This is used to calculate the following, without validating the index at all: someptr = stateptr + (index*0x924) + somestateoffset.&lt;br /&gt;
&lt;br /&gt;
After validating some flags from someptr, when input_flag=0 the input buffer data is copied to someptr+someotheroffset+0x14 with the u16 size loaded from someptr+someotheroffset.&lt;br /&gt;
&lt;br /&gt;
With a large input index someptr could be setup to be at a &amp;lt;target address&amp;gt;, for overwriting memory.&lt;br /&gt;
&lt;br /&gt;
This is probably difficult to exploit.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP_Services|MP]] cmd1 out-of-bounds handle read&lt;br /&gt;
| MP-sysmodule handles the input parameter for cmd1 as a s32. It checks for &amp;gt;=16, but not &amp;lt;0. With &amp;lt;16 it basically does the following(array of entries 4-bytes each): *outhandle = ((Handle*)(stateptr+offsetinstate))[inputindex].&lt;br /&gt;
&lt;br /&gt;
Hence, this can be used to load any handle in MP-sysmodule memory. MP doesn&#039;t really have any service handles of interest however(can be obtained from elsewhere too).&lt;br /&gt;
| Reading any handle in MP-sysmodule memory.&lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 21, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM stack/.bss infoleak via [[AM:ReadTwlBackupInfo]]([[AM:ReadTwlBackupInfoEx|Ex]])&lt;br /&gt;
| After writing the output-info structure to stack, it then copies that structure to the output buffer ptr using the size from the command. The size is not checked. This could be used to read data from the AM-service-thread stack handling the command + .bss.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was not tested on hardware.&#039;&#039;&#039;&lt;br /&gt;
| Stack/.bss reading&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27]](AM v9217)&lt;br /&gt;
| Roughly October 17, 2016&lt;br /&gt;
| October 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM module APcert infoleak via 00000000.ctx files&lt;br /&gt;
| Just after a download title is purchased from the eShop, the .ctx is in an initialized state of all FFs past the header. During download, the FF area is filled with the console APcert. Thus, it is possible to create a xorpad from the initial state and use it to decrypt the APcert filled state.&lt;br /&gt;
| APcert contains the deviceID, which can beneficial in decrypting the movable.sed (since deviceID is mathmatically related to the LFCS).&lt;br /&gt;
| None&lt;br /&gt;
| [[11.16.0-49]]&lt;br /&gt;
| August, 2022&lt;br /&gt;
| March 17, 2023&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| [[MVD_Services|MVD]]: Stack buffer overflow with [[MVDSTD:SetupOutputBuffers]].&lt;br /&gt;
| The input total_entries is not validated when initially processing the input entry-list. This fixed-size input entry-list is copied to stack from the command request. The loop for processing this initializes a global table, the converted linearmem-&amp;gt;physaddrs used there are also copied to stack(0x8-bytes of physaddrs per entry).&lt;br /&gt;
&lt;br /&gt;
If total_entries is too large, MVD-sysmodule will crash due to reading unmapped memory following the stack(0x10000000). Afterwards if the out-of-bounds total_entries is smaller than that, it will crash due accessing address 0x0, hence this useless.&lt;br /&gt;
| MVD-sysmodule crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| April 22, 2016 (Tested on the 25th)&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]]: Using CTRSDK heap with UDS sharedmem from the user-process.&lt;br /&gt;
| See the HTTP-sysmodule section below.&lt;br /&gt;
&lt;br /&gt;
CTRSDK heap is used with the sharedmem from [[NWMUDS:InitializeWithVersion]]. Buffers are allocated/freed under this heap using [[NWMUDS:Bind]] and [[NWMUDS:Unbind]].&lt;br /&gt;
&lt;br /&gt;
Hence, overwriting sharedmem with gspwn then using [[NWMUDS:Unbind]] results in the usual controlled CTRSDK memchunk-header write, similar to HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This could be done by creating an UDS network, without any other nodes on the network.&lt;br /&gt;
&lt;br /&gt;
Besides CTRSDK memchunk-headers, there are no addresses stored under this sharedmem.&lt;br /&gt;
| ROP under NWM-module.&lt;br /&gt;
| None (need to check, but CTRSDK heap code is vulnerable)&lt;br /&gt;
| [[9.0.0-20|9.0.0-X]]&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| April 16, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds memory access during spectator [[Download_Play|data-frame]] checksum calculation&lt;br /&gt;
| DLP doesn&#039;t validate the frame_size when receiving spectator data-frames at all, unlike non-spectator data-frames. The actual spectator data-frame parsing code doesn&#039;t use that field either. However, the data-frame checksum calculation code called during checksum verification does use the frame_size for loading the size of the framebuf.&lt;br /&gt;
&lt;br /&gt;
Hence, using a large frame_size like 0xFFFF will result in the checksum calculation code reading data out-of-bounds. This isn&#039;t really useful, you could trigger a remote local-WLAN DLP-sysmodule crash while a 3DS system is scanning for DLP networks(due to accessing unmapped memory), but that&#039;s about all(trying to infoleak with this likely isn&#039;t useful either).&lt;br /&gt;
| DLP-sysmodule crash, handled by dlplay system-application by a &amp;quot;connection interrupted&amp;quot; error eventually then a fatal-error via ErrDisp.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8, 2016 (Tested on the 10th)&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds output data writing during spectator sysupdate titlelist [[Download_Play|data-frame]] handling&lt;br /&gt;
| The total_entries and out_entryindex fields for the titlelist DLP spectator data-frames are not validated. This is parsed during DLP network scanning. Hence, the specified titlelist data can be written out-of-bounds using the specified out_entryindex and total_entries. A crash will occur while reading the input data-frame titlelist if total_entries is larger than 0x27A, due to accessing unmapped memory.&lt;br /&gt;
&lt;br /&gt;
There&#039;s not much non-zero data to overwrite following the output buffer(located in sharedmem), any ptrs are located in sharedmem. Overwriting certain ptr(s) are only known to cause a crash when attempting to use the DLP-client shutdown service-command.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to exploit the above crash, since the linked-list code involves writes zeros(with a controlled start ptr).&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8-9, 2016&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[IR_Services|IR]]: Stack buffer overflow with custom hardware&lt;br /&gt;
| Originally IR sysmodule used the read value from the I2C-IR registers TXLVL and RXLVL without validating them at all. See [[10.6.0-31|here]] for the fix. This is the size used for reading the data-recv FIFO, etc. The output buffer for reading is located on the stack.&lt;br /&gt;
&lt;br /&gt;
This should be exploitable if one could successfully setup the custom hardware for this and if the entire intended sizes actually get read from I2C.&lt;br /&gt;
| ROP under IR sysmodule.&lt;br /&gt;
| [[10.6.0-31|10.6.0-31]]&lt;br /&gt;
| &lt;br /&gt;
| February 23, 2016 (Unknown if it was noticed before then)&lt;br /&gt;
| February 23, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTP_Services|HTTP]]: Using CTRSDK heap with sharedmem from the user-process.&lt;br /&gt;
| The data from httpcAddPostDataAscii and other commands is stored under a CTRSDK heap. That heap is the sharedmem specified by the user-process via the HTTPC Initialize command.&lt;br /&gt;
Normally this sharedmem isn&#039;t accessible to the user-process once the sysmodule maps it, hence using it is supposed to be &amp;quot;safe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t the case due to gspwn however. Since CTRSDK heap code is so insecure in general, one can use gspwn to locate the HTTPC sharedmem + read/write it, then trigger a mem-write under the sysmodule. This can then be used to get ROP going under HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This is exploited by [https://github.com/yellows8/ctr-httpwn/ctr-httpwn ctr-httpwn].&lt;br /&gt;
| ROP under HTTP sysmdule.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45|11.13.0-X]]&lt;br /&gt;
| Late 2015&lt;br /&gt;
| March 22, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| Code execution under spi sysmodule; access to [[CONFIG11_Registers|CFG11_GPUPROT]] and ultimately kernel code execution. &lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&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 0x2D800000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 (0x800000 with New3DS) with the default memory-layout on Old3DS/New3DS. With [[11.3.0-36|11.3.0-X]] the cutoff now varies due to the new [[SVC]] 0x59. The New3DS &amp;quot;normal&amp;quot;(non-APPLICATION) cutoff was changed to 0x2D000000 due to the new [[SVC]] 0x59.&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;
| [[CECD_Services|CECD]] Streetpass message exheader stack-smashing&lt;br /&gt;
| When parsing streetpass messages, &amp;quot;nn::cec::CTR::Message::InputMessage&amp;quot; calls &amp;quot;nn::cec::CTR::Message::SetExHeaderWithoutCalc&amp;quot; for each exheader entry in the input message. The number of entries should not exceed 16 but remains unchecked, leading to a stack-buffer-overflow.&lt;br /&gt;
| ROP under any application parsing Streetpass messages&lt;br /&gt;
Remote code execution under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| &lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&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;br /&gt;
| CTPK buffer overflow&lt;br /&gt;
| At offset 0x20 in CTPK is an array for each texture, each entry is 0x20-bytes. This contains a wordindex(entry+0x18) for some srcdata relative to CTPK+0, and an u8 wordsize(entry+0x14) for this data. The CTRSDK function handling this doesn&#039;t validate the size, when copying srcdata using this size to the output buffer. Applications usually have the output buffer on the stack, hence stack buffer overflow.&lt;br /&gt;
&lt;br /&gt;
While CTPK(*.ctpk) are normally only loaded from RomFS, some application(s) load from elsewhere too.&lt;br /&gt;
| ROP under the target application.&lt;br /&gt;
| None?&lt;br /&gt;
| &amp;quot;[SDK+NINTENDO:CTR_SDK-11_4_0_200_none]&amp;quot;&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pia vulns&lt;br /&gt;
| [https://switchbrew.org/wiki/Switch_System_Flaws#Pia Originally discovered in Pia v5.x for Switch], these vulns are also present in earlier versions (v3.x/4.x/5.x, possibly earlier?) for 3DS (and Wii U too).&lt;br /&gt;
Pia encryption generally wasn&#039;t used pre-Switch (sent packets are plaintext). 3DS is affected by all Pia vulns listed above except for LAN. The functionality for ParseLeaveMeshInvitation doesn&#039;t exist in 3DS Pia v3.9.2. Wii U is affected by all listed Pia vulns except for the LAN vulns.&lt;br /&gt;
| See [https://switchbrew.org/wiki/Switch_System_Flaws#Pia here].&lt;br /&gt;
| Unfixed on 3DS/Wii U&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_5_4_3]&amp;quot;&lt;br /&gt;
| See [https://switchbrew.org/wiki/Switch_System_Flaws#Pia here]; separately checked later (UpdateConnectionReport) by [[User:Riley|Riley]] on: June 14, 2023&lt;br /&gt;
| [[User:Yellows8|Yellows8]]; added to 3dbrew (UpdateConnectionReport) by [[User:Riley|Riley]] later&lt;br /&gt;
|-&lt;br /&gt;
| pialease nerf: stack overflow in Pia when parsing UDS packet cmd=5 &amp;quot;UpdateMigrationNodeInfoMessage&amp;quot;&lt;br /&gt;
| A UDS packet as received by Pia contains a command type, where cmd=1 is higher-layer game-data, and other cmds are parsed internally.&lt;br /&gt;
&lt;br /&gt;
A function named &amp;quot;UdsNode::ParseUpdateMigrationNodeInfoMessage&amp;quot; is called to handle packets with cmd=5.&lt;br /&gt;
&lt;br /&gt;
This checks the player nodeID (returns if not player 1, that is, UDS network host), then calls an additional function which does a loop of 64-bit copies to a fixed-size stack buffer using unchecked index and data from the received packet contents.&lt;br /&gt;
&lt;br /&gt;
This therefore leads to trivial RCE (of every UDS network client) by just sending a single UDS packet; only 0xC u64s on stack can be overwritten easily, but just 2 is enough to start a ROP chain and pivot to the rest of the UDS packet contents elsewhere on the stack.&lt;br /&gt;
&lt;br /&gt;
To exploit some games, an attacker would need to also reimplement the DLP server protocol (and any quirks that game has when parsing the UDS network passphrase obtained from the DLP server). One game that requires this is Mario Party: Island Tour (only the dlplay child connects to a UDS network).&lt;br /&gt;
&lt;br /&gt;
Earliest version of Pia known to be vulnerable is v2.x. v1.x still parses this packet, but does not have the stack-copy loop (index is still unchecked there leading to heap overflow but due to overwrites not being contiguous in memory it may or may not be exploitable).&lt;br /&gt;
&lt;br /&gt;
Fixed with Pia version 4.x, which refactored the UDS send/receive wrapper code and parses completely different commands.&lt;br /&gt;
| ROP under the vulnerable application. A server can exploit every client connected to it; a client can exploit every other client connected to that server.&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_4_2_0]&amp;quot;&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_3_10_2]&amp;quot;, &amp;quot;[SDK+Nintendo:PIA_4_2_0]&amp;quot;&lt;br /&gt;
| Discovery: June 3, 2023.&lt;br /&gt;
&lt;br /&gt;
Wiki: November 20, 2023.&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=22435</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=22435"/>
		<updated>2023-11-20T12:59:41Z</updated>

		<summary type="html">&lt;p&gt;Riley: was going to wait until march-april, but N apparently confirmed to someone that there will be no more 3DS firmware updates ( https://nitter.net/RoseSilicon/status/1720635007788552396#m )&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;
* In the early days of 3DS hacking, Neimod was working on a RAM dumping setup for a while. He has de-soldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039;s PCB up to a custom RAM dumping setup. He &#039;&#039;has&#039;&#039; published photos showing his setup to be working quite well, with the 3DS successfully booting up, but however, his flickr stream is now private along with most of his work and this method has been unreleased. RAM dumping can be done through homebrew now, making this method obsolete regardless.&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). A 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 uninitialized 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;
The vulnerable timing range is about 100 CPU cycles after they start (which happens after the PLLs have stabilized after power-up). A glitch needs to be injected during one of these 100 cycles for the attack to succeed.&lt;br /&gt;
&lt;br /&gt;
It has been exploited by derrek to dump the ARM9 bootrom as of Summer 2015.&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;
| RSA keyslots don&#039;t clear exponent when setting modulus&lt;br /&gt;
| The [[RSA_Registers|RSA keyslots]] are set by boot ROM to have four private RSA keys.  The exponent value in the RSA registers is write-only and not readable.&lt;br /&gt;
&lt;br /&gt;
However, when setting a keyslot&#039;s modulus, the RSA hardware leaves the exponent alone.  This allows retrieving the exponent by doing a discrete logarithm of the output.&lt;br /&gt;
&lt;br /&gt;
By setting the modulus to a prime number whose modular multiplicative order is &amp;quot;smooth&amp;quot; (that is, p-1 is divisible by only small prime numbers), discrete logarithms can be calculated quickly using the [[wikipedia:Pohlig-Hellman algorithm|Pohlig-Hellman algorithm]].  If the prime chosen is greater than the modulus, but the same bit size, the discrete logarithm is the private exponent.&lt;br /&gt;
&lt;br /&gt;
This exploit&#039;s usefulness is limited: RSA keyslot 0 is only used in current firmware for deriving the 6.x save and 7.x NCCH keys, which were already known, and the other three keyslots are entirely unused.  Additionally, with a boot ROM dump, this exploit is moot; these private keys are located in the protected ARM9 boot ROM.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2016&lt;br /&gt;
| [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] allowing acccess to AXIWRAM/FCRAM-BASE-memregion&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] can be configured by anything with access to it to allow the GPU to access the entire AXIWRAM+FCRAM. For example, this is an issue for any sysmodule that gets exploited and has access to this register memory-page(include one that&#039;s listed below).&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;kernelhax via gspwn&amp;quot; below.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Boot ROM ==&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;
| FIRM partitions known-plaintext&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are encrypted with AES-CTR without a MAC. 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;
However it is most commonly used to install arbitrary FIRMs (usually boot9strap), thanks to sighax.&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;
| Boot9 AES keyinit function issues&lt;br /&gt;
| [[Bootloader|Boot9]] seems to have two bugs in the AES key-init function, see [[AES_Registers#AES_key-init|here]].&lt;br /&gt;
| None&lt;br /&gt;
| BootROM issue.&lt;br /&gt;
| 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| New3DS has same boot ROM as Old3DS&lt;br /&gt;
| The New3DS has the exact same boot ROM as the Old3DS.  This means, among other things, that all the same boot ROM flaws are present.  Also, this meant that it is possible to boot Old3DS firmware on New3DS (see &amp;quot;CFG9_SYSPROT9 bit1 not set by Kernel9&amp;quot;).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| October 2014&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| sighax: Boot9 improper validation of FIRM partition RSA signatures&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are signed with RSA-2048 using SHA-256 and PKCS #1 v1.5 padding.  Boot9, however, improperly validates the padding in three ways:&lt;br /&gt;
# Boot9 permits block type 02, meant for encrypted messages, to be used for signatures.  Only 01, for signatures, should have been permitted.  As a result, when using block type 02, a signature block is not required to have a long string of FF bytes as padding, but rather any nonzero random values suffice.&lt;br /&gt;
# Boot9 does not require that the length of the padding fill out the signature block completely.  As a result, there is considerable freedom in the layout of a signature.&lt;br /&gt;
# Boot9 fails to do bounds checking in its parsing of the DER-encoded hash algorithm type and hash value; the length values given in DER are permitted to point outside the signature block.&lt;br /&gt;
Flaw 3 allows the DER encoding to be such that boot9 believes that the signature&#039;s hash value is outside the range of the block itself, somewhere on the stack.  This can be pointed at the correct hash value it computes.  Boot9 then memcmp&#039;s the calculated hash against itself, and thinks that the hash is valid.&lt;br /&gt;
&lt;br /&gt;
As a result of the above, we estimate that one in 2&amp;lt;sup&amp;gt;43&amp;lt;/sup&amp;gt; (~8.8 trillion) random fake signatures will be considered by Boot9 to be valid.  This is well within the range of brute force, particularly with an optimized GPU implementation.  An Nvidia GTX 1080 Ti would take about one week to find a match.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| July 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| Boot9 FIRM loading doesn&#039;t blacklist memory-mapped I/O&lt;br /&gt;
| [[Bootloader|Boot9]]&#039;s FIRM loading blacklists Boot9 data regions, but forgets to do other important regions, including Memory-mapped I/O. Combined with sighax, a malicious FIRM can be used to overwrite:&lt;br /&gt;
a) boot9 data-abort handler, coupled with a 4th section that tries to NDMA copy to NULL, causing a data abort&lt;br /&gt;
&lt;br /&gt;
b) boot9 IRQ handler (this has the disadvantage that you must restore the original handler, then call it manually when your payload runs)&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2015(?)&lt;br /&gt;
| [[User:Derrek|derrek]] (2015?), [[User:Normmatt|Normmatt]] and [[User:SciresM|SciresM]] independently (January 2017).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;superhax&amp;quot;: Boot9 FIRM loading blacklist check is flawed&lt;br /&gt;
| Boot9 only makes sure the &#039;&#039;&#039;start&#039;&#039;&#039; and &#039;&#039;&#039;end&#039;&#039;&#039; address of each section is not covered by a blacklisted region. Thus, it is possible to overwrite blacklisted regions (e.g. ARM9 Exception Vectors) by choosing a FIRM section range that encloses an entire blacklisted region. The vulnerable code looks like this: if(blRegions[i].start &amp;lt;= sectionStart &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionStart &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; blRegions[i].start &amp;lt;= sectionEnd &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionEnd) return false; // failure&lt;br /&gt;
The boot9 vector table (0x08000000) contains 6 entries, each 8-bytes wide (0x30 bytes); Only 0x08000000 through 0x08000040 are blacklisted, and boot9 doesn&#039;t use the region after the vector table (this is convenient because we can put any payload we want after it and not worry about overwriting chunks of boot9 code)&lt;br /&gt;
&lt;br /&gt;
To exploit this, craft a FIRM section payload that&#039;s loaded a few bytes before 0x08000000, add padding to get to 0x08000000 and overwrite the vector table; You could overwrite the data-abort vector and craft a 4th FIRM section that causes a data-abort OR you can just overwrite the IRQ function pointer at 0x08000004 (make sure your payload replaces the original boot9 function pointer); you can point the rest of the vectors to infinite loops since they shouldn&#039;t be triggered.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2015&lt;br /&gt;
| [[User:Plutoo|plutoo]], [[User:Yellows8|yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
&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;
| Generating the keysector console-unique keys with ITCM+Boot9&lt;br /&gt;
| [[Bootloader|Boot9]] decrypts the 0x100-byte [[OTP_Registers|OTP]] using AES-CBC with keydata stored in Boot9. If hash verification is successful, the plaintext of the first 0x90-bytes are copied into [[Memory_layout|ITCM]]. This is the &#039;&#039;exact&#039;&#039; &#039;&#039;same&#039;&#039; region hashed by arm9loader when generating the console-unique keys for decrypting the keysector, except arm9loader uses the raw encrypted OTP.&lt;br /&gt;
&lt;br /&gt;
Therefore, with the OTP keydata+IV from Boot9 you can: encrypt the 0x90-bytes from ITCM, then hash the output to get the console-unique keys for the system&#039;s keysector. This can even be done for Old3DS which doesn&#039;t have the arm9loader keysector officially.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown why arm9loader only used the first 0x90-bytes of OTP. Using more data from OTP would&#039;ve prevented this. Fixing this would require doing exactly that, but that would also mean updating the NAND keysector(which is dangerous).&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| &lt;br /&gt;
| 2015&lt;br /&gt;
| January 6, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Rearrangable keys in the NAND keystore&lt;br /&gt;
| Due to the keystore being encrypted with AES-ECB, one can rearrange blocks and still have the NAND keystore decrypt in a deterministic way. &lt;br /&gt;
&lt;br /&gt;
Using 10.0 FIRM it is possible to rearrange keys such that ARM9 memory is executed. As such using existing ARM9 execution 10.0 FIRM can be written to NAND and a payload written to memory, with the payload to be executed post-K9L using an MCU reboot.&lt;br /&gt;
| arm9loaderhax given existing ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Early 2016&lt;br /&gt;
| 27 September 2016&lt;br /&gt;
| Myria, [[User:Dark samus|dark_samus]]; mathieulh (independently); [[User:Plutooo|plutoo]] (independently) + others&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;
| [[11.3.0-36|11.3.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 [[User:Derrek|derrek]].&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loaderhax: Missing verification block for the 9.6 keys&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, access to uncleared OTP hash keydata&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loader runs on Old3DS&lt;br /&gt;
| Despite being written only for New3DS, all of arm9loader runs fine on Old3DS.  It&#039;s not until booting Kernel9 that a New3DS FIRM partition would crash on an Old3DS.  As a result, if a bug exists in arm9loader to get control, it can be exploited on Old3DS by writing New3DS FIRM to the FIRM partitions.  Thus, arm9loaderhax works on both Old3DS and New3DS.&lt;br /&gt;
| arm9loader bugs also compromise Old3DS&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Sometime in 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]] presumably&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;
| Leak of normal-key matching a key-generator key&lt;br /&gt;
| During the 3DS&#039; development (June/July 2010) Nintendo added support installing encrypted content ([[CIA]]). Common-key index1 was intended to be a [[AES|hardware generated key]]. However while they added code to generate the key in hardware, they forgot to remove the normal-key for index1 (used elsewhere, likely old debug code). Nintendo later removed the normal key sometime before the first non-prototype firmware release.&lt;br /&gt;
&lt;br /&gt;
Knowing the keyY and the normal-key for common-key index1, the devkit key-generator algorithm can be deduced (see &amp;quot;Hardware&amp;quot; above). Additionally the remaining devkit common-keys can be generated once the common-key keyX is recovered.&lt;br /&gt;
&lt;br /&gt;
Note that the devkit key-generator was discovered to be the same as the retail key-generator.&lt;br /&gt;
| Deducing the keyX for keyslot 0x3D and hardware key-generator algorithm. Generate remaining devkit common-keys.&lt;br /&gt;
| pre-[[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| Shortly after the key-generator was revealed to be flawed at the 32c3 3ds talk&lt;br /&gt;
| January 20, 2016&lt;br /&gt;
| [[User:Jakcron|jakcron]]&lt;br /&gt;
|-&lt;br /&gt;
| Factory firmware is vulnerable to sighax&lt;br /&gt;
| During the 3DS&#039;s development, presumably boot9 was written (including the sighax vulnerability). This vulnerability is also present in factory firmware (and earlier, including 0.11). This was fixed in version 1.0.0-0.&lt;br /&gt;
| Deducing the mechanics of the sighax vulnerability in boot9 without having a dump of protected boot9. ARM9 code execution on factory/earlier firmware.&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| May 9, 2017&lt;br /&gt;
| May 19, 2017&lt;br /&gt;
| [[User:SciresM|SciresM]], [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| safecerthax &lt;br /&gt;
| O3DS &amp;amp; O2DS SAFE_FIRM is still vulnerable to the PXIAM:ImportCertificates flaw fixed in [[5.0.0-11]] and to SSLoth fixed in [[11.14.0-46]]. It makes it possible to spoof the official NUS update server and remotely trigger the vulnerability in SAFE_FIRM.&lt;br /&gt;
| Remote Arm9 code execution in O3DS/O2DS SAFE_FIRM&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| twlhax: Corrupted SRL header leads to memory overwrite&lt;br /&gt;
| During TWL_FIRM boot, the ARM11 process TwlBg puts launcher.srl, the DSi bootloader, into FCRAM.  TWL_FIRM Process9 then parses the [http://dsibrew.org/wiki/NDS_Format SRL header] to place launcher.srl&#039;s code where DSi mode can execute it.&lt;br /&gt;
&lt;br /&gt;
DSi-mode memory is in FCRAM, but interleaved.  Each byte of DSi-mode memory also exists at some address in 3DS FCRAM space.&lt;br /&gt;
&lt;br /&gt;
Process9 does not validate the RSA signature on launcher.srl, unlike SRLs loaded from cartridge or NAND (DSiWare).  A compromised ARM11 can, in a manner similar to firmlaunchhax, send a launcher.srl with a modified SRL header.  By setting the SRL header&#039;s ARM7/ARM9 load addresses and sizes carefully, accounting for the different memory map and for DSi mode&#039;s interleaved memory, it is possible to overwrite part of Process9&#039;s stack and take control with a ROP chain.&lt;br /&gt;
&lt;br /&gt;
Fixed in 11.8.0-X by... (fill me in)&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| August 11, 2018&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| agbhax&lt;br /&gt;
| This is the same issue as twlhax above. Legacy FIRMs share the same OS code (Arm9-side OS, Arm11 kernel), and therefore, the outdated AGB_FIRM can be tricked into executing the still vulnerable PrepareArm9ForTwl function.&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| December 17, 2020&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax&lt;br /&gt;
| SAFE_MODE_FIRM is almost never updated(even when NATIVE_FIRM is updated for vuln fixes), this can be noticed by &#039;&#039;just&#039;&#039; checking 3dbrew/ninupdates title-listings.&lt;br /&gt;
&lt;br /&gt;
The fix for firmlaunch-hax was only applied to NATIVE_FIRM in [[9.5.0-22|9.5.0-X]], leaving SAFE_FIRM exploitable. With ARM11-kernel execution, one can trigger FIRM-launch in to SAFE_FIRM, do Kernel9 &amp;lt;=&amp;gt; Kernel11 sync, PXI sync and then repeat the original attack on SAFE_FIRM instead.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012-2013?&lt;br /&gt;
| Wiki: January 2, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax 1.1&lt;br /&gt;
| Nintendo&#039;s original safefirmhax fix was flawed -- they added a global boolean that got set to true whenever a non-sysmodule title got launched (except for a hardcoded repair title id), and panic()&#039;d if that boolean was true to prevent launching safefirm after hax was active. However, because the boolean was initially false after firmlaunch -- With ARM11-kernel execution, one could FIRM-launch into NATIVE_FIRM, and then immediately FIRM-launch again into SAFE_FIRM early in NATIVE_FIRM boot before the boolean got set to true to repeat the safehax attack.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding additional CFG9_BOOTENV checks to firmlaunch code in 11.4.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| safefirmhax fix&lt;br /&gt;
| Wiki: April 10, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| When reading the banner of a NTR title, Process9 relies on a hardware register to know when the banner was fully read.&lt;br /&gt;
However that register is shared between the ARM9 and the ARM11.&lt;br /&gt;
An attacker with k11 control can so make Process9 believe the banner continues forever and so trigger a buffer overflow.&lt;br /&gt;
With a custom banner for a NTR flashcart, this leads to code execution in Process9.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding bound checks on the read data.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| &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;
&lt;br /&gt;
[[11.0.0-33|11.0.0-X]] fixed this for key system titles (MSET, Home Menu, spider, ErrDisp, SKATER, NATIVE_FIRM, and every retail system module), by checking the version of the title to install against a hard-coded list of (titleID, minimumVersionRequired) pairs.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], for key system titles.&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| Anti-downgrade list did not include all system titles initially&lt;br /&gt;
| The anti-downgrade list did not include legacy FIRMs until [[11.8.0-41|11.8.0-X]]. Therefore, legacy FIRMs could still be downgraded.&lt;br /&gt;
| Downgrading legacy FIRMs; allowing to exploit bugs in older legacy FIRMs (of which at least one exists, see below).&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| ?&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| TWL_FIRM cmd-9 unchecked offset&lt;br /&gt;
| In [[1.0.0-0|1.0.0-X]]&#039;s TWL_FIRM, cmds 8 and 9 were not stubbed (whereas in the corresponding NATIVE_FIRM, they were).&lt;br /&gt;
Command 8 does the Process9 initialisation for NTR carts if an NTR cart is inserted (NTR, not TWL, judged by chipid).&lt;br /&gt;
&lt;br /&gt;
Command 9 takes (u32 offset_read, u32 offset_write, u32 offset_read_end), and basically just copies (offset_read_end - offset_read) bytes starting at (offset_read) of [NTR cart header in arm9mem, NTR secure area in fcram, TWL secure area in fcram], to 0x18001000 + offset_write + offset_read.&lt;br /&gt;
&lt;br /&gt;
offset_write is not checked at all, thus this leads to ARM9 code execution as long as any NTR cart, including flashcarts that would normally be blocked by TWL_FIRM, is inserted.&lt;br /&gt;
&lt;br /&gt;
In [[2.0.0-2|2.0.0-X]] TWL_FIRM, those commands were stubbed out.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| January 2018&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|-&lt;br /&gt;
| FIRM launch doesn&#039;t check target FIRM version&lt;br /&gt;
| When executing a FIRM launch, Process9 doesn&#039;t validate that the target FIRM isn&#039;t an old version.  This allows booting an exploitable FIRM from a newer FIRM, if you can get the exploitable FIRM installed.  ([[11.0.0-33|11.0.0-X]] now prevents installing old versions of system titles, but this doesn&#039;t affect titles already installed.)&lt;br /&gt;
&lt;br /&gt;
This had a use after [[9.6.0-24|9.6.0-X]]: on a compromised 3DS running 9.2.0, you could install the 9.6.0 NATIVE_FIRM to FIRM0/FIRM1, but avoid putting it into the NATIVE_FIRM title.  This would boot the 9.2.0 system software but with the 9.6.0 Process9 and Kernel11.  With a user-mode exploit in a sufficiently-privileged application (e.g. mset), you could trigger a FIRM launch back to NATIVE_FIRM, which would load the 9.2.0 Process9 and Kernel11.&lt;br /&gt;
&lt;br /&gt;
9.6.0&#039;s keyslots 0x15 and 0x16 are unknown to 9.2.0, so 9.2.0 would not clear them.  You then could do firmlaunchhax against 9.2.0 to get ARM9 access with keyslots 0x15 and 0x16 set to their proper 9.6.0 values, allowing decrypting 9.6.0&#039;s encrypted titles.  Once the New3DS keystore was dumped, this became moot.&lt;br /&gt;
| Decrypting 9.6.0 NCCH files without dumping New3DS keystore&lt;br /&gt;
| None (but now moot)&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| August 12, 2018&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]]&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;
| [[FS:EnumerateExtSaveData]] crashes process9 when trying to parse a file as an extdata directory in Data Management (MSET9)&lt;br /&gt;
| In the implementation for FSPXI:EnumerateExtSaveData (called by [[System_Settings|MSET]] to parse 3DS extdata IDs for Data Management), the return value of the P9 internal function call to open a directory (when enumerating contents of the extdata directory) was not checked. Therefore, if the call fails, an uninitialised pointer on stack will be used for a vtable call.&lt;br /&gt;
&lt;br /&gt;
As such, a file that starts with 8 hex digits can crash process9 if placed directly inside the extdata directory. It can crash in various ways based on subtle differences in the way the user triggers the crash event.&lt;br /&gt;
&lt;br /&gt;
While mostly leading to null derefs, in one specific context, process9 jumps directly to an ID1 string being held in ARM9 memory. Surprisingly, the 3DS doesn&#039;t discern what characters are used for the ID1 directory name on the SD, only requiring exactly 32 chars. This allows the attacker to insert arm instructions into the unicode ID1 dirname and take control of the ARM9, and thus, full control of the 3DS.&lt;br /&gt;
| ARM9 code execution (primary)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.17.0-50|11.17.0-X]]&lt;br /&gt;
| April 2022&lt;br /&gt;
| August 7, 2023&lt;br /&gt;
| zoogie&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;
| [[11.3.0-36|11.3.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;
| [[11.3.0-36|11.3.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 this is used in conjunction with seedminer to be able to decrypt &amp;amp; modify DSiWare TAD containers and inject them with exploitable DSiWare titles such as sudoku (sudokuhax) and Flipnote JPN (ugopwn)&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;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| seedminer: movable.sed keyY vulnerable to brute-force&lt;br /&gt;
| Half of the movable.sed keyY&#039;s 128 bits are leaked through the [[Nandrw/sys/LocalFriendCodeSeed_B|LFCS]], which is available in userland and below. The LFCS itself also leaks almost half of the remaining bits by following the ratio: u32 keyY[3]=1/5(LFCS). The remaining keyY[3] uncertainty of about ±2000 can be greatly reduced by plotting expected error margins with several keyYs. This results in a final uncertainty of about 2^40, easily within practical brute force range of an average modern PC.&lt;br /&gt;
| Knowing the keyY of a given 3ds allows for modification of DSiWare export contents, and chained with several other public vulns, ultimately arm9 execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.8.0-X&lt;br /&gt;
| December 2017&lt;br /&gt;
| January 2018&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| Improper validation of DSiWare title SRLs&lt;br /&gt;
| The 3DS does not verify if the actual SRL embedded in the title&#039;s directory matches the titleID in the TMD before launching it or importing it from an sd DSiWare export. &lt;br /&gt;
| This allows embedding older, exploitable DSiWare titles in completely different, unexploitable DSiWare titles. Since DSiWare has raw NAND RW, this can result in arm9 control through FIRM known-plaintext and sighax attacks.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| 2015?&lt;br /&gt;
| December 2016&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| DSiWare import/export functions allow TWL system titles as arguments&lt;br /&gt;
| AM ImportTwlBackup/ExportTwlBackup unnecessarily allow TWL system titles such as DS Download Play to import/export from userland and System Settings -&amp;gt; Data Management (only am:sys is needed for userland). This is difficult to abuse for dsihax injection because no TWL system title has a save file, and any import with a save included will result in FS err C8804464. However, there is at least one dsihax primary that can load a payload from a non-NAND source, and not error if it can&#039;t access its public.sav (JPN Flipnote Studio v0).&lt;br /&gt;
| When combined with other public vulns, arm9 code execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| May 2018&lt;br /&gt;
| Sept 2018&lt;br /&gt;
| zoogie&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]]:ImportCertificates (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#CFG9_SYSPROT9|CFG9_SYSPROT9]] bit1 not set by Kernel9&lt;br /&gt;
| Old versions of Kernel9 never set bit1 of [[CONFIG Registers#CFG9_SYSPROT9|CFG9_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.&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, which is exploitable through a hardware + software vulnerability (see arm9loaderhax / description).&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 (see enhanced-arm9loaderhax / description). This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (0x05 -&amp;gt; 0x04, see partition encryption types [[Flash_Filesystem#NAND_structure|here]]) and using an Old3DS [[NCSD#NCSD_header|NCSD Header]], it is possible to boot a New3DS using Old3DS firmware 1.0-2.x to retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping the [[OTP Registers|OTP]] area.&lt;br /&gt;
Decrypting New3DS sector 0x96 keyblock.&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|svcUnbindInterrupt]] double free when irqId = 15&lt;br /&gt;
| svcBindInterrupt and svcUnbindInterrupt give special treatment to irqId 15 (FIQ helper): the access control list is bypassed and the provided KInterruptEvent (event or semaphore, via handle) is stored inside a singleton static object after having its refcount increased by 1.&lt;br /&gt;
&lt;br /&gt;
svcUnbindInterrupt assumes that the user-provided handle is what is stored in the singleton and will decref the user-provided KInterruptEvent twice, causing a use-after-free if the attacker didn&#039;t actually provide an handle to the same event or semaphore.&lt;br /&gt;
&lt;br /&gt;
This was &amp;quot;fixed&amp;quot; on [[11.14.0-46|11.14.0-X]] by preventing irqId 15 to be bound on retail units altogether (in both functions).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]] (only on retail units)&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]], maybe others&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcKernelSetState]] op=3 could map the NULL page&lt;br /&gt;
| svcKernelSetState op=3 param1=1 maps the firmlaunch parameters page to the user-specified VA.&lt;br /&gt;
&lt;br /&gt;
It had previously no check, allowing the attacker to map data at VA 0.&lt;br /&gt;
&lt;br /&gt;
Starting from [[11.14.0-46|11.14.0-X]], the VA must be in the standard 0x10000000-0x14000000 address range.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcMapProcessMemory]] can map the NULL page&lt;br /&gt;
| svcMapProcessMemory&#039;s destination VA is unchecked.&lt;br /&gt;
&lt;br /&gt;
By passing a big enough &amp;quot;size&amp;quot; parameter, an attacker can map chunks of data at VA 0 in the destination (caller) process.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| Resource limit use-after-free&lt;br /&gt;
| When assigning a KResourceLimit to a KProcess, the reslimit&#039;s refcounter doesn&#039;t get incremented. This essentially means all KResourceLimit get freed if pm gets somehow terminated.&lt;br /&gt;
&lt;br /&gt;
It turns out it is possible to ask pm (via ns:s or pm:app) to terminate itself along all other KIPs simply by passing TID 0004000100001000.&lt;br /&gt;
&lt;br /&gt;
Calling [[SVC|svcGetResourceLimit]] afterwards triggers a use-after-free. This is rather difficult to exploit, however: there is one slot left in the reslimit slabheap. An attacker either has to map the NULL page as R(W)X (svcControlProcessMemory vuln fixed on [[11.8.0-41|11.8.0-X]]), or use one of the map-null exploits above while having access to svcCreateResourceLimit (with the only one that is easy enough to use in that context having been fixed on [[11.14.0-46|11.14.0-X]], anyway).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| None (although near impossible to exploit on [[11.14.0-46|11.14.0-X]])&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcSetProcessIdealProcessor]] reference count overflow and therefore use-after-free.&lt;br /&gt;
| The SVC receive two arguments: handle and idealprocessor. The handle is used to get the KProcess object and the KProcess-&amp;gt;refCnt gets incremented,later the function check if the KProcess-&amp;gt;mem_type != BASE and if yes, it checks for idealprocessor == 2 or idealprocessor != 3. The problem here is that if you pass the idealprocessor = 3 it won&#039;t meet any condition and return the error 0xD9001BEA without decrement the reference count. &lt;br /&gt;
It can be abused to overflow the KProcess reference count that will lead to an Use-after-free. &lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free.&lt;br /&gt;
| &lt;br /&gt;
| [[11.6.0-39|11.6.0-X]]&lt;br /&gt;
| November 2, 2017&lt;br /&gt;
| [[User:st4rk|st4rk]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcGetThreadList]] process reference leak&lt;br /&gt;
| When given a valid process handle (including &amp;lt;code&amp;gt;0xFFFF8001&amp;lt;/code&amp;gt;), svcGetThreadList forgets to decrement the reference count of the underlying [[KProcess]] instance, after having finished using it.&lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free, but this UAF was most likely not exploitable&lt;br /&gt;
| &lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| April 3, 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| kernelhax via gspwn&lt;br /&gt;
| Originally the kernel didn&#039;t initialize [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]]. Since it&#039;s 0 at hard-boot, this allowed the GPU to access the entire FCRAM + AXIWRAM.&lt;br /&gt;
| Entire FCRAM+AXIWRAM R/W.&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] partly&lt;br /&gt;
|-&lt;br /&gt;
| fasthax&lt;br /&gt;
| When a KTimer is created in pulse mode, the kernel calls a virtual function to reset the timer each time it pulses. The scheduler is locked for that core to avoid race conditions, but another core can call CloseHandle on the timer and free it, leading to a UAF vtable call.&lt;br /&gt;
| See description.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| May 2016&lt;br /&gt;
| nedwill&lt;br /&gt;
|-&lt;br /&gt;
| ipctakeover&lt;br /&gt;
| When sending cmdreplies, it does not validate that the src_addr and src_size match the equivalent dst_addr and dst_size. With a modified addr/size specified in a cmdreply for an output buffer, the data-copy for the first/last pages could be used to overwrite data outside of the buffer specified by the original process.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This can be used to takeover processes where the process is using your service session. Like HTTPC -&amp;gt; BOSS, for bosshaxx above. NIM takeover can be done too(actual stack buffer overflow can trigger), etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 26, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Using IPC input buffers as output buffers&lt;br /&gt;
| When sending cmdreplies, it does not validate that the cmdreply descriptor type matches the equivalent cmdreq descriptor type. This could be used by an exploited sysmodule to use what was intended as an input-buffer as an output-buffer, and also combine other IPC vuln(s) with this.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| [[11.3.0-36|11.3.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) required patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]] (deleted)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| veryslowpidhax&lt;br /&gt;
| &#039;&#039;&#039;This is completely different from the kernelmode-code-execution vuln described in the below separate entry.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When updating the kernel global PID counter under [[SVC|svcCreateProcess]] the kernel does not check for wraparound to 0x0(the PID for the very first process). This only matters because [[Services|SM-module]] allows processes with PID value less than &amp;lt;total ARM11 FIRM modules&amp;gt; to access &#039;&#039;all&#039;&#039; services, without checking exheader service-access-control; and because Kernel11 checks for the PID to be 1 (loader) to use the input mem-region value on ControlMemory. This alone does not affect access the [[SVC|SVCs]] access table at all.&lt;br /&gt;
&lt;br /&gt;
Inlined ldrex+strex code is used for updating the above counter. [[11.2.0-35|11.2.0-X]] had changes for similar code, but it was only for dedicated ldrex+strex functions(mainly for kernel objects) and hence this PID code was not affected.&lt;br /&gt;
&lt;br /&gt;
With launching+terminating a sysmodule repeatedly with this via ns:s, it would take weeks to finish(if not at least about a month?).&lt;br /&gt;
| Access to all [[Services_API|services]], ControlMemory on any given mem-region.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| 2012 maybe?&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|  slowhax/waithax&lt;br /&gt;
|  svcWaitSynchronizationN does not decrement the references to valid handles in an array before returning an error when it encounters an invalid handle. This allows one to (slowly) overflow the reference count for a handle object to zero.&lt;br /&gt;
| ARM11 kernel-mode code execution&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| 2016&lt;br /&gt;
| nedwill, [[User:Derrek|derrek]]&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;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2.1&lt;br /&gt;
| Nintendo&#039;s fix for memchunkhax2 in [[10.4.0-29|10.4.0-X]] did not fix the GPU case: one may cause the requisite ToCToU race using gspwn, bypassing the new validation.&lt;br /&gt;
derrek&#039;s original 32c3 presentation for memchunkhax2 commented that a GPU-based attack was possible, but would be difficult.  However, memchunkhax2.1 showed that it was possible to do fairly reliably.&lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]], aliaspider&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2&lt;br /&gt;
| When allocating a block of memory, the &amp;quot;next&amp;quot; pointer of the [[Memory_Management#MemoryBlockHeader|memchunkhdr]] is accessed without being checked after being mapped to userland.&lt;br /&gt;
This allows a race condition, where the process can change the next pointer just before it&#039;s accessed. By pointing the next pointer to a crafted memchunckhdr in the kernel SlabHeap, some of the SlabHeap is allocated to the calling process, allowing to change vtables of kernel objects. &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]] (partially, see memchunkhax2.1)&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| heaphax&lt;br /&gt;
| Can change the size of free memchunk structures stored in FCRAM using DMA, which leads to the ability to allocate memory chunks over already-allocated memory. This can be used in the SYSTEM region to allocate RW memory over any part of the NS system module, which is enough to take it over.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading) Code execution within any applet.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| snshax&lt;br /&gt;
| Can force creation of Safe NS process into gspwn-able memory, allowing for takeover.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading)&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&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;
| Useless [[SM]] off-by-one write&lt;br /&gt;
| After accepting a new session, [[SM]] writes a (handler ID (0 for srv: sessions (max. 64), 1 for the srv:pm one), pointer to session context structure in BSS) pair in a global array. However that array is only 64-entry-big instead of 65 (as it ought to be), and no bound check is done in that regard.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, as of [[11.4.0-37]], the overwritten fields are totally unused after their initialization by &amp;lt;code&amp;gt;__libc_init_array&amp;lt;/code&amp;gt;.&lt;br /&gt;
| Not currently exploitable&lt;br /&gt;
| None&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| smpwn&lt;br /&gt;
| When registering a new service (or &amp;quot;port&amp;quot;), no bound checks are done on the service table. One can simply call RegisterPort repeatedly to overflow that table: it will overflow into the command replay structure.&lt;br /&gt;
&lt;br /&gt;
Combined with a other minor bugs in the sysmodule, it is possible to take over [[SM]] with this nevertheless difficult-to-exploit vulnerability.&lt;br /&gt;
| Code execution under [[SM]], etc.&lt;br /&gt;
| [[11.16.0-48]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| July 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]] (independently), presumably ichfly before &lt;br /&gt;
|-&lt;br /&gt;
| PXI cmdbuf buffer overrun &lt;br /&gt;
| Like its Arm9 counterpart, before version [[5.0.0-11|5.0.0-X]], the PXI system module did not check the command sizes. This makes it possible to get ROP under the PXI sysmodule from a pwned Process9.&lt;br /&gt;
safecerthax uses it to takeover the Arm11 processor after directly getting remote code execution on the Arm9 side. Though, is useless in classic Arm11 -&amp;gt; Arm9 chains.&lt;br /&gt;
| ROP under [[PXI_Services|PXI]]&lt;br /&gt;
| probably [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| &lt;br /&gt;
| Everyone&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;
| [[CSND_Services|CSND]] sysmodule crash due to out of bounds parameters.&lt;br /&gt;
| The CSND command [[CSND:PlaySoundDirectly|PlaySoundDirectly (0x00040080)]] takes a channel ID as the first parameter. Any value outside the range [0-3] makes the system module become unstable or crash due to an out of bounds memory read. &lt;br /&gt;
| Out of bounds memory read, probably not exploitable. More research needed.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| January 2021&lt;br /&gt;
| January 22, 2021&lt;br /&gt;
| [[User:PabloMK7|PabloMK7]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SSLoth: [[SSL_Services|SSL]] sysmodule improper certificate verification&lt;br /&gt;
| Initially, the SSL sysmodule missed the R_VERIFY_RES_SIGNATURE entry in the &amp;quot;resource list&amp;quot; provided to the RSA BSAFE library. Consequently, it did not check signatures when validating certificate chains. &lt;br /&gt;
| Forge fake certificates, spoof official servers and perform MitM attacks on SSL/TLS connections.&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], shutterbug2000 (independently)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD:ndm]] SetNZoneMacFilter (cmd8) stack smashing&lt;br /&gt;
| The length of the mac filter is not checked before being copied to a fixed-size buffer on stack.&lt;br /&gt;
| ROP under [[CECD_Services|CECD]] sysmodule&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| 2020&lt;br /&gt;
| July 20, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] message box access &lt;br /&gt;
| CECD allows any process to write to any message box, thus allowing to write Streetpass data to the message box of any title.&lt;br /&gt;
| Install exploit for any title having a vulnerability in Streetpass data parsers (see CTRSDK Streetpass parser vulnerability).&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
| ?&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| Everyone?&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] packet type 0x32/0x34 stack-smashing&lt;br /&gt;
| When parsing Streetpass packets of type 0x32 and 0x34, CECD copies a list without checking the number of entries. The packet length is limited to 0x400 bytes, which is not enough to reach the end of the stack frame and overwrite the return address. However, the buffer located just next to the packet buffer is actually filled with data sent just before, hence actually allowing to overwrite the whole stack frame with conrolled data.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] TMP files parser multiple vulnerabilities&lt;br /&gt;
| When parsing &amp;quot;TMP_XXX&amp;quot; files, CECD does not check the number of messages contained in the file. This allows to overflow the array of message pointers and message sizes on the stack. Pointers aren&#039;t controlled and sizes are limited (one cannot send gigabytes of data...), yet the last message size can be an arbitrary value (the current message pointer goes outside the file buffer and the parsing loop is broken). This allows to overwrite a pointer to a lock object on the stack and decrement an arbitrary value in memory. One can change the TMP file parsing mode to have CECD trying to free all the message buffers after parsing the next TMP file. The parsing mode is usually restored when parsing a new TMP file, but an invalid TMP file allows to make a function returns an error before the mode is restored , the return value is not checked and the parser consider the file valid. The message pointers and sizes arrays are not updated though, this is not a problem since the previous TMP file buffer is reused for the new TMP file in memory. Thus the message pointers actually points to controlled data. This allows to get a bunch of fake heap chunk freed, thus a bunch of unsafe unlink arbitrary writes.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Config_Services|CFG]]:CreateConfigInfoBlk integer underflow&lt;br /&gt;
| When creating a new block it checks the size of the block is &amp;lt;= 0x8000, but it doesn&#039;t check that the block size is less than the remaining space. This induces an integer underflow (remaining_space-block_size), the result is then used for another check (buf_start+current_offset+constant &amp;lt;= remaining_space-block_size) and then in a mempcy call (dest = buf_start+(u16)(remaining_space-block_size), size =block_size). This allow for writing past the buffer, however because of the u16 cast in the memcpy call memory has to be mapped from buf_start to buf_start+0x10000 (cannot write backward).&lt;br /&gt;
| Theoritically ROP under CFG services, but BSS section is to small (size &amp;lt;= 0x10000) so it only results in a crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.8.0-41]]&lt;br /&gt;
| November, 2018&lt;br /&gt;
| November 24, 2018&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP:SendDataFrame]] missing input array index validation&lt;br /&gt;
| [[MP:SendDataFrame]] doesn&#039;t validate the input index at cmdreq[1], unless the function for flag=non-zero is executed. This is used to calculate the following, without validating the index at all: someptr = stateptr + (index*0x924) + somestateoffset.&lt;br /&gt;
&lt;br /&gt;
After validating some flags from someptr, when input_flag=0 the input buffer data is copied to someptr+someotheroffset+0x14 with the u16 size loaded from someptr+someotheroffset.&lt;br /&gt;
&lt;br /&gt;
With a large input index someptr could be setup to be at a &amp;lt;target address&amp;gt;, for overwriting memory.&lt;br /&gt;
&lt;br /&gt;
This is probably difficult to exploit.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP_Services|MP]] cmd1 out-of-bounds handle read&lt;br /&gt;
| MP-sysmodule handles the input parameter for cmd1 as a s32. It checks for &amp;gt;=16, but not &amp;lt;0. With &amp;lt;16 it basically does the following(array of entries 4-bytes each): *outhandle = ((Handle*)(stateptr+offsetinstate))[inputindex].&lt;br /&gt;
&lt;br /&gt;
Hence, this can be used to load any handle in MP-sysmodule memory. MP doesn&#039;t really have any service handles of interest however(can be obtained from elsewhere too).&lt;br /&gt;
| Reading any handle in MP-sysmodule memory.&lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 21, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM stack/.bss infoleak via [[AM:ReadTwlBackupInfo]]([[AM:ReadTwlBackupInfoEx|Ex]])&lt;br /&gt;
| After writing the output-info structure to stack, it then copies that structure to the output buffer ptr using the size from the command. The size is not checked. This could be used to read data from the AM-service-thread stack handling the command + .bss.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was not tested on hardware.&#039;&#039;&#039;&lt;br /&gt;
| Stack/.bss reading&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27]](AM v9217)&lt;br /&gt;
| Roughly October 17, 2016&lt;br /&gt;
| October 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM module APcert infoleak via 00000000.ctx files&lt;br /&gt;
| Just after a download title is purchased from the eShop, the .ctx is in an initialized state of all FFs past the header. During download, the FF area is filled with the console APcert. Thus, it is possible to create a xorpad from the initial state and use it to decrypt the APcert filled state.&lt;br /&gt;
| APcert contains the deviceID, which can beneficial in decrypting the movable.sed (since deviceID is mathmatically related to the LFCS).&lt;br /&gt;
| None&lt;br /&gt;
| [[11.16.0-49]]&lt;br /&gt;
| August, 2022&lt;br /&gt;
| March 17, 2023&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| [[MVD_Services|MVD]]: Stack buffer overflow with [[MVDSTD:SetupOutputBuffers]].&lt;br /&gt;
| The input total_entries is not validated when initially processing the input entry-list. This fixed-size input entry-list is copied to stack from the command request. The loop for processing this initializes a global table, the converted linearmem-&amp;gt;physaddrs used there are also copied to stack(0x8-bytes of physaddrs per entry).&lt;br /&gt;
&lt;br /&gt;
If total_entries is too large, MVD-sysmodule will crash due to reading unmapped memory following the stack(0x10000000). Afterwards if the out-of-bounds total_entries is smaller than that, it will crash due accessing address 0x0, hence this useless.&lt;br /&gt;
| MVD-sysmodule crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| April 22, 2016 (Tested on the 25th)&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]]: Using CTRSDK heap with UDS sharedmem from the user-process.&lt;br /&gt;
| See the HTTP-sysmodule section below.&lt;br /&gt;
&lt;br /&gt;
CTRSDK heap is used with the sharedmem from [[NWMUDS:InitializeWithVersion]]. Buffers are allocated/freed under this heap using [[NWMUDS:Bind]] and [[NWMUDS:Unbind]].&lt;br /&gt;
&lt;br /&gt;
Hence, overwriting sharedmem with gspwn then using [[NWMUDS:Unbind]] results in the usual controlled CTRSDK memchunk-header write, similar to HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This could be done by creating an UDS network, without any other nodes on the network.&lt;br /&gt;
&lt;br /&gt;
Besides CTRSDK memchunk-headers, there are no addresses stored under this sharedmem.&lt;br /&gt;
| ROP under NWM-module.&lt;br /&gt;
| None (need to check, but CTRSDK heap code is vulnerable)&lt;br /&gt;
| [[9.0.0-20|9.0.0-X]]&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| April 16, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds memory access during spectator [[Download_Play|data-frame]] checksum calculation&lt;br /&gt;
| DLP doesn&#039;t validate the frame_size when receiving spectator data-frames at all, unlike non-spectator data-frames. The actual spectator data-frame parsing code doesn&#039;t use that field either. However, the data-frame checksum calculation code called during checksum verification does use the frame_size for loading the size of the framebuf.&lt;br /&gt;
&lt;br /&gt;
Hence, using a large frame_size like 0xFFFF will result in the checksum calculation code reading data out-of-bounds. This isn&#039;t really useful, you could trigger a remote local-WLAN DLP-sysmodule crash while a 3DS system is scanning for DLP networks(due to accessing unmapped memory), but that&#039;s about all(trying to infoleak with this likely isn&#039;t useful either).&lt;br /&gt;
| DLP-sysmodule crash, handled by dlplay system-application by a &amp;quot;connection interrupted&amp;quot; error eventually then a fatal-error via ErrDisp.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8, 2016 (Tested on the 10th)&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds output data writing during spectator sysupdate titlelist [[Download_Play|data-frame]] handling&lt;br /&gt;
| The total_entries and out_entryindex fields for the titlelist DLP spectator data-frames are not validated. This is parsed during DLP network scanning. Hence, the specified titlelist data can be written out-of-bounds using the specified out_entryindex and total_entries. A crash will occur while reading the input data-frame titlelist if total_entries is larger than 0x27A, due to accessing unmapped memory.&lt;br /&gt;
&lt;br /&gt;
There&#039;s not much non-zero data to overwrite following the output buffer(located in sharedmem), any ptrs are located in sharedmem. Overwriting certain ptr(s) are only known to cause a crash when attempting to use the DLP-client shutdown service-command.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to exploit the above crash, since the linked-list code involves writes zeros(with a controlled start ptr).&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8-9, 2016&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[IR_Services|IR]]: Stack buffer overflow with custom hardware&lt;br /&gt;
| Originally IR sysmodule used the read value from the I2C-IR registers TXLVL and RXLVL without validating them at all. See [[10.6.0-31|here]] for the fix. This is the size used for reading the data-recv FIFO, etc. The output buffer for reading is located on the stack.&lt;br /&gt;
&lt;br /&gt;
This should be exploitable if one could successfully setup the custom hardware for this and if the entire intended sizes actually get read from I2C.&lt;br /&gt;
| ROP under IR sysmodule.&lt;br /&gt;
| [[10.6.0-31|10.6.0-31]]&lt;br /&gt;
| &lt;br /&gt;
| February 23, 2016 (Unknown if it was noticed before then)&lt;br /&gt;
| February 23, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTP_Services|HTTP]]: Using CTRSDK heap with sharedmem from the user-process.&lt;br /&gt;
| The data from httpcAddPostDataAscii and other commands is stored under a CTRSDK heap. That heap is the sharedmem specified by the user-process via the HTTPC Initialize command.&lt;br /&gt;
Normally this sharedmem isn&#039;t accessible to the user-process once the sysmodule maps it, hence using it is supposed to be &amp;quot;safe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t the case due to gspwn however. Since CTRSDK heap code is so insecure in general, one can use gspwn to locate the HTTPC sharedmem + read/write it, then trigger a mem-write under the sysmodule. This can then be used to get ROP going under HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This is exploited by [https://github.com/yellows8/ctr-httpwn/ctr-httpwn ctr-httpwn].&lt;br /&gt;
| ROP under HTTP sysmdule.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45|11.13.0-X]]&lt;br /&gt;
| Late 2015&lt;br /&gt;
| March 22, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| Code execution under spi sysmodule; access to [[CONFIG11_Registers|CFG11_GPUPROT]] and ultimately kernel code execution. &lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&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 0x2D800000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 (0x800000 with New3DS) with the default memory-layout on Old3DS/New3DS. With [[11.3.0-36|11.3.0-X]] the cutoff now varies due to the new [[SVC]] 0x59. The New3DS &amp;quot;normal&amp;quot;(non-APPLICATION) cutoff was changed to 0x2D000000 due to the new [[SVC]] 0x59.&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;
| [[CECD_Services|CECD]] Streetpass message exheader stack-smashing&lt;br /&gt;
| When parsing streetpass messages, &amp;quot;nn::cec::CTR::Message::InputMessage&amp;quot; calls &amp;quot;nn::cec::CTR::Message::SetExHeaderWithoutCalc&amp;quot; for each exheader entry in the input message. The number of entries should not exceed 16 but remains unchecked, leading to a stack-buffer-overflow.&lt;br /&gt;
| ROP under any application parsing Streetpass messages&lt;br /&gt;
Remote code execution under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| &lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&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;br /&gt;
| CTPK buffer overflow&lt;br /&gt;
| At offset 0x20 in CTPK is an array for each texture, each entry is 0x20-bytes. This contains a wordindex(entry+0x18) for some srcdata relative to CTPK+0, and an u8 wordsize(entry+0x14) for this data. The CTRSDK function handling this doesn&#039;t validate the size, when copying srcdata using this size to the output buffer. Applications usually have the output buffer on the stack, hence stack buffer overflow.&lt;br /&gt;
&lt;br /&gt;
While CTPK(*.ctpk) are normally only loaded from RomFS, some application(s) load from elsewhere too.&lt;br /&gt;
| ROP under the target application.&lt;br /&gt;
| None?&lt;br /&gt;
| &amp;quot;[SDK+NINTENDO:CTR_SDK-11_4_0_200_none]&amp;quot;&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pia vulns&lt;br /&gt;
| [https://switchbrew.org/wiki/Switch_System_Flaws#Pia Originally discovered in Pia v5.x for Switch], these vulns are also present in earlier versions (v3.x/4.x/5.x, possibly earlier?) for 3DS (and Wii U too).&lt;br /&gt;
Pia encryption generally wasn&#039;t used pre-Switch (sent packets are plaintext). 3DS is affected by all Pia vulns listed above except for LAN. The functionality for ParseLeaveMeshInvitation doesn&#039;t exist in 3DS Pia v3.9.2. Wii U is affected by all listed Pia vulns except for the LAN vulns.&lt;br /&gt;
| See [https://switchbrew.org/wiki/Switch_System_Flaws#Pia here].&lt;br /&gt;
| Unfixed on 3DS/Wii U&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_5_4_3]&amp;quot;&lt;br /&gt;
| See [https://switchbrew.org/wiki/Switch_System_Flaws#Pia here]; separately checked later (UpdateConnectionReport) by [[User:Riley|Riley]] on: June 14, 2023&lt;br /&gt;
| [[User:Yellows8|Yellows8]]; added to 3dbrew (UpdateConnectionReport) by [[User:Riley|Riley]] later&lt;br /&gt;
|-&lt;br /&gt;
| pialease nerf: stack overflow in Pia when parsing UDS packet cmd=5 &amp;quot;UpdateMigrationNodeInfoMessage&amp;quot;&lt;br /&gt;
| A UDS packet as received by Pia contains a command type, where cmd=1 is higher-layer game-data, and other cmds are parsed internally.&lt;br /&gt;
&lt;br /&gt;
A function named &amp;quot;UdsNode::ParseUpdateMigrationNodeInfoMessage&amp;quot; is called to handle packets with cmd=5.&lt;br /&gt;
&lt;br /&gt;
This checks the player nodeID (returns if not player 1, that is, UDS network host), then calls an additional function which does a loop of 64-bit copies to a fixed-size stack buffer using unchecked index and data from the received packet contents.&lt;br /&gt;
&lt;br /&gt;
This therefore leads to trivial RCE (of every UDS network client) by just sending a single UDS packet; only 0xC u64s on stack can be overwritten easily, but just 2 is enough to start a ROP chain and pivot to the rest of the UDS packet contents elsewhere on the stack.&lt;br /&gt;
&lt;br /&gt;
To exploit some games, an attacker would need to also reimplement the DLP server protocol (and any quirks that game has when parsing the UDS network passphrase obtained from the DLP server). One game that requires this is Mario Party: Island Tour (only the dlplay child connects to a UDS network).&lt;br /&gt;
&lt;br /&gt;
Earliest version of Pia known to be vulnerable is v2.x. v1.x still parses this packet, but does not have the stack-copy loop (index is still unchecked there leading to heap overflow but due to overwrites not being contiguous in memory it may or may not be exploitable).&lt;br /&gt;
&lt;br /&gt;
Fixed with Pia version 4.x, which refactored the UDS send/receive wrapper code and parses completely different commands.&lt;br /&gt;
| ROP under the vulnerable application. A server can exploit every client connected to it; a client can exploit every other client connected to that server.&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_4_2_0]&amp;quot;&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_3_10_2]&amp;quot;, &amp;quot;[SDK+Nintendo:PIA_4_2_0]&amp;quot;&lt;br /&gt;
| Discovery: June 3, 2023.&lt;br /&gt;
&lt;br /&gt;
Wiki: November 20, 2023.&lt;br /&gt;
| [[User:Riley|Riley]]}&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=22305</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=22305"/>
		<updated>2023-08-14T09:27:48Z</updated>

		<summary type="html">&lt;p&gt;Riley: describe FSPXI:EnumerateExtSaveData bug further&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;
* In the early days of 3DS hacking, Neimod was working on a RAM dumping setup for a while. He has de-soldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039;s PCB up to a custom RAM dumping setup. He &#039;&#039;has&#039;&#039; published photos showing his setup to be working quite well, with the 3DS successfully booting up, but however, his flickr stream is now private along with most of his work and this method has been unreleased. RAM dumping can be done through homebrew now, making this method obsolete regardless.&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). A 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 uninitialized 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;
The vulnerable timing range is about 100 CPU cycles after they start (which happens after the PLLs have stabilized after power-up). A glitch needs to be injected during one of these 100 cycles for the attack to succeed.&lt;br /&gt;
&lt;br /&gt;
It has been exploited by derrek to dump the ARM9 bootrom as of Summer 2015.&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;
| RSA keyslots don&#039;t clear exponent when setting modulus&lt;br /&gt;
| The [[RSA_Registers|RSA keyslots]] are set by boot ROM to have four private RSA keys.  The exponent value in the RSA registers is write-only and not readable.&lt;br /&gt;
&lt;br /&gt;
However, when setting a keyslot&#039;s modulus, the RSA hardware leaves the exponent alone.  This allows retrieving the exponent by doing a discrete logarithm of the output.&lt;br /&gt;
&lt;br /&gt;
By setting the modulus to a prime number whose modular multiplicative order is &amp;quot;smooth&amp;quot; (that is, p-1 is divisible by only small prime numbers), discrete logarithms can be calculated quickly using the [[wikipedia:Pohlig-Hellman algorithm|Pohlig-Hellman algorithm]].  If the prime chosen is greater than the modulus, but the same bit size, the discrete logarithm is the private exponent.&lt;br /&gt;
&lt;br /&gt;
This exploit&#039;s usefulness is limited: RSA keyslot 0 is only used in current firmware for deriving the 6.x save and 7.x NCCH keys, which were already known, and the other three keyslots are entirely unused.  Additionally, with a boot ROM dump, this exploit is moot; these private keys are located in the protected ARM9 boot ROM.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2016&lt;br /&gt;
| [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] allowing acccess to AXIWRAM/FCRAM-BASE-memregion&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] can be configured by anything with access to it to allow the GPU to access the entire AXIWRAM+FCRAM. For example, this is an issue for any sysmodule that gets exploited and has access to this register memory-page(include one that&#039;s listed below).&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;kernelhax via gspwn&amp;quot; below.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Boot ROM ==&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;
| FIRM partitions known-plaintext&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are encrypted with AES-CTR without a MAC. 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;
However it is most commonly used to install arbitrary FIRMs (usually boot9strap), thanks to sighax.&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;
| Boot9 AES keyinit function issues&lt;br /&gt;
| [[Bootloader|Boot9]] seems to have two bugs in the AES key-init function, see [[AES_Registers#AES_key-init|here]].&lt;br /&gt;
| None&lt;br /&gt;
| BootROM issue.&lt;br /&gt;
| 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| New3DS has same boot ROM as Old3DS&lt;br /&gt;
| The New3DS has the exact same boot ROM as the Old3DS.  This means, among other things, that all the same boot ROM flaws are present.  Also, this meant that it is possible to boot Old3DS firmware on New3DS (see &amp;quot;CFG9_SYSPROT9 bit1 not set by Kernel9&amp;quot;).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| October 2014&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| sighax: Boot9 improper validation of FIRM partition RSA signatures&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are signed with RSA-2048 using SHA-256 and PKCS #1 v1.5 padding.  Boot9, however, improperly validates the padding in three ways:&lt;br /&gt;
# Boot9 permits block type 02, meant for encrypted messages, to be used for signatures.  Only 01, for signatures, should have been permitted.  As a result, when using block type 02, a signature block is not required to have a long string of FF bytes as padding, but rather any nonzero random values suffice.&lt;br /&gt;
# Boot9 does not require that the length of the padding fill out the signature block completely.  As a result, there is considerable freedom in the layout of a signature.&lt;br /&gt;
# Boot9 fails to do bounds checking in its parsing of the DER-encoded hash algorithm type and hash value; the length values given in DER are permitted to point outside the signature block.&lt;br /&gt;
Flaw 3 allows the DER encoding to be such that boot9 believes that the signature&#039;s hash value is outside the range of the block itself, somewhere on the stack.  This can be pointed at the correct hash value it computes.  Boot9 then memcmp&#039;s the calculated hash against itself, and thinks that the hash is valid.&lt;br /&gt;
&lt;br /&gt;
As a result of the above, we estimate that one in 2&amp;lt;sup&amp;gt;43&amp;lt;/sup&amp;gt; (~8.8 trillion) random fake signatures will be considered by Boot9 to be valid.  This is well within the range of brute force, particularly with an optimized GPU implementation.  An Nvidia GTX 1080 Ti would take about one week to find a match.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| July 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| Boot9 FIRM loading doesn&#039;t blacklist memory-mapped I/O&lt;br /&gt;
| [[Bootloader|Boot9]]&#039;s FIRM loading blacklists Boot9 data regions, but forgets to do other important regions, including Memory-mapped I/O. Combined with sighax, a malicious FIRM can be used to overwrite:&lt;br /&gt;
a) boot9 data-abort handler, coupled with a 4th section that tries to NDMA copy to NULL, causing a data abort&lt;br /&gt;
&lt;br /&gt;
b) boot9 IRQ handler (this has the disadvantage that you must restore the original handler, then call it manually when your payload runs)&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2015(?)&lt;br /&gt;
| [[User:Derrek|derrek]] (2015?), [[User:Normmatt|Normmatt]] and [[User:SciresM|SciresM]] independently (January 2017).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;superhax&amp;quot;: Boot9 FIRM loading blacklist check is flawed&lt;br /&gt;
| Boot9 only makes sure the &#039;&#039;&#039;start&#039;&#039;&#039; and &#039;&#039;&#039;end&#039;&#039;&#039; address of each section is not covered by a blacklisted region. Thus, it is possible to overwrite blacklisted regions (e.g. ARM9 Exception Vectors) by choosing a FIRM section range that encloses an entire blacklisted region. The vulnerable code looks like this: if(blRegions[i].start &amp;lt;= sectionStart &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionStart &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; blRegions[i].start &amp;lt;= sectionEnd &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionEnd) return false; // failure&lt;br /&gt;
The boot9 vector table (0x08000000) contains 6 entries, each 8-bytes wide (0x30 bytes); Only 0x08000000 through 0x08000040 are blacklisted, and boot9 doesn&#039;t use the region after the vector table (this is convenient because we can put any payload we want after it and not worry about overwriting chunks of boot9 code)&lt;br /&gt;
&lt;br /&gt;
To exploit this, craft a FIRM section payload that&#039;s loaded a few bytes before 0x08000000, add padding to get to 0x08000000 and overwrite the vector table; You could overwrite the data-abort vector and craft a 4th FIRM section that causes a data-abort OR you can just overwrite the IRQ function pointer at 0x08000004 (make sure your payload replaces the original boot9 function pointer); you can point the rest of the vectors to infinite loops since they shouldn&#039;t be triggered.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2015&lt;br /&gt;
| [[User:Plutoo|plutoo]], [[User:Yellows8|yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
&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;
| Generating the keysector console-unique keys with ITCM+Boot9&lt;br /&gt;
| [[Bootloader|Boot9]] decrypts the 0x100-byte [[OTP_Registers|OTP]] using AES-CBC with keydata stored in Boot9. If hash verification is successful, the plaintext of the first 0x90-bytes are copied into [[Memory_layout|ITCM]]. This is the &#039;&#039;exact&#039;&#039; &#039;&#039;same&#039;&#039; region hashed by arm9loader when generating the console-unique keys for decrypting the keysector, except arm9loader uses the raw encrypted OTP.&lt;br /&gt;
&lt;br /&gt;
Therefore, with the OTP keydata+IV from Boot9 you can: encrypt the 0x90-bytes from ITCM, then hash the output to get the console-unique keys for the system&#039;s keysector. This can even be done for Old3DS which doesn&#039;t have the arm9loader keysector officially.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown why arm9loader only used the first 0x90-bytes of OTP. Using more data from OTP would&#039;ve prevented this. Fixing this would require doing exactly that, but that would also mean updating the NAND keysector(which is dangerous).&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| &lt;br /&gt;
| 2015&lt;br /&gt;
| January 6, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Rearrangable keys in the NAND keystore&lt;br /&gt;
| Due to the keystore being encrypted with AES-ECB, one can rearrange blocks and still have the NAND keystore decrypt in a deterministic way. &lt;br /&gt;
&lt;br /&gt;
Using 10.0 FIRM it is possible to rearrange keys such that ARM9 memory is executed. As such using existing ARM9 execution 10.0 FIRM can be written to NAND and a payload written to memory, with the payload to be executed post-K9L using an MCU reboot.&lt;br /&gt;
| arm9loaderhax given existing ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Early 2016&lt;br /&gt;
| 27 September 2016&lt;br /&gt;
| Myria, [[User:Dark samus|dark_samus]]; mathieulh (independently); [[User:Plutooo|plutoo]] (independently) + others&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;
| [[11.3.0-36|11.3.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 [[User:Derrek|derrek]].&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loaderhax: Missing verification block for the 9.6 keys&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, access to uncleared OTP hash keydata&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loader runs on Old3DS&lt;br /&gt;
| Despite being written only for New3DS, all of arm9loader runs fine on Old3DS.  It&#039;s not until booting Kernel9 that a New3DS FIRM partition would crash on an Old3DS.  As a result, if a bug exists in arm9loader to get control, it can be exploited on Old3DS by writing New3DS FIRM to the FIRM partitions.  Thus, arm9loaderhax works on both Old3DS and New3DS.&lt;br /&gt;
| arm9loader bugs also compromise Old3DS&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Sometime in 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]] presumably&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;
| Leak of normal-key matching a key-generator key&lt;br /&gt;
| During the 3DS&#039; development (June/July 2010) Nintendo added support installing encrypted content ([[CIA]]). Common-key index1 was intended to be a [[AES|hardware generated key]]. However while they added code to generate the key in hardware, they forgot to remove the normal-key for index1 (used elsewhere, likely old debug code). Nintendo later removed the normal key sometime before the first non-prototype firmware release.&lt;br /&gt;
&lt;br /&gt;
Knowing the keyY and the normal-key for common-key index1, the devkit key-generator algorithm can be deduced (see &amp;quot;Hardware&amp;quot; above). Additionally the remaining devkit common-keys can be generated once the common-key keyX is recovered.&lt;br /&gt;
&lt;br /&gt;
Note that the devkit key-generator was discovered to be the same as the retail key-generator.&lt;br /&gt;
| Deducing the keyX for keyslot 0x3D and hardware key-generator algorithm. Generate remaining devkit common-keys.&lt;br /&gt;
| pre-[[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| Shortly after the key-generator was revealed to be flawed at the 32c3 3ds talk&lt;br /&gt;
| January 20, 2016&lt;br /&gt;
| [[User:Jakcron|jakcron]]&lt;br /&gt;
|-&lt;br /&gt;
| Factory firmware is vulnerable to sighax&lt;br /&gt;
| During the 3DS&#039;s development, presumably boot9 was written (including the sighax vulnerability). This vulnerability is also present in factory firmware (and earlier, including 0.11). This was fixed in version 1.0.0-0.&lt;br /&gt;
| Deducing the mechanics of the sighax vulnerability in boot9 without having a dump of protected boot9. ARM9 code execution on factory/earlier firmware.&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| May 9, 2017&lt;br /&gt;
| May 19, 2017&lt;br /&gt;
| [[User:SciresM|SciresM]], [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| safecerthax &lt;br /&gt;
| O3DS &amp;amp; O2DS SAFE_FIRM is still vulnerable to the PXIAM:ImportCertificates flaw fixed in [[5.0.0-11]] and to SSLoth fixed in [[11.14.0-46]]. It makes it possible to spoof the official NUS update server and remotely trigger the vulnerability in SAFE_FIRM.&lt;br /&gt;
| Remote Arm9 code execution in O3DS/O2DS SAFE_FIRM&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| twlhax: Corrupted SRL header leads to memory overwrite&lt;br /&gt;
| During TWL_FIRM boot, the ARM11 process TwlBg puts launcher.srl, the DSi bootloader, into FCRAM.  TWL_FIRM Process9 then parses the [http://dsibrew.org/wiki/NDS_Format SRL header] to place launcher.srl&#039;s code where DSi mode can execute it.&lt;br /&gt;
&lt;br /&gt;
DSi-mode memory is in FCRAM, but interleaved.  Each byte of DSi-mode memory also exists at some address in 3DS FCRAM space.&lt;br /&gt;
&lt;br /&gt;
Process9 does not validate the RSA signature on launcher.srl, unlike SRLs loaded from cartridge or NAND (DSiWare).  A compromised ARM11 can, in a manner similar to firmlaunchhax, send a launcher.srl with a modified SRL header.  By setting the SRL header&#039;s ARM7/ARM9 load addresses and sizes carefully, accounting for the different memory map and for DSi mode&#039;s interleaved memory, it is possible to overwrite part of Process9&#039;s stack and take control with a ROP chain.&lt;br /&gt;
&lt;br /&gt;
Fixed in 11.8.0-X by... (fill me in)&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| August 11, 2018&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| agbhax&lt;br /&gt;
| This is the same issue as twlhax above. Legacy FIRMs share the same OS code (Arm9-side OS, Arm11 kernel), and therefore, the outdated AGB_FIRM can be tricked into executing the still vulnerable PrepareArm9ForTwl function.&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| December 17, 2020&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax&lt;br /&gt;
| SAFE_MODE_FIRM is almost never updated(even when NATIVE_FIRM is updated for vuln fixes), this can be noticed by &#039;&#039;just&#039;&#039; checking 3dbrew/ninupdates title-listings.&lt;br /&gt;
&lt;br /&gt;
The fix for firmlaunch-hax was only applied to NATIVE_FIRM in [[9.5.0-22|9.5.0-X]], leaving SAFE_FIRM exploitable. With ARM11-kernel execution, one can trigger FIRM-launch in to SAFE_FIRM, do Kernel9 &amp;lt;=&amp;gt; Kernel11 sync, PXI sync and then repeat the original attack on SAFE_FIRM instead.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012-2013?&lt;br /&gt;
| Wiki: January 2, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax 1.1&lt;br /&gt;
| Nintendo&#039;s original safefirmhax fix was flawed -- they added a global boolean that got set to true whenever a non-sysmodule title got launched (except for a hardcoded repair title id), and panic()&#039;d if that boolean was true to prevent launching safefirm after hax was active. However, because the boolean was initially false after firmlaunch -- With ARM11-kernel execution, one could FIRM-launch into NATIVE_FIRM, and then immediately FIRM-launch again into SAFE_FIRM early in NATIVE_FIRM boot before the boolean got set to true to repeat the safehax attack.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding additional CFG9_BOOTENV checks to firmlaunch code in 11.4.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| safefirmhax fix&lt;br /&gt;
| Wiki: April 10, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| When reading the banner of a NTR title, Process9 relies on a hardware register to know when the banner was fully read.&lt;br /&gt;
However that register is shared between the ARM9 and the ARM11.&lt;br /&gt;
An attacker with k11 control can so make Process9 believe the banner continues forever and so trigger a buffer overflow.&lt;br /&gt;
With a custom banner for a NTR flashcart, this leads to code execution in Process9.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding bound checks on the read data.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| &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;
&lt;br /&gt;
[[11.0.0-33|11.0.0-X]] fixed this for key system titles (MSET, Home Menu, spider, ErrDisp, SKATER, NATIVE_FIRM, and every retail system module), by checking the version of the title to install against a hard-coded list of (titleID, minimumVersionRequired) pairs.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], for key system titles.&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| Anti-downgrade list did not include all system titles initially&lt;br /&gt;
| The anti-downgrade list did not include legacy FIRMs until [[11.8.0-41|11.8.0-X]]. Therefore, legacy FIRMs could still be downgraded.&lt;br /&gt;
| Downgrading legacy FIRMs; allowing to exploit bugs in older legacy FIRMs (of which at least one exists, see below).&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| ?&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| TWL_FIRM cmd-9 unchecked offset&lt;br /&gt;
| In [[1.0.0-0|1.0.0-X]]&#039;s TWL_FIRM, cmds 8 and 9 were not stubbed (whereas in the corresponding NATIVE_FIRM, they were).&lt;br /&gt;
Command 8 does the Process9 initialisation for NTR carts if an NTR cart is inserted (NTR, not TWL, judged by chipid).&lt;br /&gt;
&lt;br /&gt;
Command 9 takes (u32 offset_read, u32 offset_write, u32 offset_read_end), and basically just copies (offset_read_end - offset_read) bytes starting at (offset_read) of [NTR cart header in arm9mem, NTR secure area in fcram, TWL secure area in fcram], to 0x18001000 + offset_write + offset_read.&lt;br /&gt;
&lt;br /&gt;
offset_write is not checked at all, thus this leads to ARM9 code execution as long as any NTR cart, including flashcarts that would normally be blocked by TWL_FIRM, is inserted.&lt;br /&gt;
&lt;br /&gt;
In [[2.0.0-2|2.0.0-X]] TWL_FIRM, those commands were stubbed out.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| January 2018&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|-&lt;br /&gt;
| FIRM launch doesn&#039;t check target FIRM version&lt;br /&gt;
| When executing a FIRM launch, Process9 doesn&#039;t validate that the target FIRM isn&#039;t an old version.  This allows booting an exploitable FIRM from a newer FIRM, if you can get the exploitable FIRM installed.  ([[11.0.0-33|11.0.0-X]] now prevents installing old versions of system titles, but this doesn&#039;t affect titles already installed.)&lt;br /&gt;
&lt;br /&gt;
This had a use after [[9.6.0-24|9.6.0-X]]: on a compromised 3DS running 9.2.0, you could install the 9.6.0 NATIVE_FIRM to FIRM0/FIRM1, but avoid putting it into the NATIVE_FIRM title.  This would boot the 9.2.0 system software but with the 9.6.0 Process9 and Kernel11.  With a user-mode exploit in a sufficiently-privileged application (e.g. mset), you could trigger a FIRM launch back to NATIVE_FIRM, which would load the 9.2.0 Process9 and Kernel11.&lt;br /&gt;
&lt;br /&gt;
9.6.0&#039;s keyslots 0x15 and 0x16 are unknown to 9.2.0, so 9.2.0 would not clear them.  You then could do firmlaunchhax against 9.2.0 to get ARM9 access with keyslots 0x15 and 0x16 set to their proper 9.6.0 values, allowing decrypting 9.6.0&#039;s encrypted titles.  Once the New3DS keystore was dumped, this became moot.&lt;br /&gt;
| Decrypting 9.6.0 NCCH files without dumping New3DS keystore&lt;br /&gt;
| None (but now moot)&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| August 12, 2018&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]]&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;
| [[FS:EnumerateExtSaveData]] crashes process9 when trying to parse a file as an extdata directory in Data Management (MSET9)&lt;br /&gt;
| In the implementation for FSPXI:EnumerateExtSaveData (called by [[System_Settings|MSET]] to parse 3DS extdata IDs for Data Management), the return value of the P9 internal function call to open a directory (when enumerating contents of the extdata directory) was not checked. Therefore, if the call fails, an uninitialised pointer on stack will be used for a vtable call.&lt;br /&gt;
&lt;br /&gt;
As such, a file that starts with 8 hex digits can crash process9 if placed directly inside the extdata directory. It can crash in various ways based on subtle differences in the way the user triggers the crash event.&lt;br /&gt;
&lt;br /&gt;
While mostly leading to null derefs, in one specific context, process9 jumps directly to an ID1 string being held in ARM9 memory. Surprisingly, the 3DS doesn&#039;t discern what characters are used for the ID1 directory name on the SD, only requiring exactly 32 chars. This allows the attacker to insert arm instructions into the unicode ID1 dirname and take control of the ARM9, and thus, full control of the 3DS.&lt;br /&gt;
| ARM9 code execution (primary)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.17.0-50|11.17.0-X]]&lt;br /&gt;
| April 2022&lt;br /&gt;
| August 7, 2023&lt;br /&gt;
| zoogie&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;
| [[11.3.0-36|11.3.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;
| [[11.3.0-36|11.3.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 this is used in conjunction with seedminer to be able to decrypt &amp;amp; modify DSiWare TAD containers and inject them with exploitable DSiWare titles such as sudoku (sudokuhax) and Flipnote JPN (ugopwn)&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;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| seedminer: movable.sed keyY vulnerable to brute-force&lt;br /&gt;
| Half of the movable.sed keyY&#039;s 128 bits are leaked through the [[Nandrw/sys/LocalFriendCodeSeed_B|LFCS]], which is available in userland and below. The LFCS itself also leaks almost half of the remaining bits by following the ratio: u32 keyY[3]=1/5(LFCS). The remaining keyY[3] uncertainty of about ±2000 can be greatly reduced by plotting expected error margins with several keyYs. This results in a final uncertainty of about 2^40, easily within practical brute force range of an average modern PC.&lt;br /&gt;
| Knowing the keyY of a given 3ds allows for modification of DSiWare export contents, and chained with several other public vulns, ultimately arm9 execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.8.0-X&lt;br /&gt;
| December 2017&lt;br /&gt;
| January 2018&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| Improper validation of DSiWare title SRLs&lt;br /&gt;
| The 3DS does not verify if the actual SRL embedded in the title&#039;s directory matches the titleID in the TMD before launching it or importing it from an sd DSiWare export. &lt;br /&gt;
| This allows embedding older, exploitable DSiWare titles in completely different, unexploitable DSiWare titles. Since DSiWare has raw NAND RW, this can result in arm9 control through FIRM known-plaintext and sighax attacks.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| 2015?&lt;br /&gt;
| December 2016&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| DSiWare import/export functions allow TWL system titles as arguments&lt;br /&gt;
| AM ImportTwlBackup/ExportTwlBackup unnecessarily allow TWL system titles such as DS Download Play to import/export from userland and System Settings -&amp;gt; Data Management (only am:sys is needed for userland). This is difficult to abuse for dsihax injection because no TWL system title has a save file, and any import with a save included will result in FS err C8804464. However, there is at least one dsihax primary that can load a payload from a non-NAND source, and not error if it can&#039;t access its public.sav (JPN Flipnote Studio v0).&lt;br /&gt;
| When combined with other public vulns, arm9 code execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| May 2018&lt;br /&gt;
| Sept 2018&lt;br /&gt;
| zoogie&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]]:ImportCertificates (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#CFG9_SYSPROT9|CFG9_SYSPROT9]] bit1 not set by Kernel9&lt;br /&gt;
| Old versions of Kernel9 never set bit1 of [[CONFIG Registers#CFG9_SYSPROT9|CFG9_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.&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, which is exploitable through a hardware + software vulnerability (see arm9loaderhax / description).&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 (see enhanced-arm9loaderhax / description). This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (0x05 -&amp;gt; 0x04, see partition encryption types [[Flash_Filesystem#NAND_structure|here]]) and using an Old3DS [[NCSD#NCSD_header|NCSD Header]], it is possible to boot a New3DS using Old3DS firmware 1.0-2.x to retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping the [[OTP Registers|OTP]] area.&lt;br /&gt;
Decrypting New3DS sector 0x96 keyblock.&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|svcUnbindInterrupt]] double free when irqId = 15&lt;br /&gt;
| svcBindInterrupt and svcUnbindInterrupt give special treatment to irqId 15 (FIQ helper): the access control list is bypassed and the provided KInterruptEvent (event or semaphore, via handle) is stored inside a singleton static object after having its refcount increased by 1.&lt;br /&gt;
&lt;br /&gt;
svcUnbindInterrupt assumes that the user-provided handle is what is stored in the singleton and will decref the user-provided KInterruptEvent twice, causing a use-after-free if the attacker didn&#039;t actually provide an handle to the same event or semaphore.&lt;br /&gt;
&lt;br /&gt;
This was &amp;quot;fixed&amp;quot; on [[11.14.0-46|11.14.0-X]] by preventing irqId 15 to be bound on retail units altogether (in both functions).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]] (only on retail units)&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]], maybe others&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcKernelSetState]] op=3 could map the NULL page&lt;br /&gt;
| svcKernelSetState op=3 param1=1 maps the firmlaunch parameters page to the user-specified VA.&lt;br /&gt;
&lt;br /&gt;
It had previously no check, allowing the attacker to map data at VA 0.&lt;br /&gt;
&lt;br /&gt;
Starting from [[11.14.0-46|11.14.0-X]], the VA must be in the standard 0x10000000-0x14000000 address range.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcMapProcessMemory]] can map the NULL page&lt;br /&gt;
| svcMapProcessMemory&#039;s destination VA is unchecked.&lt;br /&gt;
&lt;br /&gt;
By passing a big enough &amp;quot;size&amp;quot; parameter, an attacker can map chunks of data at VA 0 in the destination (caller) process.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| Resource limit use-after-free&lt;br /&gt;
| When assigning a KResourceLimit to a KProcess, the reslimit&#039;s refcounter doesn&#039;t get incremented. This essentially means all KResourceLimit get freed if pm gets somehow terminated.&lt;br /&gt;
&lt;br /&gt;
It turns out it is possible to ask pm (via ns:s or pm:app) to terminate itself along all other KIPs simply by passing TID 0004000100001000.&lt;br /&gt;
&lt;br /&gt;
Calling [[SVC|svcGetResourceLimit]] afterwards triggers a use-after-free. This is rather difficult to exploit, however: there is one slot left in the reslimit slabheap. An attacker either has to map the NULL page as R(W)X (svcControlProcessMemory vuln fixed on [[11.8.0-41|11.8.0-X]]), or use one of the map-null exploits above while having access to svcCreateResourceLimit (with the only one that is easy enough to use in that context having been fixed on [[11.14.0-46|11.14.0-X]], anyway).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| None (although near impossible to exploit on [[11.14.0-46|11.14.0-X]])&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcSetProcessIdealProcessor]] reference count overflow and therefore use-after-free.&lt;br /&gt;
| The SVC receive two arguments: handle and idealprocessor. The handle is used to get the KProcess object and the KProcess-&amp;gt;refCnt gets incremented,later the function check if the KProcess-&amp;gt;mem_type != BASE and if yes, it checks for idealprocessor == 2 or idealprocessor != 3. The problem here is that if you pass the idealprocessor = 3 it won&#039;t meet any condition and return the error 0xD9001BEA without decrement the reference count. &lt;br /&gt;
It can be abused to overflow the KProcess reference count that will lead to an Use-after-free. &lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free.&lt;br /&gt;
| &lt;br /&gt;
| [[11.6.0-39|11.6.0-X]]&lt;br /&gt;
| November 2, 2017&lt;br /&gt;
| [[User:st4rk|st4rk]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcGetThreadList]] process reference leak&lt;br /&gt;
| When given a valid process handle (including &amp;lt;code&amp;gt;0xFFFF8001&amp;lt;/code&amp;gt;), svcGetThreadList forgets to decrement the reference count of the underlying [[KProcess]] instance, after having finished using it.&lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free, but this UAF was most likely not exploitable&lt;br /&gt;
| &lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| April 3, 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| kernelhax via gspwn&lt;br /&gt;
| Originally the kernel didn&#039;t initialize [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]]. Since it&#039;s 0 at hard-boot, this allowed the GPU to access the entire FCRAM + AXIWRAM.&lt;br /&gt;
| Entire FCRAM+AXIWRAM R/W.&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] partly&lt;br /&gt;
|-&lt;br /&gt;
| fasthax&lt;br /&gt;
| When a KTimer is created in pulse mode, the kernel calls a virtual function to reset the timer each time it pulses. The scheduler is locked for that core to avoid race conditions, but another core can call CloseHandle on the timer and free it, leading to a UAF vtable call.&lt;br /&gt;
| See description.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| May 2016&lt;br /&gt;
| nedwill&lt;br /&gt;
|-&lt;br /&gt;
| ipctakeover&lt;br /&gt;
| When sending cmdreplies, it does not validate that the src_addr and src_size match the equivalent dst_addr and dst_size. With a modified addr/size specified in a cmdreply for an output buffer, the data-copy for the first/last pages could be used to overwrite data outside of the buffer specified by the original process.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This can be used to takeover processes where the process is using your service session. Like HTTPC -&amp;gt; BOSS, for bosshaxx above. NIM takeover can be done too(actual stack buffer overflow can trigger), etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 26, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Using IPC input buffers as output buffers&lt;br /&gt;
| When sending cmdreplies, it does not validate that the cmdreply descriptor type matches the equivalent cmdreq descriptor type. This could be used by an exploited sysmodule to use what was intended as an input-buffer as an output-buffer, and also combine other IPC vuln(s) with this.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| [[11.3.0-36|11.3.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) required patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]] (deleted)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| veryslowpidhax&lt;br /&gt;
| &#039;&#039;&#039;This is completely different from the kernelmode-code-execution vuln described in the below separate entry.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When updating the kernel global PID counter under [[SVC|svcCreateProcess]] the kernel does not check for wraparound to 0x0(the PID for the very first process). This only matters because [[Services|SM-module]] allows processes with PID value less than &amp;lt;total ARM11 FIRM modules&amp;gt; to access &#039;&#039;all&#039;&#039; services, without checking exheader service-access-control; and because Kernel11 checks for the PID to be 1 (loader) to use the input mem-region value on ControlMemory. This alone does not affect access the [[SVC|SVCs]] access table at all.&lt;br /&gt;
&lt;br /&gt;
Inlined ldrex+strex code is used for updating the above counter. [[11.2.0-35|11.2.0-X]] had changes for similar code, but it was only for dedicated ldrex+strex functions(mainly for kernel objects) and hence this PID code was not affected.&lt;br /&gt;
&lt;br /&gt;
With launching+terminating a sysmodule repeatedly with this via ns:s, it would take weeks to finish(if not at least about a month?).&lt;br /&gt;
| Access to all [[Services_API|services]], ControlMemory on any given mem-region.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| 2012 maybe?&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|  slowhax/waithax&lt;br /&gt;
|  svcWaitSynchronizationN does not decrement the references to valid handles in an array before returning an error when it encounters an invalid handle. This allows one to (slowly) overflow the reference count for a handle object to zero.&lt;br /&gt;
| ARM11 kernel-mode code execution&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| 2016&lt;br /&gt;
| nedwill, [[User:Derrek|derrek]]&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;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2.1&lt;br /&gt;
| Nintendo&#039;s fix for memchunkhax2 in [[10.4.0-29|10.4.0-X]] did not fix the GPU case: one may cause the requisite ToCToU race using gspwn, bypassing the new validation.&lt;br /&gt;
derrek&#039;s original 32c3 presentation for memchunkhax2 commented that a GPU-based attack was possible, but would be difficult.  However, memchunkhax2.1 showed that it was possible to do fairly reliably.&lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]], aliaspider&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2&lt;br /&gt;
| When allocating a block of memory, the &amp;quot;next&amp;quot; pointer of the [[Memory_Management#MemoryBlockHeader|memchunkhdr]] is accessed without being checked after being mapped to userland.&lt;br /&gt;
This allows a race condition, where the process can change the next pointer just before it&#039;s accessed. By pointing the next pointer to a crafted memchunckhdr in the kernel SlabHeap, some of the SlabHeap is allocated to the calling process, allowing to change vtables of kernel objects. &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]] (partially, see memchunkhax2.1)&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| heaphax&lt;br /&gt;
| Can change the size of free memchunk structures stored in FCRAM using DMA, which leads to the ability to allocate memory chunks over already-allocated memory. This can be used in the SYSTEM region to allocate RW memory over any part of the NS system module, which is enough to take it over.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading) Code execution within any applet.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| snshax&lt;br /&gt;
| Can force creation of Safe NS process into gspwn-able memory, allowing for takeover.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading)&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&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;
| Useless [[SM]] off-by-one write&lt;br /&gt;
| After accepting a new session, [[SM]] writes a (handler ID (0 for srv: sessions (max. 64), 1 for the srv:pm one), pointer to session context structure in BSS) pair in a global array. However that array is only 64-entry-big instead of 65 (as it ought to be), and no bound check is done in that regard.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, as of [[11.4.0-37]], the overwritten fields are totally unused after their initialization by &amp;lt;code&amp;gt;__libc_init_array&amp;lt;/code&amp;gt;.&lt;br /&gt;
| Not currently exploitable&lt;br /&gt;
| None&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| smpwn&lt;br /&gt;
| When registering a new service (or &amp;quot;port&amp;quot;), no bound checks are done on the service table. One can simply call RegisterPort repeatedly to overflow that table: it will overflow into the command replay structure.&lt;br /&gt;
&lt;br /&gt;
Combined with a other minor bugs in the sysmodule, it is possible to take over [[SM]] with this nevertheless difficult-to-exploit vulnerability.&lt;br /&gt;
| Code execution under [[SM]], etc.&lt;br /&gt;
| [[11.16.0-48]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| July 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]] (independently), presumably ichfly before &lt;br /&gt;
|-&lt;br /&gt;
| PXI cmdbuf buffer overrun &lt;br /&gt;
| Like its Arm9 counterpart, before version [[5.0.0-11|5.0.0-X]], the PXI system module did not check the command sizes. This makes it possible to get ROP under the PXI sysmodule from a pwned Process9.&lt;br /&gt;
safecerthax uses it to takeover the Arm11 processor after directly getting remote code execution on the Arm9 side. Though, is useless in classic Arm11 -&amp;gt; Arm9 chains.&lt;br /&gt;
| ROP under [[PXI_Services|PXI]]&lt;br /&gt;
| probably [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| &lt;br /&gt;
| Everyone&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;
| [[CSND_Services|CSND]] sysmodule crash due to out of bounds parameters.&lt;br /&gt;
| The CSND command [[CSND:PlaySoundDirectly|PlaySoundDirectly (0x00040080)]] takes a channel ID as the first parameter. Any value outside the range [0-3] makes the system module become unstable or crash due to an out of bounds memory read. &lt;br /&gt;
| Out of bounds memory read, probably not exploitable. More research needed.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| January 2021&lt;br /&gt;
| January 22, 2021&lt;br /&gt;
| [[User:PabloMK7|PabloMK7]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SSLoth: [[SSL_Services|SSL]] sysmodule improper certificate verification&lt;br /&gt;
| Initially, the SSL sysmodule missed the R_VERIFY_RES_SIGNATURE entry in the &amp;quot;resource list&amp;quot; provided to the RSA BSAFE library. Consequently, it did not check signatures when validating certificate chains. &lt;br /&gt;
| Forge fake certificates, spoof official servers and perform MitM attacks on SSL/TLS connections.&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], shutterbug2000 (independently)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD:ndm]] SetNZoneMacFilter (cmd8) stack smashing&lt;br /&gt;
| The length of the mac filter is not checked before being copied to a fixed-size buffer on stack.&lt;br /&gt;
| ROP under [[CECD_Services|CECD]] sysmodule&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| 2020&lt;br /&gt;
| July 20, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] message box access &lt;br /&gt;
| CECD allows any process to write to any message box, thus allowing to write Streetpass data to the message box of any title.&lt;br /&gt;
| Install exploit for any title having a vulnerability in Streetpass data parsers (see CTRSDK Streetpass parser vulnerability).&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
| ?&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| Everyone?&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] packet type 0x32/0x34 stack-smashing&lt;br /&gt;
| When parsing Streetpass packets of type 0x32 and 0x34, CECD copies a list without checking the number of entries. The packet length is limited to 0x400 bytes, which is not enough to reach the end of the stack frame and overwrite the return address. However, the buffer located just next to the packet buffer is actually filled with data sent just before, hence actually allowing to overwrite the whole stack frame with conrolled data.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] TMP files parser multiple vulnerabilities&lt;br /&gt;
| When parsing &amp;quot;TMP_XXX&amp;quot; files, CECD does not check the number of messages contained in the file. This allows to overflow the array of message pointers and message sizes on the stack. Pointers aren&#039;t controlled and sizes are limited (one cannot send gigabytes of data...), yet the last message size can be an arbitrary value (the current message pointer goes outside the file buffer and the parsing loop is broken). This allows to overwrite a pointer to a lock object on the stack and decrement an arbitrary value in memory. One can change the TMP file parsing mode to have CECD trying to free all the message buffers after parsing the next TMP file. The parsing mode is usually restored when parsing a new TMP file, but an invalid TMP file allows to make a function returns an error before the mode is restored , the return value is not checked and the parser consider the file valid. The message pointers and sizes arrays are not updated though, this is not a problem since the previous TMP file buffer is reused for the new TMP file in memory. Thus the message pointers actually points to controlled data. This allows to get a bunch of fake heap chunk freed, thus a bunch of unsafe unlink arbitrary writes.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Config_Services|CFG]]:CreateConfigInfoBlk integer underflow&lt;br /&gt;
| When creating a new block it checks the size of the block is &amp;lt;= 0x8000, but it doesn&#039;t check that the block size is less than the remaining space. This induces an integer underflow (remaining_space-block_size), the result is then used for another check (buf_start+current_offset+constant &amp;lt;= remaining_space-block_size) and then in a mempcy call (dest = buf_start+(u16)(remaining_space-block_size), size =block_size). This allow for writing past the buffer, however because of the u16 cast in the memcpy call memory has to be mapped from buf_start to buf_start+0x10000 (cannot write backward).&lt;br /&gt;
| Theoritically ROP under CFG services, but BSS section is to small (size &amp;lt;= 0x10000) so it only results in a crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.8.0-41]]&lt;br /&gt;
| November, 2018&lt;br /&gt;
| November 24, 2018&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP:SendDataFrame]] missing input array index validation&lt;br /&gt;
| [[MP:SendDataFrame]] doesn&#039;t validate the input index at cmdreq[1], unless the function for flag=non-zero is executed. This is used to calculate the following, without validating the index at all: someptr = stateptr + (index*0x924) + somestateoffset.&lt;br /&gt;
&lt;br /&gt;
After validating some flags from someptr, when input_flag=0 the input buffer data is copied to someptr+someotheroffset+0x14 with the u16 size loaded from someptr+someotheroffset.&lt;br /&gt;
&lt;br /&gt;
With a large input index someptr could be setup to be at a &amp;lt;target address&amp;gt;, for overwriting memory.&lt;br /&gt;
&lt;br /&gt;
This is probably difficult to exploit.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP_Services|MP]] cmd1 out-of-bounds handle read&lt;br /&gt;
| MP-sysmodule handles the input parameter for cmd1 as a s32. It checks for &amp;gt;=16, but not &amp;lt;0. With &amp;lt;16 it basically does the following(array of entries 4-bytes each): *outhandle = ((Handle*)(stateptr+offsetinstate))[inputindex].&lt;br /&gt;
&lt;br /&gt;
Hence, this can be used to load any handle in MP-sysmodule memory. MP doesn&#039;t really have any service handles of interest however(can be obtained from elsewhere too).&lt;br /&gt;
| Reading any handle in MP-sysmodule memory.&lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 21, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM stack/.bss infoleak via [[AM:ReadTwlBackupInfo]]([[AM:ReadTwlBackupInfoEx|Ex]])&lt;br /&gt;
| After writing the output-info structure to stack, it then copies that structure to the output buffer ptr using the size from the command. The size is not checked. This could be used to read data from the AM-service-thread stack handling the command + .bss.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was not tested on hardware.&#039;&#039;&#039;&lt;br /&gt;
| Stack/.bss reading&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27]](AM v9217)&lt;br /&gt;
| Roughly October 17, 2016&lt;br /&gt;
| October 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM module APcert infoleak via 00000000.ctx files&lt;br /&gt;
| Just after a download title is purchased from the eShop, the .ctx is in an initialized state of all FFs past the header. During download, the FF area is filled with the console APcert. Thus, it is possible to create a xorpad from the initial state and use it to decrypt the APcert filled state.&lt;br /&gt;
| APcert contains the deviceID, which can beneficial in decrypting the movable.sed (since deviceID is mathmatically related to the LFCS).&lt;br /&gt;
| None&lt;br /&gt;
| [[11.16.0-49]]&lt;br /&gt;
| August, 2022&lt;br /&gt;
| March 17, 2023&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| [[MVD_Services|MVD]]: Stack buffer overflow with [[MVDSTD:SetupOutputBuffers]].&lt;br /&gt;
| The input total_entries is not validated when initially processing the input entry-list. This fixed-size input entry-list is copied to stack from the command request. The loop for processing this initializes a global table, the converted linearmem-&amp;gt;physaddrs used there are also copied to stack(0x8-bytes of physaddrs per entry).&lt;br /&gt;
&lt;br /&gt;
If total_entries is too large, MVD-sysmodule will crash due to reading unmapped memory following the stack(0x10000000). Afterwards if the out-of-bounds total_entries is smaller than that, it will crash due accessing address 0x0, hence this useless.&lt;br /&gt;
| MVD-sysmodule crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| April 22, 2016 (Tested on the 25th)&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]]: Using CTRSDK heap with UDS sharedmem from the user-process.&lt;br /&gt;
| See the HTTP-sysmodule section below.&lt;br /&gt;
&lt;br /&gt;
CTRSDK heap is used with the sharedmem from [[NWMUDS:InitializeWithVersion]]. Buffers are allocated/freed under this heap using [[NWMUDS:Bind]] and [[NWMUDS:Unbind]].&lt;br /&gt;
&lt;br /&gt;
Hence, overwriting sharedmem with gspwn then using [[NWMUDS:Unbind]] results in the usual controlled CTRSDK memchunk-header write, similar to HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This could be done by creating an UDS network, without any other nodes on the network.&lt;br /&gt;
&lt;br /&gt;
Besides CTRSDK memchunk-headers, there are no addresses stored under this sharedmem.&lt;br /&gt;
| ROP under NWM-module.&lt;br /&gt;
| None (need to check, but CTRSDK heap code is vulnerable)&lt;br /&gt;
| [[9.0.0-20|9.0.0-X]]&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| April 16, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds memory access during spectator [[Download_Play|data-frame]] checksum calculation&lt;br /&gt;
| DLP doesn&#039;t validate the frame_size when receiving spectator data-frames at all, unlike non-spectator data-frames. The actual spectator data-frame parsing code doesn&#039;t use that field either. However, the data-frame checksum calculation code called during checksum verification does use the frame_size for loading the size of the framebuf.&lt;br /&gt;
&lt;br /&gt;
Hence, using a large frame_size like 0xFFFF will result in the checksum calculation code reading data out-of-bounds. This isn&#039;t really useful, you could trigger a remote local-WLAN DLP-sysmodule crash while a 3DS system is scanning for DLP networks(due to accessing unmapped memory), but that&#039;s about all(trying to infoleak with this likely isn&#039;t useful either).&lt;br /&gt;
| DLP-sysmodule crash, handled by dlplay system-application by a &amp;quot;connection interrupted&amp;quot; error eventually then a fatal-error via ErrDisp.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8, 2016 (Tested on the 10th)&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds output data writing during spectator sysupdate titlelist [[Download_Play|data-frame]] handling&lt;br /&gt;
| The total_entries and out_entryindex fields for the titlelist DLP spectator data-frames are not validated. This is parsed during DLP network scanning. Hence, the specified titlelist data can be written out-of-bounds using the specified out_entryindex and total_entries. A crash will occur while reading the input data-frame titlelist if total_entries is larger than 0x27A, due to accessing unmapped memory.&lt;br /&gt;
&lt;br /&gt;
There&#039;s not much non-zero data to overwrite following the output buffer(located in sharedmem), any ptrs are located in sharedmem. Overwriting certain ptr(s) are only known to cause a crash when attempting to use the DLP-client shutdown service-command.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to exploit the above crash, since the linked-list code involves writes zeros(with a controlled start ptr).&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8-9, 2016&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[IR_Services|IR]]: Stack buffer overflow with custom hardware&lt;br /&gt;
| Originally IR sysmodule used the read value from the I2C-IR registers TXLVL and RXLVL without validating them at all. See [[10.6.0-31|here]] for the fix. This is the size used for reading the data-recv FIFO, etc. The output buffer for reading is located on the stack.&lt;br /&gt;
&lt;br /&gt;
This should be exploitable if one could successfully setup the custom hardware for this and if the entire intended sizes actually get read from I2C.&lt;br /&gt;
| ROP under IR sysmodule.&lt;br /&gt;
| [[10.6.0-31|10.6.0-31]]&lt;br /&gt;
| &lt;br /&gt;
| February 23, 2016 (Unknown if it was noticed before then)&lt;br /&gt;
| February 23, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTP_Services|HTTP]]: Using CTRSDK heap with sharedmem from the user-process.&lt;br /&gt;
| The data from httpcAddPostDataAscii and other commands is stored under a CTRSDK heap. That heap is the sharedmem specified by the user-process via the HTTPC Initialize command.&lt;br /&gt;
Normally this sharedmem isn&#039;t accessible to the user-process once the sysmodule maps it, hence using it is supposed to be &amp;quot;safe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t the case due to gspwn however. Since CTRSDK heap code is so insecure in general, one can use gspwn to locate the HTTPC sharedmem + read/write it, then trigger a mem-write under the sysmodule. This can then be used to get ROP going under HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This is exploited by [https://github.com/yellows8/ctr-httpwn/ctr-httpwn ctr-httpwn].&lt;br /&gt;
| ROP under HTTP sysmdule.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45|11.13.0-X]]&lt;br /&gt;
| Late 2015&lt;br /&gt;
| March 22, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| Code execution under spi sysmodule; access to [[CONFIG11_Registers|CFG11_GPUPROT]] and ultimately kernel code execution. &lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&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 0x2D800000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 (0x800000 with New3DS) with the default memory-layout on Old3DS/New3DS. With [[11.3.0-36|11.3.0-X]] the cutoff now varies due to the new [[SVC]] 0x59. The New3DS &amp;quot;normal&amp;quot;(non-APPLICATION) cutoff was changed to 0x2D000000 due to the new [[SVC]] 0x59.&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;
| [[CECD_Services|CECD]] Streetpass message exheader stack-smashing&lt;br /&gt;
| When parsing streetpass messages, &amp;quot;nn::cec::CTR::Message::InputMessage&amp;quot; calls &amp;quot;nn::cec::CTR::Message::SetExHeaderWithoutCalc&amp;quot; for each exheader entry in the input message. The number of entries should not exceed 16 but remains unchecked, leading to a stack-buffer-overflow.&lt;br /&gt;
| ROP under any application parsing Streetpass messages&lt;br /&gt;
Remote code execution under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| &lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&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;br /&gt;
| CTPK buffer overflow&lt;br /&gt;
| At offset 0x20 in CTPK is an array for each texture, each entry is 0x20-bytes. This contains a wordindex(entry+0x18) for some srcdata relative to CTPK+0, and an u8 wordsize(entry+0x14) for this data. The CTRSDK function handling this doesn&#039;t validate the size, when copying srcdata using this size to the output buffer. Applications usually have the output buffer on the stack, hence stack buffer overflow.&lt;br /&gt;
&lt;br /&gt;
While CTPK(*.ctpk) are normally only loaded from RomFS, some application(s) load from elsewhere too.&lt;br /&gt;
| ROP under the target application.&lt;br /&gt;
| None?&lt;br /&gt;
| &amp;quot;[SDK+NINTENDO:CTR_SDK-11_4_0_200_none]&amp;quot;&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pia vulns&lt;br /&gt;
| [https://switchbrew.org/wiki/Switch_System_Flaws#Pia Originally discovered in Pia v5.x for Switch], these vulns are also present in earlier versions (v3.x/4.x/5.x, possibly earlier?) for 3DS (and Wii U too).&lt;br /&gt;
Pia encryption generally wasn&#039;t used pre-Switch (sent packets are plaintext). 3DS is affected by all Pia vulns listed above except for LAN. The functionality for ParseLeaveMeshInvitation doesn&#039;t exist in 3DS Pia v3.9.2. Wii U is affected by all listed Pia vulns except for the LAN vulns.&lt;br /&gt;
| See [https://switchbrew.org/wiki/Switch_System_Flaws#Pia here].&lt;br /&gt;
| Unfixed on 3DS/Wii U&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_5_4_3]&amp;quot;&lt;br /&gt;
| See [https://switchbrew.org/wiki/Switch_System_Flaws#Pia here]; separately checked later (UpdateConnectionReport) by [[User:Riley|Riley]] on: June 14, 2023&lt;br /&gt;
| [[User:Yellows8|Yellows8]]; added to 3dbrew (UpdateConnectionReport) by [[User:Riley|Riley]] later&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=22233</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=22233"/>
		<updated>2023-06-15T14:03:38Z</updated>

		<summary type="html">&lt;p&gt;Riley: /* General/CTRSDK */ pia RelayRouteManageJob::UpdateConnectionReport bug does also exist on 3DS (and also on Wii U)&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;
* In the early days of 3DS hacking, Neimod was working on a RAM dumping setup for a while. He has de-soldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039;s PCB up to a custom RAM dumping setup. He &#039;&#039;has&#039;&#039; published photos showing his setup to be working quite well, with the 3DS successfully booting up, but however, his flickr stream is now private along with most of his work and this method has been unreleased. RAM dumping can be done through homebrew now, making this method obsolete regardless.&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). A 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 uninitialized 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;
The vulnerable timing range is about 100 CPU cycles after they start (which happens after the PLLs have stabilized after power-up). A glitch needs to be injected during one of these 100 cycles for the attack to succeed.&lt;br /&gt;
&lt;br /&gt;
It has been exploited by derrek to dump the ARM9 bootrom as of Summer 2015.&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;
| RSA keyslots don&#039;t clear exponent when setting modulus&lt;br /&gt;
| The [[RSA_Registers|RSA keyslots]] are set by boot ROM to have four private RSA keys.  The exponent value in the RSA registers is write-only and not readable.&lt;br /&gt;
&lt;br /&gt;
However, when setting a keyslot&#039;s modulus, the RSA hardware leaves the exponent alone.  This allows retrieving the exponent by doing a discrete logarithm of the output.&lt;br /&gt;
&lt;br /&gt;
By setting the modulus to a prime number whose modular multiplicative order is &amp;quot;smooth&amp;quot; (that is, p-1 is divisible by only small prime numbers), discrete logarithms can be calculated quickly using the [[wikipedia:Pohlig-Hellman algorithm|Pohlig-Hellman algorithm]].  If the prime chosen is greater than the modulus, but the same bit size, the discrete logarithm is the private exponent.&lt;br /&gt;
&lt;br /&gt;
This exploit&#039;s usefulness is limited: RSA keyslot 0 is only used in current firmware for deriving the 6.x save and 7.x NCCH keys, which were already known, and the other three keyslots are entirely unused.  Additionally, with a boot ROM dump, this exploit is moot; these private keys are located in the protected ARM9 boot ROM.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2016&lt;br /&gt;
| [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] allowing acccess to AXIWRAM/FCRAM-BASE-memregion&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] can be configured by anything with access to it to allow the GPU to access the entire AXIWRAM+FCRAM. For example, this is an issue for any sysmodule that gets exploited and has access to this register memory-page(include one that&#039;s listed below).&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;kernelhax via gspwn&amp;quot; below.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Boot ROM ==&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;
| FIRM partitions known-plaintext&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are encrypted with AES-CTR without a MAC. 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;
However it is most commonly used to install arbitrary FIRMs (usually boot9strap), thanks to sighax.&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;
| Boot9 AES keyinit function issues&lt;br /&gt;
| [[Bootloader|Boot9]] seems to have two bugs in the AES key-init function, see [[AES_Registers#AES_key-init|here]].&lt;br /&gt;
| None&lt;br /&gt;
| BootROM issue.&lt;br /&gt;
| 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| New3DS has same boot ROM as Old3DS&lt;br /&gt;
| The New3DS has the exact same boot ROM as the Old3DS.  This means, among other things, that all the same boot ROM flaws are present.  Also, this meant that it is possible to boot Old3DS firmware on New3DS (see &amp;quot;CFG9_SYSPROT9 bit1 not set by Kernel9&amp;quot;).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| October 2014&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| sighax: Boot9 improper validation of FIRM partition RSA signatures&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are signed with RSA-2048 using SHA-256 and PKCS #1 v1.5 padding.  Boot9, however, improperly validates the padding in three ways:&lt;br /&gt;
# Boot9 permits block type 02, meant for encrypted messages, to be used for signatures.  Only 01, for signatures, should have been permitted.  As a result, when using block type 02, a signature block is not required to have a long string of FF bytes as padding, but rather any nonzero random values suffice.&lt;br /&gt;
# Boot9 does not require that the length of the padding fill out the signature block completely.  As a result, there is considerable freedom in the layout of a signature.&lt;br /&gt;
# Boot9 fails to do bounds checking in its parsing of the DER-encoded hash algorithm type and hash value; the length values given in DER are permitted to point outside the signature block.&lt;br /&gt;
Flaw 3 allows the DER encoding to be such that boot9 believes that the signature&#039;s hash value is outside the range of the block itself, somewhere on the stack.  This can be pointed at the correct hash value it computes.  Boot9 then memcmp&#039;s the calculated hash against itself, and thinks that the hash is valid.&lt;br /&gt;
&lt;br /&gt;
As a result of the above, we estimate that one in 2&amp;lt;sup&amp;gt;43&amp;lt;/sup&amp;gt; (~8.8 trillion) random fake signatures will be considered by Boot9 to be valid.  This is well within the range of brute force, particularly with an optimized GPU implementation.  An Nvidia GTX 1080 Ti would take about one week to find a match.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| July 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| Boot9 FIRM loading doesn&#039;t blacklist memory-mapped I/O&lt;br /&gt;
| [[Bootloader|Boot9]]&#039;s FIRM loading blacklists Boot9 data regions, but forgets to do other important regions, including Memory-mapped I/O. Combined with sighax, a malicious FIRM can be used to overwrite:&lt;br /&gt;
a) boot9 data-abort handler, coupled with a 4th section that tries to NDMA copy to NULL, causing a data abort&lt;br /&gt;
&lt;br /&gt;
b) boot9 IRQ handler (this has the disadvantage that you must restore the original handler, then call it manually when your payload runs)&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2015(?)&lt;br /&gt;
| [[User:Derrek|derrek]] (2015?), [[User:Normmatt|Normmatt]] and [[User:SciresM|SciresM]] independently (January 2017).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;superhax&amp;quot;: Boot9 FIRM loading blacklist check is flawed&lt;br /&gt;
| Boot9 only makes sure the &#039;&#039;&#039;start&#039;&#039;&#039; and &#039;&#039;&#039;end&#039;&#039;&#039; address of each section is not covered by a blacklisted region. Thus, it is possible to overwrite blacklisted regions (e.g. ARM9 Exception Vectors) by choosing a FIRM section range that encloses an entire blacklisted region. The vulnerable code looks like this: if(blRegions[i].start &amp;lt;= sectionStart &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionStart &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; blRegions[i].start &amp;lt;= sectionEnd &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionEnd) return false; // failure&lt;br /&gt;
The boot9 vector table (0x08000000) contains 6 entries, each 8-bytes wide (0x30 bytes); Only 0x08000000 through 0x08000040 are blacklisted, and boot9 doesn&#039;t use the region after the vector table (this is convenient because we can put any payload we want after it and not worry about overwriting chunks of boot9 code)&lt;br /&gt;
&lt;br /&gt;
To exploit this, craft a FIRM section payload that&#039;s loaded a few bytes before 0x08000000, add padding to get to 0x08000000 and overwrite the vector table; You could overwrite the data-abort vector and craft a 4th FIRM section that causes a data-abort OR you can just overwrite the IRQ function pointer at 0x08000004 (make sure your payload replaces the original boot9 function pointer); you can point the rest of the vectors to infinite loops since they shouldn&#039;t be triggered.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2015&lt;br /&gt;
| [[User:Plutoo|plutoo]], [[User:Yellows8|yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
&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;
| Generating the keysector console-unique keys with ITCM+Boot9&lt;br /&gt;
| [[Bootloader|Boot9]] decrypts the 0x100-byte [[OTP_Registers|OTP]] using AES-CBC with keydata stored in Boot9. If hash verification is successful, the plaintext of the first 0x90-bytes are copied into [[Memory_layout|ITCM]]. This is the &#039;&#039;exact&#039;&#039; &#039;&#039;same&#039;&#039; region hashed by arm9loader when generating the console-unique keys for decrypting the keysector, except arm9loader uses the raw encrypted OTP.&lt;br /&gt;
&lt;br /&gt;
Therefore, with the OTP keydata+IV from Boot9 you can: encrypt the 0x90-bytes from ITCM, then hash the output to get the console-unique keys for the system&#039;s keysector. This can even be done for Old3DS which doesn&#039;t have the arm9loader keysector officially.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown why arm9loader only used the first 0x90-bytes of OTP. Using more data from OTP would&#039;ve prevented this. Fixing this would require doing exactly that, but that would also mean updating the NAND keysector(which is dangerous).&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| &lt;br /&gt;
| 2015&lt;br /&gt;
| January 6, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Rearrangable keys in the NAND keystore&lt;br /&gt;
| Due to the keystore being encrypted with AES-ECB, one can rearrange blocks and still have the NAND keystore decrypt in a deterministic way. &lt;br /&gt;
&lt;br /&gt;
Using 10.0 FIRM it is possible to rearrange keys such that ARM9 memory is executed. As such using existing ARM9 execution 10.0 FIRM can be written to NAND and a payload written to memory, with the payload to be executed post-K9L using an MCU reboot.&lt;br /&gt;
| arm9loaderhax given existing ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Early 2016&lt;br /&gt;
| 27 September 2016&lt;br /&gt;
| Myria, [[User:Dark samus|dark_samus]]; mathieulh (independently); [[User:Plutooo|plutoo]] (independently) + others&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;
| [[11.3.0-36|11.3.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 [[User:Derrek|derrek]].&lt;br /&gt;
| 32c3 3ds talk (December 27, 2015)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loaderhax: Missing verification block for the 9.6 keys&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, access to uncleared OTP hash keydata&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]]&lt;br /&gt;
|-&lt;br /&gt;
| arm9loader runs on Old3DS&lt;br /&gt;
| Despite being written only for New3DS, all of arm9loader runs fine on Old3DS.  It&#039;s not until booting Kernel9 that a New3DS FIRM partition would crash on an Old3DS.  As a result, if a bug exists in arm9loader to get control, it can be exploited on Old3DS by writing New3DS FIRM to the FIRM partitions.  Thus, arm9loaderhax works on both Old3DS and New3DS.&lt;br /&gt;
| arm9loader bugs also compromise Old3DS&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Sometime in 2015&lt;br /&gt;
| &lt;br /&gt;
| [[User:Plutooo|plutoo]] presumably&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;
| Leak of normal-key matching a key-generator key&lt;br /&gt;
| During the 3DS&#039; development (June/July 2010) Nintendo added support installing encrypted content ([[CIA]]). Common-key index1 was intended to be a [[AES|hardware generated key]]. However while they added code to generate the key in hardware, they forgot to remove the normal-key for index1 (used elsewhere, likely old debug code). Nintendo later removed the normal key sometime before the first non-prototype firmware release.&lt;br /&gt;
&lt;br /&gt;
Knowing the keyY and the normal-key for common-key index1, the devkit key-generator algorithm can be deduced (see &amp;quot;Hardware&amp;quot; above). Additionally the remaining devkit common-keys can be generated once the common-key keyX is recovered.&lt;br /&gt;
&lt;br /&gt;
Note that the devkit key-generator was discovered to be the same as the retail key-generator.&lt;br /&gt;
| Deducing the keyX for keyslot 0x3D and hardware key-generator algorithm. Generate remaining devkit common-keys.&lt;br /&gt;
| pre-[[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| Shortly after the key-generator was revealed to be flawed at the 32c3 3ds talk&lt;br /&gt;
| January 20, 2016&lt;br /&gt;
| [[User:Jakcron|jakcron]]&lt;br /&gt;
|-&lt;br /&gt;
| Factory firmware is vulnerable to sighax&lt;br /&gt;
| During the 3DS&#039;s development, presumably boot9 was written (including the sighax vulnerability). This vulnerability is also present in factory firmware (and earlier, including 0.11). This was fixed in version 1.0.0-0.&lt;br /&gt;
| Deducing the mechanics of the sighax vulnerability in boot9 without having a dump of protected boot9. ARM9 code execution on factory/earlier firmware.&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| May 9, 2017&lt;br /&gt;
| May 19, 2017&lt;br /&gt;
| [[User:SciresM|SciresM]], [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| safecerthax &lt;br /&gt;
| O3DS &amp;amp; O2DS SAFE_FIRM is still vulnerable to the PXIAM:ImportCertificates flaw fixed in [[5.0.0-11]] and to SSLoth fixed in [[11.14.0-46]]. It makes it possible to spoof the official NUS update server and remotely trigger the vulnerability in SAFE_FIRM.&lt;br /&gt;
| Remote Arm9 code execution in O3DS/O2DS SAFE_FIRM&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| twlhax: Corrupted SRL header leads to memory overwrite&lt;br /&gt;
| During TWL_FIRM boot, the ARM11 process TwlBg puts launcher.srl, the DSi bootloader, into FCRAM.  TWL_FIRM Process9 then parses the [http://dsibrew.org/wiki/NDS_Format SRL header] to place launcher.srl&#039;s code where DSi mode can execute it.&lt;br /&gt;
&lt;br /&gt;
DSi-mode memory is in FCRAM, but interleaved.  Each byte of DSi-mode memory also exists at some address in 3DS FCRAM space.&lt;br /&gt;
&lt;br /&gt;
Process9 does not validate the RSA signature on launcher.srl, unlike SRLs loaded from cartridge or NAND (DSiWare).  A compromised ARM11 can, in a manner similar to firmlaunchhax, send a launcher.srl with a modified SRL header.  By setting the SRL header&#039;s ARM7/ARM9 load addresses and sizes carefully, accounting for the different memory map and for DSi mode&#039;s interleaved memory, it is possible to overwrite part of Process9&#039;s stack and take control with a ROP chain.&lt;br /&gt;
&lt;br /&gt;
Fixed in 11.8.0-X by... (fill me in)&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
| [[11.8.0-41|11.8.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| August 11, 2018&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| agbhax&lt;br /&gt;
| This is the same issue as twlhax above. Legacy FIRMs share the same OS code (Arm9-side OS, Arm11 kernel), and therefore, the outdated AGB_FIRM can be tricked into executing the still vulnerable PrepareArm9ForTwl function.&lt;br /&gt;
| ARM9 code execution (whilst still in 3DS mode)&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| December 17, 2020&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax&lt;br /&gt;
| SAFE_MODE_FIRM is almost never updated(even when NATIVE_FIRM is updated for vuln fixes), this can be noticed by &#039;&#039;just&#039;&#039; checking 3dbrew/ninupdates title-listings.&lt;br /&gt;
&lt;br /&gt;
The fix for firmlaunch-hax was only applied to NATIVE_FIRM in [[9.5.0-22|9.5.0-X]], leaving SAFE_FIRM exploitable. With ARM11-kernel execution, one can trigger FIRM-launch in to SAFE_FIRM, do Kernel9 &amp;lt;=&amp;gt; Kernel11 sync, PXI sync and then repeat the original attack on SAFE_FIRM instead.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012-2013?&lt;br /&gt;
| Wiki: January 2, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax 1.1&lt;br /&gt;
| Nintendo&#039;s original safefirmhax fix was flawed -- they added a global boolean that got set to true whenever a non-sysmodule title got launched (except for a hardcoded repair title id), and panic()&#039;d if that boolean was true to prevent launching safefirm after hax was active. However, because the boolean was initially false after firmlaunch -- With ARM11-kernel execution, one could FIRM-launch into NATIVE_FIRM, and then immediately FIRM-launch again into SAFE_FIRM early in NATIVE_FIRM boot before the boolean got set to true to repeat the safehax attack.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding additional CFG9_BOOTENV checks to firmlaunch code in 11.4.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| safefirmhax fix&lt;br /&gt;
| Wiki: April 10, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| When reading the banner of a NTR title, Process9 relies on a hardware register to know when the banner was fully read.&lt;br /&gt;
However that register is shared between the ARM9 and the ARM11.&lt;br /&gt;
An attacker with k11 control can so make Process9 believe the banner continues forever and so trigger a buffer overflow.&lt;br /&gt;
With a custom banner for a NTR flashcart, this leads to code execution in Process9.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding bound checks on the read data.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| &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;
&lt;br /&gt;
[[11.0.0-33|11.0.0-X]] fixed this for key system titles (MSET, Home Menu, spider, ErrDisp, SKATER, NATIVE_FIRM, and every retail system module), by checking the version of the title to install against a hard-coded list of (titleID, minimumVersionRequired) pairs.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], for key system titles.&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| Anti-downgrade list did not include all system titles initially&lt;br /&gt;
| The anti-downgrade list did not include legacy FIRMs until [[11.8.0-41|11.8.0-X]]. Therefore, legacy FIRMs could still be downgraded.&lt;br /&gt;
| Downgrading legacy FIRMs; allowing to exploit bugs in older legacy FIRMs (of which at least one exists, see below).&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| ?&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| TWL_FIRM cmd-9 unchecked offset&lt;br /&gt;
| In [[1.0.0-0|1.0.0-X]]&#039;s TWL_FIRM, cmds 8 and 9 were not stubbed (whereas in the corresponding NATIVE_FIRM, they were).&lt;br /&gt;
Command 8 does the Process9 initialisation for NTR carts if an NTR cart is inserted (NTR, not TWL, judged by chipid).&lt;br /&gt;
&lt;br /&gt;
Command 9 takes (u32 offset_read, u32 offset_write, u32 offset_read_end), and basically just copies (offset_read_end - offset_read) bytes starting at (offset_read) of [NTR cart header in arm9mem, NTR secure area in fcram, TWL secure area in fcram], to 0x18001000 + offset_write + offset_read.&lt;br /&gt;
&lt;br /&gt;
offset_write is not checked at all, thus this leads to ARM9 code execution as long as any NTR cart, including flashcarts that would normally be blocked by TWL_FIRM, is inserted.&lt;br /&gt;
&lt;br /&gt;
In [[2.0.0-2|2.0.0-X]] TWL_FIRM, those commands were stubbed out.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| January 2018&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|-&lt;br /&gt;
| FIRM launch doesn&#039;t check target FIRM version&lt;br /&gt;
| When executing a FIRM launch, Process9 doesn&#039;t validate that the target FIRM isn&#039;t an old version.  This allows booting an exploitable FIRM from a newer FIRM, if you can get the exploitable FIRM installed.  ([[11.0.0-33|11.0.0-X]] now prevents installing old versions of system titles, but this doesn&#039;t affect titles already installed.)&lt;br /&gt;
&lt;br /&gt;
This had a use after [[9.6.0-24|9.6.0-X]]: on a compromised 3DS running 9.2.0, you could install the 9.6.0 NATIVE_FIRM to FIRM0/FIRM1, but avoid putting it into the NATIVE_FIRM title.  This would boot the 9.2.0 system software but with the 9.6.0 Process9 and Kernel11.  With a user-mode exploit in a sufficiently-privileged application (e.g. mset), you could trigger a FIRM launch back to NATIVE_FIRM, which would load the 9.2.0 Process9 and Kernel11.&lt;br /&gt;
&lt;br /&gt;
9.6.0&#039;s keyslots 0x15 and 0x16 are unknown to 9.2.0, so 9.2.0 would not clear them.  You then could do firmlaunchhax against 9.2.0 to get ARM9 access with keyslots 0x15 and 0x16 set to their proper 9.6.0 values, allowing decrypting 9.6.0&#039;s encrypted titles.  Once the New3DS keystore was dumped, this became moot.&lt;br /&gt;
| Decrypting 9.6.0 NCCH files without dumping New3DS keystore&lt;br /&gt;
| None (but now moot)&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]]&lt;br /&gt;
| March 2015&lt;br /&gt;
| August 12, 2018&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]]&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;
| [[11.3.0-36|11.3.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;
| [[11.3.0-36|11.3.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 this is used in conjunction with seedminer to be able to decrypt &amp;amp; modify DSiWare TAD containers and inject them with exploitable DSiWare titles such as sudoku (sudokuhax) and Flipnote JPN (ugopwn)&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;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| seedminer: movable.sed keyY vulnerable to brute-force&lt;br /&gt;
| Half of the movable.sed keyY&#039;s 128 bits are leaked through the [[Nandrw/sys/LocalFriendCodeSeed_B|LFCS]], which is available in userland and below. The LFCS itself also leaks almost half of the remaining bits by following the ratio: u32 keyY[3]=1/5(LFCS). The remaining keyY[3] uncertainty of about ±2000 can be greatly reduced by plotting expected error margins with several keyYs. This results in a final uncertainty of about 2^40, easily within practical brute force range of an average modern PC.&lt;br /&gt;
| Knowing the keyY of a given 3ds allows for modification of DSiWare export contents, and chained with several other public vulns, ultimately arm9 execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.8.0-X&lt;br /&gt;
| December 2017&lt;br /&gt;
| January 2018&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| Improper validation of DSiWare title SRLs&lt;br /&gt;
| The 3DS does not verify if the actual SRL embedded in the title&#039;s directory matches the titleID in the TMD before launching it or importing it from an sd DSiWare export. &lt;br /&gt;
| This allows embedding older, exploitable DSiWare titles in completely different, unexploitable DSiWare titles. Since DSiWare has raw NAND RW, this can result in arm9 control through FIRM known-plaintext and sighax attacks.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| 2015?&lt;br /&gt;
| December 2016&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| DSiWare import/export functions allow TWL system titles as arguments&lt;br /&gt;
| AM ImportTwlBackup/ExportTwlBackup unnecessarily allow TWL system titles such as DS Download Play to import/export from userland and System Settings -&amp;gt; Data Management (only am:sys is needed for userland). This is difficult to abuse for dsihax injection because no TWL system title has a save file, and any import with a save included will result in FS err C8804464. However, there is at least one dsihax primary that can load a payload from a non-NAND source, and not error if it can&#039;t access its public.sav (JPN Flipnote Studio v0).&lt;br /&gt;
| When combined with other public vulns, arm9 code execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.10.0-X&lt;br /&gt;
| May 2018&lt;br /&gt;
| Sept 2018&lt;br /&gt;
| zoogie&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]]:ImportCertificates (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#CFG9_SYSPROT9|CFG9_SYSPROT9]] bit1 not set by Kernel9&lt;br /&gt;
| Old versions of Kernel9 never set bit1 of [[CONFIG Registers#CFG9_SYSPROT9|CFG9_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.&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, which is exploitable through a hardware + software vulnerability (see arm9loaderhax / description).&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 (see enhanced-arm9loaderhax / description). This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (0x05 -&amp;gt; 0x04, see partition encryption types [[Flash_Filesystem#NAND_structure|here]]) and using an Old3DS [[NCSD#NCSD_header|NCSD Header]], it is possible to boot a New3DS using Old3DS firmware 1.0-2.x to retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping the [[OTP Registers|OTP]] area.&lt;br /&gt;
Decrypting New3DS sector 0x96 keyblock.&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|svcUnbindInterrupt]] double free when irqId = 15&lt;br /&gt;
| svcBindInterrupt and svcUnbindInterrupt give special treatment to irqId 15 (FIQ helper): the access control list is bypassed and the provided KInterruptEvent (event or semaphore, via handle) is stored inside a singleton static object after having its refcount increased by 1.&lt;br /&gt;
&lt;br /&gt;
svcUnbindInterrupt assumes that the user-provided handle is what is stored in the singleton and will decref the user-provided KInterruptEvent twice, causing a use-after-free if the attacker didn&#039;t actually provide an handle to the same event or semaphore.&lt;br /&gt;
&lt;br /&gt;
This was &amp;quot;fixed&amp;quot; on [[11.14.0-46|11.14.0-X]] by preventing irqId 15 to be bound on retail units altogether (in both functions).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]] (only on retail units)&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]], maybe others&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcKernelSetState]] op=3 could map the NULL page&lt;br /&gt;
| svcKernelSetState op=3 param1=1 maps the firmlaunch parameters page to the user-specified VA.&lt;br /&gt;
&lt;br /&gt;
It had previously no check, allowing the attacker to map data at VA 0.&lt;br /&gt;
&lt;br /&gt;
Starting from [[11.14.0-46|11.14.0-X]], the VA must be in the standard 0x10000000-0x14000000 address range.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcMapProcessMemory]] can map the NULL page&lt;br /&gt;
| svcMapProcessMemory&#039;s destination VA is unchecked.&lt;br /&gt;
&lt;br /&gt;
By passing a big enough &amp;quot;size&amp;quot; parameter, an attacker can map chunks of data at VA 0 in the destination (caller) process.&lt;br /&gt;
| Mapping the NULL page (as RW) to leverage other kernel vulnerabilities&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| Resource limit use-after-free&lt;br /&gt;
| When assigning a KResourceLimit to a KProcess, the reslimit&#039;s refcounter doesn&#039;t get incremented. This essentially means all KResourceLimit get freed if pm gets somehow terminated.&lt;br /&gt;
&lt;br /&gt;
It turns out it is possible to ask pm (via ns:s or pm:app) to terminate itself along all other KIPs simply by passing TID 0004000100001000.&lt;br /&gt;
&lt;br /&gt;
Calling [[SVC|svcGetResourceLimit]] afterwards triggers a use-after-free. This is rather difficult to exploit, however: there is one slot left in the reslimit slabheap. An attacker either has to map the NULL page as R(W)X (svcControlProcessMemory vuln fixed on [[11.8.0-41|11.8.0-X]]), or use one of the map-null exploits above while having access to svcCreateResourceLimit (with the only one that is easy enough to use in that context having been fixed on [[11.14.0-46|11.14.0-X]], anyway).&lt;br /&gt;
| Arm11 kernel code execution&lt;br /&gt;
| None (although near impossible to exploit on [[11.14.0-46|11.14.0-X]])&lt;br /&gt;
| [[11.14.0-46|11.14.0-X]]&lt;br /&gt;
| 2020&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcSetProcessIdealProcessor]] reference count overflow and therefore use-after-free.&lt;br /&gt;
| The SVC receive two arguments: handle and idealprocessor. The handle is used to get the KProcess object and the KProcess-&amp;gt;refCnt gets incremented,later the function check if the KProcess-&amp;gt;mem_type != BASE and if yes, it checks for idealprocessor == 2 or idealprocessor != 3. The problem here is that if you pass the idealprocessor = 3 it won&#039;t meet any condition and return the error 0xD9001BEA without decrement the reference count. &lt;br /&gt;
It can be abused to overflow the KProcess reference count that will lead to an Use-after-free. &lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free.&lt;br /&gt;
| &lt;br /&gt;
| [[11.6.0-39|11.6.0-X]]&lt;br /&gt;
| November 2, 2017&lt;br /&gt;
| [[User:st4rk|st4rk]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcGetThreadList]] process reference leak&lt;br /&gt;
| When given a valid process handle (including &amp;lt;code&amp;gt;0xFFFF8001&amp;lt;/code&amp;gt;), svcGetThreadList forgets to decrement the reference count of the underlying [[KProcess]] instance, after having finished using it.&lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free, but this UAF was most likely not exploitable&lt;br /&gt;
| &lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| April 3, 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| kernelhax via gspwn&lt;br /&gt;
| Originally the kernel didn&#039;t initialize [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]]. Since it&#039;s 0 at hard-boot, this allowed the GPU to access the entire FCRAM + AXIWRAM.&lt;br /&gt;
| Entire FCRAM+AXIWRAM R/W.&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] partly&lt;br /&gt;
|-&lt;br /&gt;
| fasthax&lt;br /&gt;
| When a KTimer is created in pulse mode, the kernel calls a virtual function to reset the timer each time it pulses. The scheduler is locked for that core to avoid race conditions, but another core can call CloseHandle on the timer and free it, leading to a UAF vtable call.&lt;br /&gt;
| See description.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| May 2016&lt;br /&gt;
| nedwill&lt;br /&gt;
|-&lt;br /&gt;
| ipctakeover&lt;br /&gt;
| When sending cmdreplies, it does not validate that the src_addr and src_size match the equivalent dst_addr and dst_size. With a modified addr/size specified in a cmdreply for an output buffer, the data-copy for the first/last pages could be used to overwrite data outside of the buffer specified by the original process.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This can be used to takeover processes where the process is using your service session. Like HTTPC -&amp;gt; BOSS, for bosshaxx above. NIM takeover can be done too(actual stack buffer overflow can trigger), etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 26, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Using IPC input buffers as output buffers&lt;br /&gt;
| When sending cmdreplies, it does not validate that the cmdreply descriptor type matches the equivalent cmdreq descriptor type. This could be used by an exploited sysmodule to use what was intended as an input-buffer as an output-buffer, and also combine other IPC vuln(s) with this.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| [[11.3.0-36|11.3.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) required patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]] (deleted)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| veryslowpidhax&lt;br /&gt;
| &#039;&#039;&#039;This is completely different from the kernelmode-code-execution vuln described in the below separate entry.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When updating the kernel global PID counter under [[SVC|svcCreateProcess]] the kernel does not check for wraparound to 0x0(the PID for the very first process). This only matters because [[Services|SM-module]] allows processes with PID value less than &amp;lt;total ARM11 FIRM modules&amp;gt; to access &#039;&#039;all&#039;&#039; services, without checking exheader service-access-control; and because Kernel11 checks for the PID to be 1 (loader) to use the input mem-region value on ControlMemory. This alone does not affect access the [[SVC|SVCs]] access table at all.&lt;br /&gt;
&lt;br /&gt;
Inlined ldrex+strex code is used for updating the above counter. [[11.2.0-35|11.2.0-X]] had changes for similar code, but it was only for dedicated ldrex+strex functions(mainly for kernel objects) and hence this PID code was not affected.&lt;br /&gt;
&lt;br /&gt;
With launching+terminating a sysmodule repeatedly with this via ns:s, it would take weeks to finish(if not at least about a month?).&lt;br /&gt;
| Access to all [[Services_API|services]], ControlMemory on any given mem-region.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| 2012 maybe?&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|  slowhax/waithax&lt;br /&gt;
|  svcWaitSynchronizationN does not decrement the references to valid handles in an array before returning an error when it encounters an invalid handle. This allows one to (slowly) overflow the reference count for a handle object to zero.&lt;br /&gt;
| ARM11 kernel-mode code execution&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| 2016&lt;br /&gt;
| nedwill, [[User:Derrek|derrek]]&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;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2.1&lt;br /&gt;
| Nintendo&#039;s fix for memchunkhax2 in [[10.4.0-29|10.4.0-X]] did not fix the GPU case: one may cause the requisite ToCToU race using gspwn, bypassing the new validation.&lt;br /&gt;
derrek&#039;s original 32c3 presentation for memchunkhax2 commented that a GPU-based attack was possible, but would be difficult.  However, memchunkhax2.1 showed that it was possible to do fairly reliably.&lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]], aliaspider&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2&lt;br /&gt;
| When allocating a block of memory, the &amp;quot;next&amp;quot; pointer of the [[Memory_Management#MemoryBlockHeader|memchunkhdr]] is accessed without being checked after being mapped to userland.&lt;br /&gt;
This allows a race condition, where the process can change the next pointer just before it&#039;s accessed. By pointing the next pointer to a crafted memchunckhdr in the kernel SlabHeap, some of the SlabHeap is allocated to the calling process, allowing to change vtables of kernel objects. &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]] (partially, see memchunkhax2.1)&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| heaphax&lt;br /&gt;
| Can change the size of free memchunk structures stored in FCRAM using DMA, which leads to the ability to allocate memory chunks over already-allocated memory. This can be used in the SYSTEM region to allocate RW memory over any part of the NS system module, which is enough to take it over.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading) Code execution within any applet.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| snshax&lt;br /&gt;
| Can force creation of Safe NS process into gspwn-able memory, allowing for takeover.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading)&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&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;
| Useless [[SM]] off-by-one write&lt;br /&gt;
| After accepting a new session, [[SM]] writes a (handler ID (0 for srv: sessions (max. 64), 1 for the srv:pm one), pointer to session context structure in BSS) pair in a global array. However that array is only 64-entry-big instead of 65 (as it ought to be), and no bound check is done in that regard.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, as of [[11.4.0-37]], the overwritten fields are totally unused after their initialization by &amp;lt;code&amp;gt;__libc_init_array&amp;lt;/code&amp;gt;.&lt;br /&gt;
| Not currently exploitable&lt;br /&gt;
| None&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| smpwn&lt;br /&gt;
| When registering a new service (or &amp;quot;port&amp;quot;), no bound checks are done on the service table. One can simply call RegisterPort repeatedly to overflow that table: it will overflow into the command replay structure.&lt;br /&gt;
&lt;br /&gt;
Combined with a other minor bugs in the sysmodule, it is possible to take over [[SM]] with this nevertheless difficult-to-exploit vulnerability.&lt;br /&gt;
| Code execution under [[SM]], etc.&lt;br /&gt;
| [[11.16.0-48]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| July 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]] (independently), presumably ichfly before &lt;br /&gt;
|-&lt;br /&gt;
| PXI cmdbuf buffer overrun &lt;br /&gt;
| Like its Arm9 counterpart, before version [[5.0.0-11|5.0.0-X]], the PXI system module did not check the command sizes. This makes it possible to get ROP under the PXI sysmodule from a pwned Process9.&lt;br /&gt;
safecerthax uses it to takeover the Arm11 processor after directly getting remote code execution on the Arm9 side. Though, is useless in classic Arm11 -&amp;gt; Arm9 chains.&lt;br /&gt;
| ROP under [[PXI_Services|PXI]]&lt;br /&gt;
| probably [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| &lt;br /&gt;
| Everyone&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;
| [[CSND_Services|CSND]] sysmodule crash due to out of bounds parameters.&lt;br /&gt;
| The CSND command [[CSND:PlaySoundDirectly|PlaySoundDirectly (0x00040080)]] takes a channel ID as the first parameter. Any value outside the range [0-3] makes the system module become unstable or crash due to an out of bounds memory read. &lt;br /&gt;
| Out of bounds memory read, probably not exploitable. More research needed.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| January 2021&lt;br /&gt;
| January 22, 2021&lt;br /&gt;
| [[User:PabloMK7|PabloMK7]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| SSLoth: [[SSL_Services|SSL]] sysmodule improper certificate verification&lt;br /&gt;
| Initially, the SSL sysmodule missed the R_VERIFY_RES_SIGNATURE entry in the &amp;quot;resource list&amp;quot; provided to the RSA BSAFE library. Consequently, it did not check signatures when validating certificate chains. &lt;br /&gt;
| Forge fake certificates, spoof official servers and perform MitM attacks on SSL/TLS connections.&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| [[11.14.0-46]]&lt;br /&gt;
| 2020&lt;br /&gt;
| December 18, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], shutterbug2000 (independently)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD:ndm]] SetNZoneMacFilter (cmd8) stack smashing&lt;br /&gt;
| The length of the mac filter is not checked before being copied to a fixed-size buffer on stack.&lt;br /&gt;
| ROP under [[CECD_Services|CECD]] sysmodule&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45]]&lt;br /&gt;
| 2020&lt;br /&gt;
| July 20, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] message box access &lt;br /&gt;
| CECD allows any process to write to any message box, thus allowing to write Streetpass data to the message box of any title.&lt;br /&gt;
| Install exploit for any title having a vulnerability in Streetpass data parsers (see CTRSDK Streetpass parser vulnerability).&lt;br /&gt;
| None&lt;br /&gt;
| None&lt;br /&gt;
| ?&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| Everyone?&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] packet type 0x32/0x34 stack-smashing&lt;br /&gt;
| When parsing Streetpass packets of type 0x32 and 0x34, CECD copies a list without checking the number of entries. The packet length is limited to 0x400 bytes, which is not enough to reach the end of the stack frame and overwrite the return address. However, the buffer located just next to the packet buffer is actually filled with data sent just before, hence actually allowing to overwrite the whole stack frame with conrolled data.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CECD_Services|CECD]] TMP files parser multiple vulnerabilities&lt;br /&gt;
| When parsing &amp;quot;TMP_XXX&amp;quot; files, CECD does not check the number of messages contained in the file. This allows to overflow the array of message pointers and message sizes on the stack. Pointers aren&#039;t controlled and sizes are limited (one cannot send gigabytes of data...), yet the last message size can be an arbitrary value (the current message pointer goes outside the file buffer and the parsing loop is broken). This allows to overwrite a pointer to a lock object on the stack and decrement an arbitrary value in memory. One can change the TMP file parsing mode to have CECD trying to free all the message buffers after parsing the next TMP file. The parsing mode is usually restored when parsing a new TMP file, but an invalid TMP file allows to make a function returns an error before the mode is restored , the return value is not checked and the parser consider the file valid. The message pointers and sizes arrays are not updated though, this is not a problem since the previous TMP file buffer is reused for the new TMP file in memory. Thus the message pointers actually points to controlled data. This allows to get a bunch of fake heap chunk freed, thus a bunch of unsafe unlink arbitrary writes.&lt;br /&gt;
| RCE under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| Summer 2019&lt;br /&gt;
| June 1, 2020&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Config_Services|CFG]]:CreateConfigInfoBlk integer underflow&lt;br /&gt;
| When creating a new block it checks the size of the block is &amp;lt;= 0x8000, but it doesn&#039;t check that the block size is less than the remaining space. This induces an integer underflow (remaining_space-block_size), the result is then used for another check (buf_start+current_offset+constant &amp;lt;= remaining_space-block_size) and then in a mempcy call (dest = buf_start+(u16)(remaining_space-block_size), size =block_size). This allow for writing past the buffer, however because of the u16 cast in the memcpy call memory has to be mapped from buf_start to buf_start+0x10000 (cannot write backward).&lt;br /&gt;
| Theoritically ROP under CFG services, but BSS section is to small (size &amp;lt;= 0x10000) so it only results in a crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.8.0-41]]&lt;br /&gt;
| November, 2018&lt;br /&gt;
| November 24, 2018&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP:SendDataFrame]] missing input array index validation&lt;br /&gt;
| [[MP:SendDataFrame]] doesn&#039;t validate the input index at cmdreq[1], unless the function for flag=non-zero is executed. This is used to calculate the following, without validating the index at all: someptr = stateptr + (index*0x924) + somestateoffset.&lt;br /&gt;
&lt;br /&gt;
After validating some flags from someptr, when input_flag=0 the input buffer data is copied to someptr+someotheroffset+0x14 with the u16 size loaded from someptr+someotheroffset.&lt;br /&gt;
&lt;br /&gt;
With a large input index someptr could be setup to be at a &amp;lt;target address&amp;gt;, for overwriting memory.&lt;br /&gt;
&lt;br /&gt;
This is probably difficult to exploit.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP_Services|MP]] cmd1 out-of-bounds handle read&lt;br /&gt;
| MP-sysmodule handles the input parameter for cmd1 as a s32. It checks for &amp;gt;=16, but not &amp;lt;0. With &amp;lt;16 it basically does the following(array of entries 4-bytes each): *outhandle = ((Handle*)(stateptr+offsetinstate))[inputindex].&lt;br /&gt;
&lt;br /&gt;
Hence, this can be used to load any handle in MP-sysmodule memory. MP doesn&#039;t really have any service handles of interest however(can be obtained from elsewhere too).&lt;br /&gt;
| Reading any handle in MP-sysmodule memory.&lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 21, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM stack/.bss infoleak via [[AM:ReadTwlBackupInfo]]([[AM:ReadTwlBackupInfoEx|Ex]])&lt;br /&gt;
| After writing the output-info structure to stack, it then copies that structure to the output buffer ptr using the size from the command. The size is not checked. This could be used to read data from the AM-service-thread stack handling the command + .bss.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was not tested on hardware.&#039;&#039;&#039;&lt;br /&gt;
| Stack/.bss reading&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27]](AM v9217)&lt;br /&gt;
| Roughly October 17, 2016&lt;br /&gt;
| October 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM module APcert infoleak via 00000000.ctx files&lt;br /&gt;
| Just after a download title is purchased from the eShop, the .ctx is in an initialized state of all FFs past the header. During download, the FF area is filled with the console APcert. Thus, it is possible to create a xorpad from the initial state and use it to decrypt the APcert filled state.&lt;br /&gt;
| APcert contains the deviceID, which can beneficial in decrypting the movable.sed (since deviceID is mathmatically related to the LFCS).&lt;br /&gt;
| None&lt;br /&gt;
| [[11.16.0-49]]&lt;br /&gt;
| August, 2022&lt;br /&gt;
| March 17, 2023&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| [[MVD_Services|MVD]]: Stack buffer overflow with [[MVDSTD:SetupOutputBuffers]].&lt;br /&gt;
| The input total_entries is not validated when initially processing the input entry-list. This fixed-size input entry-list is copied to stack from the command request. The loop for processing this initializes a global table, the converted linearmem-&amp;gt;physaddrs used there are also copied to stack(0x8-bytes of physaddrs per entry).&lt;br /&gt;
&lt;br /&gt;
If total_entries is too large, MVD-sysmodule will crash due to reading unmapped memory following the stack(0x10000000). Afterwards if the out-of-bounds total_entries is smaller than that, it will crash due accessing address 0x0, hence this useless.&lt;br /&gt;
| MVD-sysmodule crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| April 22, 2016 (Tested on the 25th)&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]]: Using CTRSDK heap with UDS sharedmem from the user-process.&lt;br /&gt;
| See the HTTP-sysmodule section below.&lt;br /&gt;
&lt;br /&gt;
CTRSDK heap is used with the sharedmem from [[NWMUDS:InitializeWithVersion]]. Buffers are allocated/freed under this heap using [[NWMUDS:Bind]] and [[NWMUDS:Unbind]].&lt;br /&gt;
&lt;br /&gt;
Hence, overwriting sharedmem with gspwn then using [[NWMUDS:Unbind]] results in the usual controlled CTRSDK memchunk-header write, similar to HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This could be done by creating an UDS network, without any other nodes on the network.&lt;br /&gt;
&lt;br /&gt;
Besides CTRSDK memchunk-headers, there are no addresses stored under this sharedmem.&lt;br /&gt;
| ROP under NWM-module.&lt;br /&gt;
| None (need to check, but CTRSDK heap code is vulnerable)&lt;br /&gt;
| [[9.0.0-20|9.0.0-X]]&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| April 16, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds memory access during spectator [[Download_Play|data-frame]] checksum calculation&lt;br /&gt;
| DLP doesn&#039;t validate the frame_size when receiving spectator data-frames at all, unlike non-spectator data-frames. The actual spectator data-frame parsing code doesn&#039;t use that field either. However, the data-frame checksum calculation code called during checksum verification does use the frame_size for loading the size of the framebuf.&lt;br /&gt;
&lt;br /&gt;
Hence, using a large frame_size like 0xFFFF will result in the checksum calculation code reading data out-of-bounds. This isn&#039;t really useful, you could trigger a remote local-WLAN DLP-sysmodule crash while a 3DS system is scanning for DLP networks(due to accessing unmapped memory), but that&#039;s about all(trying to infoleak with this likely isn&#039;t useful either).&lt;br /&gt;
| DLP-sysmodule crash, handled by dlplay system-application by a &amp;quot;connection interrupted&amp;quot; error eventually then a fatal-error via ErrDisp.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8, 2016 (Tested on the 10th)&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds output data writing during spectator sysupdate titlelist [[Download_Play|data-frame]] handling&lt;br /&gt;
| The total_entries and out_entryindex fields for the titlelist DLP spectator data-frames are not validated. This is parsed during DLP network scanning. Hence, the specified titlelist data can be written out-of-bounds using the specified out_entryindex and total_entries. A crash will occur while reading the input data-frame titlelist if total_entries is larger than 0x27A, due to accessing unmapped memory.&lt;br /&gt;
&lt;br /&gt;
There&#039;s not much non-zero data to overwrite following the output buffer(located in sharedmem), any ptrs are located in sharedmem. Overwriting certain ptr(s) are only known to cause a crash when attempting to use the DLP-client shutdown service-command.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to exploit the above crash, since the linked-list code involves writes zeros(with a controlled start ptr).&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8-9, 2016&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[IR_Services|IR]]: Stack buffer overflow with custom hardware&lt;br /&gt;
| Originally IR sysmodule used the read value from the I2C-IR registers TXLVL and RXLVL without validating them at all. See [[10.6.0-31|here]] for the fix. This is the size used for reading the data-recv FIFO, etc. The output buffer for reading is located on the stack.&lt;br /&gt;
&lt;br /&gt;
This should be exploitable if one could successfully setup the custom hardware for this and if the entire intended sizes actually get read from I2C.&lt;br /&gt;
| ROP under IR sysmodule.&lt;br /&gt;
| [[10.6.0-31|10.6.0-31]]&lt;br /&gt;
| &lt;br /&gt;
| February 23, 2016 (Unknown if it was noticed before then)&lt;br /&gt;
| February 23, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTP_Services|HTTP]]: Using CTRSDK heap with sharedmem from the user-process.&lt;br /&gt;
| The data from httpcAddPostDataAscii and other commands is stored under a CTRSDK heap. That heap is the sharedmem specified by the user-process via the HTTPC Initialize command.&lt;br /&gt;
Normally this sharedmem isn&#039;t accessible to the user-process once the sysmodule maps it, hence using it is supposed to be &amp;quot;safe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t the case due to gspwn however. Since CTRSDK heap code is so insecure in general, one can use gspwn to locate the HTTPC sharedmem + read/write it, then trigger a mem-write under the sysmodule. This can then be used to get ROP going under HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This is exploited by [https://github.com/yellows8/ctr-httpwn/ctr-httpwn ctr-httpwn].&lt;br /&gt;
| ROP under HTTP sysmdule.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.13.0-45|11.13.0-X]]&lt;br /&gt;
| Late 2015&lt;br /&gt;
| March 22, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| Code execution under spi sysmodule; access to [[CONFIG11_Registers|CFG11_GPUPROT]] and ultimately kernel code execution. &lt;br /&gt;
| None&lt;br /&gt;
| [[11.14.0-46]]&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 0x2D800000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 (0x800000 with New3DS) with the default memory-layout on Old3DS/New3DS. With [[11.3.0-36|11.3.0-X]] the cutoff now varies due to the new [[SVC]] 0x59. The New3DS &amp;quot;normal&amp;quot;(non-APPLICATION) cutoff was changed to 0x2D000000 due to the new [[SVC]] 0x59.&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;
| [[CECD_Services|CECD]] Streetpass message exheader stack-smashing&lt;br /&gt;
| When parsing streetpass messages, &amp;quot;nn::cec::CTR::Message::InputMessage&amp;quot; calls &amp;quot;nn::cec::CTR::Message::SetExHeaderWithoutCalc&amp;quot; for each exheader entry in the input message. The number of entries should not exceed 16 but remains unchecked, leading to a stack-buffer-overflow.&lt;br /&gt;
| ROP under any application parsing Streetpass messages&lt;br /&gt;
Remote code execution under [[CECD_Services|CECD]]&lt;br /&gt;
| [[11.12.0-44]]&lt;br /&gt;
| &lt;br /&gt;
| 2019&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&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;br /&gt;
| CTPK buffer overflow&lt;br /&gt;
| At offset 0x20 in CTPK is an array for each texture, each entry is 0x20-bytes. This contains a wordindex(entry+0x18) for some srcdata relative to CTPK+0, and an u8 wordsize(entry+0x14) for this data. The CTRSDK function handling this doesn&#039;t validate the size, when copying srcdata using this size to the output buffer. Applications usually have the output buffer on the stack, hence stack buffer overflow.&lt;br /&gt;
&lt;br /&gt;
While CTPK(*.ctpk) are normally only loaded from RomFS, some application(s) load from elsewhere too.&lt;br /&gt;
| ROP under the target application.&lt;br /&gt;
| None?&lt;br /&gt;
| &amp;quot;[SDK+NINTENDO:CTR_SDK-11_4_0_200_none]&amp;quot;&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| nn::pia::session::RelayRouteManageJob::UpdateConnectionReport buffer overflow&lt;br /&gt;
| [https://switchbrew.org/wiki/Switch_System_Flaws#Pia Originally discovered in Pia v5.x for Switch], this buffer overflow is also present in earlier versions (v3.x/4.x/5.x, possibly earlier?) for 3DS (and Wii U too).&lt;br /&gt;
| Heap buffer overflow&lt;br /&gt;
| Unfixed on 3DS&lt;br /&gt;
| &amp;quot;[SDK+Nintendo:PIA_5_4_3]&amp;quot;&lt;br /&gt;
| 3DS: June 14, 2023&lt;br /&gt;
| 3DS: [[User:Riley|Riley]], originally: [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=20798</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=20798"/>
		<updated>2018-08-05T13:01:14Z</updated>

		<summary type="html">&lt;p&gt;Riley: rip twl_firm downgrade =&amp;gt; cmd9fail&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). A 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 uninitialized 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.&lt;br /&gt;
&lt;br /&gt;
It has been exploited by derrek to dump the ARM9 bootrom as of Summer 2015.&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;
| RSA keyslots don&#039;t clear exponent when setting modulus&lt;br /&gt;
| The [[RSA_Registers|RSA keyslots]] are set by boot ROM to have four private RSA keys.  The exponent value in the RSA registers is write-only and not readable.&lt;br /&gt;
&lt;br /&gt;
However, when setting a keyslot&#039;s modulus, the RSA hardware leaves the exponent alone.  This allows retrieving the exponent by doing a discrete logarithm of the output.&lt;br /&gt;
&lt;br /&gt;
By setting the modulus to a prime number whose modular multiplicative order is &amp;quot;smooth&amp;quot; (that is, p-1 is divisible by only small prime numbers), discrete logarithms can be calculated quickly using the [[wikipedia:Pohlig-Hellman algorithm|Pohlig-Hellman algorithm]].  If the prime chosen is greater than the modulus, but the same bit size, the discrete logarithm is the private exponent.&lt;br /&gt;
&lt;br /&gt;
This exploit&#039;s usefulness is limited: RSA keyslot 0 is only used in current firmware for deriving the 6.x save and 7.x NCCH keys, which were already known, and the other three keyslots are entirely unused.  Additionally, with a boot ROM dump, this exploit is moot; these private keys are located in the protected ARM9 boot ROM.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| March 2016&lt;br /&gt;
| [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] allowing acccess to AXIWRAM/FCRAM-BASE-memregion&lt;br /&gt;
| [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]] can be configured by anything with access to it to allow the GPU to access the entire AXIWRAM+FCRAM. For example, this is an issue for any sysmodule that gets exploited and has access to this register memory-page(include one that&#039;s listed below).&lt;br /&gt;
&lt;br /&gt;
See also &amp;quot;kernelhax via gspwn&amp;quot; below.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Boot ROM ==&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;
| FIRM partitions known-plaintext&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are encrypted with AES-CTR without a MAC. 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;
However it is most commonly used to install arbitrary FIRMs (usually boot9strap), thanks to sighax.&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;
| Boot9 AES keyinit function issues&lt;br /&gt;
| [[Bootloader|Boot9]] seems to have two bugs in the AES key-init function, see [[AES_Registers#AES_key-init|here]].&lt;br /&gt;
| None&lt;br /&gt;
| BootROM issue.&lt;br /&gt;
| 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| New3DS has same boot ROM as Old3DS&lt;br /&gt;
| The New3DS has the exact same boot ROM as the Old3DS.  This means, among other things, that all the same boot ROM flaws are present.  Also, this meant that it is possible to boot Old3DS firmware on New3DS (see &amp;quot;CFG_SYSPROT9 bit1 not set by Kernel9&amp;quot;).&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| October 2014&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| sighax: Boot9 improper PKCS #1 v1.5 signature validation&lt;br /&gt;
| The [[Flash_Filesystem|FIRM partitions]] are signed with RSA-2048 using SHA-256 and PKCS #1 v1.5 padding.  Boot9, however, does improper validation of the padding in three ways:&lt;br /&gt;
# Boot9 permits block type 02, meant for encrypted messages, to be used for signatures.  Only 01, for signatures, should have been permitted.  As a result, a signature block is not required to have a long string of FF bytes as padding, but rather any random values suffice.  While correct for encryption, this severely lessens security of signatures.&lt;br /&gt;
# Boot9 does not require that the length of the padding fill out the signature block completely.  As a result, there is considerable freedom in the layout of a signature.&lt;br /&gt;
# Boot9 fails to do bounds checking in its parsing of the DER-encoded hash algorithm type and hash value; the length values given in DER are permitted to point outside the signature block.&lt;br /&gt;
Flaw 3 allows the DER encoding to be such that boot9 believes that the signature&#039;s hash value is outside the range of the block itself, somewhere on the stack.  This can be pointed at the correct hash value it computes.  Boot9 then memcmp&#039;s the calculated hash against itself, and thinks that the hash is valid.&lt;br /&gt;
&lt;br /&gt;
When all three flaws are combined, a brute force in a reasonable amount of time can find a signature that passes all checks.&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| July 2015&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| Boot9 FIRM loading doesn&#039;t blacklist memory-mapped I/O&lt;br /&gt;
| [[Bootloader|Boot9]]&#039;s FIRM loading blacklists Boot9 data regions, but forgets to do other important regions, including Memory-mapped I/O. Combined with sighax, by loading a malicious FIRM section to MMIO, one can get Boot9/Boot11 code execution. &lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| 2015(?)&lt;br /&gt;
| [[User:Derrek|derrek]] (2015?), [[User:Normmatt|Normmatt]] and [[User:SciresM|SciresM]] independently (January 2017).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;superhax&amp;quot;: Boot9 FIRM loading blacklist check is flawed&lt;br /&gt;
| Boot9 only makes sure the &#039;&#039;&#039;start&#039;&#039;&#039; and &#039;&#039;&#039;end&#039;&#039;&#039; address of each section is not covered by a blacklisted region. Thus, it is possible to overwrite blacklisted regions (e.g. ARM9 Exception Vectors) by choosing a FIRM section range that encloses an entire blacklisted region. The vulnerable code looks like this: if(blRegions[i].start &amp;lt;= sectionStart &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionStart &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; blRegions[i].start &amp;lt;= sectionEnd &amp;amp;&amp;amp; blRegions[i].end &amp;gt; sectionEnd) return false; // failure&lt;br /&gt;
| None&lt;br /&gt;
| New3DS&lt;br /&gt;
| August 2015&lt;br /&gt;
| [[User:Plutoo|plutoo]], [[User:Yellows8|yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ARM9 software ==&lt;br /&gt;
&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;
| Generating the keysector console-unique keys with ITCM+Boot9&lt;br /&gt;
| [[Bootloader|Boot9]] decrypts the 0x100-byte [[OTP_Registers|OTP]] using AES-CBC with keydata stored in Boot9. If hash verification is successful, the plaintext of the first 0x90-bytes are copied into [[Memory_layout|ITCM]]. This is the &#039;&#039;exact&#039;&#039; &#039;&#039;same&#039;&#039; region hashed by arm9loader when generating the console-unique keys for decrypting the keysector, except arm9loader uses the raw encrypted OTP.&lt;br /&gt;
&lt;br /&gt;
Therefore, with the OTP keydata+IV from Boot9 you can: encrypt the 0x90-bytes from ITCM, then hash the output to get the console-unique keys for the system&#039;s keysector. This can even be done for Old3DS which doesn&#039;t have the arm9loader keysector officially.&lt;br /&gt;
&lt;br /&gt;
It&#039;s unknown why arm9loader only used the first 0x90-bytes of OTP. Using more data from OTP would&#039;ve prevented this. Fixing this would require doing exactly that, but that would also mean updating the NAND keysector(which is dangerous).&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| &lt;br /&gt;
| 2015&lt;br /&gt;
| January 6, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Rearrangable keys in the NAND keystore&lt;br /&gt;
| Due to the keystore being encrypted with AES-ECB, one can rearrange blocks and still have the NAND keystore decrypt in a deterministic way. &lt;br /&gt;
&lt;br /&gt;
Using 10.0 FIRM it is possible to rearrange keys such that ARM9 memory is executed. As such using existing ARM9 execution 10.0 FIRM can be written to NAND and a payload written to memory, with the payload to be executed post-K9L using an MCU reboot.&lt;br /&gt;
| arm9loaderhax given existing ARM9 code execution&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| Early 2016&lt;br /&gt;
| 27 September 2016&lt;br /&gt;
| Myria, [[User:Dark samus|dark_samus]]; mathieulh (independently); [[User:Plutooo|plutoo]] (independently) + others&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;
| [[11.3.0-36|11.3.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 [[User:Derrek|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, access to uncleared OTP hash keydata&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.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;
| Leak of normal-key matching a key-generator key&lt;br /&gt;
| During the 3DS&#039; development (June/July 2010) Nintendo added support installing encrypted content ([[CIA]]). Common-key index1 was intended to be a [[AES|hardware generated key]]. However while they added code to generate the key in hardware, they forgot to remove the normal-key for index1 (used elsewhere, likely old debug code). Nintendo later removed the normal key sometime before the first non-prototype firmware release.&lt;br /&gt;
&lt;br /&gt;
Knowing the keyY and the normal-key for common-key index1, the devkit key-generator algorithm can be deduced (see &amp;quot;Hardware&amp;quot; above). Additionally the remaining devkit common-keys can be generated once the common-key keyX is recovered.&lt;br /&gt;
&lt;br /&gt;
Note that the devkit key-generator was discovered to be the same as the retail key-generator.&lt;br /&gt;
| Deducing the keyX for keyslot 0x3D and hardware key-generator algorithm. Generate remaining devkit common-keys.&lt;br /&gt;
| pre-[[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| Shortly after the key-generator was revealed to be flawed at the 32c3 3ds talk&lt;br /&gt;
| January 20, 2016&lt;br /&gt;
| [[User:Jakcron|jakcron]]&lt;br /&gt;
|-&lt;br /&gt;
| Factory firmware is vulnerable to sighax&lt;br /&gt;
| During the 3DS&#039;s development, presumably boot9 was written (including the sighax) vulnerability. This vulnerability is also present in factory firmware (and earlier, including 0.11). This was fixed in version 1.0.0-0.&lt;br /&gt;
| Deducing the mechanics of the sighax vulnerability in boot9 without having boot9 prot. Arm9 code execution on factory/earlier firmware.&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| [[1.0.0-0|1.0.0-X]]&lt;br /&gt;
| May 9, 2017&lt;br /&gt;
| May 19, 2017&lt;br /&gt;
| [[User:SciresM|SciresM]], [[User:Myria|Myria]]&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax&lt;br /&gt;
| SAFE_MODE_FIRM is almost never updated(even when NATIVE_FIRM is updated for vuln fixes), this can be noticed by &#039;&#039;just&#039;&#039; checking 3dbrew/ninupdates title-listings.&lt;br /&gt;
&lt;br /&gt;
The fix for firmlaunch-hax was only applied to NATIVE_FIRM in [[9.5.0-22|9.5.0-X]], leaving SAFE_FIRM exploitable. With ARM11-kernel execution, one can trigger FIRM-launch in to SAFE_FIRM, do Kernel9 &amp;lt;=&amp;gt; Kernel11 sync, PXI sync and then repeat the original attack on SAFE_FIRM instead.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| 2012-2013?&lt;br /&gt;
| Wiki: January 2, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| safefirmhax 1.1&lt;br /&gt;
| Nintendo&#039;s original safefirmhax fix was flawed -- they added a global boolean that got set to true whenever a non-sysmodule title got launched (except for a hardcoded repair title id), and panic()&#039;d if that boolean was true to prevent launching safefirm after hax was active. However, because the boolean was initially false after firmlaunch -- With ARM11-kernel execution, one could FIRM-launch into NATIVE_FIRM, and then immediately FIRM-launch again into SAFE_FIRM early in NATIVE_FIRM boot before the boolean got set to true to repeat the safehax attack.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding additional CFG9_BOOTENV checks to firmlaunch code in 11.4.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| safefirmhax fix&lt;br /&gt;
| Wiki: April 10, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| ntrcardhax&lt;br /&gt;
| When reading the banner of a NTR title, Process9 relies on a hardware register to know when the banner was fully read.&lt;br /&gt;
However that register is shared between the ARM9 and the ARM11.&lt;br /&gt;
An attacker with k11 control can so make Process9 believe the banner continues forever and so trigger a buffer overflow.&lt;br /&gt;
With a custom banner for a NTR flashcart, this leads to code execution in Process9.&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding bound checks on the read data.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
| &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;
&lt;br /&gt;
[[11.0.0-33|11.0.0-X]] fixed this for key system titles (MSET, Home Menu, spider, ErrDisp, SKATER, NATIVE_FIRM, and every retail system module), by checking the version of the title to install against a hard-coded list of (titleID, minimumVersionRequired) pairs.&lt;br /&gt;
| Bypassing title version check at installation, which then allows downgrading any title.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], for key system titles.&lt;br /&gt;
| NATIVE_FIRM / AM-sysmodule [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| ?&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| Anti-downgrade list did not include all system titles initially&lt;br /&gt;
| The anti-downgrade list did not include legacy FIRMs until [[11.8.0-41|11.8.0-X]]. Therefore, legacy FIRMs could still be downgraded.&lt;br /&gt;
| Downgrading legacy FIRMs; allowing to exploit bugs in older legacy FIRMs (of which at least one exists, see below).&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| [[11.8.0-33|11.8.0]]&lt;br /&gt;
| ?&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| TWL_FIRM cmd-9 unchecked offset&lt;br /&gt;
| In [[1.0.0-0|1.0.0-X]]&#039;s TWL_FIRM, cmds 8 and 9 were not stubbed (whereas in the corresponding NATIVE_FIRM, they were).&lt;br /&gt;
Command 8 does the Process9 initialisation for NTR carts if an NTR cart is inserted (NTR, not TWL, judged by chipid).&lt;br /&gt;
&lt;br /&gt;
Command 9 takes (u32 offset_read, u32 offset_write, u32 offset_read_end), and basically just copies (offset_read_end - offset_read) bytes starting at (offset_read) of [NTR cart header in arm9mem, NTR secure area in fcram, TWL secure area in fcram], to 0x18001000 + offset_write + offset_read.&lt;br /&gt;
&lt;br /&gt;
offset_write is not checked at all, thus this leads to ARM9 code execution as long as any NTR cart, including flashcarts that would normally be blocked by TWL_FIRM, is inserted.&lt;br /&gt;
&lt;br /&gt;
In [[2.0.0-2|2.0.0-X]] TWL_FIRM, those commands were stubbed out.&lt;br /&gt;
| ARM9 code execution&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| January 2018&lt;br /&gt;
| Wiki: August 5, 2018&lt;br /&gt;
| [[User:Riley|Riley]]&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;
| [[11.3.0-36|11.3.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;
| [[11.3.0-36|11.3.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 useless, unless one can obtain the console-unique movable.sed keyY which encrypts the entire DSiWare .bin.&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;
| None.&lt;br /&gt;
| 11.6.0-X&lt;br /&gt;
| April 2013&lt;br /&gt;
| &lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| seedminer: movable.sed keyY vulnerable to brute-force&lt;br /&gt;
| Half of the movable.sed keyY&#039;s 128 bits are leaked through the [[Nandrw/sys/LocalFriendCodeSeed_B|LFCS]], which is available in userland and below. The LFCS itself also leaks almost half of the remaining bits by following the ratio: u32 keyY[3]=1/5(LFCS). The remaining keyY[3] uncertainty of about ±2000 can be greatly reduced by plotting expected error margins with several keyYs. This results in a final uncertainty of about 2^40, easily within practical brute force range of an average modern PC.&lt;br /&gt;
| Knowing the keyY of a given 3ds allows for modification of DSiWare export contents, and chained with several other public vulns, ultimately arm9 execution.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.6.0-X&lt;br /&gt;
| December 2017&lt;br /&gt;
| January 2018&lt;br /&gt;
| zoogie&lt;br /&gt;
|-&lt;br /&gt;
| Improper validation of DSiWare title SRLs&lt;br /&gt;
| The 3DS does not verify if the actual SRL embedded in the title&#039;s directory matches the titleID in the TMD before launching it or importing it from an sd DSiWare export. &lt;br /&gt;
| This allows embedding older, exploitable DSiWare titles in completely different, unexploitable DSiWare titles. Since DSiWare has raw NAND RW, this can result in arm9 control through FIRM known-plaintext and sighax attacks.&lt;br /&gt;
| None.&lt;br /&gt;
| 11.6.0-X&lt;br /&gt;
| 2015?&lt;br /&gt;
| December 2016&lt;br /&gt;
| Everyone&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.&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, which is exploitable through a hardware + software vulnerability (see arm9loaderhax / description).&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 (see enhanced-arm9loaderhax / description). This was performed by downgrading to a vulnerable system version. By accounting for differences in CTR-NAND crypto (0x05 -&amp;gt; 0x04, see partition encryption types [[Flash_Filesystem#NAND_structure|here]]) and using an Old3DS [[NCSD#NCSD_header|NCSD Header]], it is possible to boot a New3DS using Old3DS firmware 1.0-2.x to retrieve the required OTP data using this flaw.&lt;br /&gt;
| Dumping the [[OTP Registers|OTP]] area.&lt;br /&gt;
Decrypting New3DS sector 0x96 keyblock.&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|svcSetProcessIdealProcessor]] reference count overflow and therefore use-after-free.&lt;br /&gt;
| The SVC receive two arguments: handle and idealprocessor. The handle is used to get the KProcess object and the KProcess-&amp;gt;refCnt gets incremented,later the function check if the KProcess-&amp;gt;mem_type != BASE and if yes, it checks for idealprocessor == 2 or idealprocessor != 3. The problem here is that if you pass the idealprocessor = 3 it won&#039;t meet any condition and return the error 0xD9001BEA without decrement the reference count. &lt;br /&gt;
It can be abused to overflow the KProcess reference count that will lead to an Use-after-free. &lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free.&lt;br /&gt;
| &lt;br /&gt;
| [[11.6.0-39|11.6.0-X]]&lt;br /&gt;
| November 2, 2017&lt;br /&gt;
| [[User:st4rk|st4rk]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcGetThreadList]] process reference leak&lt;br /&gt;
| When given a valid process handle (including &amp;lt;code&amp;gt;0xFFFF8001&amp;lt;/code&amp;gt;), svcGetThreadList forgets to decrement the reference count of the underlying [[KProcess]] instance, after having finished using it.&lt;br /&gt;
| Before [[11.2.0-35|11.2.0-X]]: reference count overflow and therefore use-after-free, but this UAF was most likely not exploitable&lt;br /&gt;
| &lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| April 3, 2017&lt;br /&gt;
| [[User:TuxSH|TuxSH]]&lt;br /&gt;
|-&lt;br /&gt;
| kernelhax via gspwn&lt;br /&gt;
| Originally the kernel didn&#039;t initialize [[CONFIG11_Registers#CFG11_GPUPROT|CFG11_GPUPROT]]. Since it&#039;s 0 at hard-boot, this allowed the GPU to access the entire FCRAM + AXIWRAM.&lt;br /&gt;
| Entire FCRAM+AXIWRAM R/W.&lt;br /&gt;
| [[3.0.0-5|3.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| February 7, 2017&lt;br /&gt;
| [[User:Plutooo|plutoo]], [[User:Yellows8|Yellows8]] partly&lt;br /&gt;
|-&lt;br /&gt;
| fasthax&lt;br /&gt;
| When a KTimer is created in pulse mode, the kernel calls a virtual function to reset the timer each time it pulses. The scheduler is locked for that core to avoid race conditions, but another core can call CloseHandle on the timer and free it, leading to a UAF vtable call.&lt;br /&gt;
| See description.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| May 2016&lt;br /&gt;
| nedwill&lt;br /&gt;
|-&lt;br /&gt;
| ipctakeover&lt;br /&gt;
| When sending cmdreplies, it does not validate that the src_addr and src_size match the equivalent dst_addr and dst_size. With a modified addr/size specified in a cmdreply for an output buffer, the data-copy for the first/last pages could be used to overwrite data outside of the buffer specified by the original process.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This can be used to takeover processes where the process is using your service session. Like HTTPC -&amp;gt; BOSS, for bosshaxx above. NIM takeover can be done too(actual stack buffer overflow can trigger), etc.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 26, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Using IPC input buffers as output buffers&lt;br /&gt;
| When sending cmdreplies, it does not validate that the cmdreply descriptor type matches the equivalent cmdreq descriptor type. This could be used by an exploited sysmodule to use what was intended as an input-buffer as an output-buffer, and also combine other IPC vuln(s) with this.&lt;br /&gt;
&lt;br /&gt;
Used by ctr-httpwn as of v1.2, for &amp;quot;ipctakeover/bosshaxx&amp;quot;.&lt;br /&gt;
| See description.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| November 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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;
| [[11.3.0-36|11.3.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) required patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
| See description&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]] (deleted)&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
| Everyone&lt;br /&gt;
|-&lt;br /&gt;
| veryslowpidhax&lt;br /&gt;
| &#039;&#039;&#039;This is completely different from the kernelmode-code-execution vuln described in the below separate entry.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When updating the kernel global PID counter under [[SVC|svcCreateProcess]] the kernel does not check for wraparound to 0x0(the PID for the very first process). This only matters because [[Services|SM-module]] allows processes with PID value less than &amp;lt;total ARM11 FIRM modules&amp;gt; to access &#039;&#039;all&#039;&#039; services, without checking exheader service-access-control; and because Kernel11 checks for the PID to be 1 (loader) to use the input mem-region value on ControlMemory. This alone does not affect access the [[SVC|SVCs]] access table at all.&lt;br /&gt;
&lt;br /&gt;
Inlined ldrex+strex code is used for updating the above counter. [[11.2.0-35|11.2.0-X]] had changes for similar code, but it was only for dedicated ldrex+strex functions(mainly for kernel objects) and hence this PID code was not affected.&lt;br /&gt;
&lt;br /&gt;
With launching+terminating a sysmodule repeatedly with this via ns:s, it would take weeks to finish(if not at least about a month?).&lt;br /&gt;
| Access to all [[Services_API|services]], ControlMemory on any given mem-region.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| 2012 maybe?&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|  slowhax/waithax&lt;br /&gt;
|  svcWaitSynchronizationN does not decrement the references to valid handles in an array before returning an error when it encounters an invalid handle. This allows one to (slowly) overflow the reference count for a handle object to zero.&lt;br /&gt;
| ARM11 kernel-mode code execution&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| 2016&lt;br /&gt;
| nedwill, [[User:Derrek|derrek]]&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;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2.1&lt;br /&gt;
| Nintendo&#039;s fix for memchunkhax2 in [[10.4.0-29|10.4.0-X]] did not fix the GPU case: one may cause the requisite ToCToU race using gspwn, bypassing the new validation.&lt;br /&gt;
derrek&#039;s original 32c3 presentation for memchunkhax2 commented that a GPU-based attack was possible, but would be difficult.  However, memchunkhax2.1 showed that it was possible to do fairly reliably.&lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]], aliaspider&lt;br /&gt;
|-&lt;br /&gt;
| memchunkhax2&lt;br /&gt;
| When allocating a block of memory, the &amp;quot;next&amp;quot; pointer of the [[Memory_Management#MemoryBlockHeader|memchunkhdr]] is accessed without being checked after being mapped to userland.&lt;br /&gt;
This allows a race condition, where the process can change the next pointer just before it&#039;s accessed. By pointing the next pointer to a crafted memchunckhdr in the kernel SlabHeap, some of the SlabHeap is allocated to the calling process, allowing to change vtables of kernel objects. &lt;br /&gt;
| ARM11 kernel code execution&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]] (partially, see memchunkhax2.1)&lt;br /&gt;
| [[10.4.0-29|10.4.0-X]]&lt;br /&gt;
|&lt;br /&gt;
| [[User:Derrek|derrek]]&lt;br /&gt;
|-&lt;br /&gt;
| heaphax&lt;br /&gt;
| Can change the size of free memchunk structures stored in FCRAM using DMA, which leads to the ability to allocate memory chunks over already-allocated memory. This can be used in the SYSTEM region to allocate RW memory over any part of the NS system module, which is enough to take it over.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading) Code execution within any applet.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]], via the new [[Memory_Management#MemoryBlockHeader|memchunkhdr]] MAC which prevents modifying memchunkhdr data with DMA.&lt;br /&gt;
| [[11.0.0-33|11.0.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&lt;br /&gt;
|-&lt;br /&gt;
| snshax&lt;br /&gt;
| Can force creation of Safe NS process into gspwn-able memory, allowing for takeover.&lt;br /&gt;
| Code execution with access to all of NS&#039;s privileges. (including downgrading)&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| [[10.1.0-27|10.1.0-X]]&lt;br /&gt;
| April 2015 ?&lt;br /&gt;
| smea&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;
| [[SM]] out-of-bounds BSS write (table 1 entry too small)&lt;br /&gt;
| After accepting a new session, [[SM]] writes a (handler ID (0 for srv: sessions (max. 64), 1 for the srv:pm one), pointer to session context structure in BSS) pair in a global array. However that array is only 64-entry-big instead of 65 (as it ought to be), and no bound check is done in that regard.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, as of [[11.4.0-37]], the overwritten fields are totally unused after their initialization by &amp;lt;code&amp;gt;__libc_init_array&amp;lt;/code&amp;gt;.&lt;br /&gt;
| Not currently exploitable&lt;br /&gt;
| None&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
|&lt;br /&gt;
|&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;
| [[MP:SendDataFrame]] missing input array index validation&lt;br /&gt;
| [[MP:SendDataFrame]] doesn&#039;t validate the input index at cmdreq[1], unless the function for flag=non-zero is executed. This is used to calculate the following, without validating the index at all: someptr = stateptr + (index*0x924) + somestateoffset.&lt;br /&gt;
&lt;br /&gt;
After validating some flags from someptr, when input_flag=0 the input buffer data is copied to someptr+someotheroffset+0x14 with the u16 size loaded from someptr+someotheroffset.&lt;br /&gt;
&lt;br /&gt;
With a large input index someptr could be setup to be at a &amp;lt;target address&amp;gt;, for overwriting memory.&lt;br /&gt;
&lt;br /&gt;
This is probably difficult to exploit.&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MP_Services|MP]] cmd1 out-of-bounds handle read&lt;br /&gt;
| MP-sysmodule handles the input parameter for cmd1 as a s32. It checks for &amp;gt;=16, but not &amp;lt;0. With &amp;lt;16 it basically does the following(array of entries 4-bytes each): *outhandle = ((Handle*)(stateptr+offsetinstate))[inputindex].&lt;br /&gt;
&lt;br /&gt;
Hence, this can be used to load any handle in MP-sysmodule memory. MP doesn&#039;t really have any service handles of interest however(can be obtained from elsewhere too).&lt;br /&gt;
| Reading any handle in MP-sysmodule memory.&lt;br /&gt;
| None&lt;br /&gt;
| [[8.0.0-18]](MP-sysmodule v2048)&lt;br /&gt;
| January 21, 2017&lt;br /&gt;
| January 22, 2017&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| AM stack/.bss infoleak via [[AM:ReadTwlBackupInfo]]([[AM:ReadTwlBackupInfoEx|Ex]])&lt;br /&gt;
| After writing the output-info structure to stack, it then copies that structure to the output buffer ptr using the size from the command. The size is not checked. This could be used to read data from the AM-service-thread stack handling the command + .bss.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This was not tested on hardware.&#039;&#039;&#039;&lt;br /&gt;
| Stack/.bss reading&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27]](AM v9217)&lt;br /&gt;
| Roughly October 17, 2016&lt;br /&gt;
| October 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MVD_Services|MVD]]: Stack buffer overflow with [[MVDSTD:SetupOutputBuffers]].&lt;br /&gt;
| The input total_entries is not validated when initially processing the input entry-list. This fixed-size input entry-list is copied to stack from the command request. The loop for processing this initializes a global table, the converted linearmem-&amp;gt;physaddrs used there are also copied to stack(0x8-bytes of physaddrs per entry).&lt;br /&gt;
&lt;br /&gt;
If total_entries is too large, MVD-sysmodule will crash due to reading unmapped memory following the stack(0x10000000). Afterwards if the out-of-bounds total_entries is smaller than that, it will crash due accessing address 0x0, hence this useless.&lt;br /&gt;
| MVD-sysmodule crash.&lt;br /&gt;
| None&lt;br /&gt;
| [[9.0.0-20]]&lt;br /&gt;
| April 22, 2016 (Tested on the 25th)&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[NWM_Services|NWM]]: Using CTRSDK heap with UDS sharedmem from the user-process.&lt;br /&gt;
| See the HTTP-sysmodule section below.&lt;br /&gt;
&lt;br /&gt;
CTRSDK heap is used with the sharedmem from [[NWMUDS:InitializeWithVersion]]. Buffers are allocated/freed under this heap using [[NWMUDS:Bind]] and [[NWMUDS:Unbind]].&lt;br /&gt;
&lt;br /&gt;
Hence, overwriting sharedmem with gspwn then using [[NWMUDS:Unbind]] results in the usual controlled CTRSDK memchunk-header write, similar to HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This could be done by creating an UDS network, without any other nodes on the network.&lt;br /&gt;
&lt;br /&gt;
Besides CTRSDK memchunk-headers, there are no addresses stored under this sharedmem.&lt;br /&gt;
| ROP under NWM-module.&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| [[9.0.0-20|9.0.0-X]]&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| April 16, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds memory access during spectator [[Download_Play|data-frame]] checksum calculation&lt;br /&gt;
| DLP doesn&#039;t validate the frame_size when receiving spectator data-frames at all, unlike non-spectator data-frames. The actual spectator data-frame parsing code doesn&#039;t use that field either. However, the data-frame checksum calculation code called during checksum verification does use the frame_size for loading the size of the framebuf.&lt;br /&gt;
&lt;br /&gt;
Hence, using a large frame_size like 0xFFFF will result in the checksum calculation code reading data out-of-bounds. This isn&#039;t really useful, you could trigger a remote local-WLAN DLP-sysmodule crash while a 3DS system is scanning for DLP networks(due to accessing unmapped memory), but that&#039;s about all(trying to infoleak with this likely isn&#039;t useful either).&lt;br /&gt;
| DLP-sysmodule crash, handled by dlplay system-application by a &amp;quot;connection interrupted&amp;quot; error eventually then a fatal-error via ErrDisp.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8, 2016 (Tested on the 10th)&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[DLP_Services|DLP]]: Out-of-bounds output data writing during spectator sysupdate titlelist [[Download_Play|data-frame]] handling&lt;br /&gt;
| The total_entries and out_entryindex fields for the titlelist DLP spectator data-frames are not validated. This is parsed during DLP network scanning. Hence, the specified titlelist data can be written out-of-bounds using the specified out_entryindex and total_entries. A crash will occur while reading the input data-frame titlelist if total_entries is larger than 0x27A, due to accessing unmapped memory.&lt;br /&gt;
&lt;br /&gt;
There&#039;s not much non-zero data to overwrite following the output buffer(located in sharedmem), any ptrs are located in sharedmem. Overwriting certain ptr(s) are only known to cause a crash when attempting to use the DLP-client shutdown service-command.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no known way to exploit the above crash, since the linked-list code involves writes zeros(with a controlled start ptr).&lt;br /&gt;
| &lt;br /&gt;
| None&lt;br /&gt;
| [[10.0.0-27|10.0.0-X]]&lt;br /&gt;
| April 8-9, 2016&lt;br /&gt;
| April 10, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[IR_Services|IR]]: Stack buffer overflow with custom hardware&lt;br /&gt;
| Originally IR sysmodule used the read value from the I2C-IR registers TXLVL and RXLVL without validating them at all. See [[10.6.0-31|here]] for the fix. This is the size used for reading the data-recv FIFO, etc. The output buffer for reading is located on the stack.&lt;br /&gt;
&lt;br /&gt;
This should be exploitable if one could successfully setup the custom hardware for this and if the entire intended sizes actually get read from I2C.&lt;br /&gt;
| ROP under IR sysmodule.&lt;br /&gt;
| [[10.6.0-31|10.6.0-31]]&lt;br /&gt;
| &lt;br /&gt;
| February 23, 2016 (Unknown if it was noticed before then)&lt;br /&gt;
| February 23, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[HTTP_Services|HTTP]]: Using CTRSDK heap with sharedmem from the user-process.&lt;br /&gt;
| The data from httpcAddPostDataAscii and other commands is stored under a CTRSDK heap. That heap is the sharedmem specified by the user-process via the HTTPC Initialize command.&lt;br /&gt;
Normally this sharedmem isn&#039;t accessible to the user-process once the sysmodule maps it, hence using it is supposed to be &amp;quot;safe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t the case due to gspwn however. Since CTRSDK heap code is so insecure in general, one can use gspwn to locate the HTTPC sharedmem + read/write it, then trigger a mem-write under the sysmodule. This can then be used to get ROP going under HTTP-sysmodule.&lt;br /&gt;
&lt;br /&gt;
This is exploited by [https://github.com/yellows8/ctr-httpwn/ctr-httpwn ctr-httpwn].&lt;br /&gt;
| ROP under HTTP sysmdule.&lt;br /&gt;
| [[11.4.0-37|11.4.0-X]]&lt;br /&gt;
| [[9.6.0-24|9.6.0-X]] (Latest sysmodule version as of [[10.7.0-32|10.7.0-32]])&lt;br /&gt;
| Late 2015&lt;br /&gt;
| March 22, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&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 0x2D800000 on New3DS. This is BASE_memregion_start(aka SYSTEM_memregion_end)-0x400000 (0x800000 with New3DS) with the default memory-layout on Old3DS/New3DS. With [[11.3.0-36|11.3.0-X]] the cutoff now varies due to the new [[SVC]] 0x59. The New3DS &amp;quot;normal&amp;quot;(non-APPLICATION) cutoff was changed to 0x2D000000 due to the new [[SVC]] 0x59.&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;br /&gt;
| CTPK buffer overflow&lt;br /&gt;
| At offset 0x20 in CTPK is an array for each texture, each entry is 0x20-bytes. This contains a wordindex(entry+0x18) for some srcdata relative to CTPK+0, and an u8 wordsize(entry+0x14) for this data. The CTRSDK function handling this doesn&#039;t validate the size, when copying srcdata using this size to the output buffer. Applications usually have the output buffer on the stack, hence stack buffer overflow.&lt;br /&gt;
&lt;br /&gt;
While CTPK(*.ctpk) are normally only loaded from RomFS, some application(s) load from elsewhere too.&lt;br /&gt;
| ROP under the target application.&lt;br /&gt;
| None?&lt;br /&gt;
| &amp;quot;[SDK+NINTENDO:CTR_SDK-11_4_0_200_none]&amp;quot;&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20794</id>
		<title>AMPXI:ExportTicketWrapped</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20794"/>
		<updated>2018-08-01T17:17:54Z</updated>

		<summary type="html">&lt;p&gt;Riley: when you does stuff in a rush, you tend to make mistakes&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 [0x006D0184]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| u64, Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| u64, Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| (CryptedTicketBufferLength &amp;lt;&amp;lt; 8) | 0x4&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Crypted ticket buffer output pointer&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| (256 &amp;lt;&amp;lt; 8) | 0x14&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Wrapped AES key/IV buffer (size 256)&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 [0x006D00C1]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Output wrapped AES key/IV length (should be 256)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This function gets a 32 byte buffer using the internal P9 PRNG function; first 16 bytes is used as AES-CBC key and last 16 bytes is used as IV.&lt;br /&gt;
&lt;br /&gt;
Next, it searches through tickets looking for one with provided ticketID, returns &amp;lt;tt&amp;gt;0xD8808040&amp;lt;/tt&amp;gt; if not found;&lt;br /&gt;
&lt;br /&gt;
Next, it reads the ticket, 0x8000 bytes at a time, into a 0x8000-byte stack buffer, after each read that buffer is crypted using that randomly generated key/IV, then written into the first output buffer;&lt;br /&gt;
&lt;br /&gt;
Finally, it encrypts the AES key/IV with RSA-2048 PKCS1; using a new public key stored in P9 .rodata; and writes the crypted output into the second output buffer.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMNet:ExportTicketWrapped&amp;diff=20793</id>
		<title>AMNet:ExportTicketWrapped</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMNet:ExportTicketWrapped&amp;diff=20793"/>
		<updated>2018-08-01T17:17:26Z</updated>

		<summary type="html">&lt;p&gt;Riley: fix ipc buffer stuff&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 [0x08290184]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| u64, Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| u64, Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| (CryptedTicketBufferLength &amp;lt;&amp;lt; 8) | 0xC&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Crypted ticket buffer output pointer&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| (256 &amp;lt;&amp;lt; 8) | 0x1C&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Wrapped AES key/IV buffer (size 256)&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 [0x082900C1]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Output wrapped AES key/IV length (should be 256)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
Wrapper for [[AMPXI:ExportTicketWrapped]].&lt;br /&gt;
&lt;br /&gt;
Before calling the AMPXI command, checks the input titleID-high, if it&#039;s 0x00048001 (TWL system), 0x00040001 (dlplay child),  or has category flag system (bit 4 set), then returns 0xE0E0803C.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20784</id>
		<title>11.8.0-41</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20784"/>
		<updated>2018-07-31T19:19:20Z</updated>

		<summary type="html">&lt;p&gt;Riley: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Old3DS+New3DS 11.8.0-41 system update was released on July 30, 2018. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN.&lt;br /&gt;
&lt;br /&gt;
Security flaws fixed: &amp;lt;fill this in manually later, see the updatedetails page from the ninupdates-report page(s) once available for now&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Change-log==&lt;br /&gt;
[https://en-americas-support.nintendo.com/app/answers/detail/a_id/667/p/430/c/267 Official] USA change-log:&lt;br /&gt;
* Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience&lt;br /&gt;
&lt;br /&gt;
==System Titles==&lt;br /&gt;
&amp;lt;fill this in (manually) later&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
Actual code changed in Process9.&lt;br /&gt;
&lt;br /&gt;
pxi:am9 command 0x6d0184 was added, see [[AMPXI:ExportTicketWrapped]]&lt;br /&gt;
&lt;br /&gt;
=== AM ===&lt;br /&gt;
New am:net command 0x8290184 was added, see [[AMNet:ExportTicketWrapped]]. This is used by nim.&lt;br /&gt;
&lt;br /&gt;
=== Friends ===&lt;br /&gt;
fpdver version string bumped to 0xC&lt;br /&gt;
&lt;br /&gt;
=== nim ===&lt;br /&gt;
Added 2 new strings in the codebin: &amp;quot;X-Authentication-Key&amp;quot; and &amp;quot;X-Authentication-Data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now uses [[AMNet:ExportTicketWrapped]] during code related to downloading contents(?) (function at 0x143B9C; its caller at 0x123ABC uses amnet:Begin/ResumeImportContent)&lt;br /&gt;
&lt;br /&gt;
If ExportTicketWrapped succeeded, then the new http headers are passed: &amp;quot;X-Authentication-Key&amp;quot; set to base64(wrapped_aes_key) and &amp;quot;X-Authentication-Data&amp;quot; set to base64(crypted_ticket).&lt;br /&gt;
&lt;br /&gt;
This (when activated server-side) would prevent downloading crypted contents entirely without a valid ticket.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
System update report(s):&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-36&amp;amp;sys=ctr]&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-40&amp;amp;sys=ktr]&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Application_Manager_Services&amp;diff=20783</id>
		<title>Application Manager Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Application_Manager_Services&amp;diff=20783"/>
		<updated>2018-07-31T19:18:24Z</updated>

		<summary type="html">&lt;p&gt;Riley: /* Application Manager network service &amp;quot;am:net&amp;quot; */ new cmd = ExportTicketWrapped&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Application Manager services &amp;quot;am:sys&amp;quot;, &amp;quot;am:u&amp;quot;, &amp;quot;am:net&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;
| 0x00010040&lt;br /&gt;
| [[AM:GetNumPrograms|GetNumPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020082&lt;br /&gt;
| [[AM:GetProgramList|GetProgramList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030084&lt;br /&gt;
| [[AM:GetProgramInfos|GetProgramInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000400C0&lt;br /&gt;
| [[AM:DeleteUserProgram|DeleteUserProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000500C0&lt;br /&gt;
| [[AM:GetProductCode|GetProductCode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000600C0&lt;br /&gt;
| [[AM:GetStorageId|GetStorageId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070080&lt;br /&gt;
| [[AM:DeleteTicket|DeleteTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| [[AM:GetNumTickets|GetNumTickets]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090082&lt;br /&gt;
| [[AM:GetTicketList|GetTicketList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| [[AM:GetDeviceId|GetDeviceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[AM:GetNumImportTitleContexts|GetNumImportTitleContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0082&lt;br /&gt;
| [[AM:GetImportTitleContextList|GetImportTitleContextList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0084&lt;br /&gt;
| [[AM:GetImportTitleContexts|GetImportTitleContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E00C0&lt;br /&gt;
| [[AM:DeleteImportTitleContext|DeleteImportTitleContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00C0&lt;br /&gt;
| [[AM:GetNumImportContentContexts|GetNumImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100102&lt;br /&gt;
| [[AM:GetImportContentContextList|GetImportContentContextList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110104&lt;br /&gt;
| [[AM:GetImportContentContexts|GetImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120102&lt;br /&gt;
| [[AM:DeleteImportContentContexts|DeleteImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130040&lt;br /&gt;
| [[AM:NeedsCleanup|NeedsCleanup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140040&lt;br /&gt;
| [[AM:DoCleanup|DoCleanup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150040&lt;br /&gt;
| [[AM:DeleteAllImportContexts|DeleteAllImportContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160000&lt;br /&gt;
| [[AM:DeleteAllTemporaryPrograms|DeleteAllTemporaryPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170044&lt;br /&gt;
| [[AM:ImportTwlBackupLegacy|ImportTwlBackupLegacy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180080&lt;br /&gt;
| [[AM:InitializeTitleDatabase|InitializeTitleDatabase]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190040&lt;br /&gt;
| [[AM:QueryAvailableTitleDatabase|QueryAvailableTitleDatabase]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A00C0&lt;br /&gt;
| [[AM:CalcTwlBackupSize|CalcTwlBackupSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B0144&lt;br /&gt;
| [[AM:ExportTwlBackup|ExportTwlBackup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0084&lt;br /&gt;
| [[AM:ImportTwlBackup|ImportTwlBackup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0000&lt;br /&gt;
| [[AM:DeleteAllTwlUserPrograms|DeleteAllTwlUserPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E00C8&lt;br /&gt;
| [[AM:ReadTwlBackupInfo|ReadTwlBackupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0040&lt;br /&gt;
| [[AM:DeleteAllExpiredUserPrograms|DeleteAllExpiredUserPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200000&lt;br /&gt;
| [[AM:GetTwlArchiveResourceInfo|GetTwlArchiveResourceInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00210042&lt;br /&gt;
| [[AM:GetPersonalizedTicketInfoList|GetPersonalizedTicketInfoList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220080&lt;br /&gt;
| [[AM:DeleteAllImportContextsFiltered|DeleteAllImportContextsFiltered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00230080&lt;br /&gt;
| [[AM:GetNumImportTitleContextsFiltered|GetNumImportTitleContextsFiltered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002400C2&lt;br /&gt;
| [[AM:GetImportTitleContextListFiltered|GetImportTitleContextListFiltered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002500C0&lt;br /&gt;
| [[AM:CheckContentRights|CheckContentRights]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260044&lt;br /&gt;
| [[AM:GetTicketLimitInfos|GetTicketLimitInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00270044&lt;br /&gt;
| [[AM:GetDemoLaunchInfos|GetDemoLaunchInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280108&lt;br /&gt;
| [[AM:ReadTwlBackupInfoEx|ReadTwlBackupInfoEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290082&lt;br /&gt;
| [[AM:DeleteUserProgramsAtomically|DeleteUserProgramsAtomically]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A00C0&lt;br /&gt;
| [[AM:GetNumExistingContentInfosSystem|GetNumExistingContentInfosSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0142&lt;br /&gt;
| [[AM:ListExistingContentInfosSystem|ListExistingContentInfosSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0084&lt;br /&gt;
| [[AM:GetProgramInfosIgnorePlatform|GetProgramInfosIgnorePlatform]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D00C0&lt;br /&gt;
| [[AM:CheckContentRightsIgnorePlatform|CheckContentRightsIgnorePlatform]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Application Manager services &amp;quot;am:u&amp;quot; and &amp;quot;am:net&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;
| 0x04010080&lt;br /&gt;
| [[AM:UpdateFirmwareTo|UpdateFirmwareTo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[AM:BeginImportProgram|BeginImportProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04030000&lt;br /&gt;
| [[AM:BeginImportProgramTemporarily|BeginImportProgramTemporarily]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040002&lt;br /&gt;
| [[AM:CancelImportProgram|CancelImportProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050002&lt;br /&gt;
| [[AM:EndImportProgram|EndImportProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060002&lt;br /&gt;
| [[AM:EndImportProgramWithoutCommit|EndImportProgramWithoutCommit]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040700C2&lt;br /&gt;
| [[AM:CommitImportPrograms|CommitImportPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04080042&lt;br /&gt;
| [[AM:GetProgramInfoFromCia|GetProgramInfoFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04090004&lt;br /&gt;
| [[AM:GetSystemMenuDataFromCia|GetSystemMenuDataFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040A0002&lt;br /&gt;
| [[AM:GetDependencyListFromCia|GetDependencyListFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040B0002&lt;br /&gt;
| [[AM:GetTransferSizeFromCia|GetTransferSizeFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040C0002&lt;br /&gt;
| [[AM:GetCoreVersionFromCia|GetCoreVersionFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040D0042&lt;br /&gt;
| [[AM:GetRequiredSizeFromCia|GetRequiredSizeFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040E00C2&lt;br /&gt;
| [[AM:CommitImportProgramsAndUpdateFirmwareAuto|CommitImportProgramsAndUpdateFirmwareAuto]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040F0000&lt;br /&gt;
| [[AM:UpdateFirmwareAuto|UpdateFirmwareAuto]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041000C0&lt;br /&gt;
| [[AM:DeleteProgram|DeleteProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04110044&lt;br /&gt;
| [[AM:GetTwlProgramListForReboot|GetTwlProgramListForReboot]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04120000&lt;br /&gt;
| [[AM:GetSystemUpdaterMutex|GetSystemUpdaterMutex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04130002&lt;br /&gt;
| [[AM:GetMetaSizeFromCia|GetMetaSizeFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04140044&lt;br /&gt;
| [[AM:GetMetaDataFromCia|GetMetaDataFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04150080&lt;br /&gt;
| [[AM:CheckDemoLaunchRights|CheckDemoLaunchRights]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041600C0&lt;br /&gt;
| [[AM:GetInternalTitleLocationInfo|GetInternalTitleLocationInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041700C0&lt;br /&gt;
| [[AM:PerpetuateAgbSaveData|PerpetuateAgbSaveData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04180040&lt;br /&gt;
| [[AM:BeginImportProgramForOverWrite|BeginImportProgramForOverWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04190000&lt;br /&gt;
| [[AM:BeginImportSystemProgram|BeginImportSystemProgram]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Application Manager service &amp;quot;am:app&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;
| 0x100100C0&lt;br /&gt;
| [[AM:GetDLCContentInfoCount|GetDLCContentInfoCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10020104&lt;br /&gt;
| [[AM:FindDLCContentInfos|FindDLCContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10030142&lt;br /&gt;
| [[AM:ListDLCContentInfos|ListDLCContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10040102&lt;br /&gt;
| [[AM:DeleteContents|DeleteContents]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10050084&lt;br /&gt;
| [[AM:GetDLCTitleInfos|GetDLCTitleInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10060080&lt;br /&gt;
| [[AM:GetNumDataTitleTickets|GetNumDataTitleTickets]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10070102&lt;br /&gt;
| [[AM:ListDataTitleTicketInfos|ListDataTitleTicketInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100801C2&lt;br /&gt;
| [[AM:GetItemRights|GetItemRights]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100900C0&lt;br /&gt;
| [[AM:IsDataTitleInUse|IsDataTitleInUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100A0000&lt;br /&gt;
| [[AM:IsExternalTitleDatabaseInitialized|IsExternalTitleDatabaseInitialized]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100B00C0&lt;br /&gt;
| [[AM:GetNumExistingContentInfos|GetNumExistingContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100C0142&lt;br /&gt;
| [[AM:ListExistingContentInfos|ListExistingContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100D0084&lt;br /&gt;
| [[AM:GetPatchTitleInfos|GetPatchTitleInfos]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only commands accessible with this service are listed under this section.&lt;br /&gt;
&lt;br /&gt;
= Application Manager service &amp;quot;am:sys&amp;quot; =&lt;br /&gt;
This service only has access to the 0x00XX* commands listed above, and the &amp;quot;am:app&amp;quot; commands.&lt;br /&gt;
&lt;br /&gt;
= Application Manager service &amp;quot;am:u&amp;quot; =&lt;br /&gt;
&lt;br /&gt;
= Application Manager network service &amp;quot;am:net&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;
| 0x08010000&lt;br /&gt;
| [[AMNet:BeginImportTicket|BeginImportTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020002&lt;br /&gt;
| [[AMNet:CancelImportTicket|CancelImportTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030002&lt;br /&gt;
| [[AMNet:EndImportTicket|EndImportTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040100&lt;br /&gt;
| [[AMNet:BeginImportTitle|BeginImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050000&lt;br /&gt;
| [[AMNet:StopImportTitle|StopImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080600C0&lt;br /&gt;
| [[AMNet:ResumeImportTitle|ResumeImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070000&lt;br /&gt;
| [[AMNet:CancelImportTitle|CancelImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[AMNet:EndImportTitle|EndImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080900C2&lt;br /&gt;
| [[AMNet:CommitImportTitles|CommitImportTitles]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0000&lt;br /&gt;
| [[AMNet:BeginImportTmd|BeginImportTmd]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0002&lt;br /&gt;
| [[AMNet:CancelImportTmd|CancelImportTmd]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0042&lt;br /&gt;
| [[AMNet:EndImportTmd|EndImportTmd]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0042&lt;br /&gt;
| [[AMNet:CreateImportContentContexts|CreateImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0040&lt;br /&gt;
| [[AMNet:BeginImportContent|BeginImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0002&lt;br /&gt;
| [[AMNet:StopImportContent|StopImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100040&lt;br /&gt;
| [[AMNet:ResumeImportContent|ResumeImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110002&lt;br /&gt;
| [[AMNet:CancelImportContent|CancelImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120002&lt;br /&gt;
| [[AMNet:EndImportContent|EndImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
| [[AMNet:GetNumCurrentImportContentContexts|GetNumCurrentImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140042&lt;br /&gt;
| [[AMNet:GetCurrentImportContentContextList|GetCurrentImportContentContextList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150044&lt;br /&gt;
| [[AMNet:GetCurrentImportContentContexts|GetCurrentImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160146&lt;br /&gt;
| [[AMNet:Sign|Sign]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170146&lt;br /&gt;
| [[AMNet:Verify|Verify]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180042&lt;br /&gt;
| [[AMNet:GetDeviceCert|GetDeviceCert]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190108&lt;br /&gt;
| [[AMNet:ImportCertificates|ImportCertificates]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
| [[AMNet:ImportCertificate|ImportCertificate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B00C2&lt;br /&gt;
| [[AMNet:CommitImportTitlesAndUpdateFirmwareAuto|CommitImportTitlesAndUpdateFirmwareAuto]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0100&lt;br /&gt;
| [[AMNet:DeleteTicketId|DeleteTicketId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0080&lt;br /&gt;
| [[AMNet:GetNumTicketIds|GetNumTicketIds]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0102&lt;br /&gt;
| [[AMNet:GetTicketIdList|GetTicketIdList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0080&lt;br /&gt;
| [[AMNet:GetNumTicketsOfProgram|GetNumTicketsOfProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200102&lt;br /&gt;
| [[AMNet:ListTicketInfos|ListTicketInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210142&lt;br /&gt;
| [[AMNet:GetRightsOnlyTicketData|GetRightsOnlyTicketData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
| [[AMNet:GetNumCurrentContentInfos|GetNumCurrentContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230044&lt;br /&gt;
| [[AMNet:FindCurrentContentInfos|FindCurrentContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240082&lt;br /&gt;
| [[AMNet:ListCurrentContentInfos|ListCurrentContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250102&lt;br /&gt;
| [[AMNet:CalculateContextRequiredSize|CalculateContextRequiredSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260042&lt;br /&gt;
| [[AMNet:UpdateImportContentContexts|UpdateImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270000&lt;br /&gt;
| [[AMNet:DeleteAllDemoLaunchInfos|DeleteAllDemoLaunchInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C0&lt;br /&gt;
| [[AMNet:BeginImportTitleForOverWrite|BeginImportTitleForOverWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290184&lt;br /&gt;
| [[AMNet:ExportTicketWrapped|ExportTicketWrapped]]&lt;br /&gt;
|}&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;
!  Available since system-version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| &lt;br /&gt;
| Stubbed. After validating the translate-paramater headers, this just returns error 0xE0C046F8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0401....&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070000&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0000&lt;br /&gt;
| &lt;br /&gt;
| This just returns 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| &lt;br /&gt;
| This just returns 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| &lt;br /&gt;
| This just returns 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is similar to [[Filesystem_services#File_service|FSFile]].&lt;br /&gt;
&lt;br /&gt;
For handling each command that&#039;s actually implemented, the AM cmdhandler function calls a vtable funcptr.&lt;br /&gt;
&lt;br /&gt;
The private port for this seems to be referred to as &amp;quot;am:pipe&amp;quot;, even though the &amp;quot;am:pipe&amp;quot; string isn&#039;t actually used.&lt;br /&gt;
&lt;br /&gt;
=Types=&lt;br /&gt;
==TicketInfo==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TitleInfo==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ContentInfo==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Index&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Bit 0: Downloaded, Bit 1: Owned&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ImportTitleContext==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x2&lt;br /&gt;
| State&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===ImportTitleContextState===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for import&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Resumable&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Waiting for commit&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Already exists&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Deleting&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Needs cleanup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ImportContentContext==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Index&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current Install Offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Application_Manager_Services_PXI|this]].&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Application_Manager_Services_PXI&amp;diff=20782</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=20782"/>
		<updated>2018-07-31T19:17:54Z</updated>

		<summary type="html">&lt;p&gt;Riley: add ExportTicketWrapped&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Application Manager Services PXI &amp;quot;pxi:am9&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;
| 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;
| [[AMPXI:GetTitleExtDataId|GetTitleExtDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeletePendingTitles|DeletePendingTitles]]&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;
| [[AMPXI:InstallTikBegin|InstallTikBegin]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTikWrite|InstallTikWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTikAbort|InstallTikAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTikFinish|InstallTikFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeleteTicket|DeleteTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTicketCount|GetTicketCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTicketList|GetTicketList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100100&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleBegin|InstallTitleBegin]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleAbort|InstallTitleAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001200C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleResume|InstallTitleResume]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTmdBegin|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;
| [[AMPXI:InstallTmdAbort|InstallTmdAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTmdFinish|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;
| [[AMPXI:InstallContentAbort|InstallContentAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallContentAbortDSi (?)&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;
| 0x001D0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetPendingTitleCount|GetPendingTitleCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E00C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetPendingTitleList|GetPendingTitleList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0084&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetPendingTitleInfo|GetPendingTitleInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002000C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeletePendingTitle|DeletePendingTitle]]&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;
| InstallTitleAbortDSi (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleFinish|InstallTitleFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A00C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitlesFinish|InstallTitlesFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0030....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0031....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0032....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0033....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0034....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0035....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0036....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0037....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0038....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&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;
| Stubbed.&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;
| [[AMPXI:GetDeviceID|GetDeviceID]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0108&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:SetCertificates|SetCertificates]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:SetCertificate|SetCertificate]]&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;
| [[AMPXI:DoCleanup|DoCleanup]]&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;
| [[AMPXI:InstallTitlesFinishFIRM|InstallTitlesFinishFIRM]]&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;
| [[AMPXI:InitializeTitleDatabase|InitializeTitleDatabase]]&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;
| InstallTitleBeginDSi (?) (unknown_u64, u8_optype) The optype must be 5 or 11, but it&#039;s not used after validating it. Disabling using this in AM-sysmodule breaks DSiWare-importing. This is used right before [[AMPXI:InstallTmdBegin|InstallTmdBegin]] in AM-sysmodule.&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;
| [[AMPXI:GetTWLPartitionInfo|GetTWLPartitionInfo]]&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;
| [[AMPXI:InstallTitleSetContentIndices|InstallTitleSetContentIndices]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005800C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:GetNumContentInfos|GetNumContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00590104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:FindContentInfos|FindContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005A0142&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:ListContentInfos|ListContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005B0000&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;
| [[AMPXI:DeleteContents|DeleteContents]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005F0080&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;
| [[AMPXI:ListDataTitleTicketInfos|ListDataTitleTicketInfos]]&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;
| 0x006400C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x006500C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:MigrateAGBtoSAV|MigrateAGBtoSAV]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0066....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| Stubbed starting with [[4.0.0-7]].&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;
| 0x006900C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:IsDataTitleInUse|IsDataTitleInUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x006A00C0&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;
| 0x006C00C0&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| (u8 [[Mediatypes|Mediatype]], u64 programID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x006D0184&lt;br /&gt;
| [[11.8.0-41]]&lt;br /&gt;
| [[AMPXI:ExportTicketWrapped|ExportTicketWrapped]]&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;
| Wrong installation state.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08020&lt;br /&gt;
| CIA file is empty.&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. Returned when a CIA header is invalid.&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(?) / the specified title(s) don&#039;t exist.&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>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMNet:ExportTicketWrapped&amp;diff=20781</id>
		<title>AMNet:ExportTicketWrapped</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMNet:ExportTicketWrapped&amp;diff=20781"/>
		<updated>2018-07-31T19:17:18Z</updated>

		<summary type="html">&lt;p&gt;Riley: document new amnet command&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 [0x08290184]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| u64, Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| u64, Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| (CryptedTicketBufferLength &amp;lt;&amp;lt; 8) | 0x4&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Crypted ticket buffer output pointer&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| (32 &amp;lt;&amp;lt; 8) | 0x14&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Wrapped AES key/IV buffer (size 256)&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 [0x082900C1]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Output wrapped AES key/IV length (should be 256)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
Wrapper for [[AMPXI:ExportTicketWrapped]].&lt;br /&gt;
&lt;br /&gt;
Before calling the AMPXI command, checks the input titleID-high, if it&#039;s 0x00048001 (TWL system), 0x00040001 (dlplay child),  or has category flag system (bit 4 set), then returns 0xE0E0803C.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20780</id>
		<title>11.8.0-41</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20780"/>
		<updated>2018-07-31T17:29:50Z</updated>

		<summary type="html">&lt;p&gt;Riley: document where exportticketwrapped is used&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Old3DS+New3DS 11.8.0-41 system update was released on July 30, 2018. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN.&lt;br /&gt;
&lt;br /&gt;
Security flaws fixed: &amp;lt;fill this in manually later, see the updatedetails page from the ninupdates-report page(s) once available for now&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Change-log==&lt;br /&gt;
[https://en-americas-support.nintendo.com/app/answers/detail/a_id/667/p/430/c/267 Official] USA change-log:&lt;br /&gt;
* Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience&lt;br /&gt;
&lt;br /&gt;
==System Titles==&lt;br /&gt;
&amp;lt;fill this in (manually) later&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
Actual code changed in Process9.&lt;br /&gt;
&lt;br /&gt;
pxi:am9 command 0x6d0184 was added: [[AMPXI:ExportTicketWrapped]]&lt;br /&gt;
&lt;br /&gt;
=== AM ===&lt;br /&gt;
New am:net command 0x8290184 was added, this just calls the new pxi:am9 command. This is used by nim.&lt;br /&gt;
&lt;br /&gt;
=== Friends ===&lt;br /&gt;
fpdver version string bumped to 0xC&lt;br /&gt;
&lt;br /&gt;
=== nim ===&lt;br /&gt;
Added 2 new strings in the codebin: &amp;quot;X-Authentication-Key&amp;quot; and &amp;quot;X-Authentication-Data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now uses new am:net command 0x8290184 during code related to downloading contents(?) (function at 0x143B9C; its caller at 0x123ABC uses amnet:Begin/ResumeImportContent)&lt;br /&gt;
&lt;br /&gt;
If ExportTicketWrapped succeeded, then the new http headers are passed: &amp;quot;X-Authentication-Key&amp;quot; set to base64(wrapped_aes_key) and &amp;quot;X-Authentication-Data&amp;quot; set to base64(crypted_ticket).&lt;br /&gt;
&lt;br /&gt;
This (when activated server-side) would prevent downloading crypted contents entirely without a valid ticket.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
System update report(s):&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-36&amp;amp;sys=ctr]&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-40&amp;amp;sys=ktr]&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20779</id>
		<title>11.8.0-41</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20779"/>
		<updated>2018-07-31T16:23:11Z</updated>

		<summary type="html">&lt;p&gt;Riley: document new ampxi command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Old3DS+New3DS 11.8.0-41 system update was released on July 30, 2018. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN.&lt;br /&gt;
&lt;br /&gt;
Security flaws fixed: &amp;lt;fill this in manually later, see the updatedetails page from the ninupdates-report page(s) once available for now&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Change-log==&lt;br /&gt;
[https://en-americas-support.nintendo.com/app/answers/detail/a_id/667/p/430/c/267 Official] USA change-log:&lt;br /&gt;
* Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience&lt;br /&gt;
&lt;br /&gt;
==System Titles==&lt;br /&gt;
&amp;lt;fill this in (manually) later&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
Actual code changed in Process9.&lt;br /&gt;
&lt;br /&gt;
pxi:am9 command 0x6d0184 was added: [[AMPXI:ExportTicketWrapped]]&lt;br /&gt;
&lt;br /&gt;
=== AM ===&lt;br /&gt;
New am:net command 0x8290184 was added, this just calls the new pxi:am9 command. This is used by nim.&lt;br /&gt;
&lt;br /&gt;
=== Friends ===&lt;br /&gt;
fpdver version string bumped to 0xC&lt;br /&gt;
&lt;br /&gt;
=== nim ===&lt;br /&gt;
Added 2 new strings in the codebin: &amp;quot;X-Authentication-Key&amp;quot; and &amp;quot;X-Authentication-Data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now uses new am:net command 0x8290184.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
System update report(s):&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-36&amp;amp;sys=ctr]&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-40&amp;amp;sys=ktr]&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20778</id>
		<title>AMPXI:ExportTicketWrapped</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20778"/>
		<updated>2018-07-31T16:22:20Z</updated>

		<summary type="html">&lt;p&gt;Riley: ...really fix header code&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 [0x006D0184]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| u64, Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| u64, Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| (CryptedTicketBufferLength &amp;lt;&amp;lt; 8) | 0x4&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Crypted ticket buffer output pointer&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| (32 &amp;lt;&amp;lt; 8) | 0x14&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Wrapped AES key/IV buffer (size 256)&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 [0x006D00C1]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Output wrapped AES key/IV length (should be 256)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This function gets a 32 byte buffer using the internal P9 PRNG function; first 16 bytes is used as AES-CBC key and last 16 bytes is used as IV.&lt;br /&gt;
&lt;br /&gt;
Next, it searches through tickets looking for one with provided ticketID, returns &amp;lt;tt&amp;gt;0xD8808040&amp;lt;/tt&amp;gt; if not found;&lt;br /&gt;
&lt;br /&gt;
Next, it reads the ticket, 0x8000 bytes at a time, into a 0x8000-byte stack buffer, after each read that buffer is crypted using that randomly generated key/IV, then written into the first output buffer;&lt;br /&gt;
&lt;br /&gt;
Finally, it encrypts the AES key/IV with RSA-2048 PKCS1; using a new public key stored in P9 .rodata; and writes the crypted output into the second output buffer.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20777</id>
		<title>AMPXI:ExportTicketWrapped</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20777"/>
		<updated>2018-07-31T16:22:02Z</updated>

		<summary type="html">&lt;p&gt;Riley: oops, fix header code&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 [0x006D184]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| u64, Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| u64, Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| (CryptedTicketBufferLength &amp;lt;&amp;lt; 8) | 0x4&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Crypted ticket buffer output pointer&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| (32 &amp;lt;&amp;lt; 8) | 0x14&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Wrapped AES key/IV buffer (size 256)&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 [0x006D00C1]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Output wrapped AES key/IV length (should be 256)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This function gets a 32 byte buffer using the internal P9 PRNG function; first 16 bytes is used as AES-CBC key and last 16 bytes is used as IV.&lt;br /&gt;
&lt;br /&gt;
Next, it searches through tickets looking for one with provided ticketID, returns &amp;lt;tt&amp;gt;0xD8808040&amp;lt;/tt&amp;gt; if not found;&lt;br /&gt;
&lt;br /&gt;
Next, it reads the ticket, 0x8000 bytes at a time, into a 0x8000-byte stack buffer, after each read that buffer is crypted using that randomly generated key/IV, then written into the first output buffer;&lt;br /&gt;
&lt;br /&gt;
Finally, it encrypts the AES key/IV with RSA-2048 PKCS1; using a new public key stored in P9 .rodata; and writes the crypted output into the second output buffer.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20776</id>
		<title>AMPXI:ExportTicketWrapped</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMPXI:ExportTicketWrapped&amp;diff=20776"/>
		<updated>2018-07-31T16:21:28Z</updated>

		<summary type="html">&lt;p&gt;Riley: document new ampxi command&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 [0x006900C0]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| u64, Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| u64, Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| (CryptedTicketBufferLength &amp;lt;&amp;lt; 8) | 0x4&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Crypted ticket buffer output pointer&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| (32 &amp;lt;&amp;lt; 8) | 0x14&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Wrapped AES key/IV buffer (size 256)&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 [0x006D00C1]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output crypted ticket buffer length&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Output wrapped AES key/IV length (should be 256)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This function gets a 32 byte buffer using the internal P9 PRNG function; first 16 bytes is used as AES-CBC key and last 16 bytes is used as IV.&lt;br /&gt;
&lt;br /&gt;
Next, it searches through tickets looking for one with provided ticketID, returns &amp;lt;tt&amp;gt;0xD8808040&amp;lt;/tt&amp;gt; if not found;&lt;br /&gt;
&lt;br /&gt;
Next, it reads the ticket, 0x8000 bytes at a time, into a 0x8000-byte stack buffer, after each read that buffer is crypted using that randomly generated key/IV, then written into the first output buffer;&lt;br /&gt;
&lt;br /&gt;
Finally, it encrypts the AES key/IV with RSA-2048 PKCS1; using a new public key stored in P9 .rodata; and writes the crypted output into the second output buffer.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Application_Manager_Services&amp;diff=20774</id>
		<title>Application Manager Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Application_Manager_Services&amp;diff=20774"/>
		<updated>2018-07-31T13:28:40Z</updated>

		<summary type="html">&lt;p&gt;Riley: /* Application Manager network service &amp;quot;am:net&amp;quot; */ add new cmd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
&lt;br /&gt;
= Application Manager services &amp;quot;am:sys&amp;quot;, &amp;quot;am:u&amp;quot;, &amp;quot;am:net&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;
| 0x00010040&lt;br /&gt;
| [[AM:GetNumPrograms|GetNumPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020082&lt;br /&gt;
| [[AM:GetProgramList|GetProgramList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030084&lt;br /&gt;
| [[AM:GetProgramInfos|GetProgramInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000400C0&lt;br /&gt;
| [[AM:DeleteUserProgram|DeleteUserProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000500C0&lt;br /&gt;
| [[AM:GetProductCode|GetProductCode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000600C0&lt;br /&gt;
| [[AM:GetStorageId|GetStorageId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070080&lt;br /&gt;
| [[AM:DeleteTicket|DeleteTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| [[AM:GetNumTickets|GetNumTickets]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090082&lt;br /&gt;
| [[AM:GetTicketList|GetTicketList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| [[AM:GetDeviceId|GetDeviceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[AM:GetNumImportTitleContexts|GetNumImportTitleContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0082&lt;br /&gt;
| [[AM:GetImportTitleContextList|GetImportTitleContextList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0084&lt;br /&gt;
| [[AM:GetImportTitleContexts|GetImportTitleContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E00C0&lt;br /&gt;
| [[AM:DeleteImportTitleContext|DeleteImportTitleContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00C0&lt;br /&gt;
| [[AM:GetNumImportContentContexts|GetNumImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100102&lt;br /&gt;
| [[AM:GetImportContentContextList|GetImportContentContextList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110104&lt;br /&gt;
| [[AM:GetImportContentContexts|GetImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120102&lt;br /&gt;
| [[AM:DeleteImportContentContexts|DeleteImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130040&lt;br /&gt;
| [[AM:NeedsCleanup|NeedsCleanup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140040&lt;br /&gt;
| [[AM:DoCleanup|DoCleanup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150040&lt;br /&gt;
| [[AM:DeleteAllImportContexts|DeleteAllImportContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160000&lt;br /&gt;
| [[AM:DeleteAllTemporaryPrograms|DeleteAllTemporaryPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170044&lt;br /&gt;
| [[AM:ImportTwlBackupLegacy|ImportTwlBackupLegacy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180080&lt;br /&gt;
| [[AM:InitializeTitleDatabase|InitializeTitleDatabase]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190040&lt;br /&gt;
| [[AM:QueryAvailableTitleDatabase|QueryAvailableTitleDatabase]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A00C0&lt;br /&gt;
| [[AM:CalcTwlBackupSize|CalcTwlBackupSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B0144&lt;br /&gt;
| [[AM:ExportTwlBackup|ExportTwlBackup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0084&lt;br /&gt;
| [[AM:ImportTwlBackup|ImportTwlBackup]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0000&lt;br /&gt;
| [[AM:DeleteAllTwlUserPrograms|DeleteAllTwlUserPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E00C8&lt;br /&gt;
| [[AM:ReadTwlBackupInfo|ReadTwlBackupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0040&lt;br /&gt;
| [[AM:DeleteAllExpiredUserPrograms|DeleteAllExpiredUserPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200000&lt;br /&gt;
| [[AM:GetTwlArchiveResourceInfo|GetTwlArchiveResourceInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00210042&lt;br /&gt;
| [[AM:GetPersonalizedTicketInfoList|GetPersonalizedTicketInfoList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220080&lt;br /&gt;
| [[AM:DeleteAllImportContextsFiltered|DeleteAllImportContextsFiltered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00230080&lt;br /&gt;
| [[AM:GetNumImportTitleContextsFiltered|GetNumImportTitleContextsFiltered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002400C2&lt;br /&gt;
| [[AM:GetImportTitleContextListFiltered|GetImportTitleContextListFiltered]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002500C0&lt;br /&gt;
| [[AM:CheckContentRights|CheckContentRights]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260044&lt;br /&gt;
| [[AM:GetTicketLimitInfos|GetTicketLimitInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00270044&lt;br /&gt;
| [[AM:GetDemoLaunchInfos|GetDemoLaunchInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280108&lt;br /&gt;
| [[AM:ReadTwlBackupInfoEx|ReadTwlBackupInfoEx]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290082&lt;br /&gt;
| [[AM:DeleteUserProgramsAtomically|DeleteUserProgramsAtomically]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A00C0&lt;br /&gt;
| [[AM:GetNumExistingContentInfosSystem|GetNumExistingContentInfosSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0142&lt;br /&gt;
| [[AM:ListExistingContentInfosSystem|ListExistingContentInfosSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0084&lt;br /&gt;
| [[AM:GetProgramInfosIgnorePlatform|GetProgramInfosIgnorePlatform]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D00C0&lt;br /&gt;
| [[AM:CheckContentRightsIgnorePlatform|CheckContentRightsIgnorePlatform]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Application Manager services &amp;quot;am:u&amp;quot; and &amp;quot;am:net&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;
| 0x04010080&lt;br /&gt;
| [[AM:UpdateFirmwareTo|UpdateFirmwareTo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020040&lt;br /&gt;
| [[AM:BeginImportProgram|BeginImportProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04030000&lt;br /&gt;
| [[AM:BeginImportProgramTemporarily|BeginImportProgramTemporarily]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040002&lt;br /&gt;
| [[AM:CancelImportProgram|CancelImportProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050002&lt;br /&gt;
| [[AM:EndImportProgram|EndImportProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060002&lt;br /&gt;
| [[AM:EndImportProgramWithoutCommit|EndImportProgramWithoutCommit]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040700C2&lt;br /&gt;
| [[AM:CommitImportPrograms|CommitImportPrograms]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04080042&lt;br /&gt;
| [[AM:GetProgramInfoFromCia|GetProgramInfoFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04090004&lt;br /&gt;
| [[AM:GetSystemMenuDataFromCia|GetSystemMenuDataFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040A0002&lt;br /&gt;
| [[AM:GetDependencyListFromCia|GetDependencyListFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040B0002&lt;br /&gt;
| [[AM:GetTransferSizeFromCia|GetTransferSizeFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040C0002&lt;br /&gt;
| [[AM:GetCoreVersionFromCia|GetCoreVersionFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040D0042&lt;br /&gt;
| [[AM:GetRequiredSizeFromCia|GetRequiredSizeFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040E00C2&lt;br /&gt;
| [[AM:CommitImportProgramsAndUpdateFirmwareAuto|CommitImportProgramsAndUpdateFirmwareAuto]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x040F0000&lt;br /&gt;
| [[AM:UpdateFirmwareAuto|UpdateFirmwareAuto]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041000C0&lt;br /&gt;
| [[AM:DeleteProgram|DeleteProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04110044&lt;br /&gt;
| [[AM:GetTwlProgramListForReboot|GetTwlProgramListForReboot]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04120000&lt;br /&gt;
| [[AM:GetSystemUpdaterMutex|GetSystemUpdaterMutex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04130002&lt;br /&gt;
| [[AM:GetMetaSizeFromCia|GetMetaSizeFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04140044&lt;br /&gt;
| [[AM:GetMetaDataFromCia|GetMetaDataFromCia]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04150080&lt;br /&gt;
| [[AM:CheckDemoLaunchRights|CheckDemoLaunchRights]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041600C0&lt;br /&gt;
| [[AM:GetInternalTitleLocationInfo|GetInternalTitleLocationInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x041700C0&lt;br /&gt;
| [[AM:PerpetuateAgbSaveData|PerpetuateAgbSaveData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04180040&lt;br /&gt;
| [[AM:BeginImportProgramForOverWrite|BeginImportProgramForOverWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x04190000&lt;br /&gt;
| [[AM:BeginImportSystemProgram|BeginImportSystemProgram]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Application Manager service &amp;quot;am:app&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;
| 0x100100C0&lt;br /&gt;
| [[AM:GetDLCContentInfoCount|GetDLCContentInfoCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10020104&lt;br /&gt;
| [[AM:FindDLCContentInfos|FindDLCContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10030142&lt;br /&gt;
| [[AM:ListDLCContentInfos|ListDLCContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10040102&lt;br /&gt;
| [[AM:DeleteContents|DeleteContents]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10050084&lt;br /&gt;
| [[AM:GetDLCTitleInfos|GetDLCTitleInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10060080&lt;br /&gt;
| [[AM:GetNumDataTitleTickets|GetNumDataTitleTickets]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10070102&lt;br /&gt;
| [[AM:ListDataTitleTicketInfos|ListDataTitleTicketInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100801C2&lt;br /&gt;
| [[AM:GetItemRights|GetItemRights]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100900C0&lt;br /&gt;
| [[AM:IsDataTitleInUse|IsDataTitleInUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100A0000&lt;br /&gt;
| [[AM:IsExternalTitleDatabaseInitialized|IsExternalTitleDatabaseInitialized]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100B00C0&lt;br /&gt;
| [[AM:GetNumExistingContentInfos|GetNumExistingContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100C0142&lt;br /&gt;
| [[AM:ListExistingContentInfos|ListExistingContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x100D0084&lt;br /&gt;
| [[AM:GetPatchTitleInfos|GetPatchTitleInfos]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only commands accessible with this service are listed under this section.&lt;br /&gt;
&lt;br /&gt;
= Application Manager service &amp;quot;am:sys&amp;quot; =&lt;br /&gt;
This service only has access to the 0x00XX* commands listed above, and the &amp;quot;am:app&amp;quot; commands.&lt;br /&gt;
&lt;br /&gt;
= Application Manager service &amp;quot;am:u&amp;quot; =&lt;br /&gt;
&lt;br /&gt;
= Application Manager network service &amp;quot;am:net&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;
| 0x08010000&lt;br /&gt;
| [[AMNet:BeginImportTicket|BeginImportTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020002&lt;br /&gt;
| [[AMNet:CancelImportTicket|CancelImportTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030002&lt;br /&gt;
| [[AMNet:EndImportTicket|EndImportTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040100&lt;br /&gt;
| [[AMNet:BeginImportTitle|BeginImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050000&lt;br /&gt;
| [[AMNet:StopImportTitle|StopImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080600C0&lt;br /&gt;
| [[AMNet:ResumeImportTitle|ResumeImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070000&lt;br /&gt;
| [[AMNet:CancelImportTitle|CancelImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| [[AMNet:EndImportTitle|EndImportTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080900C2&lt;br /&gt;
| [[AMNet:CommitImportTitles|CommitImportTitles]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0000&lt;br /&gt;
| [[AMNet:BeginImportTmd|BeginImportTmd]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0002&lt;br /&gt;
| [[AMNet:CancelImportTmd|CancelImportTmd]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0042&lt;br /&gt;
| [[AMNet:EndImportTmd|EndImportTmd]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0042&lt;br /&gt;
| [[AMNet:CreateImportContentContexts|CreateImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0040&lt;br /&gt;
| [[AMNet:BeginImportContent|BeginImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0002&lt;br /&gt;
| [[AMNet:StopImportContent|StopImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100040&lt;br /&gt;
| [[AMNet:ResumeImportContent|ResumeImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110002&lt;br /&gt;
| [[AMNet:CancelImportContent|CancelImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120002&lt;br /&gt;
| [[AMNet:EndImportContent|EndImportContent]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
| [[AMNet:GetNumCurrentImportContentContexts|GetNumCurrentImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140042&lt;br /&gt;
| [[AMNet:GetCurrentImportContentContextList|GetCurrentImportContentContextList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08150044&lt;br /&gt;
| [[AMNet:GetCurrentImportContentContexts|GetCurrentImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08160146&lt;br /&gt;
| [[AMNet:Sign|Sign]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08170146&lt;br /&gt;
| [[AMNet:Verify|Verify]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08180042&lt;br /&gt;
| [[AMNet:GetDeviceCert|GetDeviceCert]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08190108&lt;br /&gt;
| [[AMNet:ImportCertificates|ImportCertificates]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081A0042&lt;br /&gt;
| [[AMNet:ImportCertificate|ImportCertificate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081B00C2&lt;br /&gt;
| [[AMNet:CommitImportTitlesAndUpdateFirmwareAuto|CommitImportTitlesAndUpdateFirmwareAuto]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081C0100&lt;br /&gt;
| [[AMNet:DeleteTicketId|DeleteTicketId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081D0080&lt;br /&gt;
| [[AMNet:GetNumTicketIds|GetNumTicketIds]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081E0102&lt;br /&gt;
| [[AMNet:GetTicketIdList|GetTicketIdList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x081F0080&lt;br /&gt;
| [[AMNet:GetNumTicketsOfProgram|GetNumTicketsOfProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08200102&lt;br /&gt;
| [[AMNet:ListTicketInfos|ListTicketInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08210142&lt;br /&gt;
| [[AMNet:GetRightsOnlyTicketData|GetRightsOnlyTicketData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08220000&lt;br /&gt;
| [[AMNet:GetNumCurrentContentInfos|GetNumCurrentContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08230044&lt;br /&gt;
| [[AMNet:FindCurrentContentInfos|FindCurrentContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08240082&lt;br /&gt;
| [[AMNet:ListCurrentContentInfos|ListCurrentContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08250102&lt;br /&gt;
| [[AMNet:CalculateContextRequiredSize|CalculateContextRequiredSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08260042&lt;br /&gt;
| [[AMNet:UpdateImportContentContexts|UpdateImportContentContexts]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08270000&lt;br /&gt;
| [[AMNet:DeleteAllDemoLaunchInfos|DeleteAllDemoLaunchInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x082800C0&lt;br /&gt;
| [[AMNet:BeginImportTitleForOverWrite|BeginImportTitleForOverWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08290184&lt;br /&gt;
| ?&lt;br /&gt;
|}&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;
!  Available since system-version&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| &lt;br /&gt;
| Stubbed. After validating the translate-paramater headers, this just returns error 0xE0C046F8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0401....&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010100&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x080200C2&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:Read|Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030102&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:Write|Write]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040000&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:GetSize|GetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050080&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:SetSize|SetSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08060000&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070000&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| &lt;br /&gt;
| [[AMFile:Close|Close]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0000&lt;br /&gt;
| &lt;br /&gt;
| This just returns 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0000&lt;br /&gt;
| &lt;br /&gt;
| This just returns 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0000&lt;br /&gt;
| &lt;br /&gt;
| This just returns 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is similar to [[Filesystem_services#File_service|FSFile]].&lt;br /&gt;
&lt;br /&gt;
For handling each command that&#039;s actually implemented, the AM cmdhandler function calls a vtable funcptr.&lt;br /&gt;
&lt;br /&gt;
The private port for this seems to be referred to as &amp;quot;am:pipe&amp;quot;, even though the &amp;quot;am:pipe&amp;quot; string isn&#039;t actually used.&lt;br /&gt;
&lt;br /&gt;
=Types=&lt;br /&gt;
==TicketInfo==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Ticket ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TitleInfo==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ContentInfo==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Index&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Bit 0: Downloaded, Bit 1: Owned&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ImportTitleContext==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x2&lt;br /&gt;
| State&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===ImportTitleContextState===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Waiting for import&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Resumable&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Waiting for commit&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Already exists&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Deleting&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Needs cleanup&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==ImportContentContext==&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;
!  Length&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Content ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Index&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| Type&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current Install Offset&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Errors=&lt;br /&gt;
See [[Application_Manager_Services_PXI|this]].&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Application_Manager_Services_PXI&amp;diff=20773</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=20773"/>
		<updated>2018-07-31T13:27:17Z</updated>

		<summary type="html">&lt;p&gt;Riley: add new cmd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Application Manager Services PXI &amp;quot;pxi:am9&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;
| 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;
| [[AMPXI:GetTitleExtDataId|GetTitleExtDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeletePendingTitles|DeletePendingTitles]]&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;
| [[AMPXI:InstallTikBegin|InstallTikBegin]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTikWrite|InstallTikWrite]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTikAbort|InstallTikAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTikFinish|InstallTikFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeleteTicket|DeleteTicket]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTicketCount|GetTicketCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0082&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetTicketList|GetTicketList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100100&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleBegin|InstallTitleBegin]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00110000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleAbort|InstallTitleAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001200C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleResume|InstallTitleResume]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTmdBegin|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;
| [[AMPXI:InstallTmdAbort|InstallTmdAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTmdFinish|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;
| [[AMPXI:InstallContentAbort|InstallContentAbort]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| InstallContentAbortDSi (?)&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;
| 0x001D0080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetPendingTitleCount|GetPendingTitleCount]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E00C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetPendingTitleList|GetPendingTitleList]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0084&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:GetPendingTitleInfo|GetPendingTitleInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002000C0&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:DeletePendingTitle|DeletePendingTitle]]&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;
| InstallTitleAbortDSi (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290000&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitleFinish|InstallTitleFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A00C2&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:InstallTitlesFinish|InstallTitlesFinish]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0030....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0031....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0032....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0033....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0034....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0035....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0036....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0037....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0038....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Stubbed.&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;
| Stubbed.&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;
| [[AMPXI:GetDeviceID|GetDeviceID]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0108&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:SetCertificates|SetCertificates]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E0042&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| [[AMPXI:SetCertificate|SetCertificate]]&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;
| [[AMPXI:DoCleanup|DoCleanup]]&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;
| [[AMPXI:InstallTitlesFinishFIRM|InstallTitlesFinishFIRM]]&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;
| [[AMPXI:InitializeTitleDatabase|InitializeTitleDatabase]]&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;
| InstallTitleBeginDSi (?) (unknown_u64, u8_optype) The optype must be 5 or 11, but it&#039;s not used after validating it. Disabling using this in AM-sysmodule breaks DSiWare-importing. This is used right before [[AMPXI:InstallTmdBegin|InstallTmdBegin]] in AM-sysmodule.&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;
| [[AMPXI:GetTWLPartitionInfo|GetTWLPartitionInfo]]&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;
| [[AMPXI:InstallTitleSetContentIndices|InstallTitleSetContentIndices]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005800C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:GetNumContentInfos|GetNumContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00590104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:FindContentInfos|FindContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005A0142&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:ListContentInfos|ListContentInfos]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005B0000&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;
| [[AMPXI:DeleteContents|DeleteContents]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x005F0080&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;
| [[AMPXI:ListDataTitleTicketInfos|ListDataTitleTicketInfos]]&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;
| 0x006400C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x006500C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:MigrateAGBtoSAV|MigrateAGBtoSAV]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x0066....&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| Stubbed starting with [[4.0.0-7]].&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;
| 0x006900C0&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| [[AMPXI:IsDataTitleInUse|IsDataTitleInUse]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x006A00C0&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;
| 0x006C00C0&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
| (u8 [[Mediatypes|Mediatype]], u64 programID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x006D0184&lt;br /&gt;
| [[11.8.0-41]]&lt;br /&gt;
| ?&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;
| Wrong installation state.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD8E08020&lt;br /&gt;
| CIA file is empty.&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. Returned when a CIA header is invalid.&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(?) / the specified title(s) don&#039;t exist.&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>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20772</id>
		<title>11.8.0-41</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20772"/>
		<updated>2018-07-31T10:15:53Z</updated>

		<summary type="html">&lt;p&gt;Riley: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Old3DS+New3DS 11.8.0-41 system update was released on July 30, 2018. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN.&lt;br /&gt;
&lt;br /&gt;
Security flaws fixed: &amp;lt;fill this in manually later, see the updatedetails page from the ninupdates-report page(s) once available for now&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Change-log==&lt;br /&gt;
[https://en-americas-support.nintendo.com/app/answers/detail/a_id/667/p/430/c/267 Official] USA change-log:&lt;br /&gt;
* Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience&lt;br /&gt;
&lt;br /&gt;
==System Titles==&lt;br /&gt;
&amp;lt;fill this in (manually) later&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
Actual code changed in Process9.&lt;br /&gt;
pxi:am9 command 0x6d0184 was added.&lt;br /&gt;
&lt;br /&gt;
=== AM ===&lt;br /&gt;
New am:net command 0x8290184 was added, this just calls the new pxi:am9 command. This is used by nim.&lt;br /&gt;
&lt;br /&gt;
=== Friends ===&lt;br /&gt;
fpdver version string bumped to 0xC&lt;br /&gt;
&lt;br /&gt;
=== nim ===&lt;br /&gt;
Added 2 new strings in the codebin: &amp;quot;X-Authentication-Key&amp;quot; and &amp;quot;X-Authentication-Data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now uses new am:net command 0x8290184.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
System update report(s):&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-36&amp;amp;sys=ctr]&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-40&amp;amp;sys=ktr]&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20771</id>
		<title>11.8.0-41</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=11.8.0-41&amp;diff=20771"/>
		<updated>2018-07-31T10:15:36Z</updated>

		<summary type="html">&lt;p&gt;Riley: new commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Old3DS+New3DS 11.8.0-41 system update was released on July 30, 2018. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN. This Old3DS+New3DS update was released for the following regions: USA, EUR, JPN, CHN, KOR, and TWN.&lt;br /&gt;
&lt;br /&gt;
Security flaws fixed: &amp;lt;fill this in manually later, see the updatedetails page from the ninupdates-report page(s) once available for now&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Change-log==&lt;br /&gt;
[https://en-americas-support.nintendo.com/app/answers/detail/a_id/667/p/430/c/267 Official] USA change-log:&lt;br /&gt;
* Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience&lt;br /&gt;
&lt;br /&gt;
==System Titles==&lt;br /&gt;
&amp;lt;fill this in (manually) later&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Process9 ===&lt;br /&gt;
Actual code changed in Process9.&lt;br /&gt;
pxi:am9 command 0x6d0184 was added.&lt;br /&gt;
&lt;br /&gt;
=== AM ===&lt;br /&gt;
New am:net command 0x8290184 was added, this just calls the new pxi:am9 command. This is used by nim.&lt;br /&gt;
&lt;br /&gt;
=== Friends ===&lt;br /&gt;
fpdver version string bumped to 0xC&lt;br /&gt;
&lt;br /&gt;
=== nim ===&lt;br /&gt;
Added 2 new strings in the codebin: &amp;quot;X-Authentication-Key&amp;quot; and &amp;quot;X-Authentication-Data&amp;quot;.&lt;br /&gt;
Now uses new am:net command 0x8290184.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
System update report(s):&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-36&amp;amp;sys=ctr]&lt;br /&gt;
* [https://yls8.mtheall.com/ninupdates/reports.php?date=07-30-18_08-00-40&amp;amp;sys=ktr]&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20570</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20570"/>
		<updated>2018-01-16T22:32:45Z</updated>

		<summary type="html">&lt;p&gt;Riley: cmd5 correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Shuts down LgyP9, puts ARM9 into a &amp;lt;code&amp;gt;while(1) svcSleepThread(1*1000*1000);&amp;lt;/code&amp;gt; loop at the end of &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title. On success, returns u64 GBA VC title exeFS .code length in cmdbuf[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (u8 unk) Does some lowlevel sd/emmc register setting (different for unk=0 and unk=1). If unk=1, sets a flag, code ran during the pxi main-func loop detects this and calls &amp;lt;code&amp;gt;svcKernelSetState(2,0)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (DateTime datetimetoset,u8 shouldRead) - Sets the P9 date/time (calling the same function used by cmd 0xA for this), then reads (if shouldRead is not 0) or writes (if shouldRead is 0) ARM7_RTC_LO/HI registers to or from agbsave_in_ram+0x60. AgbBg doesn&#039;t appear to use this command at all.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Returns u8, IsSdCardInserted maybe?&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;
| Sets Process9&#039;s internal date/time, see below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;br /&gt;
&lt;br /&gt;
=Command 0xA=&lt;br /&gt;
This takes 3 arguments, which are the following structure packed into 12 bytes (no padding):&lt;br /&gt;
 s32 year;&lt;br /&gt;
 s8 month;&lt;br /&gt;
 s8 day;&lt;br /&gt;
 s8 day_of_week; // Sunday = 0, up to Saturday = 6&lt;br /&gt;
 s8 hour;&lt;br /&gt;
 s8 minute;&lt;br /&gt;
 s8 second;&lt;br /&gt;
 s16 ms;&lt;br /&gt;
This should be the current date/time (AgbBg seems to get it from MCU); it&#039;s converted from this structure into milliseconds, and saved into .data. Another .data variable is set from svcGetSystemTick by this command, and another function in (LGY) P9 essentially does &amp;lt;code&amp;gt;return date_time_set_from_this_command + ticks_to_ms(svcGetSystemTick() - systemtick_from_this_command);&amp;lt;/code&amp;gt; to get the current date&amp;amp;time.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=20530</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=20530"/>
		<updated>2017-12-30T01:02:48Z</updated>

		<summary type="html">&lt;p&gt;Riley: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle &amp;lt;code&amp;gt;TWL_FIRM&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AGB_FIRM&amp;lt;/code&amp;gt;&#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 GBA BIOS implemented in hardware. The BIOS is completely identical to the original GBA BIOS. The system is booted silently by calling &amp;lt;code&amp;gt;SWI 0x1&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;RegisterRamReset&amp;lt;/code&amp;gt;), followed by jumping to the code that does &amp;lt;code&amp;gt;SWI 0x0&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;SoftReset&amp;lt;/code&amp;gt;) 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 &amp;lt;code&amp;gt;SWI 0x26&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;HardReset&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Registers==&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Address&lt;br /&gt;
! Name&lt;br /&gt;
! Size (bytes)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u8&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018000&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 &lt;br /&gt;
|-&lt;br /&gt;
| Code&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018080&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_CODE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018100&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_MODE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018104&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_?_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018108&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_CNT?&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018110&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_LO&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018114&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_HI&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018118&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_LO?&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1001811C&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_HI?&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;arm7_save_cfg_t&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018120&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_CFG&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16&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 = GBA.&lt;br /&gt;
&lt;br /&gt;
===ARM7_CODE===&lt;br /&gt;
This is the first code that will be run after execution begins. &amp;lt;code&amp;gt;TwlProcess9&amp;lt;/code&amp;gt; uses this to put ARM7 in a loop (TWL), and to set the &amp;lt;code&amp;gt;POSTFLG&amp;lt;/code&amp;gt; and branch to more copied code (GBA). This doesn&#039;t seem to start execution by itself.&lt;br /&gt;
&lt;br /&gt;
Reading uninitialized data in this 32-byte region leads to both screens displaying solid green (exception), and the CPU locking up.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_MODE===&lt;br /&gt;
This tells the save storage emulation hardware which device type to emulate (64k EEPROM, a 512k Flash chip model, and SRAM are all that have been used officially; several other 512k Flash chip models, two 1 Mbit Flash chip models and 8k EEPROM are also supported). This comes directly from the [[3DS_Virtual_Console#Footer|ROM footer]].&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC_VAL===&lt;br /&gt;
These registers are set to the current LgyP9 date+time before ARM7_RTC_CNT/ARM7_RTC_? registers are used.&lt;br /&gt;
They contain the following structure, set up on the stack then both u32 registers are written one after the other:&lt;br /&gt;
&lt;br /&gt;
 s8 year_since_2000_bcd;&lt;br /&gt;
 s8 month_bcd;&lt;br /&gt;
 s8 day_bcd;&lt;br /&gt;
 s8 day_of_week;&lt;br /&gt;
 s8 hour_bcd;&lt;br /&gt;
 s8 minute_bcd;&lt;br /&gt;
 s8 second_bcd;&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC &#039;&#039;?&#039;&#039;===&lt;br /&gt;
These registers may be used to control a real-time clock. To set or read the data here, first &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;&#039;s bit 15 is waited on. Next &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; is set to zero. &lt;br /&gt;
&lt;br /&gt;
For a write: the two registers are written, a 1 is written to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, and it is waited on the same as before. Afterwards if bit 14 is not set in &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, the value was set successfully.&lt;br /&gt;
&lt;br /&gt;
For a read: a 2 is written to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, 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 &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; at this point, but &amp;lt;code&amp;gt;AGB_FIRM&amp;lt;/code&amp;gt; does not.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_CFG===&lt;br /&gt;
This is copied from rom footer + &amp;lt;code&amp;gt;0x10&amp;lt;/code&amp;gt;. 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 internal memory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08060000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x03800000&amp;lt;/code&amp;gt;, ARM7 WRAM (64KiB)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x080B0000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x03000000&amp;lt;/code&amp;gt;, GBA IWRAM (32KiB)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08080000&amp;lt;/code&amp;gt; → EEPROM/SRAM/Flash 512k/Flash 1Mbit (the 2 512k banks are contiguous in memory). Appears to be mirrored at &amp;lt;code&amp;gt;0x080C0000&amp;lt;/code&amp;gt;, maybe first mapping is read-only and second is writable? &amp;lt;code&amp;gt;0x10018104&amp;lt;/code&amp;gt; must be set to 1 before reading memory here, and restored to its previous value afterwards&lt;br /&gt;
* &amp;lt;code&amp;gt;0x01FFC000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x01000000&amp;lt;/code&amp;gt;, ARM9 ITCM under TWL (16KiB)&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20529</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20529"/>
		<updated>2017-12-30T00:43:35Z</updated>

		<summary type="html">&lt;p&gt;Riley: PrepareArm9ForAgb return value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Shuts down LgyP9, puts ARM9 into a &amp;lt;code&amp;gt;while(1) svcSleepThread(1*1000*1000);&amp;lt;/code&amp;gt; loop at the end of &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title. On success, returns u64 GBA VC title exeFS .code length in cmdbuf[2].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (u8 unk) Does some lowlevel sd/emmc register setting (different for unk=0 and unk=1). If unk=1, appears to shut down P9 afterwards, calls &amp;lt;code&amp;gt;svcKernelSetState(2,0)&amp;lt;/code&amp;gt; during shutdown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (DateTime datetimetoset,u8 shouldRead) - Sets the P9 date/time (calling the same function used by cmd 0xA for this), then reads (if shouldRead is not 0) or writes (if shouldRead is 0) ARM7_RTC_LO/HI registers to or from agbsave_in_ram+0x60. AgbBg doesn&#039;t appear to use this command at all.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Returns u8, IsSdCardInserted maybe?&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;
| Sets Process9&#039;s internal date/time, see below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;br /&gt;
&lt;br /&gt;
=Command 0xA=&lt;br /&gt;
This takes 3 arguments, which are the following structure packed into 12 bytes (no padding):&lt;br /&gt;
 s32 year;&lt;br /&gt;
 s8 month;&lt;br /&gt;
 s8 day;&lt;br /&gt;
 s8 day_of_week; // Sunday = 0, up to Saturday = 6&lt;br /&gt;
 s8 hour;&lt;br /&gt;
 s8 minute;&lt;br /&gt;
 s8 second;&lt;br /&gt;
 s16 ms;&lt;br /&gt;
This should be the current date/time (AgbBg seems to get it from MCU); it&#039;s converted from this structure into milliseconds, and saved into .data. Another .data variable is set from svcGetSystemTick by this command, and another function in (LGY) P9 essentially does &amp;lt;code&amp;gt;return date_time_set_from_this_command + ticks_to_ms(svcGetSystemTick() - systemtick_from_this_command);&amp;lt;/code&amp;gt; to get the current date&amp;amp;time.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20522</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20522"/>
		<updated>2017-12-28T16:25:03Z</updated>

		<summary type="html">&lt;p&gt;Riley: cmd5, cmd7&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Shuts down LgyP9, puts ARM9 into a &amp;lt;code&amp;gt;while(1) svcSleepThread(1*1000*1000);&amp;lt;/code&amp;gt; loop at the end of &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (u8 unk) Does some lowlevel sd/emmc register setting (different for unk=0 and unk=1). If unk=1, appears to shut down P9 afterwards, calls &amp;lt;code&amp;gt;svcKernelSetState(2,0)&amp;lt;/code&amp;gt; during shutdown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (DateTime datetimetoset,u8 shouldRead) - Sets the P9 date/time (calling the same function used by cmd 0xA for this), then reads (if shouldRead is not 0) or writes (if shouldRead is 0) ARM7_RTC_LO/HI registers to or from agbsave_in_ram+0x60. AgbBg doesn&#039;t appear to use this command at all.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Returns u8, IsSdCardInserted maybe?&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;
| Sets Process9&#039;s internal date/time, see below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;br /&gt;
&lt;br /&gt;
=Command 0xA=&lt;br /&gt;
This takes 3 arguments, which are the following structure packed into 12 bytes (no padding):&lt;br /&gt;
 s32 year;&lt;br /&gt;
 s8 month;&lt;br /&gt;
 s8 day;&lt;br /&gt;
 s8 day_of_week; // Sunday = 0, up to Saturday = 6&lt;br /&gt;
 s8 hour;&lt;br /&gt;
 s8 minute;&lt;br /&gt;
 s8 second;&lt;br /&gt;
 s16 ms;&lt;br /&gt;
This should be the current date/time (AgbBg seems to get it from MCU); it&#039;s converted from this structure into milliseconds, and saved into .data. Another .data variable is set from svcGetSystemTick by this command, and another function in (LGY) P9 essentially does &amp;lt;code&amp;gt;return date_time_set_from_this_command + ticks_to_ms(svcGetSystemTick() - systemtick_from_this_command);&amp;lt;/code&amp;gt; to get the current date&amp;amp;time.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20520</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20520"/>
		<updated>2017-12-28T14:10:02Z</updated>

		<summary type="html">&lt;p&gt;Riley: document command 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Shuts down LgyP9, puts ARM9 into a &amp;lt;code&amp;gt;while(1) svcSleepThread(1*1000*1000);&amp;lt;/code&amp;gt; loop at the end of &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (DateTime datetimetoset,u8 shouldRead) - Sets the P9 date/time (calling the same function used by cmd 0xA for this), then reads (if shouldRead is not 0) or writes (if shouldRead is 0) ARM7_RTC_LO/HI registers to or from agbsave_in_ram+0x60. AgbBg doesn&#039;t appear to use this command at all.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&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;
| Sets Process9&#039;s internal date/time, see below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;br /&gt;
&lt;br /&gt;
=Command 0xA=&lt;br /&gt;
This takes 3 arguments, which are the following structure packed into 12 bytes (no padding):&lt;br /&gt;
 s32 year;&lt;br /&gt;
 s8 month;&lt;br /&gt;
 s8 day;&lt;br /&gt;
 s8 day_of_week; // Sunday = 0, up to Saturday = 6&lt;br /&gt;
 s8 hour;&lt;br /&gt;
 s8 minute;&lt;br /&gt;
 s8 second;&lt;br /&gt;
 s16 ms;&lt;br /&gt;
This should be the current date/time (AgbBg seems to get it from MCU); it&#039;s converted from this structure into milliseconds, and saved into .data. Another .data variable is set from svcGetSystemTick by this command, and another function in (LGY) P9 essentially does &amp;lt;code&amp;gt;return date_time_set_from_this_command + ticks_to_ms(svcGetSystemTick() - systemtick_from_this_command);&amp;lt;/code&amp;gt; to get the current date&amp;amp;time.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20519</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20519"/>
		<updated>2017-12-28T14:02:47Z</updated>

		<summary type="html">&lt;p&gt;Riley: document command 0x6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (DateTime datetimetoset,u8 shouldRead) - Sets the P9 date/time (calling the same function used by cmd 0xA for this), then reads (if shouldRead is not 0) or writes (if shouldRead is 0) ARM7_RTC_LO/HI registers to or from agbsave_in_ram+0x60. AgbBg doesn&#039;t appear to use this command at all.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&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;
| Sets Process9&#039;s internal date/time, see below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;br /&gt;
&lt;br /&gt;
=Command 0xA=&lt;br /&gt;
This takes 3 arguments, which are the following structure packed into 12 bytes (no padding):&lt;br /&gt;
 s32 year;&lt;br /&gt;
 s8 month;&lt;br /&gt;
 s8 day;&lt;br /&gt;
 s8 day_of_week; // Sunday = 0, up to Saturday = 6&lt;br /&gt;
 s8 hour;&lt;br /&gt;
 s8 minute;&lt;br /&gt;
 s8 second;&lt;br /&gt;
 s16 ms;&lt;br /&gt;
This should be the current date/time (AgbBg seems to get it from MCU); it&#039;s converted from this structure into milliseconds, and saved into .data. Another .data variable is set from svcGetSystemTick by this command, and another function in (LGY) P9 essentially does &amp;lt;code&amp;gt;return date_time_set_from_this_command + ticks_to_ms(svcGetSystemTick() - systemtick_from_this_command);&amp;lt;/code&amp;gt; to get the current date&amp;amp;time.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=20518</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=20518"/>
		<updated>2017-12-28T13:56:21Z</updated>

		<summary type="html">&lt;p&gt;Riley: document 0x10018110/0x10018114&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle &amp;lt;code&amp;gt;TWL_FIRM&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AGB_FIRM&amp;lt;/code&amp;gt;&#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 GBA BIOS implemented in hardware. The BIOS is completely identical to the original GBA BIOS. The system is booted silently by calling &amp;lt;code&amp;gt;SWI 0x1&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;RegisterRamReset&amp;lt;/code&amp;gt;), followed by jumping to the code that does &amp;lt;code&amp;gt;SWI 0x0&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;SoftReset&amp;lt;/code&amp;gt;) 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 &amp;lt;code&amp;gt;SWI 0x26&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;HardReset&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Registers==&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Address&lt;br /&gt;
! Name&lt;br /&gt;
! Size (bytes)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u8&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018000&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 &lt;br /&gt;
|-&lt;br /&gt;
| Code&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018080&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_CODE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018100&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_MODE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018104&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_?_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018108&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_CNT?&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018110&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_LO&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018114&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_HI&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018118&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_LO?&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1001811C&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_HI?&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;arm7_save_cfg_t&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018120&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_CFG&amp;lt;/code&amp;gt;&lt;br /&gt;
| 16&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 = GBA.&lt;br /&gt;
&lt;br /&gt;
===ARM7_CODE===&lt;br /&gt;
This is the first code that will be run after execution begins. &amp;lt;code&amp;gt;TwlProcess9&amp;lt;/code&amp;gt; uses this to put ARM7 in a loop (TWL), and to set the &amp;lt;code&amp;gt;POSTFLG&amp;lt;/code&amp;gt; and branch to more copied code (GBA). This doesn&#039;t seem to start execution by itself.&lt;br /&gt;
&lt;br /&gt;
Reading uninitialized data in this 32-byte region leads to both screens displaying solid green (exception), and the CPU locking up.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_MODE===&lt;br /&gt;
This tells the save storage emulation hardware which device type to emulate (64k EEPROM, a 512k Flash chip model, and SRAM are all that have been used officially; several other 512k Flash chip models, two 1 Mbit Flash chip models and 8k EEPROM are also supported). This comes directly from the [[3DS_Virtual_Console#Footer|ROM footer]].&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC_VAL===&lt;br /&gt;
These registers are set to the current LgyP9 date+time before ARM7_RTC_CNT/ARM7_RTC_? registers are used.&lt;br /&gt;
They contain the following structure, set up on the stack then both u32 registers are written one after the other:&lt;br /&gt;
&lt;br /&gt;
 s8 year_since_2000_bcd;&lt;br /&gt;
 s8 month_bcd;&lt;br /&gt;
 s8 day_bcd;&lt;br /&gt;
 s8 day_of_week;&lt;br /&gt;
 s8 hour_bcd;&lt;br /&gt;
 s8 minute_bcd;&lt;br /&gt;
 s8 second_bcd;&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC &#039;&#039;?&#039;&#039;===&lt;br /&gt;
These registers may be used to control a real-time clock. To set or read the data here, first &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;&#039;s bit 15 is waited on. Next &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; is set to zero. &lt;br /&gt;
&lt;br /&gt;
For a write: the two registers are written, a 1 is written to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, and it is waited on the same as before. Afterwards if bit 14 is not set in &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, the value was set successfully.&lt;br /&gt;
&lt;br /&gt;
For a read: a 2 is written to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, 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 &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; at this point, but &amp;lt;code&amp;gt;AGB_FIRM&amp;lt;/code&amp;gt; does not.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_CFG===&lt;br /&gt;
This is copied from rom footer + &amp;lt;code&amp;gt;0x10&amp;lt;/code&amp;gt;. 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 internal memory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08060000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x03800000&amp;lt;/code&amp;gt;, ARM7 WRAM (64KiB)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x080B0000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x03000000&amp;lt;/code&amp;gt;, GBA IWRAM (32KiB)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08080000&amp;lt;/code&amp;gt; → EEPROM/SRAM/Flash 512k/Flash 1Mbit (the 2 512k banks are contiguous in memory). &amp;lt;code&amp;gt;0x10018104&amp;lt;/code&amp;gt; must be set to 1 before reading memory here, and restored to its previous value afterwards&lt;br /&gt;
* &amp;lt;code&amp;gt;0x01FFC000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x01000000&amp;lt;/code&amp;gt;, ARM9 ITCM under TWL (16KiB)&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mode_Control_Services_PXI&amp;diff=20517</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=20517"/>
		<updated>2017-12-28T02:28:38Z</updated>

		<summary type="html">&lt;p&gt;Riley: document command 0xA, same as LgyP9&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;
| Sets internal Process9 date/time, same as [[Legacy_FIRM_PXI#Command_0xA]]&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>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Virtual_Console&amp;diff=20516</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=20516"/>
		<updated>2017-12-28T01:42:13Z</updated>

		<summary type="html">&lt;p&gt;Riley: described more of GBA VC footer/config based on how it is loaded by LgyProcess9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several types of VC titles: NES/GB/GBC VC titles, SNES VC titles, GameGear VC titles and GBA VC titles.&lt;br /&gt;
Except for GBA VC, the games are ran using emulators.&lt;br /&gt;
&lt;br /&gt;
=NES/GB/GBC VC=&lt;br /&gt;
An emulator application + VC ROM in the NCCH [[RomFS]] (among other things in the RomFS). The emulator build includes support for all these three 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 [http://pastebin.com/KLeWt2W3 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;
==Savedata==&lt;br /&gt;
The savedata can contain:&lt;br /&gt;
* &amp;quot;rsm1.dat&amp;quot;: Same format as the below rsm2.dat. Probably used for the &amp;quot;restore-point&amp;quot;.&lt;br /&gt;
* &amp;quot;rsm2.dat&amp;quot;: Current emulator save-state, for storing/loading state at VC-title launch/exit.&lt;br /&gt;
* &amp;quot;sav.dat&amp;quot;: The actual savedata used by the emulated ROM.&lt;br /&gt;
* &amp;quot;SecureValue&amp;quot;: The random number used by [[Anti Savegame Restore]]. No known version of the emulator implements both savestates and secure value.&lt;br /&gt;
Overwriting sav.dat with 0xFF-bytes doesn&#039;t have any affect on the actual emulator. Doing that with most of the rsm*.dat data doesn&#039;t crash anything.&lt;br /&gt;
&lt;br /&gt;
=SNES VC=&lt;br /&gt;
An emulator application + VC ROM in the NCCH [[RomFS]] (among other things in the RomFS).&lt;br /&gt;
SNES VC titles are New 3DS exclusive.&lt;br /&gt;
&lt;br /&gt;
==RomFS==&lt;br /&gt;
* &amp;quot;rom:/ErrorMessage/&amp;quot; This directory contains text used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/shader/&amp;quot; This directory contains .shbin GPU shaders used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/VCM/&amp;quot; This directory contains text used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/caravel.bcsar&amp;quot; This file contains audio used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/ctrl_change.arc&amp;quot; This file contains graphics used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/data.bin&amp;quot; This file contains the ROM and other data. See below for documentation.&lt;br /&gt;
* &amp;quot;rom:/ErrorMessage.arc&amp;quot; This file contains graphics used by the emulator app.&lt;br /&gt;
* &amp;quot;rom:/KTR-XXXX.icn&amp;quot; Copy of the SMDH of the game.&lt;br /&gt;
* &amp;quot;rom:/shader.shbin&amp;quot; GPU shader.&lt;br /&gt;
* &amp;quot;rom:/nnfont_RectDrawerShader.shbin&amp;quot; GPU shader.&lt;br /&gt;
* &amp;quot;rom:/VCM.arc&amp;quot; This file contains graphics used by the emulator app.&lt;br /&gt;
&lt;br /&gt;
===data.bin structure===&lt;br /&gt;
The file begins with a header (all values 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;
| 0x00&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x4&lt;br /&gt;
| File size&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0x00000030&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0x00000050&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Start of the ROM (always 0x00000060 in official VC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| End of the ROM&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Start of the footer region (presumably an index for the PCM audio samples). Matches end of file/file size if PCM data is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| Start of decompressed SDD-1 graphics data region. Matches end of file/file size if no SDD-1 chip is present&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x8&lt;br /&gt;
| Product ID (KTR-XXXX), determines filenames in savedata&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x1&lt;br /&gt;
| Emulation speed in FPS (always 0x3C in official VC)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| 0x3&lt;br /&gt;
| ROM size&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| 0x3&lt;br /&gt;
| Size of the converted PCM audio samples region (starting after ROM). 0 if PCM data is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x39&lt;br /&gt;
| 0x2&lt;br /&gt;
| Footer region size. 0 if PCM data is missing&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B&lt;br /&gt;
| 0x2&lt;br /&gt;
| Always 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D&lt;br /&gt;
| 0x2&lt;br /&gt;
| Game preset ID? (varies for each game). Incremental, started with 0x10XX values in old releases, newest ones have 0x11XX (with XX being back to low values).&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F&lt;br /&gt;
| 0x1&lt;br /&gt;
| Always 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x1&lt;br /&gt;
| Sound volume&lt;br /&gt;
|-&lt;br /&gt;
| 0x41&lt;br /&gt;
| 0x1&lt;br /&gt;
| ROM type (0x15 == HiROM/0x14 == LoROM)&lt;br /&gt;
|-&lt;br /&gt;
| 0x42&lt;br /&gt;
| 0xE&lt;br /&gt;
| Always 0&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0x00000003&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x4&lt;br /&gt;
| Always 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 0x8&lt;br /&gt;
| Always 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 0x60 header is followed by the SNES ROM, often altered to replace audio samples with pointers to external PCM audio files converted from the game, presumably to speed up emulation (these pointers can be found by looking for &amp;quot;PCMF&amp;quot; in the ROM, as seen on [https://github.com/Plombo/vcromclaim/blob/master/snesrestore.py Wii VC]).&lt;br /&gt;
The ROM is then optionally followed by the PCM audio files, by the SDD-1 decompressed graphics data (presumably the emulator doesn&#039;t properly emulate the chip because of hardware constraints) and by a footer which appears to be an index for the PCM audio data.&lt;br /&gt;
There are no setting fields for specific cart features, and it appears that the emulator has &amp;quot;game presets&amp;quot; stored in its own code, which determine the cart expansion chip and probably more game-specific settings. Each official VC release has a different preset ID in the header.&lt;br /&gt;
&lt;br /&gt;
==Savedata==&lt;br /&gt;
The savedata contains:&lt;br /&gt;
* &amp;quot;KTR-XXXX.cfg&amp;quot;: Appears to contain the &amp;quot;preset ID&amp;quot; and possibly more game/save information.&lt;br /&gt;
* &amp;quot;KTR-XXXX.vea&amp;quot;: Current emulator save-state, for storing/loading state at VC-title launch/exit.&lt;br /&gt;
* &amp;quot;KTR-XXXX.ves&amp;quot;: The actual savedata used by the emulated ROM.&lt;br /&gt;
&lt;br /&gt;
Filenames are determined in the ROM header.&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 and related structures 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;
| 0x00&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &#039;.CAA&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x4&lt;br /&gt;
| Must be 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset to array of config descriptors&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Number of config descriptors &amp;lt;&amp;lt; 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Config descriptor====&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;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| If 1, then this config descriptor is used. If 0, and the following value is not 0, then the GBA VC load fails outright (causes result 0xC900464F). Otherwise, this config descriptor is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Offset to config&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Size of config (unused by the function that parses this, which hardcodes the config size (0x324) to memcpy)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Config====&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;
|  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;
| 0x4&lt;br /&gt;
| LCD ghosting (01-FF, lower values equal more ghosting)&lt;br /&gt;
|-&lt;br /&gt;
| 0x024&lt;br /&gt;
| 0x300&lt;br /&gt;
| Video LUT (black to full, rgbrgbrgb...)?,&amp;lt;br/&amp;gt;three different types of this data have been observed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Save types:&lt;br /&gt;
* 0x0: EEPROM 8k&lt;br /&gt;
* 0x1: EEPROM 8k (?)&lt;br /&gt;
* 0x2: EEPROM 64k&lt;br /&gt;
* 0x3: EEPROM 64k (?)&lt;br /&gt;
* 0x4: Flash 512k (Atmel, ID: 0x3D1F) + RTC&lt;br /&gt;
* 0x5: Flash 512k (Atmel, ID: 0x3D1F)&lt;br /&gt;
* 0x6: Flash 512k (SST, ID: 0xD4BF) + RTC&lt;br /&gt;
* 0x7: Flash 512k (SST, ID: 0xD4BF)&lt;br /&gt;
* 0x8: Flash 512k (Panasonic, ID: 0x1B32) + RTC&lt;br /&gt;
* 0x9: Flash 512k (Panasonic, ID: 0x1B32)&lt;br /&gt;
* 0xA: Flash 1Mbit (Macronix, ID: 0x09C2) + RTC&lt;br /&gt;
* 0xB: Flash 1Mbit (Macronix, ID: 0x09C2)&lt;br /&gt;
* 0xC: Flash 1Mbit (Sanyo, ID: 0x1362) + RTC&lt;br /&gt;
* 0xD: Flash 1Mbit (Sanyo, ID: 0x1362)&lt;br /&gt;
* 0xE: SRAM/FRAM 256k&lt;br /&gt;
&lt;br /&gt;
Everything above 0xE results in no save chip and nothing being saved to NAND.&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 (also see below). 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-CMAC 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;
| 0x4&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;br /&gt;
&lt;br /&gt;
===NAND Savegame on SD===&lt;br /&gt;
A NAND savegame copied to the SD by process9 is identical to its counterpart on the NAND partition, save for the CMAC. For SD copies on retail units, the CMAC is recalculated as the AES-CMAC of the (SHA256 hash of (&amp;quot;CTR-SIGN&amp;quot; + AGB TitleID (little endian) + SHA256 hash of (&amp;quot;CTR-SAV0&amp;quot; + SHA256 hash of (0x30..0x200 + the entire save itself)))), using keyslot 0x30 set up with the keyY from movable.sed. For SD copies on devkit units, the CMAC is recalculated using the SHA256 hash of 0x30..0x200 + the entire save itself, using a different key from process9 .rodata.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20515</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20515"/>
		<updated>2017-12-27T23:52:33Z</updated>

		<summary type="html">&lt;p&gt;Riley: document command 0xA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&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;
| Sets Process9&#039;s internal date/time, see below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;br /&gt;
&lt;br /&gt;
=Command 0xA=&lt;br /&gt;
This takes 3 arguments, which are the following structure packed into 12 bytes (no padding):&lt;br /&gt;
 s32 year;&lt;br /&gt;
 s8 month;&lt;br /&gt;
 s8 day;&lt;br /&gt;
 s8 day_of_week; // Sunday = 0, up to Saturday = 6&lt;br /&gt;
 s8 hour;&lt;br /&gt;
 s8 minute;&lt;br /&gt;
 s8 second;&lt;br /&gt;
 s16 ms;&lt;br /&gt;
This should be the current date/time (AgbBg seems to get it from MCU); it&#039;s converted from this structure into milliseconds, and saved into .data. Another .data variable is set from svcGetSystemTick by this command, and another function in (LGY) P9 essentially does &amp;lt;code&amp;gt;return date_time_set_from_this_command + ticks_to_ms(svcGetSystemTick() - systemtick_from_this_command);&amp;lt;/code&amp;gt; to get the current date&amp;amp;time.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20455</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20455"/>
		<updated>2017-11-06T22:38:33Z</updated>

		<summary type="html">&lt;p&gt;Riley: cmd 3 name from AgbBg debug-string&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForAgb(u64 application_titleID) This launches the specified GBA VC title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&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;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20450</id>
		<title>Legacy FIRM PXI</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Legacy_FIRM_PXI&amp;diff=20450"/>
		<updated>2017-11-06T16:36:26Z</updated>

		<summary type="html">&lt;p&gt;Riley: debug-string in TwlBg names this&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the PXI commands for TWL_FIRM/AGB_FIRM.&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;
|-&lt;br /&gt;
| 0x0001....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| PrepareArm9ForTwl(u64 application_titleID) This launches the specified TWL title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| (u64 application_titleID) This launches the specified GBA VC title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| Process9 will eventually wait for the ARM11 to send this command, see [[FIRM|here]]. The command input parameters are not used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0005....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0006....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x0007....&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
|?&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;
| 0x000B0040&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This is used for TWL initialization, prior to using command 0x00020080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0800&lt;br /&gt;
| [[1.0.0-0]]&lt;br /&gt;
| This writes the input 0x80-byte ASCII data to [[Flash_Filesystem|nand:/rw/sys/lgy.log]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This PXI service seems to be based on [[Development Services PXI]]. Commands 0x8 and 0x9 in both are stubbed with the same function (returns 0xE0C0EC03), commands that seem useless under NATIVE_FIRM have a purpose on legacy FIRMs (command 0xC does some &amp;quot;unnecessary copying to stack&amp;quot; on NATIVE_FIRM, but this same copy (0x80-bytes) is used to write to lgy.log on legacy FIRMs), and commands that are essential (and only useful) on legacy FIRMs (0x2 and 0x3) are stubbed completely on NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
=Command 0x2=&lt;br /&gt;
This does the following:&lt;br /&gt;
* Waits for an u8 state field to become non-zero.&lt;br /&gt;
* Clears DSi memory, etc.&lt;br /&gt;
* Loads the DS(i) application specified by the command request titleID. If this fails, it immediately returns the error for this.&lt;br /&gt;
* Initializes the DSi memory at 0x02fe7000 and 0x02fffc00.&lt;br /&gt;
* Loads the TWL launcher located at physical address [[Memory_layout|0x27C00000]], which was written there by the TwlBg ARM11 process.&lt;br /&gt;
* Loads the TWL bootloader, see [[FIRM|here]].&lt;br /&gt;
* Initializes DSi memory/keys, [[IO_Registers|0x10018000]] registers, etc.&lt;br /&gt;
* Writes value 0x3 to [[CONFIG_Registers|REG_BOOTENV]], and value 0x1 to an u8 state field.&lt;br /&gt;
* Uses [[SVC|svcSignalEvent]], then returns.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CONFIG11_Registers&amp;diff=20449</id>
		<title>CONFIG11 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CONFIG11_Registers&amp;diff=20449"/>
		<updated>2017-11-05T14:11:47Z</updated>

		<summary type="html">&lt;p&gt;Riley: &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;
| [[#CFG11_SHAREDWRAM_32K_DATA|CFG11_SHAREDWRAM_32K_DATA]]&amp;lt;0-7&amp;gt;&lt;br /&gt;
| 0x10140000&lt;br /&gt;
| 1*8&lt;br /&gt;
| Boot11, Process9, [[DSP Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_SHAREDWRAM_32K_CODE|CFG11_SHAREDWRAM_32K_CODE]]&amp;lt;0-7&amp;gt;&lt;br /&gt;
| 0x10140008&lt;br /&gt;
| 1*8&lt;br /&gt;
| Boot11, Process9, [[DSP Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10140100&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;
| 0x10140102&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_FIQ_CNT|CFG11_FIQ_CNT]]&lt;br /&gt;
| 0x10140104&lt;br /&gt;
| 1&lt;br /&gt;
| Kernel11.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10140105&lt;br /&gt;
| 1&lt;br /&gt;
| Kernel11.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Related to [[HID_Registers|HID_?]]&lt;br /&gt;
| 0x10140108&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| Related to [[HID_Registers|HID_?]]&lt;br /&gt;
| 0x1014010C&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_GPUPROT|CFG11_GPUPROT]]&lt;br /&gt;
| 0x10140140&lt;br /&gt;
| 4&lt;br /&gt;
| Kernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_WIFICNT|CFG11_WIFICNT]]&lt;br /&gt;
| 0x10140180&lt;br /&gt;
| 1&lt;br /&gt;
| TwlBg, [[NWM Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_SPI_CNT|CFG11_SPI_CNT]]&lt;br /&gt;
| 0x101401C0&lt;br /&gt;
| 4&lt;br /&gt;
| [[SPI Services]], TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10140200&lt;br /&gt;
| 4&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;
| Clock related?&lt;br /&gt;
| 0x10140400&lt;br /&gt;
| 1&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| Clock related?&lt;br /&gt;
| 0x10140410&lt;br /&gt;
| 4&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[#CFG11_BOOTROM_OVERLAY_CNT|CFG11_BOOTROM_OVERLAY_CNT]]&lt;br /&gt;
| 0x10140420&lt;br /&gt;
| 1&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[#CFG11_BOOTROM_OVERLAY_VAL|CFG11_BOOTROM_OVERLAY_VAL]]&lt;br /&gt;
| 0x10140424&lt;br /&gt;
| 4&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10140428&lt;br /&gt;
| 4&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;
| [[#CFG11_SOCINFO|CFG11_SOCINFO]]&lt;br /&gt;
| 0x10140FFC&lt;br /&gt;
| 2&lt;br /&gt;
| Boot11, Kernel11&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;
| CFG11_GPU_STATUS&lt;br /&gt;
| 0x10141000&lt;br /&gt;
| 2&lt;br /&gt;
| Kernel11, TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| CFG11_PTM_0&lt;br /&gt;
| 0x10141008&lt;br /&gt;
| 4&lt;br /&gt;
| [[PTM Services]], [[PDN Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| CFG11_PTM_1&lt;br /&gt;
| 0x1014100C&lt;br /&gt;
| 4&lt;br /&gt;
| [[PTM Services]], TwlBg, [[PDN Services]]&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;
| [[#CFG11_TWLMODE_0|CFG11_TWLMODE_0]]&lt;br /&gt;
| 0x10141100&lt;br /&gt;
| 2&lt;br /&gt;
| TwlProcess9, TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_TWLMODE_1|CFG11_TWLMODE_1]]&lt;br /&gt;
| 0x10141104&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_TWLMODE_2|CFG11_TWLMODE_2]]&lt;br /&gt;
| 0x10141108&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_TWLMODE_HID|CFG11_TWLMODE_HID]]&lt;br /&gt;
| 0x1014110A&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_WIFIUNK|CFG11_WIFIUNK]]&lt;br /&gt;
| 0x1014110C&lt;br /&gt;
| 1&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10141110&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10141112&lt;br /&gt;
| 2&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_CODEC|CFG11_CODEC_0]]&lt;br /&gt;
| 0x10141114&lt;br /&gt;
| 2&lt;br /&gt;
| [[Codec Services]], TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_CODEC|CFG11_CODEC_1]]&lt;br /&gt;
| 0x10141116&lt;br /&gt;
| 2&lt;br /&gt;
| [[Codec Services]], TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10141118&lt;br /&gt;
| 1&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10141119&lt;br /&gt;
| 1&lt;br /&gt;
| TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| ?&lt;br /&gt;
| 0x10141120&lt;br /&gt;
| 1&lt;br /&gt;
| TwlBg&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;
| [[#CFG11_GPU_CNT|CFG11_GPU_CNT]]&lt;br /&gt;
| 0x10141200&lt;br /&gt;
| 4&lt;br /&gt;
| Boot11, Kernel11, [[PDN Services]], TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_GPU_CNT2|CFG11_GPU_CNT2]]&lt;br /&gt;
| 0x10141204&lt;br /&gt;
| 4&lt;br /&gt;
| Boot11, Kernel11, TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| CFG11_GPU_FCRAM_CNT&lt;br /&gt;
| 0x10141210&lt;br /&gt;
| 2&lt;br /&gt;
| Kernel11, TwlBg&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_CODEC_CNT|CFG11_CODEC_CNT]]&lt;br /&gt;
| 0x10141220&lt;br /&gt;
| 1&lt;br /&gt;
| Boot11, TwlBg, [[PDN Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#CFG11_CAMERA_CNT|CFG11_CAMERA_CNT]]&lt;br /&gt;
| 0x10141224&lt;br /&gt;
| 1&lt;br /&gt;
| [[PDN Services]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| CFG11_DSP_CNT&lt;br /&gt;
| 0x10141230&lt;br /&gt;
| 1&lt;br /&gt;
| Process9, [[PDN Services]]&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;
| [[#CFG11_MPCORE_CLKCNT|CFG11_MPCORE_CLKCNT]]&lt;br /&gt;
| 0x10141300&lt;br /&gt;
| 2&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[#CFG11_MPCORE_CNT|CFG11_MPCORE_CNT]]&lt;br /&gt;
| 0x10141304&lt;br /&gt;
| 2&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[#CFG11_MPCORE_BOOTCNT&amp;lt;0-3&amp;gt;|CFG11_MPCORE_BOOTCNT]]&amp;lt;0-3&amp;gt;&lt;br /&gt;
| 0x10141310&lt;br /&gt;
| 1*4&lt;br /&gt;
| NewKernel11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CFG11_SHAREDWRAM_32K_DATA ==&lt;br /&gt;
Used for mapping 32K chunks of shared WRAM for DSP data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/data)&lt;br /&gt;
|-&lt;br /&gt;
| 2-4&lt;br /&gt;
| Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| Not used (0)&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Enable (0=Disable, 1=Enable)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CFG11_SHAREDWRAM_32K_CODE ==&lt;br /&gt;
Used for mapping 32K chunks of shared WRAM for DSP data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/code)&lt;br /&gt;
|-&lt;br /&gt;
| 2-4&lt;br /&gt;
| Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)&lt;br /&gt;
|-&lt;br /&gt;
| 5-6&lt;br /&gt;
| Not used (0)&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Enable (0=Disable, 1=Enable)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CFG11_FIQ_CNT ==&lt;br /&gt;
Writing bit1 to this register disables FIQ interrupts.&lt;br /&gt;
&lt;br /&gt;
This bit is set upon receipt of a FIQ interrupt and when [[SVC|svcUnbindInterrupt]] is called on the FIQ-abstraction [[ARM11_Interrupts#Private_Interrupts|software interrupt]] for the current core.&lt;br /&gt;
It is cleared when binding that software interrupt to an event and just before that event is signaled.&lt;br /&gt;
&lt;br /&gt;
== CFG11_SPI_CNT ==&lt;br /&gt;
When the corresponding bit is 0, the bus has to be accessed using the DS SPI registers. Otherwise it has to be accessed using the 3DS SPI registers.&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;
| 0&lt;br /&gt;
| Enable [[SPI Registers]] 0x10160000.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Enable [[SPI Registers]] 0x10142000.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Enable [[SPI Registers]] 0x10143000.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CFG11_BOOTROM_OVERLAY_CNT ==&lt;br /&gt;
Bit0: Enable bootrom overlay functionality.&lt;br /&gt;
&lt;br /&gt;
== CFG11_BOOTROM_OVERLAY_VAL ==&lt;br /&gt;
The 32-bit value to overlay data-reads to bootrom with. See [[#CFG11_MPCORE_BOOTCNT|CFG11_MPCORE_BOOTCNT]].&lt;br /&gt;
&lt;br /&gt;
== CFG11_SOCINFO ==&lt;br /&gt;
Read-only register.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
!  Used by&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 1 on both Old3DS and New3DS.&lt;br /&gt;
| Boot11&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1 on New3DS.&lt;br /&gt;
| Kernel11&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Clock modifier: if set, use a 3x multiplier, otherwise 2x&lt;br /&gt;
| Kernel11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CFG11_MPCORE_CLKCNT ==&lt;br /&gt;
This is used for configuring the New3DS ARM11 CPU clock-rate. This register is New3DS-only: reading from here on Old3DS always returns all-zeros even when one tried writing data here prior to the read.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Enable clock multiplier? This must be set to 1 before writing a non-zero value to bit1-2, otherwise freeze.&lt;br /&gt;
|-&lt;br /&gt;
| 1-2&lt;br /&gt;
| Clock multiplier (0=1x, 1=2x, 2=3x, 3=hang)&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Busy&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[SVC#KernelSetState|svcKernelSetState]] type10, only implemented on New3DS, uses this register. That code writes the following values to this register, depending on the input Param0 bit0 state, and the state of CFG11_SOCINFO:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Register value&lt;br /&gt;
!  Higher-clockrate bit set in svcKernelSetState Param0&lt;br /&gt;
!  CFG11_SOCINFO bit2 set&lt;br /&gt;
!  MPCore timer/watchdog prescaler value, prior to subtracting it by 0x1 when writing it into hw/state&lt;br /&gt;
!  Clock-rate multiplier&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1x&lt;br /&gt;
| 268MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1x&lt;br /&gt;
| 268MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| 0x03&lt;br /&gt;
| 3x&lt;br /&gt;
| 804MHz&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| 0x02&lt;br /&gt;
| 2x&lt;br /&gt;
| 536MHz (tested on New3DS)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the above CFG11_SOCINFO bit is 1 on New3DS, and 0 on Old3DS. Since this SVC is only available with the New3DS ARM11-kernel, the only additional available clock-rate is 804MHz when running on New3DS(with official kernel code).&lt;br /&gt;
&lt;br /&gt;
The following register value(s) were tested on New3DS by patching the kernel:&lt;br /&gt;
* 0x00: Entire system hangs.&lt;br /&gt;
* 0x02: Entire system hangs.&lt;br /&gt;
* 0x03: ARM11 runs at 536MHz.&lt;br /&gt;
* 0x04: Entire system hangs.&lt;br /&gt;
* 0x06: Entire system hangs.&lt;br /&gt;
* 0x07: Same result as 0x05.&lt;br /&gt;
* 0x08: Entire system hangs.&lt;br /&gt;
* 0x09: Entire system hangs.&lt;br /&gt;
* 0x0A: Entire system hangs.&lt;br /&gt;
* 0x0B: Same result as 0x03.&lt;br /&gt;
* 0x0C: Entire system hangs.&lt;br /&gt;
* 0x0D: Same result as 0x05.&lt;br /&gt;
* 0x0E: Entire system hangs.&lt;br /&gt;
* 0x0F: Same result as 0x05.&lt;br /&gt;
* 0x1F, 0x2F, 0x4F, 0x8F, 0xFF: Same result as 0x05.&lt;br /&gt;
&lt;br /&gt;
== CFG11_MPCORE_CNT ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Power on 3rd ARM11 MPCore maybe?&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Power on 4th ARM11 MPCore maybe?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CFG11_MPCORE_BOOTCNT&amp;lt;0-3&amp;gt; ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Enable bootrom instruction overlay, maybe? This bit is only writable for core2 and core3.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Enable bootrom data overlay. This bit is only writable for core2 and core3.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Has core booted maybe?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Always 1?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The normal ARM11 bootrom checks cpuid and hangs if cpuid &amp;gt;= 2. This is a problem when booting the 2 additional New3DS ARM11 MPCores. NewKernel11 solves this by using a hardware feature to overlay the bootrom with a configurable branch to a kernel function. This overlay feature was added with the New3DS.&lt;br /&gt;
&lt;br /&gt;
Bit1 in register above enables a bootrom data-override for physical addresses 0xFFFF0000-0xFFFF1000 and 0x10000-0x11000. All _data reads_ made to those regions now read the 32-bit value provided in [[#CFG11_BOOTROM_OVERLAY_VAL|CFG11_BOOTROM_OVERLAY_VAL]].&lt;br /&gt;
&lt;br /&gt;
Bit0 enables a bootrom instruction-overlay which means that _instruction reads_ made to the bootrom region are overridden. We have not been able to dump what instructions are actually placed at bootrom by this switch (because reading the area only yields data-reads). Jumping randomly into the 0xFFFF0000-0xFFFF1000 region works fine and jumps to the value provided by the data overlay [[#CFG11_BOOTROM_OVERLAY_VAL|CFG11_BOOTROM_OVERLAY_VAL]]. Thus we may predict that the entire bootrom region is filled by:&lt;br /&gt;
ldr pc, [pc]&lt;br /&gt;
&lt;br /&gt;
Or equivalent. However, jumping to some high addresses such as 0xFFFF0FF0+ will crash the core. This may be explained by prefetching in the ARM pipeline, and might help us identify what instructions are placed by the instruction-overlay.&lt;br /&gt;
&lt;br /&gt;
==CFG11_GPUPROT==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 3-0&lt;br /&gt;
| Old FCRAM DMA cutoff size, 0 = no protection.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 7-4&lt;br /&gt;
| New FCRAM DMA cutoff size, 0 = no protection.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 8&lt;br /&gt;
| AXIWRAM protection, 0 = accessible.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| 10-9&lt;br /&gt;
| QTM DMA cutoff size&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 31-11&lt;br /&gt;
| Zeroes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the old FCRAM DMA cutoff, it protects starting from 0x28000000-(0x800000*x) until end of FCRAM. There is no way to protect the first 0x800000-bytes.&lt;br /&gt;
&lt;br /&gt;
For the new FCRAM DMA cutoff, it protects starting from 0x30000000-(0x800000*x) until end of FCRAM. When the old FCRAM cutoff is set to non-zero, the first 0x800000-bytes bytes of new FCRAM are protected.&lt;br /&gt;
&lt;br /&gt;
On New3DS the old+new FCRAM cutoff can be used at the same time, however this isn&#039;t done officially.&lt;br /&gt;
&lt;br /&gt;
For the QTM DMA cutoff, it protects starting from 0x1F400000-(0x100000*x) until end of QTM mem.&lt;br /&gt;
&lt;br /&gt;
On cold boot this reg is set to 0.&lt;br /&gt;
&lt;br /&gt;
When this register is set to value 0, the GPU can access the entire FCRAM, AXIWRAM, and on New3DS all QTM-mem.&lt;br /&gt;
&lt;br /&gt;
[[SVC|Initialized]] during kernel boot, and used with [[SVC]] 0x59 which was implemented with [[11.3.0-36|v11.3]].&lt;br /&gt;
&lt;br /&gt;
==CFG11_WIFICNT==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 0&lt;br /&gt;
| Enable wifi subsystem&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CFG11_TWLMODE_0==&lt;br /&gt;
Observed 0x8001 when running under TWL_ and AGB_FIRM, 0 NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
This address is poked from ARM7 to signal that it has booted and begun executing code. The ARM7-mode address for this register is 0x4700000.&lt;br /&gt;
&lt;br /&gt;
The very last 3DS-mode register poke the [[FIRM|TWL_FIRM]] Process9 does before it gets switched into TWL-mode, is writing 0x8000 to this register. Before writing this register, TWL Process9 waits for ARM7 to change the value of this register. The Process9 code for this runs from ITCM, since switching into TWL-mode includes remapping all ARM9 physical memory.&lt;br /&gt;
&lt;br /&gt;
Writing 0x8000 to here from the ARM9 with NATIVE_FIRM running doesn&#039;t seem to do anything, other reg-pokes likely need done first.&lt;br /&gt;
&lt;br /&gt;
==CFG11_TWLMODE_1==&lt;br /&gt;
Observed 0x8000 when running under TWL_FIRM, 0 NATIVE_FIRM.&lt;br /&gt;
&lt;br /&gt;
==CFG11_TWLMODE_2==&lt;br /&gt;
Bitfield.&lt;br /&gt;
&lt;br /&gt;
==CFG11_TWLMODE_HID==&lt;br /&gt;
The value of this register is copied to [[HID_Registers|HID_?]] under certain conditions.&lt;br /&gt;
&lt;br /&gt;
==CFG11_WIFIUNK==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| 4&lt;br /&gt;
| Wifi-related? Set to 1 very early in NWM-module.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==CFG11_GPU_CNT==&lt;br /&gt;
This one seems to control the LCD/GPU/Backlight.&lt;br /&gt;
&lt;br /&gt;
Bit0: Enable GPU registers at 0x10400000+.&lt;br /&gt;
Bit16: Turn on LCD backlight.&lt;br /&gt;
&lt;br /&gt;
==CFG11_GPU_CNT2==&lt;br /&gt;
Bit0: Power on GPU?&lt;br /&gt;
&lt;br /&gt;
==CFG11_GPU_FCRAM_CNT==&lt;br /&gt;
Bit1: Enable/disable FCRAM.&lt;br /&gt;
Bit2: Enable/disable operation in progress.&lt;br /&gt;
&lt;br /&gt;
==CFG11_CODEC==&lt;br /&gt;
The following is the only time the ARM11 CODEC module uses any 0x1EC41XXX registers. In one case CODEC module clears bit1 in register 0x1EC41114, in the other case CODEC module sets bit1 in registers 0x1EC41114 and 0x1EC41116.&lt;br /&gt;
&lt;br /&gt;
==CFG11_CODEC_CNT==&lt;br /&gt;
This is the power register used for the [[CFG11_Services|PDN]] CODEC service.&lt;br /&gt;
&lt;br /&gt;
bit0 = unknown, bit1 = turn on/off DSP, rest = always 0.&lt;br /&gt;
&lt;br /&gt;
==CFG11_CAMERA_CNT==&lt;br /&gt;
This is the power register used for the [[CFG11_Services|PDN]] camera service.&lt;br /&gt;
&lt;br /&gt;
bit0 = unknown, bit1 = turn on/off cameras, rest = always 0.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Mysteries&amp;diff=20408</id>
		<title>Mysteries</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Mysteries&amp;diff=20408"/>
		<updated>2017-10-18T20:14:41Z</updated>

		<summary type="html">&lt;p&gt;Riley: &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;
: C may stand for Chiheisen (&amp;quot;horizon&amp;quot; in Japanese, the O3DS&#039;s codename being &amp;quot;Project Horizon&amp;quot;).&lt;br /&gt;
:: Not true, Horizon refers to the OS.&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 [http://i.imgur.com/0kJlbEw.png 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, New 2DS, and even a prototype board from April(?) 2010. All matching exactly.&lt;br /&gt;
&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 key scrambler constant was &amp;quot;Nintendo Co., Ltd&amp;quot; in Japanese (&amp;quot;任天堂株式会社&amp;quot;), UTF-16LE encoded, with byte order mark.  The 3DS key scrambler constant, by comparison, is random-looking.&lt;br /&gt;
&lt;br /&gt;
=== What is the PDN abbreviation? ===&lt;br /&gt;
: Power distribution network&lt;br /&gt;
&lt;br /&gt;
=== How does Nintendo reflash bricked systems? ===&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; Before trying to boot from NAND, the bootrom checks to see if a key combination (Start + Select + X) is being held, and whether the shell is closed. If so, it tries to boot from an inserted NTR (Nintendo DS) cartridge.&lt;br /&gt;
This allows to execute a FIRM that is probably used by Nintendo to reflash the system.&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;
: Power/time management&lt;br /&gt;
&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;br /&gt;
=== How is CTRAging launched during factory setup? ===&lt;br /&gt;
&#039;&#039;&#039;Background:&#039;&#039;&#039; No TestMenu version is capable of launching CTRAging directly: O3DS factory TestMenu can only launch DevMenu installed on NAND, the inserted cartridge and the TWL/AGB test apps; N3DS factory TestMenu can only launch DevMenu installed on NAND, the inserted cartridge and System Settings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Theory:&#039;&#039;&#039; NtrBoot another time &lt;br /&gt;
=== Why are there 4 stubbed syscalls named SendSyncRequest1-4? ===&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Userland_Flaws&amp;diff=20335</id>
		<title>3DS Userland Flaws</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_Userland_Flaws&amp;diff=20335"/>
		<updated>2017-09-21T07:36:39Z</updated>

		<summary type="html">&lt;p&gt;Riley: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists vulnerabilities / exploits for 3DS applications and applets. Exploiting these initially results in ROP, from that ROP one can then for example try exploiting [[3DS_System_Flaws|system]] flaw(s).&lt;br /&gt;
&lt;br /&gt;
=Non-system applications=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Application name&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed in app/system version&lt;br /&gt;
!  Last app/system version this flaw was checked for&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this vuln was discovered&lt;br /&gt;
!  Vuln discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Cubic Ninja&lt;br /&gt;
| Map-data stack smash&lt;br /&gt;
| See [[Ninjhax|here]] regarding Ninjhax.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[10.4.0-29]].&lt;br /&gt;
| Ninjhax release&lt;br /&gt;
| July 2014&lt;br /&gt;
| [[User:smea|smea]]&lt;br /&gt;
|-&lt;br /&gt;
| The Legend of Zelda: Ocarina of Time 3D&lt;br /&gt;
| UTF-16 name string buffer overflow via unchecked u8 length field&lt;br /&gt;
| The u8 at offset 0x2C in the savefile is the character-length of the UTF-16 string at offset 0x1C. When copying this string, it&#039;s essentially a memory-copy with lenval*2, not a string-copy. This can be used to trigger buffer overflows at various locations depending on the string length.&lt;br /&gt;
* When value is &amp;gt;=0x6E it crashes when saving the saveslot, this causes a stack-smash however it normally crashes before it returns from the function which had the stack-frame overwritten.&lt;br /&gt;
* With value &amp;gt;=0x9A, it crashes via stack-smash in-game once any dialogs are opened(touching buttons on the touch-screen can trigger it too).&lt;br /&gt;
* Length value&amp;gt;=0xCD causes a crash while loading the saveslot, via a heap buffer overflow. This buf-overflow overwrites a heap memchunk following the allocated buffer. When the first 16-bits overwriting that heap memchunk is not the memchunk magic-number(0x7373), the mem-alloc code will just return a NULL ptr which later results in a crash. When the magic-number is valid, the mem-alloc code will continue to attempt to parse the memchunk, which may crash depending on the data which overwrote the memchunk. This heap code is separate from the CTRSDK heap code. Exploiting this doesn&#039;t seem to be possible: since the heap code actually verifies that the magic-number for the next/prev memchunk ptrs are correct(unlike CTRSDK), it&#039;s not possible to change those ptrs to useful arbitrary addresses outside of savedata(like with triggering a write to a c++ object ptr which later is used with a vtable func-call, this is what one would do with CTRSDK heap here).&lt;br /&gt;
&lt;br /&gt;
On March 11, 2015, an exploit using this vuln was released, that one was intended for warez/etc. The following exploit wasn&#039;t released before then mainly because doing so would (presumably) result in the vuln being fixed. The following old exploit was released on March 14, 2015: [https://github.com/yellows8/oot3dhax].&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[10.6.0-31]].&lt;br /&gt;
| March 11, 2015&lt;br /&gt;
| Around October 22, 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Super Smash Bros 3DS&lt;br /&gt;
| Buffer overflow in local-multiplayer beacon handling.&lt;br /&gt;
| See [[smashbroshax|here]].&lt;br /&gt;
| App: v1.1.3&lt;br /&gt;
| See [[smashbroshax|here]]. System: [[10.3.0-28]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| See [[smashbroshax|here]].&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Super Mystery Dungeon&lt;br /&gt;
| Heap overflow within linear memory via unchecked save file length&lt;br /&gt;
| Pokemon Super Mystery Dungeon uses zlib compression for most of its save files, possibly due to the save files being larger than its predecessor, Gates to Infinity. When a save file is being prepared to be loaded and read from, only a 0x32000 large buffer is allocated for file reading, and a 0x3e800-large buffer for decompression is also allocated before the file is read. However, the game does not limit the size of the file read to this allocation bound, allowing for the file to overflow into the linear memory heap and into the next allocation. Since Pokemon Super Mystery Dungeon stores allocation memchunks directly before the allocation, overwriting the next memchunk with a corrupted one allows for arbitrary writes of linear heap pointers when the next buffer is allocated or arbitrary writes of any pointer within writable memory when the corrupted buffer is freed.&lt;br /&gt;
| None&lt;br /&gt;
| O3DS: [[11.3.0-36]]. N3DS: [[11.4.0-37]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| April 14, 2016&lt;br /&gt;
| [[User:Shinyquagsire23|Shiny Quagsire]]&lt;br /&gt;
|-&lt;br /&gt;
| VVVVVV&lt;br /&gt;
| Buffer overflow in XML save file array parsing&lt;br /&gt;
| VVVVVV utilizes several XML files (renamed with a .vvv extension) to store level save data, stats and settings. Within these XML files are several tags containing an array of data which, when parsed, is not properly checked to be of proper length for the tag being parsed from. This allows for an overflow of 16-bit array values from the location where the array is parsed. With unlock.vvv, XML data is parsed to the stack, and with level saves the heap. This allows for the pointer where the level save worldmap tag array should be parsed into to be overwritten with a stack address, allowing for ROP from within the XML array parsing function on the next level load.&lt;br /&gt;
| App: v1.1&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Shinyquagsire23|Shiny Quagsire]]&lt;br /&gt;
|-&lt;br /&gt;
| Citizens of Earth&lt;br /&gt;
| Save file read stack smash&lt;br /&gt;
| Citizens of Earth also uses &amp;quot;XML&amp;quot; files for saves, which are actually entirely binary data (not XML at all) with no checksums. These files are read from the filesystem on to a fixed size stack buffer which leads to an incredibly trivial stack smash. When using the autosave slot for this, the save is parsed when the user selects &amp;quot;continue&amp;quot;. When using one of the dedicated save slots (1-3), the save is parsed shortly after the company splash screens fade. Note that the save is read quite high (descending) on the stack - when exploiting this, one would likely need to move SP due to almost instantly overflowing the physical stack.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| May 5, 2016&lt;br /&gt;
| [[User:Dazzozo|Dazzozo]]&lt;br /&gt;
|-&lt;br /&gt;
| SmileBASIC 3.x&lt;br /&gt;
| Poor parameter validation on &amp;quot;BGSCREEN&amp;quot; command&lt;br /&gt;
| The SmileBASIC &amp;quot;BGSCREEN&amp;quot; command&#039;s second parameter is not properly validated as being within range.  As a result, one can set the screen size to an absurdly large value.  This means that the &amp;quot;BGGET&amp;quot; and &amp;quot;BGPUT&amp;quot; commands can then be used on out-of-range values to read and write a significant chunk of the interpreter&#039;s address space.&lt;br /&gt;
With a series of carefully-designed BGPUT commands, one can build a ROP chain and cause it to be executed.&lt;br /&gt;
| App: 3.3.2.&lt;br /&gt;
| System: [[11.0.0-33]].&lt;br /&gt;
| July 20, 2016&lt;br /&gt;
| Around June 26, 2016&lt;br /&gt;
| slackerSnail, 12Me12, incvoid&lt;br /&gt;
Exploited by MrNbaYoh and [[User:Plutooo|plutoo]].&lt;br /&gt;
|-&lt;br /&gt;
| The Legend of Zelda: Tri Force Heroes&lt;br /&gt;
| [[3DS_System_Flaws#General.2FCTRSDK|CTRSDK]] CTPK buffer overflow combined with game&#039;s usage of SpotPass&lt;br /&gt;
| During the very first screen displayed by the game during boot(&amp;quot;Loading...&amp;quot;), just seconds after title launch, the game loads CTPK from the [[BOSS_Services|stored]] SpotPass content. Hence, this game could be exploited via the vulnerable CTRSDK CTPK code &#039;&#039;if&#039;&#039; one could get custom SpotPass data into extdata somehow(ctr-httpwn &amp;gt;=v1.2 with bosshaxx allows this).&lt;br /&gt;
&lt;br /&gt;
The code for this runs from a thread separate from the main-thread, with the stack in linearmem heap. This SpotPass handling triggers before the game ever opens the regular savedata archive. The extdata is opened at some point before this: it opens a file for checking if it exists, then immediately closes it.&lt;br /&gt;
&lt;br /&gt;
The two SpotPass URLs for this have always(?) returned HTTP 404 as of November 2016. It appears these were intended for use as textures for additional costumes(and never got used publicly), but this wasn&#039;t tested.&lt;br /&gt;
&lt;br /&gt;
This is used by [https://github.com/yellows8/ctpkpwn ctpkpwn_tfh].&lt;br /&gt;
| None&lt;br /&gt;
| App: v2.1.0&lt;br /&gt;
| November 18, 2016&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pixel Paint&lt;br /&gt;
| Buffer overflow via unchecked extdata file length&lt;br /&gt;
| Pixel Paint loads pictures saved by the user from extdatas. The file is read to a fixed size buffer but the file length remains unchecked, so with a large enough file, one can overwrite pointers in memory and gain control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[11.2.0-35]].&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| November 5, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Steel Diver : Sub Wars&lt;br /&gt;
| Heap overflow / arbitrary memcpy&lt;br /&gt;
| Savefile datas are stored as key/value pairs, a large enough string key makes the game overwrite a memcpy source/destination addresses and size arguments. So one can actually memcpy a rop on the stack and gain control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| System: [[11.2.0-35]].&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| Around July 15, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], Vegaroxas&lt;br /&gt;
|-&lt;br /&gt;
| 1001 Spikes&lt;br /&gt;
| Buffer overflow via unchecked array-indexes in XML savefile parsing&lt;br /&gt;
| The savefiles are stored as renamed .xml files, which contain several tags with attributes like &#039;array-index=&amp;quot;array-value&amp;quot;&#039;, where both of these are converted from ASCII strings to integers as signed-int32, and the array-value given blindly written to an array inside a structure using the (unchecked) index given. With several of these attributes, one can overwrite the stack starting from the stored lr of the function that does this parsing, and write a ROP chain there. Testing used the &amp;quot;LevelAttempts&amp;quot; tag which is the last such tag parsed in that function.&lt;br /&gt;
| None&lt;br /&gt;
| App: v1.2.0 (TMD v2096)&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| Around November 2, 2016&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Omega Ruby/Alpha Sapphire&lt;br /&gt;
| Secret base team name heap overflow&lt;br /&gt;
| When the player wants to edit the team name, it is copied over the heap, however its length is not verified. So with a large enough team name one can overwrite some pointers and get two arbitrary jumps and then get control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| App: 1.4. System: [[11.2.0-35]].&lt;br /&gt;
| December 30, 2016&lt;br /&gt;
| June, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Swapdoodle&lt;br /&gt;
| Heap buffer overflow via unchecked size&lt;br /&gt;
| The letter file format used by doodlebomb is composed of multiple chunks. Each chunks is described in the header of the file where the name, size and CRC of each chunk are stored. Some chunks are meant to be headers, every header&#039;s size should be 0x80, however the length of the STAHED1 chunk remains unchecked and the game memcpy the chunk to a 0x80 byte buffer with the length provided in the file. This way one is able to overwrite some pointers and get control of the execution flow.&lt;br /&gt;
| App: &amp;gt; v1.1.1&lt;br /&gt;
| App: v1.1.1&lt;br /&gt;
| April 24, 2017&lt;br /&gt;
| February, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Picross&lt;br /&gt;
| Arbitrary memcpy via unchecked size&lt;br /&gt;
| When reading the savefile, the game handles some lists of buffers that are copied to memory. These buffers should always be 0x14-bytes long but the game uses the size provided in the savefile to copy them. These buffers are copied in some structs and thus with a big enough length value, one can overwrite the next struct which contains a size and a destination address for a memcpy.&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| May 29, 2017&lt;br /&gt;
| June, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| RPG Maker Fes/Player&lt;br /&gt;
| Buffer overflow on .bss section&lt;br /&gt;
| When loading a project, the game copies multiple chunks over the BSS section. However the number of chunks to copy is not checked, thus a large amount of chunk result in a buffer overflow. There&#039;s multiple way to exploit this flaw to gain an arbitrary memcpy or an arbitrary jump.&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| August 28, 2017&lt;br /&gt;
| August, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| RPG Maker Fes/Player&lt;br /&gt;
| Buffer overflow via unchecked file size&lt;br /&gt;
| When loading a project, the game loads the file to a 0x200000 bytes long buffer. However the size remains unchecked, so with a big enough file one can overflow the buffer and overwrite a thread stack and then achieve ROP.&lt;br /&gt;
| None?&lt;br /&gt;
| App: ?&lt;br /&gt;
| August 29, 2017&lt;br /&gt;
| August, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Flipnote Studio 3D==&lt;br /&gt;
&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;
!  Fixed in app/system version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Flaw discovered by&lt;br /&gt;
|-&lt;br /&gt;
| KFH frame count overflow&lt;br /&gt;
| The KFH frame count field should not be &amp;gt;= 0x3E8, but it wasn&#039;t checked and so uncontrolled data were written over pointers, causing an unexploitable crash.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KMI paper color overflow&lt;br /&gt;
| Paper color field (and similar color fields) in KMI chunks was not checked, a too high value caused a jump to an uncontrolled location.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KSN BGM data size overflow&lt;br /&gt;
| The size of the BGM data in the KSN chunk was not checked, it was used in a memcpy so with a big enough size one could overwrite a thread stack on linear mem and achieve ROP (notehax v1).&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KMC chunk unchecked&lt;br /&gt;
| The KMC chunk was not verified at all, the CRC32 and the size were not checked. A big enough size caused an integer overflow and made the game read the file backward.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| KMI layer size unchecked&lt;br /&gt;
| The 3 layer size fields in KMI chunks were not checked, leading to some crashes in the editor.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Bad &amp;quot;queue&amp;quot; implementation&lt;br /&gt;
| When a KWZ was parsed, frames were copied in a kind of queue, bounds were not checked obviously, so with the KMI layer size flaw one was able to fill completely the queue, then write past the buffer and overwrite a heap chunk header (notehax v2). This is not possible anymore, the queue cannot be filled because layer sizes are checked. Moreover each time an element is removed from the queue, the whole content is memmoved *facepalm*.&lt;br /&gt;
| System: 11.6&lt;br /&gt;
| September 20, 2017&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Useless crashes / applications which were fuzzed==&lt;br /&gt;
* Pushmo (3DSWare), QR codes: level name is properly limited to 16 characters, game doesn&#039;t crash with a longer name. The only possible crashes are triggered by out-of-bounds array index values, these crashes are not exploitable due to the index value being 8bit.&lt;br /&gt;
&lt;br /&gt;
* [[Pyramids (3DSWare)]], QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
&lt;br /&gt;
* [[Pyramids 2 (3DSWare)]], QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/yellows8/mm3d_re The Legend of Zelda: Majora&#039;s Mask 3D]&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;The Legend of Zelda: A Link Between Worlds&amp;quot; and &amp;quot;The Legend of Zelda: Tri Force Heroes&amp;quot;: these games don&#039;t crash at all when the entire save-file(minus constant header data) is overwritten with /dev/random output / 0xFF-bytes. All of the CRC32s were updated for this of course.  Note that this refers to the regular save file: Tri Force Heroes can be exploited via BOSS extdata - see above.&lt;br /&gt;
&lt;br /&gt;
* Pokemon Mystery Dungeon: Gates to Infinity has the same unchecked file bounds as Pokemon Super Mystery Dungeon, however since save compression was introduced in Pokemon Super Mystery Dungeon, it only allocates one buffer within the application heap instead of several within the linear heap, resulting in nothing to corrupt or overwrite even if the file&#039;s length is extended past its allocation.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Kid Icarus: Uprising&amp;quot;: Overwriting the entire savedata results in various crashes, nothing useful.&lt;br /&gt;
&lt;br /&gt;
* Savedata/extdata for &amp;quot;Super Smash Bros 3DS&amp;quot;: Overwriting the various files stored under savedata/extdata results in useless crashes.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;StarFox 64 3D&amp;quot;: Doesn&#039;t crash at all with the entire savedata overwritten.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Frogger 3D&amp;quot;: Overwriting a savefile with random-data results in *nothing* crashing.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Mutant Mudds&amp;quot;: Overwriting the savefile with random data results in a crash&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Animal Crossing: New Leaf&amp;quot;: Creating a QR code from random data results in a valid QR code and a random design. In some very rare cases(which aren&#039;t always reproducible?) a crash/etc may occur, but this isn&#039;t known to be useful.&lt;br /&gt;
&lt;br /&gt;
==Crashes needing investigation==&lt;br /&gt;
* Disney Infinity crashes when all savedata overwritten with /dev/urandom. No checksums. 0xFF bytes don&#039;t cause a crash.&lt;br /&gt;
&lt;br /&gt;
* Football Up Online / Soccer Up Online and Football Up 3D / Soccer Up 3D crash when teamname(UTF-16) length = 0x48 AND 0x20 null bytes are removed after just the name or if teamname length is way longer than 0x48.&lt;br /&gt;
&lt;br /&gt;
=System applications=&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;
!  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;
| 3DS [[System Settings]] DS profile string stack-smash&lt;br /&gt;
| Too long or corrupted strings (01Ah  2   Nickname length in characters     050h  2   Message length in characters) in the NVRAM DS user settings (System Settings-&amp;gt;Other Settings-&amp;gt;Profile-&amp;gt;Nintendo DS Profile) cause it to crash in 3DS-mode due to a stack-smash. The DSi is not vulnerable to this, DSi launcher(menu) and DSi System Settings will reset the NVRAM user-settings if the length field values are too long(same result as when the CRCs are invalid). TWL_FIRM also resets the NVRAM user-settings when the string-length(s) are too long.&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Ichfly|Ichfly]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Nintendo 3DS Sound]]&lt;br /&gt;
| When a .m4a is loaded, the song name is copied to a 256 byte buffer. When the song name begins with a Unicode BOM marker, it memcpy&#039;s the tag using the user-provided length. This gives an arbitrary write which can be used to achieve ROP.&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
| [[11.4.0-37]]&lt;br /&gt;
| June/July 2016&lt;br /&gt;
| [[User:nedwill|nedwill]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=System applets=&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;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Introduced with version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Webkit/web-browser bugs&lt;br /&gt;
| spider has had at least three different code-execution exploits. Majority of them are use-after-free issues. See also [[browserhax|here]].&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| 2013?&lt;br /&gt;
|&lt;br /&gt;
| A lot of people.&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS/New3DS [[Internet_Browser|Browser-version-check]] bypass&lt;br /&gt;
| When the browser-version-check code runs where the savedata for it was never initialized(such as when the user used the &amp;quot;Initialize savedata&amp;quot; option), it will use base_timestamp=0 instead of the timestamp loaded from savedata. This is then used with &amp;quot;if(cur_timestamp - base_timestamp &amp;gt;= &amp;lt;24h timestamp&amp;gt;){Run browser-version-check HTTPS request code}&amp;quot;.&lt;br /&gt;
Hence, if the savedata was just initialized, and if the system datetime is set to before January 2, 2000, the browser-version-check will be skipped. This includes January 1, 2000, 00:00, because that&#039;s the epoch(timestamp value 0x0) used with this timestamp.&lt;br /&gt;
&lt;br /&gt;
See [http://yls8.mtheall.com/3dsbrowserhax.php here] for bypass usage instructions.&lt;br /&gt;
&lt;br /&gt;
This was fixed with [[10.7.0-32|10.7.0-32]], see [[Internet_Browser|here]] for details.&lt;br /&gt;
| [[10.7.0-32|10.7.0-32]]&lt;br /&gt;
| &lt;br /&gt;
| [[9.9.0-26|9.9.0-26]]&lt;br /&gt;
| February 25, 2016&lt;br /&gt;
| November 2, 2015 (Exactly one week after the browser version pages were initially updated server-side)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Home Menu==&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;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Introduced with version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| bossbannerhax&lt;br /&gt;
| After successfully loading [[Extended_Banner|extended-banner]] data(done when selecting an icon), Home Menu attempts to load &amp;quot;[[CBMD]]&amp;quot; data into a 0x100000-byte heap buffer from the [[BOSS_Services|stored]] SpotPass content. When successful and the magic-number is CBMD, Home Menu then decompresses the exbanner sections into another fixed-size heap buffer, without checking the outsize at all. The main CBMD CGFX code with ExeFS checks the size, but this code doesn&#039;t(however this is exbanner &amp;quot;CBMD&amp;quot;, not a &amp;quot;normal&amp;quot; CBMD).&lt;br /&gt;
&lt;br /&gt;
Used with menuhax as of v3.2.&lt;br /&gt;
| [[11.3.0-36|11.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[1.0.0-0|1.0.0-0]]&lt;br /&gt;
| November 18, 2016&lt;br /&gt;
| December 23, 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| sdiconhax&lt;br /&gt;
| This is basically the same as nandiconhax, the vulnerable SD/NAND functions are &#039;&#039;identical&#039;&#039; minus the file-buffer offsets. Exploitation is different due to different heap-buffer location though. Unlike nandiconhax, the icon buffer for SD is located in linearmem(with recent Home Menu versions at least). This is used by [[menuhax]].&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7|4.0.0-X]]&lt;br /&gt;
| July 27, 2016&lt;br /&gt;
| October 23, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[System_SaveData|NAND-savedata]] Launcher.dat icons (nandiconhax)&lt;br /&gt;
| The homemenu code processing the titleid list @ launcherdat+8 copies those titleIDs to another buffer, where the offset relative to that buffer is calculated using the corresponding s8/s16 entries. Those two values are not range checked at all. Hence, one can use this to write u64(s) with arbitrary values to before/after this allocated output buffer. See [[Home_Menu|here]] regarding Launcher.dat structure.&lt;br /&gt;
&lt;br /&gt;
This can be exploited(with Launcher.dat loading at startup at least) by using a s16 for the icon entry with value 0xFFEC(-20)(and perhaps more icons with similar s16 values to write multiple u64s). The result is that the u64 value is written to outbuf-0xA0, which overwrites object+0(vtable) and object+4(doesn&#039;t matter here) for an object that gets used a bit after the vulnerable function triggers. The low 32bits of the u64 can then be set to the address of controlled memory(either outbuf in regular heap or the entire launcherdat buffer in linearmem), for use as a fake vtable in order to get control of PC. From there one can begin ROP via vtable funcptrs to do a stack-pivot(r4=objectaddr at the time the above object gets used).&lt;br /&gt;
&lt;br /&gt;
Originally this vuln could only be triggered via Launcher.dat at Home Menu startup, right after Launcher.dat gets loaded + memory gets allocated, once the file-format version code is finished running. Starting with v9.6 this can be triggered when loading layouts from SD extdata as well. The vuln itself triggers before the layout data is written to Launcher.dat, but it doesn&#039;t seem to be possible to overwrite anything which actually gets used before the function which writes Launcher.dat into the layout gets called.&lt;br /&gt;
&lt;br /&gt;
Home Menu has some sort of fail-safe system(or at least on v9.7) when Home Menu crashes due to Launcher.dat(this also applies for other things with Home Menu): after crashing once, Home Menu resets Launcher.dat to a state where it no longer crashes anymore. However, note that any exploits using this which hang/etc without crashing will still brick the system. &#039;&#039;&#039;Hence, attempting anything with this on physnand without hw-nand-access isn&#039;t really recommended.&#039;&#039;&#039;&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7|4.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| May 14, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Theme-data decompression buffer overflow ([[menuhax|themehax]])&lt;br /&gt;
| The only func-call size parameter used by the theme decompression function is one for the compressed size, none for the decompressed size. The decompressed-size value from the LZ header is used by this function to check when to stop decompressing, but this function itself has nothing to verify the decompressed_size with. The code calling this function does not check or even use the decompressed size from the header either.&lt;br /&gt;
&lt;br /&gt;
This function is separate from the rest of the Home Menu code: the function used for decompressing themes is *only* used for decompressing themes, nothing else. There&#039;s a separate decompression function in Home Menu used for decompressing everything else.&lt;br /&gt;
&lt;br /&gt;
That other decompression function in Home Menu handles decompression size properly(decompressed size check for max buffer size is done by code calling the other function, not in the function itself). Unlike the other function, the theme function supports multiple LZ algorithms, but the one which actually gets used in official themes is the same one supported by the other function anyway.&lt;br /&gt;
&lt;br /&gt;
See also [[menuhax|here]].&lt;br /&gt;
&lt;br /&gt;
With [[10.2.0-28|10.2.0-X]] Home Menu, the only code change was that the following was added right after theme-load and before actual decompression: &amp;quot;if(&amp;lt;get_lzheader_decompressed_size&amp;gt;(compressed_buf) &amp;gt; 0x150000)&amp;lt;exit&amp;gt;;&amp;quot;. This fixed the vuln.&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| &amp;lt;Old3DS/New3DS version which added initial theme support&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| December 22, 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]] independently (~spring 2015)&lt;br /&gt;
|-&lt;br /&gt;
| Shuffle body-data buffer overflow ([[menuhax|shufflehax]])&lt;br /&gt;
| See [[menuhax|here]].&lt;br /&gt;
| [[10.6.0-31|10.6.0-X]]&lt;br /&gt;
| [[10.6.0-31|10.6.0-X]]&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| January 3, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Extdata file-data loading buffer overflow&lt;br /&gt;
| The extdata file-reading code allocates a fixed-size heap buffer for the expected filesize, then reads the filedata into this buffer using the actual FS filesize. Before v5.0 the filesize used here wasn&#039;t validated, hence if the filesize is larger than alloc_size a buffer overflow would occur. &#039;&#039;After&#039;&#039; doing the file-read it does validate that the actual_readsize matches the alloc_size, but at this point the buffer overflow has already occurred.&lt;br /&gt;
&lt;br /&gt;
This affected at least the following: SaveData.dat and Cache.dat.&lt;br /&gt;
&lt;br /&gt;
This can be triggered with SaveData.dat by installing a &amp;lt;v4.0 Home Menu version, with Home Menu extdata from &amp;gt;=v4.0 still on SD. When this is done with v2.0 Home Menu, a kernelpanic occurs when processing an AM command(it appears a buffer ptr which is then passed to a command was overwritten with 0x0 - of course other SaveData.dat filesizes may result in different behaviour).&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| June 9, 2016&lt;br /&gt;
| June 9, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The icon data arrays used with {sd/nand}iconhax were added to SaveData.dat/Launcher.dat with [[4.0.0-7|4.0.0-X]], hence the vulnerable functions were added with that same version.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;=v4.0 the SaveData.dat buffer is located in the regular heap. It&#039;s unknown when exactly it was moved to linearmem, which is where it&#039;s located with recent versions. It&#039;s located in linearmem for KOR &amp;gt;=v9.6 for example.&lt;br /&gt;
&lt;br /&gt;
The SaveData.dat/Launcher.dat icon vulns were fixed by doing various unsigned &amp;gt;=60/&amp;gt;=360 checks on the loaded values. When these checks fail, it just skips over handling this icon entry. Hence, the original value can&#039;t be negative / out-of-bounds any more.&lt;br /&gt;
&lt;br /&gt;
==Useless crashes==&lt;br /&gt;
Old3DS system web-browser:&lt;br /&gt;
* 2^32 characters long string(&#039;&#039;finally&#039;&#039; fixed with v10.6): this is similar to the vulnerability fixed [http://git.chromium.org/gitweb/?p=external/Webkit.git;a=commitdiff;h=ec471f16fbd1f879cb631f9b022fd16acd75f4d4 here], concat-large-strings-crash2.html triggers a crash which is about the same as the one triggered by a 2^32 string. Most of the time this vulnerability will cause a memory page permissions fault, since the WebKit code attempts to copy the string text data to the output buffer located in read-only [[CRO0|CRO]] heap memory. The only difference between a crash triggered by a 2^32 string and the concat-large-strings-crash2.html crash is at the former copies the string data using the original string length(like 1 text character for &amp;quot;x&amp;quot;, 4 for &amp;quot;xxxx&amp;quot;) while the latter attempts to copy &amp;gt;12MB. In some &#039;&#039;very&#039;&#039; rare cases a thread separate from the string data-copy thread will crash, this might be exploitable. However, this is mostly useless since it rarely crashes this way.&lt;br /&gt;
&lt;br /&gt;
* Trying to directly load a page via the browser &amp;quot;URL&amp;quot; option with [https://github.com/yellows8/3ds_browserhax_common webkitdebug] setup, causes a crash to trigger in oss.cro due to an use-after-free being caught with webkitdebug. This is presumably some sort of realloc() issue in the libcurl version used by the &amp;lt;={v10.2-v10.3} browser. This happens with *every* *single* *page* one tries to load via the &amp;quot;URL&amp;quot; option, but not when loading links on the current page, hence this is probably useless. A different use-after-free with realloc triggers with loading any page at all regardless of method too(libcurl probably).&lt;br /&gt;
&lt;br /&gt;
* This WebKit build has &#039;&#039;a lot&#039;&#039; of crash-trigger bugs that only happen with [https://github.com/yellows8/3ds_browserhax_common webkitdebug] completely setup(addr accesses near 0x0), with &#039;&#039;just&#039;&#039; trying to load any page at all.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NS_and_APT_Services&amp;diff=20314</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=20314"/>
		<updated>2017-09-18T09:20:33Z</updated>

		<summary type="html">&lt;p&gt;Riley: &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 (also see [[Bootloader]]). 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;
| 0x000100C0&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;
| 0x00030000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:TerminateApplication|TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040040&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:TerminateProcess|TerminateProcess]]&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:SetWirelessRebootInfo|SetWirelessRebootInfo]]&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;
| [[NSS:CardUpdateShutdown|CardUpdateShutdown]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| Gamecard system update related.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&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:SetTWLBannerHMAC|SetTWLBannerHMAC]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:ShutdownAsync|ShutdownAsync]]&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;
| 0x00110100&lt;br /&gt;
| [[1.0.0-0]] - [[2.0.0-2]]&lt;br /&gt;
| [[NSS:TerminateTitle|TerminateTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001200C0&lt;br /&gt;
| ?&lt;br /&gt;
| [[NSS:SetApplicationCpuTimeLimit|SetApplicationCpuTimeLimit]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140042&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150140&lt;br /&gt;
| ?&lt;br /&gt;
| [[NSS:LaunchApplication|LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| [[NSS:RebootSystemClean|RebootSystemClean]]&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 Power Service &amp;quot;ns:p&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;
| 0x00010040&lt;br /&gt;
| [[NSP:RebootSystem|RebootSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020000&lt;br /&gt;
| [[NSS:ShutdownAsync|ShutdownAsync]]&lt;br /&gt;
|}&lt;br /&gt;
&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;
{| 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;
| 0x00010100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&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;
| [[APT:GetLockHandle|GetLockHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| &lt;br /&gt;
| See [[APT:Initialize|here]].&lt;br /&gt;
| [[APT:Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:Enable|Enable]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:Finalize|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, for AppID != 0x300&lt;br /&gt;
| [[APT:GetAppletInfo|GetAppletInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetLastSignaledAppletId|GetLastSignaledAppletId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CountRegisteredApplet|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;
| [[APT:GetAttribute|GetAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:InquireNotification|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;
| [[APT:DebugFunc|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;
| [[APT:SetHomeMenuAppletIdForDebug|SetHomeMenuAppletIdForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetPreparationState|GetPreparationState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SetPreparationState|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;
| [[APT:PreloadLibraryApplet|PreloadLibraryApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:FinishPreloadingLibraryApplet|FinishPreloadingLibraryApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToStartLibraryApplet|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;
| [[APT:PrepareToStartNewestHomeMenu|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;
| [[APT:WakeupApplication|WakeupApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CancelApplication|CancelApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E0084&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:StartLibraryApplet|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;
| [[APT:OrderToCloseApplication|OrderToCloseApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToCloseApplication|PrepareToCloseApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00230040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToJumpToApplication|PrepareToJumpToApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00240044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:JumpToApplication|JumpToApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002500C0&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToCloseLibraryApplet|PrepareToCloseLibraryApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToCloseSystemApplet|PrepareToCloseSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00270044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CloseApplication|CloseApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CloseLibraryApplet|CloseLibraryApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CloseSystemApplet|CloseSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:OrderToCloseSystemApplet|OrderToCloseSystemApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToJumpToHomeMenu|PrepareToJumpToHomeMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:JumpToHomeMenu|JumpToHomeMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D0000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToLeaveHomeMenu|PrepareToLeaveHomeMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E0044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:LeaveHomeMenu|LeaveHomeMenu]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToLeaveResidentApplet|PrepareToLeaveResidentApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00300044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:LeaveResidentApplet|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;
| [[APT:GetProgramIdOnApplicationJump|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;
| [[APT:ReceiveDeliverArg|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;
| [[APT:PreloadResidentApplet|PreloadResidentApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00390040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:PrepareToStartResidentApplet|PrepareToStartResidentApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003A0044&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:StartResidentApplet|StartResidentApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003B0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CancelLibraryApplet|CancelLibraryApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003C0042&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SendDspSleep|SendDspSleep]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0042&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:SendDspWakeUp|SendDspWakeUp]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E0080&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:ReplySleepQuery|ReplySleepQuery]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x003F0040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:ReplySleepNotificationComplete|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;
| [[APT:SleepSystem|SleepSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00430040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:NotifyToWait|NotifyToWait]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00440000&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetSharedFont|GetSharedFont]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00450040&lt;br /&gt;
| &lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetWirelessRebootInfo|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;
| [[APT:SetFatalErrDispMode|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;
| [[APT:HardwareResetAsync|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;
| 0x00510080&lt;br /&gt;
| [[3.0.0-5]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetStartupArgument|GetStartupArgument]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00520104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:Wrap1|Wrap1]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00530104&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:Unwrap1|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;
| [[APT:SetScreencapPostPermission|SetScreencapPostPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00560000&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetScreencapPostPermission|GetScreencapPostPermission]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00570044&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| ?&lt;br /&gt;
| [[APT:WakeupApplication2|WakeupApplication2]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x00580002&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:GetProgramID|GetProgramID]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x01010000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CheckNew3DSApp|CheckNew3DSApp]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x01020000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| Yes&lt;br /&gt;
| [[APT:CheckNew3DS|CheckNew3DS]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x01030000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| Yes&lt;br /&gt;
| This writes an output u8 to cmdreply[2], the value is determined by checking various NS internal state + whether this is a New3DS.&lt;br /&gt;
The normal output seems to be value 0x2. Forcing this value to 0x1 causes New3DS HID usage(via ir:USER) in Smash Bros to be disabled.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01040000&lt;br /&gt;
| [[8.0.0-18]]&lt;br /&gt;
| ?&lt;br /&gt;
| [[APT:IsStandardMemoryLayout|IsStandardMemoryLayout]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x01050100&lt;br /&gt;
| [[10.4.0-29]]&lt;br /&gt;
| ?&lt;br /&gt;
| [[APT:IsTitleAllowed|IsTitleAllowed]]&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;
== AppletAttr ==&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-2&lt;br /&gt;
| [[NS_and_APT_Services#AppletPos|AppletPos]]&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Manually Acquire/Release GPU Rights&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Manually Acquire/Release DSP Rights&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DisplayBufferMode ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| FORMAT_R8G8B8A8&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| FORMAT_R8G8B8&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| FORMAT_R5G6B5&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| FORMAT_R5G5B5A1&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| FORMAT_R4G4B4A4&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFFF&lt;br /&gt;
| FORMAT_UNIMPORTABLE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is the same mapping as used for the [[GPU/External_Registers#Framebuffer_color_formats|GPU framebuffer color formats]].&lt;br /&gt;
&lt;br /&gt;
== AppletPos ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1&lt;br /&gt;
| POS_NONE&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| POS_APP&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| POS_APPLIB&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| POS_SYS&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| POS_SYSLIB&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| POS_RESIDENT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== QueryReply ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| REPLY_REJECT&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| REPLY_ACCEPT&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| REPLY_LATER&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notification ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| NOTIFICATION_NONE&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| NOTIFICATION_HOME_BUTTON_1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| NOTIFICATION_HOME_BUTTON_2&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| NOTIFICATION_SLEEP_QUERY&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| NOTIFICATION_SLEEP_CANCELED_BY_OPEN&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| NOTIFICATION_SLEEP_ACCEPTED&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| NOTIFICATION_SLEEP_AWAKE&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| NOTIFICATION_SHUTDOWN&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| NOTIFICATION_POWER_BUTTON_CLICK&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| NOTIFICATION_POWER_BUTTON_CLEAR&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| NOTIFICATION_TRY_SLEEP&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| NOTIFICATION_ORDER_TO_CLOSE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Command ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| COMMAND_NONE&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| COMMAND_WAKEUP&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| COMMAND_REQUEST&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| COMMAND_RESPONSE&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| COMMAND_EXIT&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| COMMAND_MESSAGE&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| COMMAND_HOME_BUTTON_SINGLE&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| COMMAND_HOME_BUTTON_DOUBLE&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| COMMAND_DSP_SLEEP&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| COMMAND_DSP_WAKEUP&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| COMMAND_WAKEUP_BY_EXIT&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| COMMAND_WAKEUP_BY_PAUSE&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| COMMAND_WAKEUP_BY_CANCEL&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| COMMAND_WAKEUP_BY_CANCELALL&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| COMMAND_WAKEUP_BY_POWER_BUTTON_CLICK&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| COMMAND_WAKEUP_TO_JUMP_HOME&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| COMMAND_REQUEST_FOR_SYS_APPLET&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| COMMAND_WAKEUP_TO_LAUNCH_APPLICATION&lt;br /&gt;
|-&lt;br /&gt;
| 0x41&lt;br /&gt;
| Unknown. [[APT:ReceiveParameter|Received]] by Home Menu during boot when the Home Menu process doesn&#039;t terminate properly(svcExitProcess/crash).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AppletPreparationState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| NO_PREPARATION&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| PREPARED_TO_LAUNCH_APP&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PREPARED_TO_CLOSE_APP&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| PREPARED_TO_FORCE_TO_CLOSE_APP&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| PREPARED_TO_PRELOAD_APPLIB&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| PREPARED_TO_LAUNCH_APPLIB&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| PREPARED_TO_CLOSE_APPLIB&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| PREPARED_TO_LAUNCH_SYS&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| PREPARED_TO_CLOSE_SYS&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| PREPARED_TO_PRELOAD_SYSLIB&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| PREPARED_TO_LAUNCH_SYSLIB&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| PREPARED_TO_CLOSE_SYSLIB&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| PREPARED_TO_LAUNCH_RESIDENT&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| PREPARED_TO_LEAVE_RESIDENT&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| PREPARED_TO_DO_HOMEMENU&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| PREPARED_TO_LEAVE_HOMEMENU&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| PREPARED_TO_START_RESIDENT&lt;br /&gt;
|-&lt;br /&gt;
| 17&lt;br /&gt;
| PREPARED_TO_DO_APP_JUMP&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| PREPARED_TO_FORCE_TO_CLOSE_SYS&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| PREPARED_TO_LAUNCH_OTHER_SYS&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| PREPARED_TO_JUMP_TO_APP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== StartupArgumentType ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| STARTUP_ARGUMENT_TYPE_OTHER_APP&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| STARTUP_ARGUMENT_TYPE_RESTART&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| STARTUP_ARGUMENT_TYPE_OTHER_MEDIA&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CaptureBufferInfo ==&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;
| u32, Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8, 3D (0 = not 3D, 1 = 3D)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| 0x3&lt;br /&gt;
| Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Main Screen Left Offset&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Main Screen Right Offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Main Screen [[NS_and_APT_Services#DisplayBufferMode|DisplayBufferMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sub Screen Left Offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sub Screen Right Offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Sub Screen [[NS_and_APT_Services#DisplayBufferMode|DisplayBufferMode]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==WirelessRebootInfo==&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;
| 0x6&lt;br /&gt;
| Host MAC address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x9&lt;br /&gt;
| WirelessRebootPassphrase&lt;br /&gt;
|-&lt;br /&gt;
| 0xF&lt;br /&gt;
| 0x1&lt;br /&gt;
| Uninitialized&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is [[NSS:SetWirelessRebootInfo|setup]] by the dlplay system-application, before launching the DLP-child which can then use [[APT:GetWirelessRebootInfo]]. The MAC address and passphrase is used for connecting to the host by the DLP-child. See also [[DLP_Services|here]].&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;
=Applets=&lt;br /&gt;
NS module does not verify that the input appID for the APT service cmds are correct for that type of command. For example, a process-launch of a SystemApplet via LibraryApplet commands works fine(minus the launched-process side of APT probably).&lt;br /&gt;
&lt;br /&gt;
==System Applets==&lt;br /&gt;
On Old3DS there could only be one applet here(Home Menu, Internet Browser, Friend-List, etc) with programID-high 00040030 running at a time. On Old3DS when directly launching one of these 00040030 applets with Home Menu, the Home Menu process will terminate once the process is launched. On Old3DS when returning to Home Menu from that launched process, the Home Menu process is launched again.&lt;br /&gt;
&lt;br /&gt;
On New3DS the Home Menu process is still running/in-memory, while another system-applet is running. On New3DS it appears that the Home Menu process is terminated+relaunched, when another system-applet terminated without exiting with APT properly.&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 ([[Camera Applet|CtrApp]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x112&lt;br /&gt;
| Friends List applet ([[Friend List|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;
| 0x118&lt;br /&gt;
| [[Miiverse]] posting applet (solv3)&lt;br /&gt;
|-&lt;br /&gt;
| 0x119&lt;br /&gt;
| Amiibo settings (cabinet)&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 ([[ErrDisp|error]]) (?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x207&lt;br /&gt;
| eShop applet ([[EShop#NS_eShop_application_parameters|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;
| 0x301&lt;br /&gt;
| eShop (tiger)&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>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_Userland_Flaws&amp;diff=19040</id>
		<title>3DS Userland Flaws</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_Userland_Flaws&amp;diff=19040"/>
		<updated>2016-12-27T16:41:50Z</updated>

		<summary type="html">&lt;p&gt;Riley: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists vulnerabilities / exploits for 3DS applications and applets. Exploiting these initially results in ROP, from that ROP one can then for example try exploiting [[3DS_System_Flaws|system]] flaw(s).&lt;br /&gt;
&lt;br /&gt;
=Non-system applications=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Application name&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed in app/system version&lt;br /&gt;
!  Last app/system version this flaw was checked for&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this vuln was discovered&lt;br /&gt;
!  Vuln discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Cubic Ninja&lt;br /&gt;
| Map-data stack smash&lt;br /&gt;
| See [[Ninjhax|here]] regarding Ninjhax.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[10.4.0-29]].&lt;br /&gt;
| Ninjhax release&lt;br /&gt;
| July 2014&lt;br /&gt;
| [[User:smea|smea]]&lt;br /&gt;
|-&lt;br /&gt;
| The Legend of Zelda: Ocarina of Time 3D&lt;br /&gt;
| UTF-16 name string buffer overflow via unchecked u8 length field&lt;br /&gt;
| The u8 at offset 0x2C in the savefile is the character-length of the UTF-16 string at offset 0x1C. When copying this string, it&#039;s essentially a memory-copy with lenval*2, not a string-copy. This can be used to trigger buffer overflows at various locations depending on the string length.&lt;br /&gt;
* When value is &amp;gt;=0x6E it crashes when saving the saveslot, this causes a stack-smash however it normally crashes before it returns from the function which had the stack-frame overwritten.&lt;br /&gt;
* With value &amp;gt;=0x9A, it crashes via stack-smash in-game once any dialogs are opened(touching buttons on the touch-screen can trigger it too).&lt;br /&gt;
* Length value&amp;gt;=0xCD causes a crash while loading the saveslot, via a heap buffer overflow. This buf-overflow overwrites a heap memchunk following the allocated buffer. When the first 16-bits overwriting that heap memchunk is not the memchunk magic-number(0x7373), the mem-alloc code will just return a NULL ptr which later results in a crash. When the magic-number is valid, the mem-alloc code will continue to attempt to parse the memchunk, which may crash depending on the data which overwrote the memchunk. This heap code is separate from the CTRSDK heap code. Exploiting this doesn&#039;t seem to be possible: since the heap code actually verifies that the magic-number for the next/prev memchunk ptrs are correct(unlike CTRSDK), it&#039;s not possible to change those ptrs to useful arbitrary addresses outside of savedata(like with triggering a write to a c++ object ptr which later is used with a vtable func-call, this is what one would do with CTRSDK heap here).&lt;br /&gt;
&lt;br /&gt;
On March 11, 2015, an exploit using this vuln was released, that one was intended for warez/etc. The following exploit wasn&#039;t released before then mainly because doing so would (presumably) result in the vuln being fixed. The following old exploit was released on March 14, 2015: [https://github.com/yellows8/oot3dhax].&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[10.6.0-31]].&lt;br /&gt;
| March 11, 2015&lt;br /&gt;
| Around October 22, 2012&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Super Smash Bros 3DS&lt;br /&gt;
| Buffer overflow in local-multiplayer beacon handling.&lt;br /&gt;
| See [[smashbroshax|here]].&lt;br /&gt;
| App: v1.1.3&lt;br /&gt;
| See [[smashbroshax|here]]. System: [[10.3.0-28]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| See [[smashbroshax|here]].&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pokemon Super Mystery Dungeon&lt;br /&gt;
| Heap overflow within linear memory via unchecked save file length&lt;br /&gt;
| Pokemon Super Mystery Dungeon uses zlib compression for most of its save files, possibly due to the save files being larger than it&#039;s predecessor, Gates to Infinity. When a save file is being prepared to be loaded and read from, only a 0x32000 large buffer is allocated for file reading, and a 0x3e800-large buffer for decompression is also allocated before the file is read. However, the game does not limit the size of the file read to this allocation bound, allowing for the file to overflow into the linear memory heap and into the next allocation. Since Pokemon Super Mystery Dungeon stores allocation memchunks directly before the allocation, overwriting the next memchunk with a corrupted one allows for arbitrary writes of linear heap pointers when the next buffer is allocated or arbitrary writes of any pointer within writable memory when the corrupted buffer is freed.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| April 14, 2016&lt;br /&gt;
| [[User:Shinyquagsire23|Shiny Quagsire]]&lt;br /&gt;
|-&lt;br /&gt;
| VVVVVV&lt;br /&gt;
| Buffer overflow in XML save file array parsing&lt;br /&gt;
| VVVVVV utilizes several XML files (renamed with a .vvv extension) to store level save data, stats and settings. Within these XML files are several tags containing an array of data which, when parsed, is not properly checked to be of proper length for the tag being parsed from. This allows for an overflow of 16-bit array values from the location where the array is parsed. With unlock.vvv, XML data is parsed to the stack, and with level saves the heap. This allows for the pointer where the level save worldmap tag array should be parsed into to be overwritten with a stack address, allowing for ROP from within the XML array parsing function on the next level load.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| April 25, 2016&lt;br /&gt;
| [[User:Shinyquagsire23|Shiny Quagsire]]&lt;br /&gt;
|-&lt;br /&gt;
| Citizens of Earth&lt;br /&gt;
| Save file read stack smash&lt;br /&gt;
| Citizens of Earth also uses &amp;quot;XML&amp;quot; files for saves, which are actually entirely binary data (not XML at all) with no checksums. These files are read from the filesystem on to a fixed size stack buffer which leads to an incredibly trivial stack smash. When using the autosave slot for this, the save is parsed when the user selects &amp;quot;continue&amp;quot;. When using one of the dedicated save slots (1-3), the save is parsed shortly after the company splash screens fade. Note that the save is read quite high (descending) on the stack - when exploiting this, one would likely need to move SP due to almost instantly overflowing the physical stack.&lt;br /&gt;
| None&lt;br /&gt;
| [[10.7.0-32]].&lt;br /&gt;
| Time of exploit release.&lt;br /&gt;
| May 5, 2016&lt;br /&gt;
| [[User:Dazzozo|Dazzozo]]&lt;br /&gt;
|-&lt;br /&gt;
| SmileBASIC 3.x&lt;br /&gt;
| Poor parameter validation on &amp;quot;BGSCREEN&amp;quot; command&lt;br /&gt;
| The SmileBASIC &amp;quot;BGSCREEN&amp;quot; command&#039;s second parameter is not properly validated as being within range.  As a result, one can set the screen size to an absurdly large value.  This means that the &amp;quot;BGGET&amp;quot; and &amp;quot;BGPUT&amp;quot; commands can then be used on out-of-range values to read and write a significant chunk of the interpreter&#039;s address space.&lt;br /&gt;
With a series of carefully-designed BGPUT commands, one can build a ROP chain and cause it to be executed.&lt;br /&gt;
| App: 3.3.2.&lt;br /&gt;
| System: [[11.0.0-33]].&lt;br /&gt;
| July 20, 2016&lt;br /&gt;
| Around June 26, 2016&lt;br /&gt;
| slackerSnail, 12Me12, incvoid&lt;br /&gt;
Exploited by MrNbaYoh and [[User:Plutooo|plutoo]].&lt;br /&gt;
|-&lt;br /&gt;
| The Legend of Zelda: Tri Force Heroes&lt;br /&gt;
| [[3DS_System_Flaws#General.2FCTRSDK|CTRSDK]] CTPK buffer overflow combined with game&#039;s usage of SpotPass&lt;br /&gt;
| This isn&#039;t really useful due to [[BOSS_Services#Custom_SpotPass_content|this]].&lt;br /&gt;
&lt;br /&gt;
During the very first screen displayed by the game during boot(&amp;quot;Loading...&amp;quot;), just seconds after title launch, the game loads CTPK from the [[BOSS_Services|stored]] SpotPass content. Hence, this game could be exploited via the vulnerable CTRSDK CTPK code &#039;&#039;if&#039;&#039; one could get custom SpotPass data into extdata somehow.&lt;br /&gt;
&lt;br /&gt;
The code for this runs from a thread separate from the main-thread, with the stack in linearmem heap.&lt;br /&gt;
&lt;br /&gt;
The two SpotPass URLs for this have always(?) returned HTTP 404 as of November 2016. It appears these were intended for use as textures for additional costumes(and never got used publicly), but this wasn&#039;t tested.&lt;br /&gt;
| None&lt;br /&gt;
| App: v2.1.0&lt;br /&gt;
| November 18, 2016&lt;br /&gt;
| November 14, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Pixel Paint&lt;br /&gt;
| Buffer overflow via unchecked extdata file length&lt;br /&gt;
| Pixel Paint loads pictures saved by the user from extdatas. The file is read to a fixed size buffer but the file length remains unchecked, so with a large enough file, one can overwrite pointers in memory and gain control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| App: Initial version. System: [[11.2.0-35]].&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| November 5, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]]&lt;br /&gt;
|-&lt;br /&gt;
| Steel Diver : Sub Wars&lt;br /&gt;
| Heap overflow / arbitrary memcpy&lt;br /&gt;
| Savefile datas are stored as key/value pairs, a large enough string key makes the game overwrite a memcpy source/destination addresses and size arguments. So one can actually memcpy a rop on the stack and gain control of the execution flow.&lt;br /&gt;
| None&lt;br /&gt;
| System: [[11.2.0-35]].&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| Around July 15, 2016&lt;br /&gt;
| [[User:Nba_Yoh|MrNbaYoh]], Vegaroxas&lt;br /&gt;
|-&lt;br /&gt;
| 1001 Spikes&lt;br /&gt;
| Buffer overflow via unchecked array-indexes in XML savefile parsing&lt;br /&gt;
| The savefiles are stored as renamed .xml files, which contain several tags with attributes like &#039;array-index=&amp;quot;array-value&amp;quot;&#039;, where both of these are converted from ASCII strings to integers as signed-int32, and the array-value given blindly written to an array inside a structure using the (unchecked) index given. With several of these attributes, one can overwrite the stack starting from the stored lr of the function that does this parsing, and write a ROP chain there. Testing used the &amp;quot;LevelAttempts&amp;quot; tag which is the last such tag parsed in that function.&lt;br /&gt;
| None&lt;br /&gt;
| App: v1.2.0 (TMD v2096)&lt;br /&gt;
| December 27, 2016&lt;br /&gt;
| Around November 2, 2016&lt;br /&gt;
| [[User:Riley|Riley]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Useless crashes / applications which were fuzzed==&lt;br /&gt;
* Pushmo (3DSWare), QR codes: level name is properly limited to 16 characters, game doesn&#039;t crash with a longer name. The only possible crashes are triggered by out-of-bounds array index values, these crashes are not exploitable due to the index value being 8bit.&lt;br /&gt;
&lt;br /&gt;
* [[Pyramids (3DSWare)]], QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
&lt;br /&gt;
* [[Pyramids 2 (3DSWare)]], QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/yellows8/mm3d_re The Legend of Zelda: Majora&#039;s Mask 3D]&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;The Legend of Zelda: A Link Between Worlds&amp;quot; and &amp;quot;The Legend of Zelda: Tri Force Heroes&amp;quot;: these games don&#039;t crash at all when the entire save-file(minus constant header data) is overwritten with /dev/random output / 0xFF-bytes. All of the CRC32s were updated for this of course.&lt;br /&gt;
&lt;br /&gt;
* Pokemon Mystery Dungeon: Gates to Infinity has the same unchecked file bounds as Pokemon Super Mystery Dungeon, however since save compression was introduced in Pokemon Super Mystery Dungeon, it only allocates one buffer within the application heap instead of several within the linear heap, resulting in nothing to corrupt or overwrite even if the file&#039;s length is extended past it&#039;s allocation.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Kid Icarus: Uprising&amp;quot;: Overwriting the entire savedata results in various crashes, nothing useful.&lt;br /&gt;
&lt;br /&gt;
* Savedata/extdata for &amp;quot;Super Smash Bros 3DS&amp;quot;: Overwriting the various files stored under savedata/extdata results in useless crashes.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;StarFox 64 3D&amp;quot;: Doesn&#039;t crash at all with the entire savedata overwritten.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Frogger 3D&amp;quot;: Overwriting a savefile with random-data results in *nothing* crashing.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Mutant Mudds&amp;quot;: Overwriting the savefile with random data results in a crash&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Animal Crossing: New Leaf&amp;quot;: Creating a QR code from random data results in a valid QR code and a random design. In some very rare cases(which aren&#039;t always reproducible?) a crash/etc may occur, but this isn&#039;t known to be useful.&lt;br /&gt;
&lt;br /&gt;
==Crashes needing investigation==&lt;br /&gt;
* Disney Infinity crashes when all savedata overwritten with /dev/urandom. No checksums. 0xFF bytes don&#039;t cause a crash.&lt;br /&gt;
&lt;br /&gt;
* Football Up Online / Soccer Up Online and Football Up 3D / Soccer Up 3D crash when teamname(UTF-16) length = 0x48 AND 0x20 null bytes are removed after just the name or if teamname length is way longer than 0x48.&lt;br /&gt;
&lt;br /&gt;
=System applications=&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;
!  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;
| 3DS [[System Settings]] DS profile string stack-smash&lt;br /&gt;
| Too long or corrupted strings (01Ah  2   Nickname length in characters     050h  2   Message length in characters) in the NVRAM DS user settings (System Settings-&amp;gt;Other Settings-&amp;gt;Profile-&amp;gt;Nintendo DS Profile) cause it to crash in 3DS-mode due to a stack-smash. The DSi is not vulnerable to this, DSi launcher(menu) and DSi System Settings will reset the NVRAM user-settings if the length field values are too long(same result as when the CRCs are invalid). TWL_FIRM also resets the NVRAM user-settings when the string-length(s) are too long.&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
| 2012&lt;br /&gt;
| [[User:Ichfly|Ichfly]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=System applets=&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;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Introduced with version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| Webkit/web-browser bugs&lt;br /&gt;
| spider has had at least three different code-execution exploits. Majority of them are use-after-free issues. See also [[browserhax|here]].&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
| 2013?&lt;br /&gt;
|&lt;br /&gt;
| A lot of people.&lt;br /&gt;
|-&lt;br /&gt;
| Old3DS/New3DS [[Internet_Browser|Browser-version-check]] bypass&lt;br /&gt;
| When the browser-version-check code runs where the savedata for it was never initialized(such as when the user used the &amp;quot;Initialize savedata&amp;quot; option), it will use base_timestamp=0 instead of the timestamp loaded from savedata. This is then used with &amp;quot;if(cur_timestamp - base_timestamp &amp;gt;= &amp;lt;24h timestamp&amp;gt;){Run browser-version-check HTTPS request code}&amp;quot;.&lt;br /&gt;
Hence, if the savedata was just initialized, and if the system datetime is set to before January 2, 2000, the browser-version-check will be skipped. This includes January 1, 2000, 00:00, because that&#039;s the epoch(timestamp value 0x0) used with this timestamp.&lt;br /&gt;
&lt;br /&gt;
See [http://yls8.mtheall.com/3dsbrowserhax.php here] for bypass usage instructions.&lt;br /&gt;
&lt;br /&gt;
This was fixed with [[10.7.0-32|10.7.0-32]], see [[Internet_Browser|here]] for details.&lt;br /&gt;
| [[10.7.0-32|10.7.0-32]]&lt;br /&gt;
| &lt;br /&gt;
| [[9.9.0-26|9.9.0-26]]&lt;br /&gt;
| February 25, 2016&lt;br /&gt;
| November 2, 2015 (Exactly one week after the browser version pages were initially updated server-side)&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Home Menu==&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;
!  Fixed in version&lt;br /&gt;
!  Last version this flaw was checked for&lt;br /&gt;
!  Introduced with version&lt;br /&gt;
!  Timeframe info related to this was added to wiki&lt;br /&gt;
!  Timeframe this was discovered&lt;br /&gt;
!  Discovered by&lt;br /&gt;
|-&lt;br /&gt;
| bossbannerhax&lt;br /&gt;
| This isn&#039;t really useful due to [[BOSS_Services#Custom_SpotPass_content|this]].&lt;br /&gt;
&lt;br /&gt;
After successfully loading [[Extended_Banner|extended-banner]] data(done when selecting an icon), Home Menu attempts to load [[CBMD]] data into a 0x100000-byte heap buffer from the [[BOSS_Services|stored]] SpotPass content. When successful and the magic-number is CBMD, Home Menu then decompresses the CGFX sections into another fixed-size heap buffer, without checking the outsize at all. The main CBMD CGFX code with ExeFS checks the size, but this code doesn&#039;t.&lt;br /&gt;
| None&lt;br /&gt;
| [[11.2.0-35|11.2.0-X]]&lt;br /&gt;
| [[1.0.0-0|1.0.0-0]]&lt;br /&gt;
| November 18, 2016&lt;br /&gt;
| December 23, 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| sdiconhax&lt;br /&gt;
| This is basically the same as nandiconhax, the vulnerable SD/NAND functions are &#039;&#039;identical&#039;&#039; minus the file-buffer offsets. Exploitation is different due to different heap-buffer location though. Unlike nandiconhax, the icon buffer for SD is located in linearmem(with recent Home Menu versions at least). This is used by [[menuhax]].&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7|4.0.0-X]]&lt;br /&gt;
| July 27, 2016&lt;br /&gt;
| October 23, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[System_SaveData|NAND-savedata]] Launcher.dat icons (nandiconhax)&lt;br /&gt;
| The homemenu code processing the titleid list @ launcherdat+8 copies those titleIDs to another buffer, where the offset relative to that buffer is calculated using the corresponding s8/s16 entries. Those two values are not range checked at all. Hence, one can use this to write u64(s) with arbitrary values to before/after this allocated output buffer. See [[Home_Menu|here]] regarding Launcher.dat structure.&lt;br /&gt;
&lt;br /&gt;
This can be exploited(with Launcher.dat loading at startup at least) by using a s16 for the icon entry with value 0xFFEC(-20)(and perhaps more icons with similar s16 values to write multiple u64s). The result is that the u64 value is written to outbuf-0xA0, which overwrites object+0(vtable) and object+4(doesn&#039;t matter here) for an object that gets used a bit after the vulnerable function triggers. The low 32bits of the u64 can then be set to the address of controlled memory(either outbuf in regular heap or the entire launcherdat buffer in linearmem), for use as a fake vtable in order to get control of PC. From there one can begin ROP via vtable funcptrs to do a stack-pivot(r4=objectaddr at the time the above object gets used).&lt;br /&gt;
&lt;br /&gt;
Originally this vuln could only be triggered via Launcher.dat at Home Menu startup, right after Launcher.dat gets loaded + memory gets allocated, once the file-format version code is finished running. Starting with v9.6 this can be triggered when loading layouts from SD extdata as well. The vuln itself triggers before the layout data is written to Launcher.dat, but it doesn&#039;t seem to be possible to overwrite anything which actually gets used before the function which writes Launcher.dat into the layout gets called.&lt;br /&gt;
&lt;br /&gt;
Home Menu has some sort of fail-safe system(or at least on v9.7) when Home Menu crashes due to Launcher.dat(this also applies for other things with Home Menu): after crashing once, Home Menu resets Launcher.dat to a state where it no longer crashes anymore. However, note that any exploits using this which hang/etc without crashing will still brick the system. &#039;&#039;&#039;Hence, attempting anything with this on physnand without hw-nand-access isn&#039;t really recommended.&#039;&#039;&#039;&lt;br /&gt;
| [[11.1.0-34|11.1.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[4.0.0-7|4.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| May 14, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Theme-data decompression buffer overflow ([[menuhax|themehax]])&lt;br /&gt;
| The only func-call size parameter used by the theme decompression function is one for the compressed size, none for the decompressed size. The decompressed-size value from the LZ header is used by this function to check when to stop decompressing, but this function itself has nothing to verify the decompressed_size with. The code calling this function does not check or even use the decompressed size from the header either.&lt;br /&gt;
&lt;br /&gt;
This function is separate from the rest of the Home Menu code: the function used for decompressing themes is *only* used for decompressing themes, nothing else. There&#039;s a separate decompression function in Home Menu used for decompressing everything else.&lt;br /&gt;
&lt;br /&gt;
That other decompression function in Home Menu handles decompression size properly(decompressed size check for max buffer size is done by code calling the other function, not in the function itself). Unlike the other function, the theme function supports multiple LZ algorithms, but the one which actually gets used in official themes is the same one supported by the other function anyway.&lt;br /&gt;
&lt;br /&gt;
See also [[menuhax|here]].&lt;br /&gt;
&lt;br /&gt;
With [[10.2.0-28|10.2.0-X]] Home Menu, the only code change was that the following was added right after theme-load and before actual decompression: &amp;quot;if(&amp;lt;get_lzheader_decompressed_size&amp;gt;(compressed_buf) &amp;gt; 0x150000)&amp;lt;exit&amp;gt;;&amp;quot;. This fixed the vuln.&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| [[10.2.0-28|10.2.0-X]]&lt;br /&gt;
| &amp;lt;Old3DS/New3DS version which added initial theme support&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| December 22, 2014&lt;br /&gt;
| [[User:Yellows8|Yellows8]], [[User:Myria|Myria]] independently (~spring 2015)&lt;br /&gt;
|-&lt;br /&gt;
| Shuffle body-data buffer overflow ([[menuhax|shufflehax]])&lt;br /&gt;
| See [[menuhax|here]].&lt;br /&gt;
| [[10.6.0-31|10.6.0-X]]&lt;br /&gt;
| [[10.6.0-31|10.6.0-X]]&lt;br /&gt;
| [[9.3.0-21|9.3.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| January 3, 2015&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|-&lt;br /&gt;
| Extdata file-data loading buffer overflow&lt;br /&gt;
| The extdata file-reading code allocates a fixed-size heap buffer for the expected filesize, then reads the filedata into this buffer using the actual FS filesize. Before v5.0 the filesize used here wasn&#039;t validated, hence if the filesize is larger than alloc_size a buffer overflow would occur. &#039;&#039;After&#039;&#039; doing the file-read it does validate that the actual_readsize matches the alloc_size, but at this point the buffer overflow has already occurred.&lt;br /&gt;
&lt;br /&gt;
This affected at least the following: SaveData.dat and Cache.dat.&lt;br /&gt;
&lt;br /&gt;
This can be triggered with SaveData.dat by installing a &amp;lt;v4.0 Home Menu version, with Home Menu extdata from &amp;gt;=v4.0 still on SD. When this is done with v2.0 Home Menu, a kernelpanic occurs when processing an AM command(it appears a buffer ptr which is then passed to a command was overwritten with 0x0 - of course other SaveData.dat filesizes may result in different behaviour).&lt;br /&gt;
| [[5.0.0-11|5.0.0-X]]&lt;br /&gt;
| &lt;br /&gt;
| [[2.0.0-2|2.0.0-X]]&lt;br /&gt;
| June 9, 2016&lt;br /&gt;
| June 9, 2016&lt;br /&gt;
| [[User:Yellows8|Yellows8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The icon data arrays used with {sd/nand}iconhax were added to SaveData.dat/Launcher.dat with [[4.0.0-7|4.0.0-X]], hence the vulnerable functions were added with that same version.&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;=v4.0 the SaveData.dat buffer is located in the regular heap. It&#039;s unknown when exactly it was moved to linearmem, which is where it&#039;s located with recent versions. It&#039;s located in linearmem for KOR &amp;gt;=v9.6 for example.&lt;br /&gt;
&lt;br /&gt;
The SaveData.dat/Launcher.dat icon vulns were fixed by doing various unsigned &amp;gt;=60/&amp;gt;=360 checks on the loaded values. When these checks fail, it just skips over handling this icon entry. Hence, the original value can&#039;t be negative / out-of-bounds any more.&lt;br /&gt;
&lt;br /&gt;
==Useless crashes==&lt;br /&gt;
Old3DS system web-browser:&lt;br /&gt;
* 2^32 characters long string(&#039;&#039;finally&#039;&#039; fixed with v10.6): this is similar to the vulnerability fixed [http://git.chromium.org/gitweb/?p=external/Webkit.git;a=commitdiff;h=ec471f16fbd1f879cb631f9b022fd16acd75f4d4 here], concat-large-strings-crash2.html triggers a crash which is about the same as the one triggered by a 2^32 string. Most of the time this vulnerability will cause a memory page permissions fault, since the WebKit code attempts to copy the string text data to the output buffer located in read-only [[CRO0|CRO]] heap memory. The only difference between a crash triggered by a 2^32 string and the concat-large-strings-crash2.html crash is at the former copies the string data using the original string length(like 1 text character for &amp;quot;x&amp;quot;, 4 for &amp;quot;xxxx&amp;quot;) while the latter attempts to copy &amp;gt;12MB. In some &#039;&#039;very&#039;&#039; rare cases a thread separate from the string data-copy thread will crash, this might be exploitable. However, this is mostly useless since it rarely crashes this way.&lt;br /&gt;
&lt;br /&gt;
* Trying to directly load a page via the browser &amp;quot;URL&amp;quot; option with [https://github.com/yellows8/3ds_browserhax_common webkitdebug] setup, causes a crash to trigger in oss.cro due to an use-after-free being caught with webkitdebug. This is presumably some sort of realloc() issue in the libcurl version used by the &amp;lt;={v10.2-v10.3} browser. This happens with *every* *single* *page* one tries to load via the &amp;quot;URL&amp;quot; option, but not when loading links on the current page, hence this is probably useless. A different use-after-free with realloc triggers with loading any page at all regardless of method too(libcurl probably).&lt;br /&gt;
&lt;br /&gt;
* This WebKit build has &#039;&#039;a lot&#039;&#039; of crash-trigger bugs that only happen with [https://github.com/yellows8/3ds_browserhax_common webkitdebug] completely setup(addr accesses near 0x0), with &#039;&#039;just&#039;&#039; trying to load any page at all.&lt;/div&gt;</summary>
		<author><name>Riley</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Error_codes&amp;diff=18868</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Error_codes&amp;diff=18868"/>
		<updated>2016-12-12T13:16:19Z</updated>

		<summary type="html">&lt;p&gt;Riley: Adding some more description ranges (for fs-module)&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;
For the description field, codes in range 1000(?)~1023 is common to all modules, while codes outside this range are defined independently by each module.&lt;br /&gt;
&lt;br /&gt;
Description ranges: (some if not all of these could be specifically for fs-module)&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;
| 130-179 (subset of previous)&lt;br /&gt;
| Media 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;
| 260-279 (subset of previous)&lt;br /&gt;
| Write protected&lt;br /&gt;
|-&lt;br /&gt;
| 360-389&lt;br /&gt;
| Bad format&lt;br /&gt;
|-&lt;br /&gt;
| 390-399&lt;br /&gt;
| Verification failure&lt;br /&gt;
|-&lt;br /&gt;
| 600-629&lt;br /&gt;
| Out of resources&lt;br /&gt;
|-&lt;br /&gt;
| 630-660&lt;br /&gt;
| Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 700-729&lt;br /&gt;
| Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 730-749&lt;br /&gt;
| Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 750-759&lt;br /&gt;
| Already initialized&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;
| 47&lt;br /&gt;
| Invalid command header (OS)&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;
| GSP&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;
| 83&lt;br /&gt;
| ACT&lt;br /&gt;
|-&lt;br /&gt;
| 84&lt;br /&gt;
| VCTL&lt;br /&gt;
|-&lt;br /&gt;
| 85&lt;br /&gt;
| OLV&lt;br /&gt;
|-&lt;br /&gt;
| 86&lt;br /&gt;
| NEIA&lt;br /&gt;
|-&lt;br /&gt;
| 87&lt;br /&gt;
| NPNS&lt;br /&gt;
|-&lt;br /&gt;
| 90&lt;br /&gt;
| AVD&lt;br /&gt;
|-&lt;br /&gt;
| 91&lt;br /&gt;
| L2B&lt;br /&gt;
|-&lt;br /&gt;
| 92&lt;br /&gt;
| MVD&lt;br /&gt;
|-&lt;br /&gt;
| 93&lt;br /&gt;
| NFC&lt;br /&gt;
|-&lt;br /&gt;
| 94&lt;br /&gt;
| UART&lt;br /&gt;
|-&lt;br /&gt;
| 95&lt;br /&gt;
| SPM&lt;br /&gt;
|-&lt;br /&gt;
| 96&lt;br /&gt;
| QTM&lt;br /&gt;
|-&lt;br /&gt;
| 97&lt;br /&gt;
| NFP (amiibo)&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>Riley</name></author>
	</entry>
</feed>