By entering this site you need to consent to the use of cookies and their functional use according to this privacy policy. Cookies help us to provide the functional services of the website. Kindly read the below message of use and consent to the use.
The following cookies are stored and shared when accessing this website:
- Internal cookies for the MediaWiki site. This is used for user authentication and article modifications.
- Third-party cookies from Google providing services for Google AdSense and Google Analytics
We will never use data collected outside of the above scope.
| Header's CTR. Official code copies the pre-decryption CTR over the decrypted result. Used to calculate the size of the entire package2 with the raw header: size = word2 ^ word3 ^ word0, additionally validated by checking (word1 ^ (word1 >> 16)) & 0xFF == word1 >> 24.
+
| Header's CTR. Also used as metadata before decryption.
|-
|-
| 0x10
| 0x10
Line 129:
Line 129:
Each section follows each other immediately and is encrypted with the same key used for encrypting the header.
Each section follows each other immediately and is encrypted with the same key used for encrypting the header.
The section offsets are relative to a base, which is typically 0x80000000 pointing to the base of DRAM.
The section offsets are relative to a base, which is typically 0x80000000 pointing to the base of DRAM.
+
+
Before being decrypted, the encrypted header's CTR additionally encodes metadata used to validate package2's contents as follows:
+
* Size of the entire package2 with the raw header = ctr_word2 ^ ctr_word3 ^ ctr_word0
+
* Metadata version field = ((ctr_word1 ^ (ctr_word1 >> 16)) & 0xFF) ^ (ctr_word1 >> 24)
+
+
In [4.0.0], the metadata version field must be less or equal to 4.