<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nwert</id>
	<title>Nintendo Switch Brew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nwert"/>
	<link rel="alternate" type="text/html" href="https://switchbrew.org/wiki/Special:Contributions/Nwert"/>
	<updated>2026-05-17T10:54:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Talk:Package2&amp;diff=3357</id>
		<title>Talk:Package2</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Talk:Package2&amp;diff=3357"/>
		<updated>2018-01-01T21:53:49Z</updated>

		<summary type="html">&lt;p&gt;Nwert: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Package2&amp;diff=3356</id>
		<title>Package2</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Package2&amp;diff=3356"/>
		<updated>2018-01-01T21:53:02Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Present in the firmware package titles (0100000000000819, 010000000000081A, 010000000000081B and 010000000000081C) and installed into eMMC storage&#039;s [[Flash_Filesystem#User_Partitions|BCPKG2 partitions]], &amp;quot;package2&amp;quot; contains the Switch kernel and the built-in system modules.&lt;br /&gt;
&lt;br /&gt;
= Format =&lt;br /&gt;
Package2 is distributed in an already encrypted format. Therefore, it&#039;s not additionally encrypted when installed into the flash filesystem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| [[#Public Keys|RSA-2048]] signature (PKCS#1 v2.1 RSASSA-PSS-VERIFY with SHA256)&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 0x100&lt;br /&gt;
| Encrypted header&lt;br /&gt;
|-&lt;br /&gt;
| 0x200&lt;br /&gt;
| Variable&lt;br /&gt;
| Encrypted body&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
Package2&#039;s contents are AES-CTR encrypted with a key known only by TrustZone.&lt;br /&gt;
&lt;br /&gt;
The encrypted header&#039;s CTR is stored as it&#039;s first 0x10 bytes (offset 0x100).&lt;br /&gt;
The encrypted body is divided in up to 4 sections, each one with a CTR stored inside the decrypted header.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
When decrypted, package2&#039;s header is as follows.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10&lt;br /&gt;
| Decrypted header&#039;s CTR&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| Section 0 CTR&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x10&lt;br /&gt;
| Section 1 CTR&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x10&lt;br /&gt;
| Section 2 CTR&lt;br /&gt;
|-&lt;br /&gt;
| 0x40&lt;br /&gt;
| 0x10&lt;br /&gt;
| Section 3 CTR&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;PK21&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version. HighByte must be &amp;lt;{maxver} and LowByte must be &amp;gt;{minver}, where {maxver} and {minver} are constants used by TZ updated with each package1 update.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 0x4&lt;br /&gt;
| Section 0 size&lt;br /&gt;
|-&lt;br /&gt;
| 0x64&lt;br /&gt;
| 0x4&lt;br /&gt;
| Section 1 size&lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 0x4&lt;br /&gt;
| Section 2 size&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Section 3 size&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x20&lt;br /&gt;
| SHA-256 hash over encrypted section 0&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0&lt;br /&gt;
| 0x20&lt;br /&gt;
| SHA-256 hash over encrypted section 1&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0&lt;br /&gt;
| 0x20&lt;br /&gt;
| SHA-256 hash over encrypted section 2&lt;br /&gt;
|-&lt;br /&gt;
| 0xE0&lt;br /&gt;
| 0x20&lt;br /&gt;
| SHA-256 hash over encrypted section 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each section follows each other immediately and is encrypted with the same key used for encrypting the header.&lt;br /&gt;
&lt;br /&gt;
== Section 0 ==&lt;br /&gt;
When decrypted, this section contains the plaintext Switch kernel binary.&lt;br /&gt;
&lt;br /&gt;
== Section 1 ==&lt;br /&gt;
When decrypted, this section contains the built-in system modules encapsulated in a custom format.&lt;br /&gt;
&lt;br /&gt;
=== INI1 ===&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;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u32&lt;br /&gt;
| Magic &amp;quot;INI1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| NumberProcesses&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| Zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== KIP1 ====&lt;br /&gt;
Kernel internal process?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u32&lt;br /&gt;
| Magic &amp;quot;KIP1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| char[12]&lt;br /&gt;
| Name&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| u64&lt;br /&gt;
| TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| u32&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| u32&lt;br /&gt;
| Flags / etc. Byte3 bit0-2: compression-enable for each section, when set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| [[#SectionHeader]][3]&lt;br /&gt;
| Sections&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| char[0x20]&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| u64[0x20]&lt;br /&gt;
| KernelCaps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== SectionHeader =====&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;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| u32&lt;br /&gt;
| OutOffset&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32&lt;br /&gt;
| DecompressedSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| u32&lt;br /&gt;
| CompressedSize&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| u32&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Compression =====&lt;br /&gt;
The compression used here is BLZ, with a modified footer since 3ds. The footer is now 0xC bytes instead of 0x8, and has the form u32 compressed_data_len; u32 initial_index; u32 additional_len_when_uncompressed;&lt;br /&gt;
&lt;br /&gt;
== Section 2 ==&lt;br /&gt;
This section has a valid CTR and SHA-256 hash (over NULL) stored in the package2&#039;s header, but it&#039;s size is always 0. Likely reserved for future expansion.&lt;br /&gt;
&lt;br /&gt;
== Section 3 ==&lt;br /&gt;
This section is not present (CTR and SHA-256 hash in package2&#039;s header are NULL). Likely reserved for future expansion.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! System version&lt;br /&gt;
! Package1 maxver constant&lt;br /&gt;
! Package1 minver constant&lt;br /&gt;
! Package2 version field&lt;br /&gt;
|-&lt;br /&gt;
| [[2.0.0]]&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x4&lt;br /&gt;
|-&lt;br /&gt;
| [[4.1.0]]&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x7&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Public Keys =&lt;br /&gt;
&lt;br /&gt;
=== Exponent ===&lt;br /&gt;
 0x10001&lt;br /&gt;
&lt;br /&gt;
=== Retail Modulus ===&lt;br /&gt;
 8D 13 A7 77 6A E5 DC C0 3B 25 D0 58 E4 20 69 59&lt;br /&gt;
 55 4B AB 70 40 08 28 07 A8 A7 FD 0F 31 2E 11 FE&lt;br /&gt;
 47 A0 F9 9D DF 80 DB 86 5A 27 89 CD 97 6C 85 C5&lt;br /&gt;
 6C 39 7F 41 F2 FF 24 20 C3 95 A6 F7 9D 4A 45 74&lt;br /&gt;
 8B 5D 28 8A C6 99 35 68 85 A5 64 32 80 9F D3 48&lt;br /&gt;
 39 A2 1D 24 67 69 DF 75 AC 12 B5 BD C3 29 90 BE&lt;br /&gt;
 37 E4 A0 80 9A BE 36 BF 1F 2C AB 2B AD F5 97 32&lt;br /&gt;
 9A 42 9D 09 8B 08 F0 63 47 A3 E9 1B 36 D8 2D 8A&lt;br /&gt;
 D7 E1 54 11 95 E4 45 88 69 8A 2B 35 CE D0 A5 0B&lt;br /&gt;
 D5 5D AC DB AF 11 4D CA B8 1E E7 01 9E F4 46 A3&lt;br /&gt;
 8A 94 6D 76 BD 8A C8 3B D2 31 58 0C 79 A8 26 E9&lt;br /&gt;
 D1 79 9C CB D4 2B 6A 4F C6 CC CF 90 A7 B9 98 47&lt;br /&gt;
 FD FA 4C 6C 6F 81 87 3B CA B8 50 F6 3E 39 5D 4D&lt;br /&gt;
 97 3F 0F 35 39 53 FB FA CD AB A8 7A 62 9A 3F F2&lt;br /&gt;
 09 27 96 3F 07 9A 91 F7 16 BF C6 3A 82 5A 4B CF&lt;br /&gt;
 49 50 95 8C 55 80 7E 39 B1 48 05 1E 21 C7 24 4F&lt;br /&gt;
&lt;br /&gt;
=== Debug Modulus ===&lt;br /&gt;
 B3 65 54 FB 0A B0 1E 85 A7 F6 CF 91 8E BA 96 99&lt;br /&gt;
 0D 8B 91 69 2A EE 01 20 4F 34 5C 2C 4F 4E 37 C7&lt;br /&gt;
 F1 0B D4 CD A1 7F 93 F1 33 59 CE B1 E9 DD 26 E6&lt;br /&gt;
 F3 BB 77 87 46 7A D6 4E 47 4A D1 41 B7 79 4A 38&lt;br /&gt;
 06 6E CF 61 8F CD C1 40 0B FA 26 DC C0 34 51 83&lt;br /&gt;
 D9 3B 11 54 3B 96 27 32 9A 95 BE 1E 68 11 50 A0&lt;br /&gt;
 6B 10 A8 83 8B F5 FC BC 90 84 7A 5A 5C 43 52 E6&lt;br /&gt;
 C8 26 E9 FE 06 A0 8B 53 0F AF 1E C4 1C 0B CF 50&lt;br /&gt;
 1A A4 F3 5C FB F0 97 E4 DE 32 0A 9F E3 5A AA B7&lt;br /&gt;
 44 7F 5C 33 60 B9 0F 22 2D 33 2A E9 69 79 31 42&lt;br /&gt;
 8F E4 3A 13 8B E7 26 BD 08 87 6C A6 F2 73 F6 8E&lt;br /&gt;
 A7 F2 FE FB 6C 28 66 0D BD D7 EB 42 A8 78 E6 B8&lt;br /&gt;
 6B AE C7 A9 E2 40 6E 89 20 82 25 8E 3C 6A 60 D7&lt;br /&gt;
 F3 56 8E EC 8D 51 8A 63 3C 04 78 23 0E 90 0C B4&lt;br /&gt;
 E7 86 3B 4F 8E 13 09 47 32 0E 04 B8 4D 5B B0 46&lt;br /&gt;
 71 B0 5C F4 AD 63 4F C5 E2 AC 1E C4 33 96 09 7B&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=2676</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=2676"/>
		<updated>2017-10-04T20:40:14Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention up to a small change:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-8 || 0x0000FF00 || Argument type. This is different from the ARM SMC calling convention.&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || 0x000000FF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If bit &#039;&#039;n&#039;&#039; is set in the argument type then parameter X&#039;&#039;n&#039;&#039; is treated as a pointer and the kernel will setup address translation for it in [[SVC#svcCallSecureMonitor|svcCallSecureMonitor]].&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
Functions exposed to user-mode processes using [[SVC|svcCallSecureMonitor]].&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || CheckStatus || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || GetResult || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || GetRandomBytes (Same as Id 1 Sub-Id 5.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || [[#GenerateAesKek]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || [[#LoadAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || [[#CryptAes]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || [[#GenerateSpecificAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || [[#ComputeCmac]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || [[#LoadRsaPrivateKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || [[#PrivateRsa]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || [[#LoadRsaPublicKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || [[#PublicRsa]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || [[#UnwrapRsaEncryptedAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || [[#LoadRsaWrappedAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || [2.0.0+] GenerateRsaKek || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GenerateAesKek ===&lt;br /&gt;
Takes an &amp;quot;access key&amp;quot; as input, an [[#CryptoUsecase]].&lt;br /&gt;
&lt;br /&gt;
Returns a session-unique kek for said usecase.&lt;br /&gt;
&lt;br /&gt;
=== LoadAesKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped AES key.&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_Aes.&lt;br /&gt;
&lt;br /&gt;
=== CryptAes ===&lt;br /&gt;
Encrypts/decrypts using Aes (CTR and CBC).&lt;br /&gt;
&lt;br /&gt;
Key must be set prior using one of the [[#LoadAesKey]], [[#GenerateSpecificAesKey]] or [[#LoadRsaWrappedAesKey]] commands.&lt;br /&gt;
&lt;br /&gt;
=== GenerateSpecificAesKey ===&lt;br /&gt;
Todo: This one seems unrelated to [[#CryptoUsecase]].&lt;br /&gt;
&lt;br /&gt;
=== LoadRsaPrivateKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped RSA private key.&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_PrivateRsa.&lt;br /&gt;
&lt;br /&gt;
=== PrivateRsa ===&lt;br /&gt;
Encrypts using Rsa private key.&lt;br /&gt;
&lt;br /&gt;
Key must be set prior using the [[#LoadRsaPrivateKey]] command.&lt;br /&gt;
&lt;br /&gt;
=== LoadRsaPublicKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped RSA public key.&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_PublicRsa.&lt;br /&gt;
&lt;br /&gt;
=== PublicRsa ===&lt;br /&gt;
Encrypts using Rsa public key.&lt;br /&gt;
&lt;br /&gt;
Key must be set prior using the [[#LoadRsaPublicKey]] command.&lt;br /&gt;
&lt;br /&gt;
=== UnwrapRsaEncryptedAesKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped RSA public key.&lt;br /&gt;
&lt;br /&gt;
Returns a session-unique AES key especially for use in [[#LoadRsaWrappedAesKey]].&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_RsaWrappedAesKey.&lt;br /&gt;
&lt;br /&gt;
=== LoadRsaWrappedAesKey ===&lt;br /&gt;
Takes a session-unique AES key from [[#UnwrapRsaEncryptedAesKey]].&lt;br /&gt;
&lt;br /&gt;
=== enum CryptoUsecase ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CryptoUsecase_Aes&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CryptoUsecase_PrivateRsa&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CryptoUsecase_PublicRsa&lt;br /&gt;
|-&lt;br /&gt;
| 3 || CryptoUsecase_RsaWrappedAesKey&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
Functions exposed to the kernel internally.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CpuSuspend (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CpuOff || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CpuOn || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || GetRandomBytes (Same as Id 0 Sub-Id 6.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || [2.0.0+] ProtectKernelRegion || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || [2.0.0+] ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=2675</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=2675"/>
		<updated>2017-10-04T20:34:57Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention up to a small change:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-8 || 0x0000FF00 || Argument type. This is different from the ARM SMC calling convention.&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || 0x000000FF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If bit &#039;&#039;n&#039;&#039; is set in the argument type then parameter X&#039;&#039;n&#039;&#039; is treated as a pointer and the kernel will setup address translation for it in [[SVC#svcCallSecureMonitor|svcCallSecureMonitor]].&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
Functions exposed to user-mode processes using [[SVC|svcCallSecureMonitor]].&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || CheckStatus || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || GetResult || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || GetRandomBytes (Same as Id 1 Sub-Id 5.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || [[#GenerateAesKek]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || [[#LoadAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || [[#DecryptAes]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || [[#GenerateSpecificAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || [[#ComputeCmac]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || [[#LoadRsaPrivateKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || [[#PrivateRsa]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || [[#LoadRsaPublicKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || [[#PublicRsa]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || [[#UnwrapRsaEncryptedAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || [[#LoadRsaWrappedAesKey]] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || [2.0.0+] GenerateRsaKek || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GenerateAesKek ===&lt;br /&gt;
Takes an &amp;quot;access key&amp;quot; as input, an [[#CryptoUsecase]].&lt;br /&gt;
&lt;br /&gt;
Returns a session-unique kek for said usecase.&lt;br /&gt;
&lt;br /&gt;
=== LoadAesKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped AES key.&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_Aes.&lt;br /&gt;
&lt;br /&gt;
=== DecryptAes ===&lt;br /&gt;
Encrypts/decrypts using Aes (CTR, CBC-Encrypt, CBC-Decrypt).&lt;br /&gt;
&lt;br /&gt;
Key must be set prior using one of the [[#LoadAesKey]], [[#GenerateSpecificAesKey]] or [[#LoadRsaWrappedAesKey]] commands.&lt;br /&gt;
&lt;br /&gt;
=== GenerateSpecificAesKey ===&lt;br /&gt;
Todo: This one seems unrelated to [[#CryptoUsecase]].&lt;br /&gt;
&lt;br /&gt;
=== LoadRsaPrivateKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped RSA private key.&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_PrivateRsa.&lt;br /&gt;
&lt;br /&gt;
=== PrivateRsa ===&lt;br /&gt;
Encrypts using Rsa private key.&lt;br /&gt;
&lt;br /&gt;
Key must be set prior using the [[#LoadRsaPrivateKey]] command.&lt;br /&gt;
&lt;br /&gt;
=== LoadRsaPublicKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped RSA public key.&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_PublicRsa.&lt;br /&gt;
&lt;br /&gt;
=== PublicRsa ===&lt;br /&gt;
Encrypts using Rsa public key.&lt;br /&gt;
&lt;br /&gt;
Key must be set prior using the [[#LoadRsaPublicKey]] command.&lt;br /&gt;
&lt;br /&gt;
=== UnwrapRsaEncryptedAesKey ===&lt;br /&gt;
Takes a session kek created with [[#GenerateAesKek]], and a wrapped RSA public key.&lt;br /&gt;
&lt;br /&gt;
Returns a session-unique AES key especially for use in [[#LoadRsaWrappedAesKey]].&lt;br /&gt;
&lt;br /&gt;
The session kek must have been created with CryptoUsecase_RsaWrappedAesKey.&lt;br /&gt;
&lt;br /&gt;
=== LoadRsaWrappedAesKey ===&lt;br /&gt;
Takes a session-unique AES key from [[#UnwrapRsaEncryptedAesKey]].&lt;br /&gt;
&lt;br /&gt;
=== enum CryptoUsecase ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CryptoUsecase_Aes&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CryptoUsecase_PrivateRsa&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CryptoUsecase_PublicRsa&lt;br /&gt;
|-&lt;br /&gt;
| 3 || CryptoUsecase_RsaWrappedAesKey&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
Functions exposed to the kernel internally.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CpuSuspend (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CpuOff || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CpuOn || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || GetRandomBytes (Same as Id 0 Sub-Id 6.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || [2.0.0+] ProtectKernelRegion || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || [2.0.0+] ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Flog&amp;diff=2409</id>
		<title>Flog</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Flog&amp;diff=2409"/>
		<updated>2017-09-17T19:55:30Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the system &amp;quot;flog&amp;quot; 01008BB00013C000 [[Title_list|title]]. This is a NES emulator. Installed on retail systems since [[1.0.0]].&lt;br /&gt;
&lt;br /&gt;
The titleID for &amp;quot;flog&amp;quot; is used by 3 funcs in [[qlaunch]]. It&#039;s unknown what exactly triggers launching this title officially. This can be run with unofficial methods.&lt;br /&gt;
&lt;br /&gt;
The ROM is not loaded via [[Filesystem_services|FS]] but is embedded in the main binary.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;flog&amp;quot; == &amp;quot;golf&amp;quot; backwards. This runs the NES &amp;quot;Golf&amp;quot; game. {1/2}-player via joy-cons is supported. Controls are &amp;quot;d-pad&amp;quot; buttons + stick, however motion control while holding the Z{L/R} button is also supported instead of using buttons.&lt;br /&gt;
&lt;br /&gt;
[[File:Flog0.jpg|200px|thumb|left|Flog main-screen]]&lt;br /&gt;
[[File:Flog1.jpg|200px|thumb|left|Flog 1-player]]&lt;br /&gt;
[[File:Flog2.jpg|200px|thumb|left|Flog 2-player mode as player-1.]]&lt;br /&gt;
[[File:Flog3.jpg|200px|thumb|left|Flog 2-player mode as player-2.]]&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Factory_Setup&amp;diff=2259</id>
		<title>Factory Setup</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Factory_Setup&amp;diff=2259"/>
		<updated>2017-09-01T03:15:16Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup Process ==&lt;br /&gt;
&lt;br /&gt;
At the factory, a minimal version of the Switch OS is installed. A modified version of the [[boot2]] title (boot2.manuBoot) is installed that launches an additional &amp;quot;[[Manu Services|Manu]]&amp;quot; sysmodule, and the system config title specifies to launch &amp;quot;Test Application Launcher&amp;quot; instead of qlaunch.&lt;br /&gt;
&lt;br /&gt;
Test Application Launcher is used to launch a number of tests, &amp;quot;CAL0&amp;quot; calibration data is written to NAND, and retail firmware is installed.&lt;br /&gt;
&lt;br /&gt;
== Titles ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
Factory firmware contains a stripped down version of the Switch&#039;s OS with unnecessary titles removed, and a number of additional debug titles installed.&lt;br /&gt;
&lt;br /&gt;
[[File:TestApplicationLauncher.jpg|400px|thumb|right|TestApplicationLauncher running on a console.]]&lt;br /&gt;
&lt;br /&gt;
==== Removed Titles ====&lt;br /&gt;
&lt;br /&gt;
* The following system data archive titles are present in retail firmware, but not installed at the factory: 0100000000000801, 0100000000000803, 0100000000000804, 0100000000000805, 0100000000000808, 010000000000080A, 010000000000080B, 010000000000080C, 010000000000080D, 010000000000081A, 010000000000081B, 010000000000081E.&lt;br /&gt;
&lt;br /&gt;
* Every System Applet &amp;quot;10XX&amp;quot; title is not installed.&lt;br /&gt;
&lt;br /&gt;
* 01008BB00013C000 (&amp;quot;flog&amp;quot;) is not installed.&lt;br /&gt;
&lt;br /&gt;
==== Factory-Only Titles ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Title ID&lt;br /&gt;
!  Name&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002000&lt;br /&gt;
|  &amp;quot;BoardTest&amp;quot;&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002001&lt;br /&gt;
|  ? &lt;br /&gt;
|  Probably Battery Vendor related.&lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002002&lt;br /&gt;
|  C1LcdAndKey&lt;br /&gt;
|  LCD/Keyboard testing.&lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002003&lt;br /&gt;
|  C2UsbHpmic&lt;br /&gt;
|  USB testing.&lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002004&lt;br /&gt;
|  C3Aging&lt;br /&gt;
|  Graphics/Framerate testing.&lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002005&lt;br /&gt;
|  C4SixAxis&lt;br /&gt;
|  Sixaxis (controller peripheral) testing.&lt;br /&gt;
|-&lt;br /&gt;
|  0100000000002006&lt;br /&gt;
|  C5Wireless&lt;br /&gt;
|  Wireless testing.&lt;br /&gt;
|-&lt;br /&gt;
|  010000000000204E&lt;br /&gt;
|  A4BoardCalWriti&lt;br /&gt;
|  Writes calibration data to NAND.&lt;br /&gt;
|-&lt;br /&gt;
|  010000000000209C&lt;br /&gt;
|  TestApplication&lt;br /&gt;
|  &amp;quot;Test Application Launcher&amp;quot;, factory qlaunch replacement. Used to launch other tests.&lt;br /&gt;
|-&lt;br /&gt;
|  010000000000B14A&lt;br /&gt;
|  [[Manu Services|Manu]]&lt;br /&gt;
|  Manufacturing sysmodule.&lt;br /&gt;
|-&lt;br /&gt;
|  1000000000000001&lt;br /&gt;
|  SystemInitializ&lt;br /&gt;
|  Initial system installer (used to write/verify console specific &#039;&#039;calibration&#039;&#039; data such as asymmetric keys and write/verify NAND partitions from an initial installation image).&lt;br /&gt;
|-&lt;br /&gt;
|  1000000000000004&lt;br /&gt;
|  ?&lt;br /&gt;
|  ? &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Switch_System_Flaws&amp;diff=2128</id>
		<title>Switch System Flaws</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Switch_System_Flaws&amp;diff=2128"/>
		<updated>2017-08-17T20:05:05Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
System Flaws are used to execute unofficial code (homebrew) on the Nintendo Switch. This page is a list of known and public Switch System Flaws.&lt;br /&gt;
&lt;br /&gt;
=List of Switch System Flaws=&lt;br /&gt;
&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;
| No public hardware exploits &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== System software ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Stage 1 Bootloader ===&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 version&lt;br /&gt;
!  Last 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;
|  Null-dereference in panic()&lt;br /&gt;
|  The Switch&#039;s stage 1 bootloader, on panic(), clears the stack and then attempts to clear the Security Engine. However, it does so by dereferencing a pointer to the SE in .bss (initially NULL), and this pointer doesn&#039;t get initialized until partway into the bootloader&#039;s main() after several functions that might panic() are called. Thus, a panic() caused prior to SE initialization would result in the SE pointer still being NULL when dereferenced. This would cause a data abort, causing the bootloader to clear the stack and then try to clear the security engine...dereferencing NULL again, over and over in a loop.&lt;br /&gt;
&lt;br /&gt;
In 3.0.0, this was fixed by moving the security engine initialization earlier in main(), before the first function that could potentially panic().&lt;br /&gt;
|  Infinite clear-the-stack-then-data-abort loop very early in boot, before SBK/other keyslots are cleared. Probably useless for anything more interesting.&lt;br /&gt;
|  [[3.0.0]]&lt;br /&gt;
|  [[3.0.0]]&lt;br /&gt;
|  Early July, 2017&lt;br /&gt;
|  July 30, 2017&lt;br /&gt;
|  Everyone who diff&#039;d 2.3.0 and 3.0.0 Package1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== TrustZone ===&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 version&lt;br /&gt;
!  Last 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;
|  No public ARM TrustZone exploits &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Kernel ===&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 version&lt;br /&gt;
!  Last 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;
|  No public Kernel exploits &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== FIRM-package System Modules ===&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 version&lt;br /&gt;
!  Last 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;
| Service access control bypass (sm:h, smhax, probably other names)&lt;br /&gt;
| Prior to [[3.0.1]], the &#039;&#039;service manager&#039;&#039; (sm) built-in system module treats a user as though it has full permissions if the user creates a new &amp;quot;sm:&amp;quot; port session but bypasses [[Services_API#Initialize|initialization]]. This is due to the other sm commands skipping the service ACL check for Pids &amp;lt;= 7 (i.e. all kernel bundled modules) and that skipping the initialization command leaves the Pid field uninitialized.&lt;br /&gt;
In [[3.0.1]], sm returns error code 0x415 if [[Services_API#Initialize|Initialize]] has not been called yet.&lt;br /&gt;
| Acquiring, registering, and unregistering arbitrary services&lt;br /&gt;
| [[3.0.1]]&lt;br /&gt;
| [[3.0.1]]&lt;br /&gt;
| May 2017&lt;br /&gt;
| August 17, 2017&lt;br /&gt;
| Everyone&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== System Modules ===&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 version&lt;br /&gt;
!  Last 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;
| Out-of-bounds array read for [[BCAT_Content_Container]] secret-data index&lt;br /&gt;
| The [[BCAT_Content_Container]] secret-data index is not validated at all. This is handled before the RSA-signature(?) is ever used. Since the field is an u8, a total of 0x800-bytes relative to the array start can be accessed.&lt;br /&gt;
This is not useful since the string loaded from this array is only involved with key-generation.&lt;br /&gt;
| &lt;br /&gt;
| Unknown&lt;br /&gt;
| [[2.0.0]]&lt;br /&gt;
| August 4, 2017&lt;br /&gt;
| August 6, 2017&lt;br /&gt;
| [[User: shinyquagsire23|Shiny Quagsire]], [[User:Yellows8|Yellows8]] (independently)&lt;br /&gt;
|-&lt;br /&gt;
|  OOB Read in NS system module (pl:utoohax, pl:utonium, maybe other names)&lt;br /&gt;
|  Prior to [[3.0.0]], pl:u (Shared Font services implemented in the NS sysmodule) service commands 1,2,3 took in a signed 32-bit index and returned that index of an array but did not check that index at all. This allowed for an arbitrary read within a 34-bit range (33-bit signed) from NS .bss. In [[3.0.0]], sending out of range indexes causes error code 0x60A to be returned.&lt;br /&gt;
|  Dumping full NS .text, .rodata and .data, infoleak, etc&lt;br /&gt;
|  [[3.0.0]]&lt;br /&gt;
|  [[3.0.0]]&lt;br /&gt;
|  April 2017&lt;br /&gt;
|  On exploit&#039;s fix in [[3.0.0]]&lt;br /&gt;
|  qlutoo, Reswitched team (independently)&lt;br /&gt;
|-&lt;br /&gt;
| Unchecked domain ID in common IPC code&lt;br /&gt;
| Prior to [[2.0.0]], object IDs in [[IPC_Marshalling#Domain_message|domain messages]] are not bounds checked. This out-of-bounds read could be exploited to brute-force ASLR and get PC control in some services that support domain messages.&lt;br /&gt;
|&lt;br /&gt;
| [[2.0.0]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Cryptosystem&amp;diff=1804</id>
		<title>Cryptosystem</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Cryptosystem&amp;diff=1804"/>
		<updated>2017-07-26T21:55:41Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Like the 3DS, the Switch relies on a number of cryptographic keys to prevent unauthorized persons from dumping and analyzing its software and assets. This page will focus on the &amp;quot;symmetric&amp;quot; cryptography involved in the Switch&#039;s cryptosystem.&lt;br /&gt;
&lt;br /&gt;
== BootROM ==&lt;br /&gt;
&lt;br /&gt;
The Switch&#039;s BootROM does no symmetric cryptographic operations. However, it sets up two keys in the hardware security engine&#039;s keyslots: the SBK (Secure Boot Key) in keyslot 0xE and the SSK (Secure Storage Key) in keyslot 0xF. Reads from both of these keyslots are disabled by the bootROM. The material used to generate these keys is stored in special fuses that have their access disabled by the bootROM.&lt;br /&gt;
&lt;br /&gt;
The SBK is common to all consoles while the SSK is console unique. The SSK is not used on retail devices.&lt;br /&gt;
== Falcon coprocessor ==&lt;br /&gt;
&lt;br /&gt;
The falcon processor (TSEC) stores a special console-unique key (that will be referred to as the &amp;quot;device keyblob seed generation key&amp;quot;) in fuses that only microcode authenticated by NVidia has access to.&lt;br /&gt;
&lt;br /&gt;
== Bootloader stage 0 ==&lt;br /&gt;
&lt;br /&gt;
=== Key generation ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keyslot&lt;br /&gt;
! Name&lt;br /&gt;
! Set by&lt;br /&gt;
! Cleared by&lt;br /&gt;
! Per-console&lt;br /&gt;
|-&lt;br /&gt;
| 0xB&lt;br /&gt;
| Pk11DecryptionKey&lt;br /&gt;
| [[Package1]]&lt;br /&gt;
| [[Package1]]&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| MasterKey&lt;br /&gt;
| [[Package1]]&lt;br /&gt;
| Forever&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| ConsoleKey&lt;br /&gt;
| [[Package1]]&lt;br /&gt;
| Forever&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| 0xE&lt;br /&gt;
| SecureBootKey&lt;br /&gt;
| Bootrom&lt;br /&gt;
| [[Package1]]&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| 0xF&lt;br /&gt;
| SecureStorageKey&lt;br /&gt;
| Bootrom&lt;br /&gt;
| [[Package1]]&lt;br /&gt;
| Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bootloader stage 0 generates three keys. Keyslot 0xB is cleared after it is used to decrypt the stage 2 bootloader; only keyslots 0xC and 0xD will be transferred to stage 2. Additionally, keyslots 0xC and 0xD are set read-only after they are generated. The SBK and the SSK are also cleared after use (although the SSK isn&#039;t used at all, except on dev units).&lt;br /&gt;
&lt;br /&gt;
The master static key is generated by decrypting the master static seed (a constant stored in bootloader .data) with the master static key encryption key. The master static seed used varies depending on whether the console is a retail unit or a dev unit.&lt;br /&gt;
Both the master static key encryption key and the stage 2 key are stored in a keyblob. The keyblob format is described [[Flash_Filesystem#Keyblob|here]].&lt;br /&gt;
&lt;br /&gt;
The 32 blobs are stored in the eMMC. Only one at a time is loaded, it is controlled by the bootloader version field in the BCT (at +0x2330).&lt;br /&gt;
&lt;br /&gt;
Although the keydata is presumably common to all consoles, each keyblob is console-unique, because the key used to encrypt it is at the factory is console unique. Each keyblob has its own encryption key, with keyblob key N generated by decrypting keyblob key seed N with the SBK, and keyblob key seed N generated by decrypting keyblob N&#039;s seed constant with the device keyblob seed generation key obtained from the Falcon. Keyblob key 1 is special: In addition to being used to decrypt keyblob 1, it is also used to generate the master device key by decrypting a constant block.&lt;br /&gt;
&lt;br /&gt;
The key used to verify a keyblob&#039;s MAC is not the keyblob key but a key derived from it; this is likely part of an attempt to mitigate side-channel attacks as the MAC is an alterable part of the keyblob.&lt;br /&gt;
&lt;br /&gt;
The bootloader only stores the seed constants for the keyblob loaded by the current revision and for keyblob 1 (So that the master device key can be generated). &lt;br /&gt;
&lt;br /&gt;
This mechanism provides several advantages. If the stage 2 bootloader is compromised, stage 1 can just use another master static key in the keyblob. If stage 1 itself is glitched or exploited in such a way the keyblob is dumped, Nintendo just has to change the loaded keyblob: the vulnerable bootloader won&#039;t be able to decrypt the new keyblob, as the keyblob key it knows is different from the one needed. Even if somehow an exploit or glitch allowed one to be able to use the SBK to generate keyblob keys, the seed constants for future keyblobs are unknown (and will be until Nintendo releases new bootloaders that use them), and so the exploit or glitch would have to be re-done on each new bootloader revision (if it&#039;s not patched).&lt;br /&gt;
&lt;br /&gt;
The key-derivation is described [[Package1#Key_generation|here]].&lt;br /&gt;
&lt;br /&gt;
==== Table of used keyblobs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! System version&lt;br /&gt;
! Used keyblob&lt;br /&gt;
! Used master static key encryption key in keyblob&lt;br /&gt;
|-&lt;br /&gt;
| 1.0.0-2.3.0&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3.0.0&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Bootloader stage 1 ==&lt;br /&gt;
&lt;br /&gt;
It is currently unknown what key generation the stage 2 bootloader does.&lt;br /&gt;
&lt;br /&gt;
== Secure Monitor ==&lt;br /&gt;
&lt;br /&gt;
The secure monitor performs some runtime cryptographic operations. See [[SMC]] for what operations it provides.&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Package1&amp;diff=1803</id>
		<title>Package1</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Package1&amp;diff=1803"/>
		<updated>2017-07-26T21:46:45Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Nintendo Switch&#039;s bootloader (called &amp;quot;package1&amp;quot;) is the first custom piece of code running on the Switch. It is loaded in the IRAM and launched by the Tegra X1 bootROM according to the BCT. It runs on the boot processor, an ARM7TDMI called &amp;quot;BPMP&amp;quot; by NVidia (Boot and Power Management Processor).&lt;br /&gt;
It is split into two parts, one that is in plaintext, one that is encrypted. The bootROM does not perform any symmetric cryptographic operations on the bootloader it loads.&lt;br /&gt;
&lt;br /&gt;
== Stage 1 ==&lt;br /&gt;
&lt;br /&gt;
The first stage of the bootloader is the plaintext part of the bootloader. It has four goals: to power on devices, to look for incoherencies, to generate keys, and to decrypt and launch the second stage.&lt;br /&gt;
The stage 1 bootloader&#039;s authors knew that the code was in plaintext, and thus took extra care to try to protect the bootloader from side-channel attacks.&lt;br /&gt;
&lt;br /&gt;
=== Execution flow ===&lt;br /&gt;
&lt;br /&gt;
==== Startup ====&lt;br /&gt;
&lt;br /&gt;
After setting up the stack and branching to main, stage 1 poisons all the exception vectors to point at the panic function.&lt;br /&gt;
It then clears the (empty) bss and calls the functions in the (empty) init array.&lt;br /&gt;
&lt;br /&gt;
==== Main ====&lt;br /&gt;
&lt;br /&gt;
* Registers are setup&lt;br /&gt;
* A device (?) is powered on&lt;br /&gt;
* Flags are set on the clock-reset registers&lt;br /&gt;
* [3.0.0+] The security engine address is setup&lt;br /&gt;
* [3.0.0+] Bit30 of offset 0x800 of the security engine is checked: if set, panic.&lt;br /&gt;
* The SKU info is checked. If it doesn&#039;t match 0x83, panic.&lt;br /&gt;
* Fuse coherency is checked, potentially panicking.&lt;br /&gt;
* The copy of the BCT left by the bootROM is checked. If the version field doesn&#039;t match the expected version field, panic.&lt;br /&gt;
* Anti-downgrade fuses are checked, potentially panicking.&lt;br /&gt;
* [1.0.0-2.3.0] Fuse programming is disabled until next reboot.&lt;br /&gt;
* The memory controller is powered on and setup to allow GPU DMA to the IRAM. This will be needed to interact with the Falcon and with the security engine.&lt;br /&gt;
* [1.0.0-2.3.0] The security engine address is setup&lt;br /&gt;
* [1.0.0-2.3.0] Bit30 of offset 0x800 of the security engine is checked: if set, panic.&lt;br /&gt;
* Key generation is performed. If the unit type is equal to 0 (non-retail) AND if some fuse is clear, the secondary method will be used. Else, the main method will be used.&lt;br /&gt;
* Stage 2 is decrypted with keyslot 0xB. Keyslot 0xB is cleared, and the second stage&#039;s header validity is checked. If any of this fails, panic.&lt;br /&gt;
* The entrypoint of stage 2 is computed.&lt;br /&gt;
* The stack is pivoted to a secondary stack, the main stack and the key area are cleared, and stage 1 jumps to stage 2&#039;s entrypoint.&lt;br /&gt;
&lt;br /&gt;
==== Fuse coherency ====&lt;br /&gt;
&lt;br /&gt;
Unit type is computed from data from a fuse. It must be either 0 (non-retail) or 1 (retail). If it&#039;s neither, 2 will be returned by the function, and the check will call panic.&lt;br /&gt;
&lt;br /&gt;
==== Downgrade check ====&lt;br /&gt;
&lt;br /&gt;
The bootloader will check if someone attempted to downgrade it. A fuse array will be checked, if too many fuses are burnt the bootloader will detect a downgrade attempt. If too little are set, the bootloader will program the expected bitmap and force a reset. The fuse array and the expected number of burnt fuses is different on unit type 0 (non-retail) and unit type 1 (retail).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! System version&lt;br /&gt;
! Expected number of burnt fuses (retail)&lt;br /&gt;
! Expected number of burnt fuses (non-retail)&lt;br /&gt;
|-&lt;br /&gt;
| 1.0.0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 2.0.0-2.3.0&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 3.0.0&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Panic ====&lt;br /&gt;
&lt;br /&gt;
The panic function does the following things:&lt;br /&gt;
* It clears the stack&lt;br /&gt;
* It disables(?) and clears the security engine&lt;br /&gt;
* It disables fuse programming&lt;br /&gt;
* It clears the key area&lt;br /&gt;
* It clears the data for stage 2&lt;br /&gt;
* It signals over the debug interface that a panic occurred until the Switch is reset.&lt;br /&gt;
&lt;br /&gt;
=== Key generation ===&lt;br /&gt;
For more detail on the Switch&#039;s Cryptosystem, please see [[Cryptosystem|this page]].&lt;br /&gt;
&lt;br /&gt;
In all cases, at the end of the key generation function three keys are generated: the stage 2 key (stored in keyslot 0xB), the master static key (stored in keyslot 0xC), and the master device key (stored in keyslot 0xD).&lt;br /&gt;
The two keys initialized by the bootROM (the SBK, stored in keyslot 0xE, and the SSK, stored in keyslot 0xF) are cleared immediately after the bootloader is finished using them.&lt;br /&gt;
Keyslots 0xC and 0xD are marked unreadable. Keyslot 0xB is not, but is is cleared by stage 1 after stage 2&#039;s decryption anyway.&lt;br /&gt;
&lt;br /&gt;
==== Main method ====&lt;br /&gt;
&lt;br /&gt;
This method is called when the unit type is equal to 1 (retail) OR when unit type is equal to 0 and some fuse is set. &lt;br /&gt;
&lt;br /&gt;
The master static seed selected depends on whether the unit type is zero and whether the last byte of the bootloader&#039;s RSA modulus is 0x4F.&lt;br /&gt;
&lt;br /&gt;
* Falcon microcode is loaded, the device keyblob seed generation key is obtained from the Falcon.&lt;br /&gt;
* The device keyblob seed generation key is stored in keyslot 0xD.&lt;br /&gt;
* [3.0.0+] keyblob key seed 1 is generated by decrypting the keyblob seed constant 1 with the device keyblob seed generation key&lt;br /&gt;
* [3.0.0+] keyblob key 1 is generated by decrypting keyblob key seed 1 with the SBK. The result is directly stored in keyslot 0xA without leaving the crypto engine.&lt;br /&gt;
* keyblob key seed N is generated by decrypting the keyblob seed constant N with the device keyblob seed generation key&lt;br /&gt;
* keyblob key N is generated by decrypting keyblob key seed N with the SBK. The result is directly stored in keyslot 0xD without leaving the crypto engine.&lt;br /&gt;
* The SBK and the SSK are cleared.&lt;br /&gt;
* The constant MAC key generator block is decrypted with keyblob key N to generate keyblob MAC key N. The result is directly stored in keyslot 0xB without leaving the crypto engine.&lt;br /&gt;
* With keyblob MAC key N, AES CMAC is performed over the keyblob.&lt;br /&gt;
* With a comparison function which is safe against timing attacks, the CMAC is compared with the stored CMAC. If they differ, panic is called.&lt;br /&gt;
* The keyblob data is decrypted with AES-CTR, using the keyblob key N and the stored CTR.&lt;br /&gt;
* The stage 2 decryption key (the ninth key in the blob) is loaded in keyslot 0xB.&lt;br /&gt;
* The master static key encryption key. is loaded in keyslot 0xC.&lt;br /&gt;
* The decrypted keyblob data is erased.&lt;br /&gt;
* The master static key is generated by decrypting the master static seed with the master static key encryption key. The result is directly stored in keyslot 0xC without leaving the crypto engine.&lt;br /&gt;
* [1.0.0-2.3.0] The master device key is generated by decrypting a constant block with keyslot 0xD (which contains keyblob N&#039;s key 1). The result is directly stored in keyslot 0xD without leaving the crypto engine.&lt;br /&gt;
* [3.0.0+] The master device key is generated by decrypting a constant block with keyslot 0xA (which contains keyblob 1&#039;s key 1). The result is directly stored in keyslot 0xD without leaving the crypto engine.&lt;br /&gt;
* [3.0.0+] Keyslot 0xA is cleared.&lt;br /&gt;
&lt;br /&gt;
==== Secondary method ====&lt;br /&gt;
&lt;br /&gt;
The secondary method (which is never launched on retail units) is very simple.&lt;br /&gt;
First a master static seed is selected (depending on whether the bootloader&#039;s RSA modulus ends with 0x11).&lt;br /&gt;
Then, a constant block is decrypted by the SBK. The result is the stage 2 key and will be stored in keyslot 0xB. &lt;br /&gt;
A constant block will be decrypted by the SBK and temporarily stored in keyslot 0xC. Another constant block will be decrypted by the SSK and temporarily stored in keyslot 0xD.&lt;br /&gt;
Both the SBK and the SSK are cleared.&lt;br /&gt;
The master static seed is decrypted with keyslot 0xC and stored in keyslot 0xC.&lt;br /&gt;
A constant block is decrypted with keyslot 0xD and stored in keyslot 0xD. &lt;br /&gt;
&lt;br /&gt;
== Stage 2 (package1.1) ==&lt;br /&gt;
&lt;br /&gt;
The second stage of the bootloader is the encrypted part of the bootloader. It is much bigger than stage 1, but what it does is currently unknown due to its being encrypted.&lt;br /&gt;
&lt;br /&gt;
=== Header 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;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 4&lt;br /&gt;
| Magic &amp;quot;PK11&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 4&lt;br /&gt;
| Size of section 3&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 8&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 4&lt;br /&gt;
| Size of section 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 4&lt;br /&gt;
| Entrypoint of section 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 4&lt;br /&gt;
| Size of section 1&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 4&lt;br /&gt;
| Entrypoint of section 1?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entrypoints are relative to the section.&lt;br /&gt;
Stage 1 jumps to the entrypoint of section 2.&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Memory_layout&amp;diff=1779</id>
		<title>Memory layout</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Memory_layout&amp;diff=1779"/>
		<updated>2017-07-25T21:07:33Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Userspace =&lt;br /&gt;
The userspace virtual address space has 38 bits. It seems that when the IPC protocol was designed, it was only 36 bits leading to a weird encoding format.&lt;br /&gt;
&lt;br /&gt;
There are several regions maintained by the kernel, each one starting at the upper bits bit37-21 randomized:&lt;br /&gt;
* Main binary region.&lt;br /&gt;
* Heap region.&lt;br /&gt;
* Stack mapping region, available from [[SVC#svcGetInfo]].&lt;br /&gt;
&lt;br /&gt;
For the stack mapping region, the userland randomizes a page-offset where to start inside the region.&lt;br /&gt;
This adds some additional entropy.&lt;br /&gt;
&lt;br /&gt;
Binaries mapped by RO seems to be mapped randomly everywhere in the entire address space. The random base address for each NRO has bits 37-12 randomized, unlike the main binary region.&lt;br /&gt;
&lt;br /&gt;
For all binaries(main area / NROs), the R-- section is always located immediately after R-X. The RW- section is always located immediately after the R-- section. Hence, there&#039;s no extra randomization / guard-pages for these sections.&lt;br /&gt;
&lt;br /&gt;
On version [[1.0.0]], the initial binaries loaded into memory by the kernel always have the upper 32-bits as all-zero, so there are 6 fewer bits of layout randomization. &lt;br /&gt;
&lt;br /&gt;
==TLS==&lt;br /&gt;
This is the 0x200-byte thread-local-storage, the base address is loaded via ARM threadid register tpidrro_el0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| [[IPC_Marshalling|IPC]] command buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 0xF8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Address of threadctx+0x58.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Thread context==&lt;br /&gt;
This is the structure of the 0x228-byte threadctx used by official userland software.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0xA8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xA8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Address of the stack-bottom-mirror which the thread was created with.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Size of the stack.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB8&lt;br /&gt;
| 0x178&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Kernel =&lt;br /&gt;
  Granule size for TTBR0*_EL1 is 4KB.&lt;br /&gt;
  TTBR0_EL1 vmem starts at vaddr 0x0.&lt;br /&gt;
  vmem end-addr for TTBR1_EL1 is 0xffffffffffffffff. vmem start-addr for TTBR1_EL1 is 0xFFFFFFF000000000.&lt;br /&gt;
  T0SZ = 31. Hence, bit-size of the TTBR0*_EL1 vmem region is 33. (0x0000000200000000)&lt;br /&gt;
  T1SZ = 28. Hence, bit-size of the TTBR1*_EL1 vmem region is 36. (0x0000001000000000)&lt;br /&gt;
  &lt;br /&gt;
  Note: ARM config for TTBR0 is presumably configured for userland later.&lt;br /&gt;
  &lt;br /&gt;
  See arm-doc for &amp;quot;Table D4-25 Translation table entry addresses when using the 4KB translation granule&amp;quot;.&lt;br /&gt;
  &lt;br /&gt;
  See arm-doc for &amp;quot;Overview of VMSAv8-64 address translation using the 4KB translation granule&amp;quot;.&lt;br /&gt;
  &lt;br /&gt;
  See arm-doc for &amp;quot;Table D4-11 TCR.TnSZ values and IA ranges, 4K granule with no concatenation of tables&amp;quot;.&lt;br /&gt;
  Both TTBR*_EL1 use &amp;quot;Initial lookup level&amp;quot; 1. Therefore, the TTBR*_EL1 tables are level1.&lt;br /&gt;
  &lt;br /&gt;
  Due to T*SZ, Stage1/Stage2 translation for the initial table(level1) are the same, except Stage2 uses hard-coded T0SZ.&lt;br /&gt;
  Basically, the table is accessed as: ((u64*)tablebase)[&amp;lt;IA[y:30]&amp;gt;], where y = (37-T*SZ)+26. That is, starting at bit &amp;quot;y&amp;quot; ending(inclusive) at bit30. For TTBR0*_EL1, y = 32, while for TTBR1_EL1 y = 35.&lt;br /&gt;
  Hence, for TTBR0, index=((vaddr&amp;gt;&amp;gt;30) &amp;amp; 0x7), and for TTBR1, index=((vaddr&amp;gt;&amp;gt;30) &amp;amp; 0x3f).&lt;br /&gt;
&lt;br /&gt;
As of [[2.0.0]] KASLR is not used.&lt;br /&gt;
&lt;br /&gt;
== [[2.0.0]] ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Vector Base Address Register (EL1)&amp;quot; = 0xfffffff7ffc50800.&lt;br /&gt;
&lt;br /&gt;
The table for TTBR0 only contains the following:&lt;br /&gt;
* Vmem 0x80000000 is mapped to physmem 0x80000000, using a size loaded from a register. This is only done when: &amp;quot;endaddr = 0x7fffffff + size; if(endaddr &amp;gt;= 0x80000001){...}&amp;quot;&lt;br /&gt;
** The size is loaded from: &amp;quot;(u32 *0x70019050 &amp;amp; 0x3fff) &amp;lt;&amp;lt; 20;&amp;quot;&lt;br /&gt;
** The value written to the MMU-table descriptor is: &amp;quot;physaddr | val | 0x709;&amp;quot;. val is 1&amp;lt;&amp;lt;52 when &amp;quot;tmp&amp;gt;&amp;gt;34&amp;quot; is non-zero and when &amp;quot;if((physaddr &amp;amp; 0x3c0000000) == 0)&amp;quot;, otherwise val=0. tmp=size at the start and increased by 0xffffffffc0000000 each loop iteration. physaddr is increased by 0x40000000 each loop iteration.&lt;br /&gt;
&lt;br /&gt;
TTBR1:&lt;br /&gt;
* vmem 0xFFFFFFF800000000 is mapped to physmem 0x80000000. Similar to above, except tmp=0 due to wrap-around, etc. The chunksize used when increasing addr is 0xfffffff840000000, with another +=0x40000000 separate from the addr cmp for the loop.&lt;br /&gt;
** &amp;quot;endaddr = 0x3fffffff + (&amp;lt;size from above&amp;gt; | 0xfffffff800000000); enaddr = (endaddr &amp;amp; 0xffffffffc0000000)-1; if(endaddr &amp;gt;= 0xfffffff800000001){&amp;lt;map mem&amp;gt;}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Initializes level2 pagetable descriptor for vmem 0xFFFFFFF7C0000000. descriptor = 0x3 | physaddr. physaddr is core-specific.&lt;br /&gt;
* Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FFC00000. descriptor = 0x3 | physaddr. physaddr is core-specific.&lt;br /&gt;
* The content of the pagetable for the following level3 mmutables are not initialized in the main mmutable-init func. descriptor = 0x8007c003(0x3 | &amp;lt;physaddr tablebase&amp;gt;). tablebase=0x8007c000.&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FEE00000. physaddr = tablebase + (0x1&amp;lt;&amp;lt;12).&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FF000000. physaddr = tablebase + (0x2&amp;lt;&amp;lt;12).&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FF200000. physaddr = tablebase + (0x3&amp;lt;&amp;lt;12).&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FFA00000. physaddr = tablebase + (0x7&amp;lt;&amp;lt;12).&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FEC00000. physaddr = tablebase.&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FF400000. physaddr = tablebase + (0x4&amp;lt;&amp;lt;12).&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FF600000. physaddr = tablebase + (0x5&amp;lt;&amp;lt;12).&lt;br /&gt;
** Initializes level3 pagetable descriptor for vmem 0xFFFFFFF7FF800000. physaddr = tablebase + (0x6&amp;lt;&amp;lt;12).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Vmem&lt;br /&gt;
! Physmem&lt;br /&gt;
! Size&lt;br /&gt;
! Descriptor ORR-value&lt;br /&gt;
! Permissions&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFC00000..0xFFFFFFF7FFC62000 (inclusive)&lt;br /&gt;
| 0x800A0000&lt;br /&gt;
| 0x63000&lt;br /&gt;
| 0x78B&lt;br /&gt;
| &lt;br /&gt;
| Kernel .text&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFC63000..0xFFFFFFF7FFC65000 (inclusive)&lt;br /&gt;
| 0x80103000&lt;br /&gt;
| 0x3000&lt;br /&gt;
| 0x6000000000078B&lt;br /&gt;
| &lt;br /&gt;
| Kernel .rodata&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFC66000..0xFFFFFFF7FFC6E000 (inclusive)&lt;br /&gt;
| 0x80106000&lt;br /&gt;
| 0x9000&lt;br /&gt;
| 0x6000000000070B&lt;br /&gt;
| &lt;br /&gt;
| Kernel .data/...&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following uses descriptor ORR-value 0x6000000000070B, the size of each one is 0x1000-bytes.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Vmem&lt;br /&gt;
! Physmem&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDCA000 || 0x80060000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDCB000 || 0x80061000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDCE000 || 0x80068000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDD4000 || 0x80062000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDD5000 || 0x80063000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDD8000 || 0x8006A000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDD9000 || 0x8006B000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDDE000 || 0x80064000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDDF000 || 0x80065000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDE2000 || 0x8006C000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDE3000 || 0x8006D000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDE8000 || 0x80066000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDE9000 || 0x80067000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDCF000 || 0x80069000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDEC000 || 0x8006E000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDED000 || 0x8006F000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDD2000 || 0x80070000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDDC000 || 0x80071000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDE6000 || 0x80072000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDF0000 || 0x80073000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following uses descriptor ORR-value 0x60000000000607, the size of each one is 0x1000-bytes.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Vmem&lt;br /&gt;
! Physmem&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDC6000&lt;br /&gt;
| 0x70019000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDC4000&lt;br /&gt;
| 0x7001C000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDC2000&lt;br /&gt;
| 0x7001D000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDC0000&lt;br /&gt;
| 0x60006000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDC8000&lt;br /&gt;
| 0x70006000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDFB000&lt;br /&gt;
| 0x50041000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDFD000&lt;br /&gt;
| 0x50042000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The rest are are mapped to core-specific physaddrs, each one is 0x1000-bytes. Descriptor ORR-value = 0x6000000000070B.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Vmem&lt;br /&gt;
! Physmem&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDF7000&lt;br /&gt;
| &amp;lt;physaddr from vmem 0xFFFFFFF7FFDF6000&amp;gt; + 0x1000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDF3000&lt;br /&gt;
| &amp;lt;physaddr from vmem 0xFFFFFFF7FFDF2000&amp;gt; + 0x1000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDF6000&lt;br /&gt;
| 0x800XX000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDF2000&lt;br /&gt;
| 0x800XX000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDFF000&lt;br /&gt;
| 0x800XX000&lt;br /&gt;
|-&lt;br /&gt;
| 0xFFFFFFF7FFDF9000&lt;br /&gt;
| 0x800XX000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Secure Monitor =&lt;br /&gt;
&lt;br /&gt;
== [[2.0.0]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Vmem&lt;br /&gt;
! Physmem&lt;br /&gt;
! Size&lt;br /&gt;
! Descriptor ORR-value&lt;br /&gt;
! Permissions&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C010000&lt;br /&gt;
| 0x7C010000&lt;br /&gt;
| 0x10000&lt;br /&gt;
| 0x300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x40020000&lt;br /&gt;
| 0x40020000&lt;br /&gt;
| 0x20000&lt;br /&gt;
| 0x300&lt;br /&gt;
| &lt;br /&gt;
| iRAM-C&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0080000&lt;br /&gt;
| 0x50041000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| ARM Interrupt Distributor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0082000&lt;br /&gt;
| 0x50042000&lt;br /&gt;
| 0x2000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| Interrupt Controller Physical CPU interface&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0085000&lt;br /&gt;
| 0x70006000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000324&lt;br /&gt;
| &lt;br /&gt;
| UART-A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0087000&lt;br /&gt;
| 0x60006000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000324&lt;br /&gt;
| &lt;br /&gt;
| Clock and Reset&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0089000&lt;br /&gt;
| 0x7000E000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| RTC&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F008B000&lt;br /&gt;
| 0x60005000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| TMR&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F008D000&lt;br /&gt;
| 0x6000C000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| System Registers&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F008F000&lt;br /&gt;
| 0x70012000&lt;br /&gt;
| 0x2000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| SE&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0092000&lt;br /&gt;
| 0x700F0000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| SYSCTR0&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0094000&lt;br /&gt;
| 0x70019000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| MC&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0096000&lt;br /&gt;
| 0x7000F000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| FUSE (0x7000F800)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0098000&lt;br /&gt;
| 0x70000000&lt;br /&gt;
| 0x4000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| MISC&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F009D000&lt;br /&gt;
| 0x60007000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| Flow Controller&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F009F000&lt;br /&gt;
| 0x40002000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| iRAM-A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F00A1000&lt;br /&gt;
| 0x7000D000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| I2C5 - SPI 2B-6&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F00A3000&lt;br /&gt;
| 0x6000D000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| GPIO-1 - GPIO-8&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F00A5000&lt;br /&gt;
| 0x7000C000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| I2C-I2C4&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F00A7000&lt;br /&gt;
| 0x6000F000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000304&lt;br /&gt;
| &lt;br /&gt;
| Exception vectors&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0180000&lt;br /&gt;
| 0x40020000&lt;br /&gt;
| 0x10000&lt;br /&gt;
| 0x40000000000324&lt;br /&gt;
| &lt;br /&gt;
| iRAM-C&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F0190000&lt;br /&gt;
| 0x40003000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000324&lt;br /&gt;
| &lt;br /&gt;
| iRAM-A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01A0000&lt;br /&gt;
| 0x7C010000&lt;br /&gt;
| 0x10000&lt;br /&gt;
| 0x40000000000380&lt;br /&gt;
| &lt;br /&gt;
| TZRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01C3000&lt;br /&gt;
| 0x80010000&lt;br /&gt;
| 0x10000&lt;br /&gt;
| 0x40000000000324&lt;br /&gt;
| &lt;br /&gt;
| EMEM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01C2000&lt;br /&gt;
| 0x8000F000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000324&lt;br /&gt;
| &lt;br /&gt;
| EMEM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01E0000&lt;br /&gt;
| 0x7C013000&lt;br /&gt;
| 0xB000&lt;br /&gt;
| 0x300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM (Secure Monitor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01F0000&lt;br /&gt;
| 0x7C01E000&lt;br /&gt;
| 0x2000&lt;br /&gt;
| 0x300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM (Secure Monitor init)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01F6000&lt;br /&gt;
| 0x7C01E000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01F8000&lt;br /&gt;
| 0x7C01F000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01FA000&lt;br /&gt;
| 0x7C010000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM (Secure Monitor exception vectors)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01FC000&lt;br /&gt;
| 0x7C011000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F01FE000&lt;br /&gt;
| 0x7C012000&lt;br /&gt;
| 0x1000&lt;br /&gt;
| 0x40000000000300&lt;br /&gt;
| &lt;br /&gt;
| TZRAM&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SPL_services&amp;diff=1707</id>
		<title>SPL services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SPL_services&amp;diff=1707"/>
		<updated>2017-07-18T23:08:31Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= spl: =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetConfig]] || wrapper for [[SMC#GetConfig|GetConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ExpMod || user supplied modulus and exponent&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#KeygenAndSealX]] || wrapper for [[SMC#KeygenAndSealX|KeygenAndSealX]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || SetKeyslotFromXY || wrapper for [[SMC#SetKeyslotFromXY|SetKeyslotFromXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DecryptAESECBWithX || decrypts 0x10 bytes using AES ECB, uses [[SMC#SetKeyslotFromXY|SetKeyslotFromXY]] with a fixed Y&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#SetConfig]] || wrapper for [[SMC#SetConfig|SetConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Prng || uses [[SMC#PrngX931|PrngX931]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ImportExpModParams || wrapper for [[SMC#ImportParamsForFWithXY|ImportParamsForFWithXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || ExpMod || wrapper for [[SMC#ExpMod|ExpMod]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#IsDevUnit]] || uses [[SMC#GetConfig|GetConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || KeygenA || wrapper for [[SMC#KeygenA|KeygenA]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#DecryptExpModParamsWithXY]] || wrapper for [[SMC#DecryptExpModParamsWithXY|DecryptExpModParamsWithXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DecryptAESECB || decrypts 0x10 bytes using AES ECB, uses [[SMC#SetKeyslotFromXY|SetKeyslotFromXY]] with fixed X and Y&lt;br /&gt;
|-&lt;br /&gt;
| 15 || SymmetricCrypto || wrapper for [[SMC#SymmetricCrypto|SymmetricCrypto]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || CMAC || wrapper for [[SMC#CMAC|CMAC]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ImportExpModParams || wrapper for [[SMC#ImportParamsFor10WithXY|ImportParamsFor10WithXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ExpModAndKeygenAndSealZ || wrapper for [[SMC#ExpModAndKeygenAndSealZ|ExpModAndKeygenAndSealZ]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || SetKeyslotFromZ || wrapper for [[SMC#SetKeyslotFromZ|SetKeyslotFromZ]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || KeygenAndSealZ || wrapper for [[SMC#KeygenAndSealZ|KeygenAndSealZ]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || || &lt;br /&gt;
|-&lt;br /&gt;
| 22 || || &lt;br /&gt;
|-&lt;br /&gt;
| 23 || GetSplWaitEvent || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetConfig ==&lt;br /&gt;
Takes an input word (ConfigItem), and returns a u64 with the config params.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ConfigItem || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableProgramVerification&lt;br /&gt;
|-&lt;br /&gt;
| 2 || MemoryConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 5 || HardwareType (0=Icosa, 1=Copper)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || IsRecoveryBoot&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceId (byte7 clear).&lt;br /&gt;
|-&lt;br /&gt;
| 9 || BootReason&lt;br /&gt;
|-&lt;br /&gt;
| 10 || MemoryArrange&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AllowSkippingNrrSignatures&lt;br /&gt;
|-&lt;br /&gt;
| 13 || BatteryProfile?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Output from this when used by [[NIM_services|NIM]] must match the [[Settings_services|set:cal]] DeviceId with byte7 cleared, otherwise NIM will panic.&lt;br /&gt;
&lt;br /&gt;
[[Loader services|RO]] checks id11, if set then skipping NRR rsa signatures is allowed.&lt;br /&gt;
&lt;br /&gt;
== KeygenAndSealX ==&lt;br /&gt;
Takes 16-bytes as input and two u32s. Outputs random-looking 16-bytes.&lt;br /&gt;
&lt;br /&gt;
Same input gives same output. Output changes when system is rebooted.&lt;br /&gt;
&lt;br /&gt;
== SetConfig ==&lt;br /&gt;
Takes two input words, a ConfigItem and the value to set.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ConfigItem || Name&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Battery profile?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IsDevUnit ==&lt;br /&gt;
No input params.&lt;br /&gt;
&lt;br /&gt;
Returns an u8 flag for whether the system is devunit. Output flag is 0 on retail.&lt;br /&gt;
&lt;br /&gt;
== DecryptExpModParamsWithXY ==&lt;br /&gt;
Last SPL cmd used by [[SSL_services|SSL]]-sysmodule for TLS client-privk.&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SPL_services&amp;diff=1688</id>
		<title>SPL services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SPL_services&amp;diff=1688"/>
		<updated>2017-07-18T20:46:07Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= spl: =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetConfig]] || wrapper for [[SMC#GetConfig|GetConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ExpMod || user supplied modulus and exponent&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#KeygenAndSealX]] || wrapper for [[SMC#KeygenAndSealX|KeygenAndSealX]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || SetKeyslotFromXY || wrapper for [[SMC#SetKeyslotFromXY|SetKeyslotFromXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DecryptAESCBCWithX || decrypts 16 bytes, uses [[SMC#SetKeyslotFromXY|SetKeyslotFromXY]] with a fixed Y and a fixed CBC IV&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#SetConfig]] || wrapper for [[SMC#SetConfig|SetConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Prng || uses [[SMC#PrngX931|PrngX931]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ImportExpModParams || wrapper for [[SMC#ImportParamsForFWithXY|ImportParamsForFWithXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || ExpMod || wrapper for [[SMC#ExpMod|ExpMod]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#GetDevunitFlag]] || uses [[SMC#GetConfig|GetConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || KeygenA || wrapper for [[SMC#KeygenA|KeygenA]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#DecryptExpModParamsWithXY]] || wrapper for [[SMC#DecryptExpModParamsWithXY|DecryptExpModParamsWithXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DecryptAESCBC || decrypts 16 bytes, uses [[SMC#SetKeyslotFromXY|SetKeyslotFromXY]] with fixed X, Y and a fixed CBC IV&lt;br /&gt;
|-&lt;br /&gt;
| 15 || SymmetricCrypto || wrapper for [[SMC#SymmetricCrypto|SymmetricCrypto]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || CMAC || wrapper for [[SMC#CMAC|CMAC]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ImportExpModParams || wrapper for [[SMC#ImportParamsFor10WithXY|ImportParamsFor10WithXY]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ExpModAndKeygenAndSealZ || wrapper for [[SMC#ExpModAndKeygenAndSealZ|ExpModAndKeygenAndSealZ]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || SetKeyslotFromZ || wrapper for [[SMC#SetKeyslotFromZ|SetKeyslotFromZ]]&lt;br /&gt;
|-&lt;br /&gt;
| 20 || KeygenAndSealZ || wrapper for [[SMC#KeygenAndSealZ|KeygenAndSealZ]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || || &lt;br /&gt;
|-&lt;br /&gt;
| 22 || || &lt;br /&gt;
|-&lt;br /&gt;
| 23 || GetSplWaitEvent || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetConfig ==&lt;br /&gt;
Takes an input word (ConfigItem), and returns a u64 with the config params.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ConfigItem || Name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || MemoryConfiguration&lt;br /&gt;
|-&lt;br /&gt;
| 5 || HardwareType (0=Icosa, 1=Copper)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || IsRecoveryBoot&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceId (byte7 clear).&lt;br /&gt;
|-&lt;br /&gt;
| 9 || BootReason&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AllowSkippingNrrSignatures&lt;br /&gt;
|-&lt;br /&gt;
| 13 || BatteryProfile?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Output from this when used by [[NIM_services|NIM]] must match the [[Settings_services|set:cal]] DeviceId with byte7 cleared, otherwise NIM will panic.&lt;br /&gt;
&lt;br /&gt;
[[Loader services|RO]] checks id11, if set then skipping NRR rsa signatures is allowed.&lt;br /&gt;
&lt;br /&gt;
== KeygenAndSealX ==&lt;br /&gt;
Takes 16-bytes as input and two u32s. Outputs random-looking 16-bytes.&lt;br /&gt;
&lt;br /&gt;
Same input gives same output. Output changes when system is rebooted.&lt;br /&gt;
&lt;br /&gt;
== SetConfig ==&lt;br /&gt;
Takes two input words, a ConfigItem and the value to set.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! ConfigItem || Name&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Battery profile?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetDevunitFlag ==&lt;br /&gt;
No input params.&lt;br /&gt;
&lt;br /&gt;
Returns an u8 flag for whether the system is devunit. Output flag is 0 on retail.&lt;br /&gt;
&lt;br /&gt;
== DecryptExpModParamsWithXY ==&lt;br /&gt;
Last SPL cmd used by [[SSL_services|SSL]]-sysmodule for TLS client-privk.&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1501</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1501"/>
		<updated>2017-07-12T22:28:21Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention up to a small change:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-8 || 0x0000FF00 || Argument type. This is different from the ARM SMC calling convention.&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || 0x000000FF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If bit &#039;&#039;n&#039;&#039; is set in the argument type then parameter X&#039;&#039;n&#039;&#039; is treated as a pointer and the kernel will setup address translation for it in [[SVC#svcCallSecureMonitor|svcCallSecureMonitor]].&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
Cryptography related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || CheckStatus_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || GetResult_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || PrngX931 (Same as Id 1 Sub-Id 5.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || KeygenAndSealX || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || SetKeyslotFromXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || SymmetricCrypto || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || KeygenA || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || CMAC || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || ImportParamsFor10WithXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || DecryptExpModParamsWithXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || ImportParamsForFWithXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || ExpModAndKeygenAndSealZ || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || SetKeyslotFromZ || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || KeygenAndSealZ || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
General and power related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CPU_SUSPEND (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CPU_OFF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CPU_ON || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || PrngX931 (Same as Id 0 Sub-Id 6.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1495</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1495"/>
		<updated>2017-07-12T02:16:36Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention up to a small change:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-8 || 0x0000FF00 || Argument type. This is different from the ARM SMC calling convention.&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || 0x000000FF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If bit &#039;&#039;n&#039;&#039; is set in the argument type then parameter X&#039;&#039;n&#039;&#039; is treated as a pointer and the kernel will setup address translation for it in [[SVC#svcCallSecureMonitor|svcCallSecureMonitor]].&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
Cryptography related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || CheckStatus_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || GetResult_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || PrngX931 (Same as Id 1 Sub-Id 5.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || KeygenAndSealX || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || SetKeyslotFromXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || SymmetricCrypto || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || KeygenA || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || CMAC || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || ImportParamsFor10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || DecryptExpModParams || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || ImportParamsForF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || SetKeyslotFromZ || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || KeygenAndSealZ || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
General and power related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CPU_SUSPEND (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CPU_OFF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CPU_ON || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || PrngX931 (Same as Id 0 Sub-Id 6.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1490</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1490"/>
		<updated>2017-07-11T23:51:13Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-0 || 0x0000FFFF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
Cryptography related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || CheckStatus_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || GetResult_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || PrngX931 (Same as Id 1 Sub-Id 5.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || KeygenAndSealX || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || SetKeyslotFromXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || SymmetricCrypto || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || KeygenA || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || CMAC || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || ImportParamsFor10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || DecryptExpModParams || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || ImportParamsForF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || SetKeyslotFromZ || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || KeygenAndSealZ || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
General and power related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CPU_SUSPEND (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CPU_OFF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CPU_ON || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || PrngX931 (Same as Id 0 Sub-Id 6.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1475</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1475"/>
		<updated>2017-07-11T09:26:36Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-0 || 0x0000FFFF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
Cryptography related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || CheckStatus_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || GetResult_5_9_F_10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || PrngX931 (Same as Id 1 Sub-Id 5.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || Keygen7 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || SetKeyslotFromXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || SymmetricCrypto || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || KeygenA || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || CMAC || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || ImportParamsFor10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || DecryptExpModParams || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || ImportParamsForF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || ExpMod || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || SetKeyslotFromX || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || Keygen12 || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
General and power related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CPU_SUSPEND (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CPU_OFF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CPU_ON || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || PrngX931 (Same as Id 0 Sub-Id 6.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1469</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1469"/>
		<updated>2017-07-11T00:40:24Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
Secure Monitor Calls follow the ARM SMC calling convention:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bit number || Bit mask || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 0x80000000 || Set to 0 means Yielding Call; Set to 1 means Fast Call.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 0x40000000 || Set to 0 means SMC32 convention; Set to 1 means SMC64.&lt;br /&gt;
|-&lt;br /&gt;
| 29-24 || 0x3F000000 || Service Call ranges.&lt;br /&gt;
|-&lt;br /&gt;
| 23-16 || 0x00FF0000 || Must be zero.&lt;br /&gt;
|-&lt;br /&gt;
| 15-0 || 0x0000FFFF || Function number within the range call type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
Cryptography related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || SetConfig || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || GetConfig (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || Keygen7 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || SetKeyslotFromXY || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || SetKeyslotFromX || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || Keygen12 || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
General and power related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || CPU_SUSPEND (oyasumi) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || CPU_OFF || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || CPU_ON || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || GetConfig (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || Panic || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || ReadWriteRegister || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1461</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1461"/>
		<updated>2017-07-10T08:53:14Z</updated>

		<summary type="html">&lt;p&gt;Nwert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
Cryptography related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
General and power related functions.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || oyasumi || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1459</id>
		<title>Secure Monitor</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Secure_Monitor&amp;diff=1459"/>
		<updated>2017-07-10T03:02:17Z</updated>

		<summary type="html">&lt;p&gt;Nwert: Created page with &amp;quot;= Secure Monitor Calls =  The secure monitor provides two top level handlers of which each provides a range of sub handlers.  == Id 0 ==  {| class=wikitable ! Sub-Id || Name |...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Secure Monitor Calls =&lt;br /&gt;
&lt;br /&gt;
The secure monitor provides two top level handlers of which each provides a range of sub handlers.&lt;br /&gt;
&lt;br /&gt;
== Id 0 ==&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000401 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000002 || (Same as Id 1 Sub-Id 4.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000003 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000404 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000E05 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000009 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300000A || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300040B || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100C || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100D || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300100E || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC300060F || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000610 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000011 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000012 || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Id 1 ==&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Sub-Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000001 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x84000002 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC4000003 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000004 || (Same as Id 0 Sub-Id 2.) || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000005 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000006 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000007 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0xC3000008 || || ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nwert</name></author>
	</entry>
</feed>