Changes

1,012 bytes added ,  05:02, 27 October 2015
AGB NAND savegame format, MAC, etc
Line 75: Line 75:  
* Flash V124 was observed 0x90, V131 was observed 0xC0.
 
* Flash V124 was observed 0x90, V131 was observed 0xC0.
 
* EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.
 
* EEPROM-based games vary wildly, since they can likely specify chip info in the 0x10-region of the footer.
 +
 +
 +
===NAND Savegame===
 +
AGB_FIRM saves its active save memory to NAND on exit, this is then immediately picked up by NATIVE_FIRM on reboot by checking [[CONFIG_Registers#CFG_BOOTENV|CFG_BOOTENV]]. From there, this is verified and copied out to SD. The savegame format is as follows:
 +
{| class="wikitable" border="1"
 +
|-
 +
!  START
 +
!  SIZE
 +
!  DESCRIPTION
 +
|-
 +
|  0x0
 +
|  0x4
 +
|  Magic ('.SAV')
 +
|-
 +
| 0x4
 +
| 0xC
 +
| Always 0xFF
 +
|-
 +
| 0x10
 +
| 0x10
 +
| AES-MAC of the SHA256 hash of 0x30..0x200 + the entire save itself, keyslot 0x24, keyY from process9 .rodata
 +
|-
 +
| 0x20
 +
| 0x10
 +
| Always 0xFF
 +
|-
 +
|-
 +
| 0x30
 +
| 0x40
 +
| Always 0x1?
 +
|-
 +
| 0x34
 +
| 0x4
 +
| ? (observed 0x1, may change though)
 +
|-
 +
| 0x38
 +
| 0x8
 +
| AGB TitleID
 +
|-
 +
| 0x40
 +
| 0x10
 +
| eMMC CID from the console the save was made on (verified on load)
 +
|-
 +
| 0x50
 +
| 0x4
 +
| Save start addr (always 0x200)
 +
|-
 +
| 0x54
 +
| 0x4
 +
| Save size
 +
|-
 +
| 0x58
 +
| 0x8
 +
| Always 0xFF (?)
 +
|-
 +
| 0x60
 +
| 0x4
 +
| See [[ARM7_Registers|here]]
 +
|-
 +
| 0x64
 +
| 0x4
 +
| See [[ARM7_Registers|here]]
 +
|-
 +
| 0x68
 +
| 0x198
 +
| Always 0xFF
 +
|}
96

edits