Add CFGI_SecureInfoGetSerialNumber

This commit is contained in:
Joel16 2017-10-02 15:27:50 -05:00
parent 53c42003f3
commit a11bec5da5
2 changed files with 21 additions and 0 deletions

View File

@ -170,3 +170,9 @@ Result CFGI_VerifySigLocalFriendCodeSeed(void);
* @brief Verifies the RSA signature for the SecureInfo data already stored in memory. * @brief Verifies the RSA signature for the SecureInfo data already stored in memory.
*/ */
Result CFGI_VerifySigSecureInfo(void); Result CFGI_VerifySigSecureInfo(void);
/**
* @brief Gets the system's serial number.
* @param serial Pointer to output the serial to.
*/
Result CFGI_SecureInfoGetSerialNumber(u8 *serial);

View File

@ -315,3 +315,18 @@ Result CFGI_VerifySigSecureInfo(void)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result CFGI_SecureInfoGetSerialNumber(u8 *serial)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x408,1,2); // 0x4080042
cmdbuf[1] = 0xF;
cmdbuf[2] = 12 | (0xF << 4);
cmdbuf[3] = (u32)serial;
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
return (Result)cmdbuf[1];
}