Migration services: Difference between revisions

No edit summary
No edit summary
Line 633: Line 633:


Besides other functionality, this async task may call the same network-request func as [[#Cmd500_2|Cmd500]].
Besides other functionality, this async task may call the same network-request func as [[#Cmd500_2|Cmd500]].
= AdvertiseData =
These sections document the initial [[LDN_services|AdvertiseData]] used by migration.
The global constant used with hashing below is the same regardless of the AdvertiseData.
Later the server also sets the AdvertiseData to {0x10-byte data}.
== user ==
Used by nn::migration::user::*.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x8 || AccountId
|-
| 0x8 || 0x58 || Unused
|-
| 0x60 || 0x100 ||
|-
| 0x160 || 0x20 || SHA256 hash
|}
The hash is calculated by using SHA256-update with each field separately, followed by global constant:
* AccountId
* +0x60 size 0x100-bytes
* 0x100-byte global constant
== savedata ==
Used by nn::migration::savedata::*.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x10 ||
|-
| 0x10 || 0x8 || AccountId
|-
| 0x18 || 0x8 || ApplicationId
|-
| 0x20 || 0x4 || [[Settings_services#GetProductModel|ProductModel]]
|-
| 0x24 || 0x4 || Padding
|-
| 0x28 || 0x100 ||
|-
| 0x128 || 0x20 || SHA256 hash
|}
The hash is calculated by using SHA256-update with each field separately, followed by global constant:
* +0x0 size 0x10
* AccountId
* ApplicationId
* ProductModel
* +0x28 size 0x100
* 0x100-bytes global constant
== device ==
Used by nn::migration::device::*.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x10 ||
|-
| 0x10 || 0x40 (0x8*0x8) || Array of u64s with the below count.
|-
| 0x50 || 0x4 || Count for the above array.
|-
| 0x54 || 0xC || Unused
|-
| 0x60 || 0x100 ||
|-
| 0x160 || 0x20 || SHA256 hash
|}
The hash is calculated by using SHA256-update with each field separately, followed by global constant:
* +0x0 size 0x10-bytes
* +0x10 size 0x40-bytes
* +0x50 size 0x4-bytes
* +0x60 size 0x100-bytes
* 0x100-bytes global constant


= Notes =
= Notes =