Beispiel #1
0
void make_blanksig_ec_cert(u8 *cert_out, const char *signer, const char *name, const u8 *private_key, u32 key_id)
{
	memset(cert_out, 0, 0x180);
	*(u32*)cert_out = Common::swap32(0x10002);

	strncpy((char*)cert_out + 0x80, signer, 0x40);
	*(u32*)(cert_out + 0xc0) = Common::swap32(2);
	strncpy((char*)cert_out + 0xc4, name, 0x40);
	*(u32*)(cert_out + 0x104) = Common::swap32(key_id);
	ec_priv_to_pub(private_key, cert_out + 0x108);
}
void CWiiSaveCrypted::make_ec_cert(u8 *cert, u8 *sig, char *signer, char *name, u8 *priv, u32 key_id)
{
	memset(cert, 0, 0x180);
	*(u32*)cert = Common::swap32(0x10002);

	memcpy(cert + 4, sig, 60);
	strcpy((char*)cert + 0x80, signer);
	*(u32*)(cert + 0xc0) = Common::swap32(2);
	strcpy((char*)cert + 0xc4, name);
	*(u32*)(cert + 0x104) = Common::swap32(key_id);
	ec_priv_to_pub(priv, cert + 0x108);
}