diff --git a/PKG-Information.md b/PKG-Information.md index 95108b4..ed8d7fe 100644 --- a/PKG-Information.md +++ b/PKG-Information.md @@ -20,10 +20,10 @@ First 4.096 bytes (0x1000) are the PKG Header. PKG header appears to be in Big E | pkg_flags | U32 | 4 | 0x004 | *Check PKG Flags table below | 0x8 | U32 | 4 | 0x008 | ??? | pkg_file_count | U32 | 4 | 0x00C | -| pkg_table_entry_count | U32 | 4 | 0x010 | +| pkg_table_entry_count | U32 | 4 | 0x010 | Number of files inside PKG (doesn't include PFS) | pkg_sc_entry_count | U16 | 2 | 0x014 | | pkg_table_entry_count_2 | U16 | 2 | 0x016 | same as pkg_table_entry_count -| pkg_table_entry_offset | U32 | +| pkg_table_entry_offset | U32 | 4 | 0x018 | offset of the first pkg file entry *Check file table below | pkg_sc_entry_data_size | U32 | | pkg_body_offset | U64| | pkg_body_size | U64| @@ -74,3 +74,16 @@ First 4.096 bytes (0x1000) are the PKG Header. PKG header appears to be in Big E | INTERNAL | 0x40000000| | FINALIZED | 0x80000000| +## PKG File Table + +The file table is a list of file entries. File entries start from **pkg_table_entry_offset** field of pkg header and it's increasing by 0x20 for each file entry . **pkg_table_entry_count** field of pkg header indicates the number of file entries. + +| Field | Type | Size | Offset | Description +| -------------- | -----|----- |----- |------------| +| id | U32 | 4 | 0x000 | File ID, useful for files without a filename entry +| filename_offset | U32 | 4 | 0x004 | Offset into the filenames table (ID 0x200) where this file's name is located +| flags1 | U32 | 4 | 0x008 | Flags including encrypted flag, etc +| flags2 | U32 | 4 | 0x00C | Flags including encryption key index, etc +| offset | U32 | 4 | 0x010 | Offset into PKG to find the file +| size | U32 | 4 | 0x014 | Size of the file +| padding | U64 | 8 | 0x018 | blank padding \ No newline at end of file