SLB2: Difference between revisions

From PS4 Developer wiki
Jump to navigation Jump to search
No edit summary
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== SLB2 structure ==
== Structure ==


[[File:PS4 SLB PUP container format - SKFU.png|thumb|PS4 SLB PUP container format - SKFU]]
[[File:PS4 SLB PUP container format - SKFU.png|thumb|PS4 SLB PUP container format - SKFU]]
Line 6: Line 6:
/* SLB2 structure is little endian */
/* SLB2 structure is little endian */
   
   
struct slb2_entry {
struct SceSlb2Entry {
uint32_t block_offset;
uint32_t fileStartSector;
uint32_t file_size;
uint32_t fileSizeInByte;
uint32_t alignment[2];
uint32_t reserved[2]; // padding for alignment
char    file_name[32];
char    fileName[32];
} __attribute__((packed));
} __attribute__((packed));
   
   
struct slb2_header {
struct SceSlb2Header {
uint32_t magic;
uint32_t magic; // "SLB2"
uint32_t version;
uint32_t version; // ex: 1
uint32_t flags;
uint32_t flags; // ex: 0
uint32_t file_count;
uint32_t entryNum;
uint32_t block_count;
uint32_t sizeInSector;
uint32_t unk[3];
uint32_t reserved[3]; // padding for alignment
struct slb2_entry entry_list[0];
struct SceSlb2Entry entryList[0];
} __attribute__((packed));
} __attribute__((packed));
</source>
</source>
Line 39: Line 39:
* [https://github.com/yifanlu/slb2tools slb2tools] (yifan lu)
* [https://github.com/yifanlu/slb2tools slb2tools] (yifan lu)


== Usage ==
SLB2 files are parsed by many executables:
* PS4 [[Southbridge]] EMC IPL to extract C0028001 (EMC IPL) and C0020001 (EMC IPL information) from sflash0s0x32b (inactive partition).
== Other notes ==
It looks like newer (confirmed for OFW 7.55 and above) SLB2 files have some data between 0x200 and 0x270 which doesn't affect any unpacking tool but affects the unpacking on the PS4. The file gets recognised as corrupted if that data isn't there. This data is present in the `recovery` images but not in the `update` images.


{{Software}}
{{Software}}
<noinclude>[[Category:Main]]</noinclude>
<noinclude>[[Category:Main]]</noinclude>

Revision as of 23:25, 21 September 2022

Structure

PS4 SLB PUP container format - SKFU
/* SLB2 structure is little endian */
 
struct SceSlb2Entry {
	uint32_t fileStartSector;
	uint32_t fileSizeInByte;
	uint32_t reserved[2]; // padding for alignment
	char     fileName[32];
} __attribute__((packed));
 
struct SceSlb2Header {
	uint32_t magic; // "SLB2"
	uint32_t version; // ex: 1
	uint32_t flags; // ex: 0
	uint32_t entryNum;
	uint32_t sizeInSector;
	uint32_t reserved[3]; // padding for alignment
	struct SceSlb2Entry entryList[0];
} __attribute__((packed));

Unpacking

Usage

SLB2 files are parsed by many executables:

  • PS4 Southbridge EMC IPL to extract C0028001 (EMC IPL) and C0020001 (EMC IPL information) from sflash0s0x32b (inactive partition).

Other notes

It looks like newer (confirmed for OFW 7.55 and above) SLB2 files have some data between 0x200 and 0x270 which doesn't affect any unpacking tool but affects the unpacking on the PS4. The file gets recognised as corrupted if that data isn't there. This data is present in the `recovery` images but not in the `update` images.