Editing PUP
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 32: | Line 32: | ||
uint32_t unknown_three; // 0x1C | uint32_t unknown_three; // 0x1C | ||
}; // Size: 0x20 | }; // Size: 0x20 | ||
</ | </source> | ||
=== Segments === | === Segments === | ||
Line 45: | Line 45: | ||
uint64_t uncompressed_size; // 0x18 | uint64_t uncompressed_size; // 0x18 | ||
}; // Size: 0x20 | }; // Size: 0x20 | ||
</ | </source> | ||
While offset, compressed_size, and uncompressed_size fields are self-explanatory, the flags field packs a lot of information. Below are known flags: | While offset, compressed_size, and uncompressed_size fields are self-explanatory, the flags field packs a lot of information. Below are known flags: | ||
Line 58: | Line 58: | ||
#define PUP_SEGMENT_HAS_DIGESTS(x) ((x->flags & (1 << 16)) != 0) | #define PUP_SEGMENT_HAS_DIGESTS(x) ((x->flags & (1 << 16)) != 0) | ||
#define PUP_SEGMENT_BLOCK_SIZE(x) (1 << (((x->flags >> 12) & 0xF) + PAGE_SHIFT)) // Note: PAGE_SHIFT = 0xC | #define PUP_SEGMENT_BLOCK_SIZE(x) (1 << (((x->flags >> 12) & 0xF) + PAGE_SHIFT)) // Note: PAGE_SHIFT = 0xC | ||
</ | </source> | ||
In most cases (ie. "data" segments as opposed to info segments), the segment ID indicates the type of firmware or file to update (see [[#Indices]] table). In the case of info segments, the segment ID points to the index of the "data" segment it contains information for. Info segments are typically only seen when the file or firmware utilizes block-based segments. | In most cases (ie. "data" segments as opposed to info segments), the segment ID indicates the type of firmware or file to update (see [[#Indices]] table). In the case of info segments, the segment ID points to the index of the "data" segment it contains information for. Info segments are typically only seen when the file or firmware utilizes block-based segments. | ||
Line 76: | Line 76: | ||
char unknown_three[0x8]; // 0x28 | char unknown_three[0x8]; // 0x28 | ||
} | } | ||
</ | </source> | ||
=== Metadata === | === Metadata === | ||
Line 89: | Line 89: | ||
char digest_key[0x10]; // 0x40 - SHA256 digest HMAC key | char digest_key[0x10]; // 0x40 - SHA256 digest HMAC key | ||
}; // Size: 0x50 | }; // Size: 0x50 | ||
</ | </source> | ||
=== Unpacking Notes === | === Unpacking Notes === |