Editing PUP

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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
</syntaxhighlight>
</source>


=== Segments ===
=== Segments ===
Line 45: Line 45:
uint64_t uncompressed_size;    // 0x18
uint64_t uncompressed_size;    // 0x18
}; // Size: 0x20
}; // Size: 0x20
</syntaxhighlight>
</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
</syntaxhighlight>
</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
}
}
</syntaxhighlight>
</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
</syntaxhighlight>
</source>


=== Unpacking Notes ===
=== Unpacking Notes ===
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)