LDN services: Difference between revisions
No edit summary |
|||
| (9 intermediate revisions by the same user not shown) | |||
| Line 269: | Line 269: | ||
This cmd was implemented with [20.0.0+], prior to that this just returned an error. | This cmd was implemented with [20.0.0+], prior to that this just returned an error. | ||
The sdk user-process func will pass value 1 to the cmd when the input [[#Protocol|Protocol]] is 0 | The sdk user-process func will pass value 1 (2 on Ounce) to the cmd when the input [[#Protocol|Protocol]] is 0, valid values passed directly when recognized, otherwise Abort. User-processes use SetProtocol immediately after initializing ldn. | ||
[20.0.0+] The ldn initialization functionality in sdknso also uses this with value 1 (NX) eventually after the init cmd was used successfully. | [20.0.0+] The ldn initialization functionality in sdknso also uses this with value 1 (NX) eventually after the init cmd was used successfully. | ||
| Line 540: | Line 540: | ||
[18.0.0+] The sdknso uses SessionManager with this, where the additional session-count is 0x3. | [18.0.0+] The sdknso uses SessionManager with this, where the additional session-count is 0x3. | ||
[S2] There appears to be 2 ldn:u services, this appears to be for having separate [[#Protocol|Protocol]] permissions for NX and Ounce games. | [S2] There appears to be 2 ldn:u services, this appears to be for having separate [[#Protocol|Protocol]] permissions for NX and Ounce games. The Creator object has the same vtable for both of these. However the vtable for IUserLocalCommunicationService appears to be larger even with NX, which likely indicates there's new commands? There also appears to be 4 additional max-sessions allocated to ldn*, this is probably for one of these ldn:u services? | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
| Line 1,467: | Line 1,467: | ||
| 2 || [S2] | | 2 || [S2] | ||
|- | |- | ||
| 3 || (NXAndOunce?) | | 3 || [20.0.0+] (NXAndOunce?) | ||
|- | |- | ||
| 4 || [S2] | | 4 || [S2] [20.0.0+] | ||
|} | |} | ||
The Initialize* cmds configure state the same as using [[#SetProtocol|SetProtocol]] with Protocol NX. | The Initialize* cmds configure state the same as using [[#SetProtocol|SetProtocol]] with Protocol NX. | ||
There | There's S2-only values which enables using Ounce-only keys. The following uses new Ounce-only keys (with S2 hosting): | ||
* In-game ldn-usage for a S2-only Application. | * In-game ldn-usage for a S2-only Application. | ||
* Local-game-update with a S2-only Application. | * Local-game-update with a S2-only Application. | ||
| Line 1,481: | Line 1,481: | ||
There's system-titles which [[20.0.0|use]] SetProtocol. While there's game(s) which use SetProtocol, there's no known (?) games using Protocol3 (excluding GameShare which is system). | There's system-titles which [[20.0.0|use]] SetProtocol. While there's game(s) which use SetProtocol, there's no known (?) games using Protocol3 (excluding GameShare which is system). | ||
Protocol2 and Protocol4 appear to be identical to Protocol3 except for using [[SPL_services|Ounce]] keys (?) | [S2] Protocol2 and Protocol4 appear to be identical to Protocol3 except for using [[SPL_services|Ounce]] keys (?). It's unknown exactly which Protocol uses which [[SPL_services|Generation]], though presumably 2/4 is Generation 0x0/0x1? lcs (local-content-share) uses Generation 0x1, while Mario Kart World uses 0x0. | ||
[S2] Keys are generated by passing the SHA256 hash as the KeySource to the relevant [[SPL_services|spl:ldn]] command with the above Generation, with the full hash being passed to the Ounce cmds. Only the first 0x10-bytes of the output key is used, since AES-128 is used even with Ounce. | |||
On NX, the Protocol [[#SetProtocol|permission-bitmask]] is always set to 0xA (1 and 3). On Ounce, all services have this set to 0x1E, except for one which has it set to 0xA (which is likely the one for S1-compat). 0x1E allows additional protocol values 2 and 4. | On NX, the Protocol [[#SetProtocol|permission-bitmask]] is always set to 0xA (1 and 3). On Ounce, all services have this set to 0x1E, except for one which has it set to 0xA (which is likely the one for S1-compat). 0x1E allows additional protocol values 2 and 4. | ||
| Line 1,887: | Line 1,889: | ||
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50 | | 0x0 || 0x10 || [[#NetworkInfo]]+0x50 | ||
|- | |- | ||
| 0x10 || 0x8 || [[#NetworkInfo]]+0x478 | | 0x10 || 0x8 || [[#NetworkInfo]]+0x478 [S2] The Station seems to verify that this is 0 when the Challenge is unused (ldn:s)? Throws an error if set before connecting to an [[#Protocol|Ounce]] network. | ||
|- | |- | ||
| 0x18 || 0x1 || [[#NetworkInfo]]+0x60 | | 0x18 || 0x1 || [[#NetworkInfo]]+0x60 | ||
| Line 2,165: | Line 2,167: | ||
[S2] Access to btm and spl:mig were replaced with bt:sys and spl:ldn. | [S2] Access to btm and spl:mig were replaced with bt:sys and spl:ldn. | ||
[S2] Various objects/state have the same size/layout as S1, generally?(Other than IPC-related differences) There's also stack differences. | |||
== Code-region Memory Layout == | |||
=== S2 20.2.0 === | |||
This is the codebin-region layout for S2 ldn 20.2.0-20.5.0. BuildId is "DC456FA4...". | |||
The on-NX note is for the equivalent memregion location/size, memregion-size/contents compared to NX may vary. | |||
Total size is 0x24F000-bytes. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Permissions | |||
! Description | |||
|- | |||
| 0x0 || 0xE1000 || --X || .text | |||
|- | |||
| 0xE1000 || 0x3D000 || R-- || RO-region | |||
|- | |||
| 0x11E000 || 0x3A000 || RW || On NX this is at 0xEF000. The main ExpHeap is at +0x2000, on NX it's at +0x1000. | |||
|- | |||
| 0x158000 || 0x8000 || non-RW || On NX this is at 0x123000. | |||
|- | |||
| 0x160000 || 0x8000 || RW || On NX this is at 0x12B000. | |||
|- | |||
| 0x168000 || 0xF000 || non-RW || On NX this is at 0x139000. | |||
|- | |||
| 0x177000 || 0x3000 || RW || On NX this is at 0x13F000. | |||
|- | |||
| 0x17A000 || 0x24000 || non-RW || On NX this is at 0x14B000. | |||
|- | |||
| 0x19E000 || 0x4E000 || RW || On NX this is at 0x16F000. | |||
|- | |||
| 0x1EC000 || 0x2000 || -- || On NX this is at 0x1BD000. | |||
|- | |||
| 0x1EE000 || 0x2000 || {accessible} || On NX this is at 0x1BF000. | |||
|- | |||
| 0x1EF000 || 0x5000 || -- || On NX this is at 0x1E2000. | |||
|- | |||
| 0x1F4000 || 0x21000 || {accessible} || On NX this is at 0x1EA000. | |||
|- | |||
| 0x218000 || 0x8000 || -- || | |||
|- | |||
| 0x220000 || 0x2F000 || {accessible} | |||
|} | |||
[[Category:Services]] | [[Category:Services]] | ||