NFC services: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 533: | Line 533: | ||
Just converts data from the internal [[#Amiibo settings]] to the output data. The last write date is not validated here (unlike with [[#GetCommonInfo]]). | Just converts data from the internal [[#Amiibo settings]] to the output data. The last write date is not validated here (unlike with [[#GetCommonInfo]]). | ||
[20.5.0+] Amiibo version is no longer hardcoded to value 2, and actually set from the corresponding amiibo ID bits. | |||
==== SetAll ==== | ==== SetAll ==== | ||
| Line 608: | Line 610: | ||
Creates an internal object that manages mounted amiibo data. This step loads the amiibo [[#Raw format]], saves it in [[#Backup data]], and converts/decrypts it internally into a [[#Plain format]]. | Creates an internal object that manages mounted amiibo data. This step loads the amiibo [[#Raw format]], saves it in [[#Backup data]], and converts/decrypts it internally into a [[#Plain format]]. | ||
[20.5.0+] Internal check "amiibo_version == 2" was changed to "(amiibo_version & 0xFE) == 2" to also cover new v3 amiibos. | |||
=== Unmount === | === Unmount === | ||
| Line 639: | Line 643: | ||
Performs CRC verifications, updates write counters (see [[#Amiibo settings]]) and then calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | Performs CRC verifications, updates write counters (see [[#Amiibo settings]]) and then calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | ||
[20.5.0+] [[#Amiibo settings]] Field `Unknown2` always zeroed for v3 amiibos, while it it conditionally zeroed for v2 amiibos (as it was done so far). | |||
=== Restore === | === Restore === | ||
| Line 644: | Line 650: | ||
Reloads amiibo data (same internal functions as [[#Mount]]) and writes the data to the amiibo again. If reading the amiibo fails, it tries to load the [[#Raw data]] from the [[#Backup data]]. | Reloads amiibo data (same internal functions as [[#Mount]]) and writes the data to the amiibo again. If reading the amiibo fails, it tries to load the [[#Raw data]] from the [[#Backup data]]. | ||
[20.5.0+] Internal check "amiibo_version == 2" was changed to "(amiibo_version & 0xFE) == 2" to also cover new v3 amiibos. | |||
=== CreateApplicationArea === | === CreateApplicationArea === | ||
| Line 651: | Line 659: | ||
Sets the new application ID / access ID values (even if an application area already existed), updates CRC values, updates write counters (see [[#Amiibo settings]]), copies input data, fills remaining space with random bytes, and then calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | Sets the new application ID / access ID values (even if an application area already existed), updates CRC values, updates write counters (see [[#Amiibo settings]]), copies input data, fills remaining space with random bytes, and then calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | ||
[20.5.0+] [[#Amiibo settings]] Field `Unknown2` always zeroed for v3 amiibos, while it it conditionally zeroed for v2 amiibos (as it was done so far). | |||
=== GetTagInfo === | === GetTagInfo === | ||
| Line 713: | Line 723: | ||
Performs the same logic as [[#SetApplicationArea]] but without checking the current access ID, just overwriting it. | Performs the same logic as [[#SetApplicationArea]] but without checking the current access ID, just overwriting it. | ||
[20.5.0+] Now the Mii CRC32 in [[#Amiibo settings]] is properly computed for v3 amiibos, while for v2 amiibos (as it was done so far)the field is set to a random u16 value. | |||
=== Format === | === Format === | ||
| Line 723: | Line 735: | ||
Just converts data from the internal [[#Amiibo settings]] to the output info. | Just converts data from the internal [[#Amiibo settings]] to the output info. | ||
[20.5.0+] Amiibo version is no longer hardcoded to value 2, and actually set from the corresponding amiibo ID bits. | |||
=== GetRegisterInfoPrivate === | === GetRegisterInfoPrivate === | ||
| Line 737: | Line 751: | ||
Just converts data from the input info to the internal [[#Amiibo settings]]. No flushing / writing to the amiibo is done in this command. | Just converts data from the input info to the internal [[#Amiibo settings]]. No flushing / writing to the amiibo is done in this command. | ||
[20.5.0+] [[#Amiibo settings]] Field `Unknown2` always zeroed for v3 amiibos, while it it conditionally zeroed for v2 amiibos (as it was done so far). | |||
=== DeleteRegisterInfo === | === DeleteRegisterInfo === | ||
| Line 744: | Line 760: | ||
All [[#RegisterInfo]]-related fields in the internal [[#Amiibo settings]] are filled with random bytes, and the amiibo-initialized [[#Amiibo flag]] is removed. Finally, it calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | All [[#RegisterInfo]]-related fields in the internal [[#Amiibo settings]] are filled with random bytes, and the amiibo-initialized [[#Amiibo flag]] is removed. Finally, it calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | ||
[20.5.0+] Now the Mii CRC32 in [[#Amiibo settings]] is properly computed for v3 amiibos, while for v2 amiibos (as it was done so far)the field is set to a random u16 value. | |||
=== DeleteApplicationArea === | === DeleteApplicationArea === | ||
| Line 751: | Line 769: | ||
All [[#Application area]]-related fields in the internal [[#Amiibo settings]] are filled with random bytes, and the corresponding [[#Amiibo flag]] is removed. Finally, it calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | All [[#Application area]]-related fields in the internal [[#Amiibo settings]] are filled with random bytes, and the corresponding [[#Amiibo flag]] is removed. Finally, it calls internally the same function as [[#BreakTag]] with [[#BreakType]] 0. | ||
[20.5.0+] [[#Amiibo settings]] Field `Unknown2` always zeroed for v3 amiibos, while it it conditionally zeroed for v2 amiibos (as it was done so far). | |||
=== ExistsApplicationArea === | === ExistsApplicationArea === | ||
| Line 1,225: | Line 1,245: | ||
| 0xC || 0x2 || Packed date (when this entry was written) | | 0xC || 0x2 || Packed date (when this entry was written) | ||
|- | |- | ||
| 0xE || | | 0xE || 0x1 || [20.5.0+] Backup entry type, depending on amiibo version (0 = v2, 1 = v3), previously reserved/zero | ||
|- | |||
| 0xF || 0xD || Unknown (reserved?) | |||
|- | |- | ||
| 0x1C || 0x4 || CRC32 of the 0x1C bytes above | | 0x1C || 0x4 || CRC32 of the 0x1C bytes above | ||
| Line 1,237: | Line 1,259: | ||
NFC writes here the amiibo [[#Raw format]], while the remaining 0x5E4 bytes are unused. | NFC writes here the amiibo [[#Raw format]], while the remaining 0x5E4 bytes are unused. | ||
[20.5.0+] The entry data stored is different for v3 amiibos: the first 0x80 bytes of the [[#Raw format]] are stored, then followed by 0x40 internal bytes from the corresponding Noft2 object (what exactly?) and finally followed by the remaining (0x19C) bytes of the raw data, thus now using 0x25C bytes of the entry data (and leaving the remaining 0x5A4 bytes unused). | |||
= Amiibo = | = Amiibo = | ||
| Line 1,413: | Line 1,437: | ||
| 0x6 || 0x1 || NFP type (figurine type) | | 0x6 || 0x1 || NFP type (figurine type) | ||
|- | |- | ||
| 0x7 || 0x1 || | | 0x7 || 0x1 || Amiibo version (v2 or [20.5.0+] v3) | ||
|} | |} | ||
| Line 1,501: | Line 1,525: | ||
| 0x90 || 0x8 || Mii StoreDataExtension | | 0x90 || 0x8 || Mii StoreDataExtension | ||
|- | |- | ||
| 0x98 || 0x14 || Unknown2 | | 0x98 || 0x14 || Unknown2 (appears to be reserved for v2 amiibos and used in v3 amiibos, for maybe application area-related purposes?) | ||
|- | |- | ||
| 0xAC || 0x4 || CRC32 of mii data (Ver3StoreData + pad + CRC16) + Application ID byte + Unknown1 + StoreDataExtension + Unknown2 (total of 0x7E bytes) (big-endian) | | 0xAC || 0x4 || CRC32 of mii data (Ver3StoreData + pad + CRC16) + Application ID byte + Unknown1 + StoreDataExtension + Unknown2 (total of 0x7E bytes) (big-endian) | ||