SLB2: Difference between revisions

From PS4 Developer wiki
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:


<source lang="c">
<source lang="c">
/* file structure of SLB goes as following, if unpacking make sure you use 64 bits little endian on windows os */
/* SLB2 structure is little endian */
typedef unsigned char u8;
typedef unsigned long int u32;
typedef unsigned long long int u64;
   
   
typedef struct{
struct slb2_entry {
u32 offset; //1 block is headersize (512 padded)
uint32_t block_offset;
u32 cryptSize;
uint32_t file_size;
u64 reserved; //probably file alignment
uint32_t alignment[2];
u8 fileName[32];
char    file_name[32];
} fileEntry;
} __attribute__((packed));
   
   
typedef struct{
struct slb2_header {
u32 magic; //SLB2
uint32_t magic;
u32 version; //1
uint32_t version;
        u32 flags; // 0
uint32_t flags;
u32 fileCount;
uint32_t file_count;
u32 blockCount;
uint32_t block_count;
u8 reserved[12];
uint32_t unk[3];
fileEntry files[10];
struct slb2_entry entry_list[0];
} slb2_header;
} __attribute__((packed));
</source>
</source>



Revision as of 10:53, 30 August 2018

SLB2 structure

PS4 SLB PUP container format - SKFU
/* SLB2 structure is little endian */
 
struct slb2_entry {
	uint32_t block_offset;
	uint32_t file_size;
	uint32_t alignment[2];
	char     file_name[32];
} __attribute__((packed));
 
struct slb2_header {
	uint32_t magic;
	uint32_t version;
	uint32_t flags;
	uint32_t file_count;
	uint32_t block_count;
	uint32_t unk[3];
	struct slb2_entry entry_list[0];
} __attribute__((packed));

SLB2 files to play with

1.500.000:

1.501.000:

Unpacking