FRDU:GetMyApproachContext

Revision as of 22:01, 16 December 2024 by TimmSkiller (talk | contribs) (Created page with "=Request= {{IPC/Request}} {{IPC/RequestHeader|0x0033|0|0}} {{IPC/RequestEnd}} =Request Static Buffers= {{IPC/RequestStaticBuffers}} {{#vardefine:ipc_offset|0}} {{IPC/Translat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

RequestEdit

Index Word Description
0
Header 0x00330000 Cmd 0x0033 Param 0 Xlat 0

Request Static BuffersEdit

The handler for this IPC command expects the following 0x100-bytes after the beginning of the above command buffer:

Index Word Description


0 Descriptor for static buffer (id 0)
1 Output encrypted ApproachContext payload buffer

ResponseEdit

Index Word Description
0
Header 0x00330042 Cmd 0x0033 Param 1 Xlat 2
1 Result code
2 Descriptor for static buffer (id 0)
3 Output encrypted ApproachContext payload buffer

DescriptionEdit

Creates an encrypted payload containing information that can be used to add this console as a friend locally. (See Approach Contexts for details)

First, the 0x1E0-sized ApproachContext structure is created and user's personal Mii is encrypted using APT:Wrap. If the user doesn't have a personal Mii yet, the 0x70-sized field in the approach context is set to all zeros.

The populated structure is then encrypted with AES-CCM using PS:EncryptSignDecryptVerifyAesCcm and keytype 8 (Keyslot 0x36), the nonce being the concatenated little-endian Principal ID and Friend Code of the console (total nonce size 12). The nonce is returned in plaintext at offset 0x4-0x10. Note that the ApproachContext is located at 0x10 and that is where the actually encrypted section begins. In other words, the AES-CCM encrypted section is located at offset 0x10 thru 0x1F0.