2018-04-21 09:20:37 +00:00
|
|
|
#pragma once
|
|
|
|
#include <fnd/types.h>
|
2018-08-07 08:35:03 +00:00
|
|
|
#include <fnd/rsa.h>
|
2018-10-22 13:30:49 +00:00
|
|
|
#include <nn/hac/define/macro.h>
|
2018-04-21 09:20:37 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2018-04-21 09:20:37 +00:00
|
|
|
{
|
|
|
|
namespace aci
|
|
|
|
{
|
2018-06-29 07:10:10 +00:00
|
|
|
static const uint32_t kAciStructMagic = _MAKE_STRUCT_MAGIC_U32("ACI0");
|
|
|
|
static const uint32_t kAciDescStructMagic = _MAKE_STRUCT_MAGIC_U32("ACID");
|
2018-06-27 05:03:46 +00:00
|
|
|
static const size_t kSectionAlignSize = 0x10;
|
2018-04-27 16:13:35 +00:00
|
|
|
|
2018-06-27 05:03:46 +00:00
|
|
|
enum Flag
|
2018-04-27 16:13:35 +00:00
|
|
|
{
|
|
|
|
FLAG_PRODUCTION,
|
|
|
|
FLAG_UNQUALIFIED_APPROVAL
|
|
|
|
};
|
2018-04-21 09:20:37 +00:00
|
|
|
}
|
|
|
|
#pragma pack(push,1)
|
2018-06-27 05:03:46 +00:00
|
|
|
struct sAciSection
|
|
|
|
{
|
|
|
|
le_uint32_t offset;
|
|
|
|
le_uint32_t size;
|
|
|
|
};
|
|
|
|
|
2018-04-21 09:20:37 +00:00
|
|
|
struct sAciHeader
|
|
|
|
{
|
2018-06-26 04:23:40 +00:00
|
|
|
le_uint32_t st_magic;
|
2018-06-27 05:03:46 +00:00
|
|
|
byte_t reserved_00[0xC];
|
|
|
|
le_uint64_t program_id;
|
|
|
|
byte_t reserved_01[0x8];
|
|
|
|
sAciSection fac;
|
|
|
|
sAciSection sac;
|
|
|
|
sAciSection kc;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sAciDescHeader
|
|
|
|
{
|
2018-08-07 08:35:03 +00:00
|
|
|
byte_t signature[fnd::rsa::kRsa2048Size];
|
|
|
|
byte_t nca_rsa_signature2_modulus[fnd::rsa::kRsa2048Size];
|
2018-06-27 05:03:46 +00:00
|
|
|
le_uint32_t st_magic;
|
|
|
|
le_uint32_t signed_size;
|
|
|
|
byte_t reserved_00[0x4];
|
|
|
|
le_uint32_t flags;
|
|
|
|
le_uint64_t program_id_min;
|
|
|
|
le_uint64_t program_id_max;
|
|
|
|
sAciSection fac;
|
|
|
|
sAciSection sac;
|
|
|
|
sAciSection kc;
|
2018-04-21 09:20:37 +00:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2018-04-21 09:20:37 +00:00
|
|
|
}
|