[ctr] Add cia.h

This commit is contained in:
jakcron 2018-09-24 18:14:12 +08:00
parent 303fba2275
commit 759abf3bb8
3 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,42 @@
#pragma once
#include <fnd/types.h>
#include <fnd/sha.h>
#include <fnd/rsa.h>
#include <nn/ctr/macro.h>
namespace nn
{
namespace ctr
{
namespace cia
{
static const uint16_t kDefaultType = 0x0;
static const uint16_t kDefaultFormatVersion = 0x0;
static const size_t kContentBitfieldArrayLen = 0x2000;
}
#pragma pack(push, 1)
struct sCiaHeader
{
le_uint32_t header_size;
le_uint16_t type;
le_uint16_t format_version;
le_uint32_t cert_chain_size;
le_uint32_t ticket_size;
le_uint32_t tmd_size;
le_uint32_t lotcheck_data_size;
le_uint64_t content_size;
byte_t included_content_bitfield[cia::kContentBitfieldArrayLen];
};
struct sLotCheckData
{
byte_t reserved_for_dependent_module_title_ids[0x180];
byte_t reserved_00[0x180];
le_uint32_t core_version;
byte_t reserved_01[0xFC];
// smdh icon data
};
#pragma pack(pop)
}
}

View file

@ -135,6 +135,7 @@
<Text Include="notes.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\nn\ctr\cia.h" />
<ClInclude Include="include\nn\ctr\code.h" />
<ClInclude Include="include\nn\ctr\CodeBinaryHeader.h" />
<ClInclude Include="include\nn\ctr\CodeSegment.h" />

View file

@ -35,6 +35,9 @@
<Text Include="notes.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\nn\ctr\cia.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\nn\ctr\code.h">
<Filter>Header Files</Filter>
</ClInclude>