2018-04-21 09:20:37 +00:00
|
|
|
#pragma once
|
|
|
|
#include <fnd/types.h>
|
2018-06-27 05:03:46 +00:00
|
|
|
#include <crypto/rsa.h>
|
2018-06-03 07:41:56 +00:00
|
|
|
#include <nx/macro.h>
|
2018-04-21 09:20:37 +00:00
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
namespace aci
|
|
|
|
{
|
2018-06-26 04:23:40 +00:00
|
|
|
static const uint32_t kAciStructMagic = _MAKE_STRUCT_MAGIC("ACI0");
|
|
|
|
static const uint32_t kAciDescStructMagic = _MAKE_STRUCT_MAGIC("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
|
|
|
|
{
|
|
|
|
byte_t signature[crypto::rsa::kRsa2048Size];
|
|
|
|
byte_t nca_rsa_signature2_modulus[crypto::rsa::kRsa2048Size];
|
|
|
|
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)
|
|
|
|
}
|