Add more CFGI SecureInfo functions (#393)

This commit is contained in:
Joel 2018-02-15 18:48:31 -06:00 committed by fincs
parent 29418f4d3d
commit 6dcbee7f4c
2 changed files with 44 additions and 2 deletions

View File

@ -194,3 +194,15 @@ Result CFGI_GetLocalFriendCodeSeedData(u8 *data);
* @param seed Pointer to write the friend code seed to.
*/
Result CFGI_GetLocalFriendCodeSeed(u64* seed);
/**
* @brief Gets the 0x11-byte data following the SecureInfo signature.
* @param data Pointer to output the buffer. (The size must be at least 0x11-bytes)
*/
Result CFGI_GetSecureInfoData(u8 *data);
/**
* @brief Gets the 0x100-byte RSA-2048 SecureInfo signature.
* @param data Pointer to output the buffer. (The size must be at least 0x100-bytes)
*/
Result CFGI_GetSecureInfoSignature(u8 *data);

View File

@ -351,8 +351,8 @@ Result CFGI_GetLocalFriendCodeSeedData(u8 *data)
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[1] = 0x110;
cmdbuf[2] = IPC_Desc_Buffer(0x110, IPC_BUFFER_W);
cmdbuf[3] = (u32)data;
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
@ -373,3 +373,33 @@ Result CFGI_GetLocalFriendCodeSeed(u64* seed)
return (Result)cmdbuf[1];
}
Result CFGI_GetSecureInfoData(u8 *data)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x814,1,2); // 0x8140042
cmdbuf[1] = 0x11;
cmdbuf[2] = IPC_Desc_Buffer(0x11, IPC_BUFFER_W);
cmdbuf[3] = (u32)data;
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
return (Result)cmdbuf[1];
}
Result CFGI_GetSecureInfoSignature(u8 *data)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x815,1,2); // 0x8150042
cmdbuf[1] = 0x100;
cmdbuf[2] = IPC_Desc_Buffer(0x100, IPC_BUFFER_W);
cmdbuf[3] = (u32)data;
if(R_FAILED(ret = svcSendSyncRequest(cfguHandle)))return ret;
return (Result)cmdbuf[1];
}