Nn idbe.rpl: Difference between revisions

m Renamed OSv12 to OSv10
 
(5 intermediate revisions by one other user not shown)
Line 17: Line 17:


== Encryption ==  
== Encryption ==  
The icon database is encrypted with AES-128-CBC. There's a two byte header:
byte 0: always zero.
byte 1: aes key index
followed by encrypted data.


nn_idbe contains hardcoded keys in one 0x50 sized block (0x10 * 5), consisting of the 16-byte hardcoded IV, and 4 hardcoded 16-byte AES-128 keys.
nn_idbe contains hardcoded keys in one 0x50 sized block (0x10 * 5), consisting of the 16-byte hardcoded IV, and 4 hardcoded 16-byte AES-128 keys.


In OSv12 (000500101000400A), the keys are located at $.rodata+0x4c of nn_idbe.rpl.
In OSv10 (000500101000400A), the keys are located at $.rodata+0x4c of nn_idbe.rpl.


Here are the keys: (no copyright issue as OSv12 is a free title Kappa)
Here are the keys:


<syntaxhighlight lang="Python">
<syntaxhighlight lang="Python">
Line 44: Line 37:
</syntaxhighlight>
</syntaxhighlight>


== Decrypted icon format ==
== Icon format ==
 
=== Encrypted ===
 
{| class="wikitable"
! Offset
! Length
! Description
|-
| 0x0
| 0x1
| Always 0
|-
| 0x1
| 0x1
| AES key index
|-
| 0x2
| Remainder
| Encrypted file contents
|}
 
=== Decrypted ===


{| class="wikitable"
{| class="wikitable"
Line 72: Line 87:
|-
|-
| 0x50
| 0x50
| 0x80*64
| 0x200*16
| 64 UTF-16 blocks of text for the publisher/title name. Each block has a length of 0x80 (See note 2 below)
| Title Info (See note 2 below)
|-
|-
| 0x2050
| 0x2050
| Remainder
| Remainder
| Original TGA
| Original TGA
|}
=== Title Info ===
{| class="wikitable"
! Offset
! Length
! Description
|-
| 0x0
| 0x80
| Short title name
|-
| 0x80
| 0x100
| Full title name
|-
| 0x180
| 0x80
| Publisher
|}
|}


'''Note 1:'''
'''Note 1:'''
The first 8 bytes of this section seem to always be relatively empty, where as the last 10 seem to always been some combination of the characters € and À.
The first 8 bytes of this section seem to always be relatively empty, where as the last 16 seem to always been some combination of the characters € and À.


'''Examples:'''
'''Examples:'''
Line 92: Line 127:


'''Note 2:'''
'''Note 2:'''
Each block always has a length of 0x80, even if the string does not take up the entire (or any of the) block. Some games have plain-text strings starting here, where others have empty null bytes or seemingly garbage text (sometimes a mix of all 3). There also seems to be a strict format/rule set for how the publisher/title names are supposed to be laid out and structured, but it is not known at the moment.
Each of the 16 0x200-length groups has 3 UTF-16-BE text blocks. There is always 3 blocks, even if the string does not take up the entire (or any of the) block. Each group is for a different language/region. The first group is for Japanese, the order of the other languages is unknown.


'''Examples:'''
'''Examples:'''