2016-09-25 16:37:59 +00:00
|
|
|
|
2022-07-03 07:49:25 +00:00
|
|
|
// partition descriptor structure
|
2016-09-25 16:37:59 +00:00
|
|
|
struct ptable_line{
|
|
|
|
char name[16];
|
|
|
|
unsigned start;
|
|
|
|
unsigned lsize;
|
|
|
|
unsigned length;
|
2022-07-03 07:49:25 +00:00
|
|
|
unsigned loadaddr;
|
|
|
|
unsigned entry;
|
|
|
|
unsigned type;
|
|
|
|
unsigned nproperty; // partition flags
|
2016-09-25 16:37:59 +00:00
|
|
|
unsigned count;
|
|
|
|
};
|
|
|
|
|
2022-07-03 07:49:25 +00:00
|
|
|
// pull page structure from partition table
|
2016-09-25 16:37:59 +00:00
|
|
|
struct ptable_t {
|
|
|
|
uint8_t head[16];
|
|
|
|
uint8_t version[16];
|
|
|
|
uint8_t product[16];
|
|
|
|
struct ptable_line part[41];
|
|
|
|
uint8_t tail[32];
|
|
|
|
};
|
|
|
|
|
2022-07-03 07:49:25 +00:00
|
|
|
// header signature table
|
2016-09-25 16:37:59 +00:00
|
|
|
extern const uint8_t headmagic[16];
|
|
|
|
|
|
|
|
uint32_t find_ptable(FILE* ldr);
|
|
|
|
uint32_t find_ptable_ram(char* buf, uint32_t size);
|
|
|
|
void show_map(struct ptable_t ptable);
|