Difference between revisions of "Calibration"
Jump to navigation
Jump to search
(Created page with "During factory setup, the Switch goes through calibration and the generated data from this process is written to two [[Flash_Filesystem|NAND user partitions]...") |
|||
Line 24: | Line 24: | ||
| 0x0004 | | 0x0004 | ||
| 0x04 | | 0x04 | ||
− | | | + | | unk |
| Always 0x07. | | Always 0x07. | ||
|- | |- | ||
Line 30: | Line 30: | ||
| 0x04 | | 0x04 | ||
| calib_data_size | | calib_data_size | ||
− | | Total size of calibration data minus | + | | Total size of calibration data minus 0x40 bytes (header + calib_data_sha256). |
|- | |- | ||
| 0x000C | | 0x000C | ||
Line 54: | Line 54: | ||
| 0x0060 | | 0x0060 | ||
| 0x20 | | 0x20 | ||
− | | | + | | reserved |
| Empty. | | Empty. | ||
|- | |- | ||
Line 60: | Line 60: | ||
| 0x04 | | 0x04 | ||
| wlan_country_codes_num | | wlan_country_codes_num | ||
− | | | + | | Number of elements in the wlan_country_codes array. |
|- | |- | ||
| 0x0084 | | 0x0084 | ||
− | | | + | | 0x04 |
+ | | wlan_country_codes_last_idx | ||
+ | | Index of the last element in the wlan_country_codes array. | ||
+ | |- | ||
+ | | 0x0088 | ||
+ | | 0x180 | ||
| wlan_country_codes | | wlan_country_codes | ||
− | | | + | | Array of WLAN country code strings. Each element is 3 bytes (code + NULL terminator). |
|- | |- | ||
| 0x0210 | | 0x0210 | ||
Line 105: | Line 110: | ||
| 0x30 | | 0x30 | ||
| device_key_ecc_p256 | | device_key_ecc_p256 | ||
− | | Device key ECC-P256 | + | | Device key (ECC-P256 version; empty and unused). |
|- | |- | ||
| 0x02B0 | | 0x02B0 | ||
| 0x180 | | 0x180 | ||
| device_cert_ecc_p256 | | device_cert_ecc_p256 | ||
− | | Device certificate ECC-P256 | + | | Device certificate (ECC-P256 version; empty and unused). |
|- | |- | ||
| 0x0440 | | 0x0440 | ||
| 0x30 | | 0x30 | ||
| device_key_ecc_b233 | | device_key_ecc_b233 | ||
− | | Device key ECC-B233 | + | | Device key (ECC-B233 version; empty and unused). |
|- | |- | ||
| 0x0480 | | 0x0480 | ||
| 0x180 | | 0x180 | ||
| device_cert_ecc_b233 | | device_cert_ecc_b233 | ||
− | | Device certificate ECC-B233 | + | | Device certificate (ECC-B233 version; active). |
|- | |- | ||
| 0x0610 | | 0x0610 | ||
| 0x30 | | 0x30 | ||
| eticket_key_ecc_p256 | | eticket_key_ecc_p256 | ||
− | | ETicket key ECC P256 | + | | ETicket key (ECC-P256 version; empty and unused). |
|- | |- | ||
| 0x0650 | | 0x0650 | ||
| 0x180 | | 0x180 | ||
| eticket_cert_ecc_p256 | | eticket_cert_ecc_p256 | ||
− | | ETicket certificate ECC-P256 | + | | ETicket certificate (ECC-P256 version; empty and unused). |
|- | |- | ||
| 0x07E0 | | 0x07E0 | ||
| 0x30 | | 0x30 | ||
| eticket_key_ecc_b233 | | eticket_key_ecc_b233 | ||
− | | ETicket key ECC-B233 | + | | ETicket key (ECC-B233 version; empty and unused). |
|- | |- | ||
| 0x0820 | | 0x0820 | ||
| 0x180 | | 0x180 | ||
| eticket_cert_ecc_b233 | | eticket_cert_ecc_b233 | ||
− | | ETicket certificate ECC-B233 | + | | ETicket certificate (ECC-B233 version; empty and unused). |
|- | |- | ||
| 0x09B0 | | 0x09B0 | ||
Line 175: | Line 180: | ||
| 0x110 | | 0x110 | ||
| gamecard_key | | gamecard_key | ||
− | | | + | | GameCard key (empty and unused). |
|- | |- | ||
| 0x2440 | | 0x2440 | ||
| 0x400 | | 0x400 | ||
| gamecard_cert | | gamecard_cert | ||
− | | | + | | GameCard certificate. |
|- | |- | ||
| 0x2840 | | 0x2840 | ||
| 0x20 | | 0x20 | ||
| gamecard_cert_sha256 | | gamecard_cert_sha256 | ||
− | | SHA256 over the | + | | SHA256 over the GameCard certificate. |
|- | |- | ||
| 0x2860 | | 0x2860 | ||
| 0x220 | | 0x220 | ||
| eticket_key_rsa | | eticket_key_rsa | ||
− | | ETicket key RSA-2048 | + | | ETicket key (RSA-2048 version; empty and unused). |
|- | |- | ||
| 0x2A90 | | 0x2A90 | ||
| 0x240 | | 0x240 | ||
| eticket_cert_rsa | | eticket_cert_rsa | ||
− | | ETicket certificate RSA-2048 | + | | ETicket certificate (RSA-2048 version; active). |
|- | |- | ||
| 0x2CE0 | | 0x2CE0 | ||
Line 215: | Line 220: | ||
| 0x50 | | 0x50 | ||
| amiibo_key | | amiibo_key | ||
− | | Amiibo key. | + | | Amiibo key (ECQV and ECDSA versions). |
|- | |- | ||
| 0x3580 | | 0x3580 | ||
| 0x14 | | 0x14 | ||
| amiibo_cert_ecqv | | amiibo_cert_ecqv | ||
− | | Amiibo certificate ECQV | + | | Amiibo certificate (ECQV version). |
|- | |- | ||
| 0x35A0 | | 0x35A0 | ||
| 0x70 | | 0x70 | ||
| amiibo_cert_ecdsa | | amiibo_cert_ecdsa | ||
− | | Amiibo certificate ECDSA | + | | Amiibo certificate (ECDSA version). |
|- | |- | ||
| 0x3620 | | 0x3620 | ||
| 0x40 | | 0x40 | ||
| amiibo_key_ecqv_bls | | amiibo_key_ecqv_bls | ||
− | | Amiibo ECQV-BLS | + | | Amiibo key (ECQV-BLS version). |
|- | |- | ||
| 0x3670 | | 0x3670 | ||
| 0x20 | | 0x20 | ||
| amiibo_cert_ecqv_bls | | amiibo_cert_ecqv_bls | ||
− | | Amiibo certificate ECQV-BLS | + | | Amiibo certificate (ECQV-BLS version). |
|- | |- | ||
| 0x36A0 | | 0x36A0 | ||
| 0x90 | | 0x90 | ||
| amiibo_root_cert_ecqv_bls | | amiibo_root_cert_ecqv_bls | ||
− | | Amiibo root certificate ECQV-BLS | + | | Amiibo root certificate (ECQV-BLS version). |
|- | |- | ||
| 0x3740 | | 0x3740 | ||
Line 260: | Line 265: | ||
| 0x50 | | 0x50 | ||
| device_ext_key_ecc_b233 | | device_ext_key_ecc_b233 | ||
− | | Extended device key ECC-B233 | + | | Extended device key (ECC-B233 version; active). |
|- | |- | ||
| 0x37D0 | | 0x37D0 | ||
| 0x30 | | 0x30 | ||
| eticket_ext_key_ecc_p256 | | eticket_ext_key_ecc_p256 | ||
− | | Extended ETicket key ECC-P256 | + | | Extended ETicket key (ECC-P256 version; empty and unused). |
|- | |- | ||
| 0x3830 | | 0x3830 | ||
| 0x50 | | 0x50 | ||
| eticket_ext_key_ecc_b233 | | eticket_ext_key_ecc_b233 | ||
− | | Extended ETicket key ECC-B233 | + | | Extended ETicket key (ECC-B233 version; empty and unused). |
|- | |- | ||
| 0x3890 | | 0x3890 | ||
| 0x240 | | 0x240 | ||
| eticket_ext_key_rsa | | eticket_ext_key_rsa | ||
− | | Extended ETicket key RSA-2048 | + | | Extended ETicket key (RSA-2048 version; active). |
|- | |- | ||
| 0x3AE0 | | 0x3AE0 | ||
Line 285: | Line 290: | ||
| 0x130 | | 0x130 | ||
| gamecard_ext_key | | gamecard_ext_key | ||
− | | Extended | + | | Extended GameCard key (active). |
|- | |- | ||
| 0x3D60 | | 0x3D60 |
Revision as of 14:28, 8 September 2017
During factory setup, the Switch goes through calibration and the generated data from this process is written to two NAND user partitions (PRODINFO and PRODINFOF).
PRODINFOF is a FAT12 compliant filesystem and it's structure can be found here. It's mainly used to keep calibration logs and other assorted files.
PRODINFO is a raw binary blob containing the main calibration data, which ranges from hardware IDs to system keys.
CAL0
This is the raw data stored under the PRODINFO partition. Each block of data is padded to 16 bytes, being the last 2 bytes a CRC16 over said block.
Bellow is a list of offsets and sizes for each block of raw calibration data.
Offset | Size | Field | Description |
---|---|---|---|
0x0000 | 0x04 | magic | "CAL0" header magic. |
0x0004 | 0x04 | unk | Always 0x07. |
0x0008 | 0x04 | calib_data_size | Total size of calibration data minus 0x40 bytes (header + calib_data_sha256). |
0x000C | 0x02 | version | Always 0x01. |
0x000E | 0x02 | revision | Increases each time calibration data is installed. |
0x0020 | 0x20 | calib_data_sha256 | SHA256 hash calculated over calibration data. |
0x0040 | 0x1D | config_id1 | Configuration ID string. |
0x0060 | 0x20 | reserved | Empty. |
0x0080 | 0x04 | wlan_country_codes_num | Number of elements in the wlan_country_codes array. |
0x0084 | 0x04 | wlan_country_codes_last_idx | Index of the last element in the wlan_country_codes array. |
0x0088 | 0x180 | wlan_country_codes | Array of WLAN country code strings. Each element is 3 bytes (code + NULL terminator). |
0x0210 | 0x06 | wlan_mac_addr | |
0x0220 | 0x06 | bd_addr | |
0x0230 | 0x06 | accelerometer_offset | |
0x0238 | 0x06 | accelerometer_scale | |
0x0240 | 0x06 | gyroscope_offset | |
0x0248 | 0x06 | gyroscope_scale | |
0x0250 | 0x18 | serial_number | |
0x0270 | 0x30 | device_key_ecc_p256 | Device key (ECC-P256 version; empty and unused). |
0x02B0 | 0x180 | device_cert_ecc_p256 | Device certificate (ECC-P256 version; empty and unused). |
0x0440 | 0x30 | device_key_ecc_b233 | Device key (ECC-B233 version; empty and unused). |
0x0480 | 0x180 | device_cert_ecc_b233 | Device certificate (ECC-B233 version; active). |
0x0610 | 0x30 | eticket_key_ecc_p256 | ETicket key (ECC-P256 version; empty and unused). |
0x0650 | 0x180 | eticket_cert_ecc_p256 | ETicket certificate (ECC-P256 version; empty and unused). |
0x07E0 | 0x30 | eticket_key_ecc_b233 | ETicket key (ECC-B233 version; empty and unused). |
0x0820 | 0x180 | eticket_cert_ecc_b233 | ETicket certificate (ECC-B233 version; empty and unused). |
0x09B0 | 0x110 | ssl_key | SSL key (empty and unused). |
0x0AD0 | 0x04 | ssl_cert_size | Total size of the SSL certificate. |
0x0AE0 | 0x800 | ssl_cert | SSL certificate. Only ssl_cert_size bytes are used. |
0x12E0 | 0x20 | ssl_cert_sha256 | SHA256 over the SSL certificate. |
0x1300 | 0x1000 | random_number | Random generated data. |
0x2300 | 0x20 | random_number_sha256 | SHA256 over the random data block. |
0x2320 | 0x110 | gamecard_key | GameCard key (empty and unused). |
0x2440 | 0x400 | gamecard_cert | GameCard certificate. |
0x2840 | 0x20 | gamecard_cert_sha256 | SHA256 over the GameCard certificate. |
0x2860 | 0x220 | eticket_key_rsa | ETicket key (RSA-2048 version; empty and unused). |
0x2A90 | 0x240 | eticket_cert_rsa | ETicket certificate (RSA-2048 version; active). |
0x2CE0 | 0x18 | battery_lot | Battery lot string ID. |
0x2D00 | 0x800 | speaker_calib_value | Speaker calibration values. Only 0x5A bytes are used. |
0x3510 | 0x04 | region_code | |
0x3520 | 0x50 | amiibo_key | Amiibo key (ECQV and ECDSA versions). |
0x3580 | 0x14 | amiibo_cert_ecqv | Amiibo certificate (ECQV version). |
0x35A0 | 0x70 | amiibo_cert_ecdsa | Amiibo certificate (ECDSA version). |
0x3620 | 0x40 | amiibo_key_ecqv_bls | Amiibo key (ECQV-BLS version). |
0x3670 | 0x20 | amiibo_cert_ecqv_bls | Amiibo certificate (ECQV-BLS version). |
0x36A0 | 0x90 | amiibo_root_cert_ecqv_bls | Amiibo root certificate (ECQV-BLS version). |
0x3740 | 0x04 | product_model | |
0x3750 | 0x06 | color_variation | |
0x3760 | 0x0C | lcd_backlight_brightness_mapping | |
0x3770 | 0x50 | device_ext_key_ecc_b233 | Extended device key (ECC-B233 version; active). |
0x37D0 | 0x30 | eticket_ext_key_ecc_p256 | Extended ETicket key (ECC-P256 version; empty and unused). |
0x3830 | 0x50 | eticket_ext_key_ecc_b233 | Extended ETicket key (ECC-B233 version; empty and unused). |
0x3890 | 0x240 | eticket_ext_key_rsa | Extended ETicket key (RSA-2048 version; active). |
0x3AE0 | 0x130 | ssl_ext_key | Extended SSL key (active). |
0x3C20 | 0x130 | gamecard_ext_key | Extended GameCard key (active). |
0x3D60 | 0x04 | lcd_vendor_id |