Fixing xex loading into 4k pages.

This commit is contained in:
Ben Vanik
2014-09-13 19:32:37 -07:00
parent 0ad3ed0230
commit 447b5bf316
6 changed files with 25 additions and 25 deletions

View File

@@ -399,6 +399,8 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
XEEXPECTNOTNULL(header->sections);
for (size_t n = 0; n < header->section_count; n++) {
xe_xex2_section_t *section = &header->sections[n];
section->page_size =
header->exe_address <= 0x90000000 ? 64 * 1024 : 4 * 1024;
section->info.value = poly::load_and_swap<uint32_t>(ps);
ps += 4;
memcpy(section->digest, ps, sizeof(section->digest));

View File

@@ -410,18 +410,17 @@ typedef enum {
} xe_xex2_section_type;
typedef struct {
size_t page_size;
union {
struct {
xe_xex2_section_type type : 4;
uint32_t page_count : 28; // # of 64kb pages
uint32_t page_count : 28; // # of pages
};
uint32_t value; // To make uint8_t swapping easier
} info;
uint8_t digest[20];
} xe_xex2_section_t;
#define xe_xex2_section_length 0x00010000
typedef struct {
uint32_t xex2;
xe_xex2_module_flags module_flags;