Add CFGI_GetLocalFriendCodeSeedData

This commit is contained in:
Joel16 2017-10-27 20:23:54 -05:00
parent 732de941c2
commit 691c5092aa
2 changed files with 21 additions and 0 deletions

View File

@ -183,6 +183,12 @@ Result CFGI_VerifySigSecureInfo(void);
*/ */
Result CFGI_SecureInfoGetSerialNumber(u8 *serial); Result CFGI_SecureInfoGetSerialNumber(u8 *serial);
/**
* @brief Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.
* @param data Pointer to output the buffer. (The size must be at least 0x110-bytes)
*/
Result CFGI_GetLocalFriendCodeSeedData(u8 *data);
/** /**
* @brief Gets the 64-bit local friend code seed. * @brief Gets the 64-bit local friend code seed.
* @param seed Pointer to write the friend code seed to. * @param seed Pointer to write the friend code seed to.

View File

@ -345,6 +345,21 @@ Result CFGI_SecureInfoGetSerialNumber(u8 *serial)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result CFGI_GetLocalFriendCodeSeedData(u8 *data)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x404,1,2); // 0x4040042
cmdbuf[1] = (u32)0x110;
cmdbuf[2] = IPC_Desc_Buffer((u32)0x110, IPC_BUFFER_W);
cmdbuf[3] = (u32)data;
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
return (Result)cmdbuf[1];
}
Result CFGI_GetLocalFriendCodeSeed(u64* seed) Result CFGI_GetLocalFriendCodeSeed(u64* seed)
{ {
Result ret = 0; Result ret = 0;