AM:ImportTwlBackup

AM:ImportTwlBackup

Request #

Index WordDescription
0Header code [0x001C0084]
1Buffer Size (must be >= 0x20000)
2u8, Operation
30x10
4FSFILE Handle
5(Buffer Size << 4) | 0xC
6Work buffer pointer

Response #

Index WordDescription
0Header code
1Result code

Operation #

ValueDescription
0-1Invalid, same as values 4 and 7.
2 and 5?
3 and 6?
4 and >=7No importing is done here.

Description #

AM module uses AMPXI:DecryptDSiWareData for decrypting each DSiWare section. After decrypting a section via that command, AM module calculates a hash over the decrypted payload data for AMPXI:ValidateDSiWareSectionMAC. The footer hash for this section is then verified by calculating a hash over the cleartext data as well.

After AM module validates the header, AM module then uses AMPXI:ValidateDSiWareMovableSedHash. The footer ECDSA verification is handled by AMPXI:VerifyDSiWareFooter.