Add CFGI_GetLocalFriendCodeSeed

This commit is contained in:
Joel16 2017-10-27 11:29:21 -05:00
parent 0451fce227
commit 36a85debe9
2 changed files with 20 additions and 0 deletions

View File

@ -182,3 +182,9 @@ Result CFGI_VerifySigSecureInfo(void);
* @param serial Pointer to output the serial to. (This is normally 0xF) * @param serial Pointer to output the serial to. (This is normally 0xF)
*/ */
Result CFGI_SecureInfoGetSerialNumber(u8 *serial); Result CFGI_SecureInfoGetSerialNumber(u8 *serial);
/**
* @brief Gets the 64-bit local friend code seed.
* @param seed Pointer to write the friend code seed to.
*/
Result CFGI_GetLocalFriendCodeSeed(u64* seed);

View File

@ -344,3 +344,17 @@ Result CFGI_SecureInfoGetSerialNumber(u8 *serial)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result CFGI_GetLocalFriendCodeSeed(u64* seed)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x405,0,0); // 0x4050000
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
*seed = (u64)cmdbuf[2] | (u64)cmdbuf[3] << 32;
return (Result)cmdbuf[1];
}