Changes

953 bytes added ,  00:48, 7 July 2020
Line 82: Line 82:  
| 60002 || [4.0.0+] OpenAccessorSession
 
| 60002 || [4.0.0+] OpenAccessorSession
 
|}
 
|}
 +
 +
Cmd18: Takes a type-70 buffer and returns a bool. If the buffer is sufficient it writes two application ID's to the buffer (0x100000000001000 and 0x100000000001fff) and returns true. This is used by photoViewer to group all screenshots of applets.
    
Cmd1002: Takes a total of 0x38-bytes of input, two type-0x5 input buffers, and returns 0x20-bytes of output. [4.0.0+] No longer returns output, and now takes the following buffers instead: type-0x16, type-0x46, and type-0x6.
 
Cmd1002: Takes a total of 0x38-bytes of input, two type-0x5 input buffers, and returns 0x20-bytes of output. [4.0.0+] No longer returns output, and now takes the following buffers instead: type-0x16, type-0x46, and type-0x6.
Line 414: Line 416:  
|-
 
|-
 
| 3 || ExtraMovie. Videos recorded by the current Application title via [[GRC_services#IMovieMaker|GRC MovieMaker]].
 
| 3 || ExtraMovie. Videos recorded by the current Application title via [[GRC_services#IMovieMaker|GRC MovieMaker]].
 +
|}
 +
 +
=== AlbumStorage ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Nand. ImageDirectory on the USER partition.
 +
|-
 +
| 1 || Sd. ImageDirectory on the Sd card
 
|}
 
|}
   Line 445: Line 458:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || Unknown
+
| 0x0 || 0x8 || Size of the entry.
 
|-
 
|-
| 0x8 || 0x8 || titleID
+
| 0x8 || 0x8 || ApplicationId
 
|-
 
|-
 
| 0x10 || 0x8 || [[#AlbumFileDateTime]]
 
| 0x10 || 0x8 || [[#AlbumFileDateTime]]
 
|-
 
|-
| 0x18 || 0x1 || Unknown
+
| 0x18 || 0x1 || [[#AlbumStorage]]
 
|-
 
|-
| 0x19 || 0x1 || Unknown
+
| 0x19 || 0x1 || [[#ContentType]]
 
|-
 
|-
| 0x1A || 0x6 || Padding?
+
| 0x1A || 0x6 || Padding.
 
|}
 
|}
   Line 468: Line 481:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || Unknown.
+
| 0x0 || 0x8 || Size of the entry.
 
|-
 
|-
| 0x8 || 0x8 || Unknown.
+
| 0x8 || 0x8 || AES256 with hardcoded key over AlbumEntry.  
 
|-
 
|-
 
| 0x10 || 0x8 || [[#AlbumFileDateTime]]
 
| 0x10 || 0x8 || [[#AlbumFileDateTime]]
 
|-
 
|-
| 0x18 || 0x8 || Unknown.
+
| 0x18 || 0x1 || [[#AlbumStorage]]
 +
|-
 +
| 0x19 || 0x1 || [[#ContentType]]
 +
|-
 +
| 0x1a || 0x5 || Padding.
 +
|-
 +
| 0x1f || 0x1 || Unknown. Set to 1 by official software.
 
|}
 
|}
   −
This is "nn::capsrv::ApplicationAlbumEntry". This is a 0x20-byte struct. On older versions where [[#ShimLibraryVersion]] is 0, this has a different format.
+
This is "nn::capsrv::ApplicationAlbumEntry". This is a 0x20-byte struct. On older versions where [[#ShimLibraryVersion]] is 0, this was a plain AES256 with a random key generated at application launch.
    
With the output from [[Applet_Manager_services#caps:su|caps:su]] sdk-nso only uses this for the [[Internet_Browser|Share-applet]] (when the output is used at all), with everything else it's used as an [[#AlbumFileEntry]]. In those cases with the <code>nn::album</code> wrapper funcs, it's "converted" by just copying the struct (arrays are "converted" by just returning a ptr to the input array).
 
With the output from [[Applet_Manager_services#caps:su|caps:su]] sdk-nso only uses this for the [[Internet_Browser|Share-applet]] (when the output is used at all), with everything else it's used as an [[#AlbumFileEntry]]. In those cases with the <code>nn::album</code> wrapper funcs, it's "converted" by just copying the struct (arrays are "converted" by just returning a ptr to the input array).
Line 635: Line 654:  
== Videos ==
 
== Videos ==
 
[[4.0.0]] includes video playback etc support in Album via mp4. These include a JPEG thumbnail, which is used for video "validation". The EXIF is also much larger: the MakerNote is 0x498-bytes, with encrypted data starting at offset +0x8. This encryption uses AES-CTR with hardcoded key/ctr. MAC calculation works the same way as the [[3.0.0]]+ JPEG MAC calculation, except with a different movie_kek_source/movie_key_source.
 
[[4.0.0]] includes video playback etc support in Album via mp4. These include a JPEG thumbnail, which is used for video "validation". The EXIF is also much larger: the MakerNote is 0x498-bytes, with encrypted data starting at offset +0x8. This encryption uses AES-CTR with hardcoded key/ctr. MAC calculation works the same way as the [[3.0.0]]+ JPEG MAC calculation, except with a different movie_kek_source/movie_key_source.
 +
 +
Each 0x40000-byte chunk in the Movie data stream is validated with a SHA256 hash table, where hash_index=offset>>18. Whether an error is thrown on mismatch is controlled by [[System_Settings|system-setting]] "capsrv!enable_album_movie_filehash_verification".
    
Note: the Album process itself uses libstagefright for video playback.
 
Note: the Album process itself uses libstagefright for video playback.
    
[[Category:Services]]
 
[[Category:Services]]