summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Poole <Gareth422@users.noreply.github.com>2015-10-11 03:51:06 +0200
committerGareth Poole <Gareth422@users.noreply.github.com>2015-10-11 04:35:22 +0200
commit721475420dd2863c2cb9142f1fc3f89e2a9d46d5 (patch)
tree7522160ba1989e2c1a784cdf4298b6cba4f3f4f6
parentLoader: Implement encryption check (diff)
downloadyuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.tar
yuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.tar.gz
yuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.tar.bz2
yuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.tar.lz
yuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.tar.xz
yuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.tar.zst
yuzu-721475420dd2863c2cb9142f1fc3f89e2a9d46d5.zip
-rw-r--r--src/core/loader/ncch.cpp3
-rw-r--r--src/core/loader/ncch.h32
2 files changed, 17 insertions, 18 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index c67d25b55..68b3f546e 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -128,9 +128,8 @@ ResultStatus AppLoader_NCCH::LoadExec() {
if (ResultStatus::Success == ReadCode(code)) {
std::string process_name = Common::StringFromFixedZeroTerminatedBuffer(
(const char*)exheader_header.codeset_info.name, 8);
- u64 program_id = *reinterpret_cast<u64_le const*>(&ncch_header.program_id[0]);
- SharedPtr<CodeSet> codeset = CodeSet::Create(process_name, program_id);
+ SharedPtr<CodeSet> codeset = CodeSet::Create(process_name, ncch_header.program_id);
codeset->code.offset = 0;
codeset->code.addr = exheader_header.codeset_info.text.address;
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h
index fd7c65814..ca6772a78 100644
--- a/src/core/loader/ncch.h
+++ b/src/core/loader/ncch.h
@@ -17,31 +17,31 @@
struct NCCH_Header {
u8 signature[0x100];
- u32 magic;
- u32 content_size;
+ u32_le magic;
+ u32_le content_size;
u8 partition_id[8];
- u16 maker_code;
- u16 version;
+ u16_le maker_code;
+ u16_le version;
u8 reserved_0[4];
u64_le program_id;
u8 reserved_1[0x10];
u8 logo_region_hash[0x20];
u8 product_code[0x10];
u8 extended_header_hash[0x20];
- u32 extended_header_size;
+ u32_le extended_header_size;
u8 reserved_2[4];
u8 flags[8];
- u32 plain_region_offset;
- u32 plain_region_size;
- u32 logo_region_offset;
- u32 logo_region_size;
- u32 exefs_offset;
- u32 exefs_size;
- u32 exefs_hash_region_size;
+ u32_le plain_region_offset;
+ u32_le plain_region_size;
+ u32_le logo_region_offset;
+ u32_le logo_region_size;
+ u32_le exefs_offset;
+ u32_le exefs_size;
+ u32_le exefs_hash_region_size;
u8 reserved_3[4];
- u32 romfs_offset;
- u32 romfs_size;
- u32 romfs_hash_region_size;
+ u32_le romfs_offset;
+ u32_le romfs_size;
+ u32_le romfs_hash_region_size;
u8 reserved_4[4];
u8 exefs_super_block_hash[0x20];
u8 romfs_super_block_hash[0x20];
@@ -110,7 +110,7 @@ struct ExHeader_StorageInfo {
struct ExHeader_ARM11_SystemLocalCaps {
u64_le program_id;
- u32 core_version;
+ u32_le core_version;
u8 reserved_flags[2];
union {
u8 flags0;