From 759abf3bb8ac72a9a954832c421f7da0431044aa Mon Sep 17 00:00:00 2001 From: jakcron Date: Mon, 24 Sep 2018 18:14:12 +0800 Subject: [PATCH] [ctr] Add cia.h --- lib/libctr/include/nn/ctr/cia.h | 42 +++++++++++++++++++++++++++++++ lib/libctr/libctr.vcxproj | 1 + lib/libctr/libctr.vcxproj.filters | 3 +++ 3 files changed, 46 insertions(+) create mode 100644 lib/libctr/include/nn/ctr/cia.h diff --git a/lib/libctr/include/nn/ctr/cia.h b/lib/libctr/include/nn/ctr/cia.h new file mode 100644 index 0000000..4492b28 --- /dev/null +++ b/lib/libctr/include/nn/ctr/cia.h @@ -0,0 +1,42 @@ +#pragma once +#include +#include +#include +#include + +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) +} +} \ No newline at end of file diff --git a/lib/libctr/libctr.vcxproj b/lib/libctr/libctr.vcxproj index 18dfb75..6a9a6ef 100644 --- a/lib/libctr/libctr.vcxproj +++ b/lib/libctr/libctr.vcxproj @@ -135,6 +135,7 @@ + diff --git a/lib/libctr/libctr.vcxproj.filters b/lib/libctr/libctr.vcxproj.filters index b15c0b1..fc89cfc 100644 --- a/lib/libctr/libctr.vcxproj.filters +++ b/lib/libctr/libctr.vcxproj.filters @@ -35,6 +35,9 @@ + + Header Files + Header Files