Merge pull request #6142 from lat9nq/prog_meta_ref_bind_address

program_metadata: Avoid reference binding to misaligned address
This commit is contained in:
bunnei
2022-10-06 20:42:15 -07:00
committed by GitHub
2 changed files with 51 additions and 15 deletions

View File

@ -144,20 +144,18 @@ private:
static_assert(sizeof(AciHeader) == 0x40, "ACI0 header structure size is wrong");
#pragma pack(push, 1)
// FileAccessControl and FileAccessHeader need loaded per-component: this layout does not
// reflect the real layout to avoid reference binding to misaligned addresses
struct FileAccessControl {
u8 version;
INSERT_PADDING_BYTES(3);
// 3 padding bytes
u64_le permissions;
std::array<u8, 0x20> unknown;
};
static_assert(sizeof(FileAccessControl) == 0x2C, "FS access control structure size is wrong");
struct FileAccessHeader {
u8 version;
INSERT_PADDING_BYTES(3);
// 3 padding bytes
u64_le permissions;
u32_le unk_offset;
u32_le unk_size;
@ -165,10 +163,6 @@ private:
u32_le unk_size_2;
};
static_assert(sizeof(FileAccessHeader) == 0x1C, "FS access header structure size is wrong");
#pragma pack(pop)
Header npdm_header;
AciHeader aci_header;
AcidHeader acid_header;