23 lines
546 B
C
Raw Normal View History

2018-08-13 00:08:56 +02:00
#pragma once
#include "common.h"
#define CERT_SIZE sizeof(Certificate)
// from: http://3dbrew.org/wiki/Certificates
// all numbers in big endian
typedef struct {
u8 sig_type[4]; // expected: 0x010004 / RSA_2048 SHA256
u8 signature[0x100];
u8 padding0[0x3C];
u8 issuer[0x40];
u8 keytype[4]; // expected: 0x01 / RSA_2048
u8 name[0x40];
u8 unknown[4];
u8 mod[0x100];
u8 exp[0x04];
u8 padding1[0x34];
} PACKED_STRUCT Certificate;
2018-08-13 00:08:56 +02:00
u32 LoadCertFromCertDb(u64 offset, Certificate* cert, u32* mod, u32* exp);