Switch 2: BCH: Difference between revisions
Created page with "= NvBootComponentHeader = {| class="wikitable" border="1" |- ! Offset ! Size ! Name ! Description |- | 0x0000 || 4 || HeaderMagic || |- | 0x0004 || 0x40 || OuterDigest || |- | style="background: orange" | Outer Section Begin | style="background: orange" | | style="background: orange" | | style="background: orange" | |- | 0x0044 || 0xC || Reserved || |- | 0x0050 || 0x40 || InnerDigest || |- | 0x0090 || 0x40 || Stage2Signature || |- | 0x0BA0..." |
|||
| (4 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
! Offset | ! Offset | ||
! Size | ! Size | ||
! Description | ! Description | ||
|- | |- | ||
| | | 0x0 || 0x4 || HeaderMagic | ||
|- | |- | ||
| | | 0x4 || 0x40 || OuterDigest | ||
|- | |- | ||
| style="background: | | style="background: red" | Outer Section Begin | ||
| style="background: | | style="background: red" | | ||
| style="background: | | style="background: red" | | ||
| | |- | ||
| 0x44 || 0xC || Reserved | |||
|- | |- | ||
| | | 0x50 || 0x40 || InnerDigest | ||
|- | |- | ||
| | | 0x90 || 0xB10 || [[#NvBootCryptoSignatures|Stage2Signature]] | ||
|- | |- | ||
| | | 0xBA0 || 0x180 || [[#NvPublicKeyParameters|Stage2Pcp]] | ||
|- | |- | ||
| | | 0xD20 || 0x2A0 || | ||
|- | |- | ||
| style="background: orange" | Stage 2 Signed Section Begin | | style="background: orange" | Stage 2 Signed Section Begin | ||
| style="background: orange" | | | style="background: orange" | | ||
| style="background: orange" | | | style="background: orange" | | ||
|- | |- | ||
| | | 0xFC0 || 0x10 || Stage2Iv | ||
|- | |||
| 0xFD0 || 0x10 || Stage2Ecid | |||
|- | |||
| 0xFE0 || 0x4 || Stage2NumBinaries | |||
|- | |||
| 0xFE4 || 0x100 || Duk | |||
|- | |||
| 0x10E4 || 0x30C || | |||
|- | |- | ||
| | | 0x13F0 || 0x8 || BlDerStr (must match BlDerStr from [[Switch_2:_BCT#BRBCT|BRBCT]]) | ||
|- | |- | ||
| | | 0x13F8 || 0x8 || FwDerStr | ||
|- | |- | ||
| | | 0x1400 || 0x500 (0xA0 *8) || [[#NvStage2Component|Stage2Components]][8] | ||
|- | |- | ||
| | | 0x1900 || 0x180 || Stage1Signature (always RSA-3072) | ||
|- | |- | ||
| | | style="background: yellow" | Stage 1 Signed Section Begin | ||
| style="background: yellow" | | |||
| style="background: yellow" | | |||
|- | |- | ||
| | | 0x1A80 || 0x10 || Stage1Iv | ||
|- | |- | ||
| | | 0x1A90 || 0x10 || Stage1Ecid | ||
| | |||
|- | |- | ||
| | | 0x1AA0 || 0x4 || Stage1NumBinaries | ||
|- | |- | ||
| | | 0x1AA4 || 0x8 || Key7KdfLabel | ||
|- | |- | ||
| | | 0x1AAC || 0x430 || | ||
|- | |- | ||
| | | 0x1EE0 || 0x120 (0x90 * 2) || [[#NvStage1Component|Stage1Components]][2] | ||
|- | |- | ||
| | | style="background: yellow" | Stage 1 Signed Section End | ||
| style="background: yellow" | | |||
| style="background: yellow" | | |||
|- | |- | ||
| style="background: orange" | | | style="background: orange" | Stage 2 Signed Section End | ||
| style="background: orange" | | | style="background: orange" | | ||
| style="background: orange" | | | style="background: orange" | | ||
|- | |||
| style="background: red" | Outer Section End | |||
| style="background: red" | | |||
| style="background: red" | | |||
|} | |} | ||
| Line 69: | Line 80: | ||
! Offset | ! Offset | ||
! Size | ! Size | ||
! | ! Description | ||
|- | |- | ||
| style="background: orange" | AAD Section Start | | style="background: orange" | AAD Section Start | ||
| Line 75: | Line 86: | ||
| style="background: orange" | | | style="background: orange" | | ||
|- | |- | ||
| 0x0 || | | 0x0 || 0x4 || BinaryMagic | ||
|- | |- | ||
| 0x4 || | | 0x4 || 0x4 || BinaryLen | ||
|- | |- | ||
| 0x8 || | | 0x8 || 0x4 || LoadDestination | ||
|- | |- | ||
| 0xC || | | 0xC || 0x4 || EntryPoint | ||
|- | |- | ||
| 0x10 || | | 0x10 || 0x4 || [[#NvBootComponentVersion|Version]] | ||
|- | |- | ||
| 0x14 || | | 0x14 || 0x4 || Reserved | ||
|- | |- | ||
| 0x18 || | | 0x18 || 0x8 || PartitionOffset (only used for MEM-BCT) | ||
|- | |- | ||
| 0x20 || | | 0x20 || 0x10 || DerStr | ||
|- | |- | ||
| 0x30 || | | 0x30 || 0x4 || Reserved | ||
|- | |- | ||
| 0x34 || | | 0x34 || 0xC || Iv | ||
|- | |- | ||
| style="background: orange" | AAD Section End | | style="background: orange" | AAD Section End | ||
| Line 99: | Line 110: | ||
| style="background: orange" | | | style="background: orange" | | ||
|- | |- | ||
| 0x40 || | | 0x40 || 0x10 || AuthTag | ||
|- | |- | ||
| 0x50 || | | 0x50 || 0x40 || PayloadDigest (SHA512 of 0x2000..) | ||
|} | |} | ||
| Line 109: | Line 120: | ||
! Offset | ! Offset | ||
! Size | ! Size | ||
! | ! Description | ||
|- | |- | ||
| style="background: orange" | AAD Section Start | | style="background: orange" | AAD Section Start | ||
| Line 115: | Line 126: | ||
| style="background: orange" | | | style="background: orange" | | ||
|- | |- | ||
| 0x0 || | | 0x0 || 0x4 || BinaryMagic | ||
|- | |||
| 0x4 || 0x4 || BinaryLen | |||
|- | |- | ||
| | | 0x8 || 0x4 || LoadDestination | ||
|- | |- | ||
| | | 0xC || 0x4 || EntryPoint | ||
|- | |- | ||
| | | 0x10 || 0x4 || [[#NvBootComponentVersion|Version]] | ||
|- | |- | ||
| | | 0x14 || 0x4 || | ||
|- | |- | ||
| | | 0x18 || 0x4 || | ||
|- | |- | ||
| | | 0x1C || 0x4 || [[#Flags0|Flags0]] | ||
|- | |- | ||
| | | 0x20 || 0x4 || UncompressedBinaryLen | ||
|- | |- | ||
| 0x44 || | | 0x24 || 0x4 || [[#Flags1|Flags1]] | ||
|- | |||
| 0x28 || 0x4 || CompressedBinaryLen | |||
|- | |||
| 0x2C || 0x4 || [[#Flags2|Flags2]] | |||
|- | |||
| 0x30 || 0x10 || DerStr | |||
|- | |||
| 0x40 || 0x4 || Reserved | |||
|- | |||
| 0x44 || 0xC || Iv | |||
|- | |- | ||
| style="background: orange" | AAD Section End | | style="background: orange" | AAD Section End | ||
| Line 137: | Line 160: | ||
| style="background: orange" | | | style="background: orange" | | ||
|- | |- | ||
| 0x50 || | | 0x50 || 0x10 || AuthTag | ||
|- | |- | ||
| 0x60 || | | 0x60 || 0x40 || PayloadDigest (SHA512 of 0x2000..) | ||
|} | |} | ||
| Line 147: | Line 170: | ||
! Offset | ! Offset | ||
! Size | ! Size | ||
! | ! Description | ||
|- | |- | ||
| 0x0 || 1 || Major | | 0x0 || 1 || Major | ||
| Line 159: | Line 182: | ||
== NvBootCryptoSignatures == | == NvBootCryptoSignatures == | ||
This is | This is an union. | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
| Line 165: | Line 188: | ||
! Offset | ! Offset | ||
! Size | ! Size | ||
! | ! Description | ||
|- | |- | ||
| 0x0 || 0x20 || Sha256Signature | | 0x0 || 0x20 || Sha256Signature | ||
| Line 174: | Line 197: | ||
|- | |- | ||
| 0x0 || 0xB10 || XmssSignature | | 0x0 || 0xB10 || XmssSignature | ||
|} | |||
== NvPublicKeyParameters == | |||
This is an union. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 || 0x20 || Eddsa | |||
|- | |||
| 0x0 || 0x40 || Ecdsa | |||
|- | |||
| 0x0 || 0x180 || Rsa | |||
|} | |||
== Flags0 == | |||
{| class="wikitable" border="1" | |||
! Bits | |||
! Description | |||
|- | |||
| 0-25 | |||
| | |||
|- | |||
| 26 | |||
| IsEncrypted | |||
|- | |||
| 27 | |||
| IsCompressed | |||
|- | |||
| 28-31 | |||
| | |||
|} | |||
== Flags1 == | |||
{| class="wikitable" border="1" | |||
! Bits | |||
! Description | |||
|- | |||
| 0-23 | |||
| | |||
|- | |||
| 16-23 | |||
| BootImgType | |||
|- | |||
| 24-31 | |||
| | |||
|} | |||
== Flags2 == | |||
{| class="wikitable" border="1" | |||
! Bits | |||
! Description | |||
|- | |||
| 0-7 | |||
| | |||
|- | |||
| 8 | |||
| IsClassKeysSigned | |||
|- | |||
| 9-31 | |||
| | |||
|} | |} | ||