Files.db: Difference between revisions
Tomtomdu80 (talk | contribs) (Created page with "Category:Software<noinclude>Category:Main</noinclude> == files.db structure == '''''Warning : This structure is still uncertain/not complete''''' files.db is organi...") |
CelesteBlue (talk | contribs) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Software]]<noinclude>[[Category:Main]]</noinclude> | [[Category:Software]]<noinclude>[[Category:Main]]</noinclude> | ||
*Path: /[[sce_pfs|sce_pfs]]/files.db | |||
*Size: variable | |||
== files.db structure == | == files.db structure == | ||
Line 5: | Line 9: | ||
files.db is organized in blocks of 1024 bytes, the first block is the header of the file, its structure is still unknown | files.db is organized in blocks of 1024 bytes, the first block is the header of the file, its structure is still unknown. | ||
Each block contains 4 sub-blocks : | Each block contains 4 sub-blocks : | ||
Line 13: | Line 17: | ||
* File informations (9 entries) | * File informations (9 entries) | ||
* Hashes block? | * Hashes block? | ||
Note : Numbers are stored in little-endian. | |||
=== Block header === | === Block header === | ||
Line 18: | Line 24: | ||
0x10 bytes wide, structure is uncertain. | 0x10 bytes wide, structure is uncertain. | ||
<pre>typedef struct { | <pre> | ||
typedef struct { | |||
u32 id; | u32 id; | ||
u32 type; | u32 type; | ||
u32 nfiles; | u32 nfiles; | ||
u32 unk1; | u32 unk1; | ||
} | } block_header; | ||
</pre> | |||
'''id''' : | '''id''' : | ||
Line 79: | Line 88: | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
!File/Dir | ! File/Dir !! idx (fname) !! idx (finfo) !! Path | ||
!idx (fname) | |||
!idx (finfo) | |||
!Path | |||
|- | |- | ||
|lol.png | | lol.png || 2 || 3 || /images/abcd/lol.png | ||
|2 | |||
|3 | |||
|/images/abcd/lol.png | |||
|- | |- | ||
|abcd/ | | abcd/ || 1 || 2 || /images/abcd/ | ||
|1 | |||
|2 | |||
|/images/abcd/ | |||
|- | |- | ||
|images/ | | images/ || 0 || 1 || /images/ | ||
|0 | |||
|1 | |||
|/images/ | |||
|- | |- | ||
|eboot.bin | | eboot.bin || 0 || 4 || /eboot.bin | ||
|0 | |||
|4 | |||
|/eboot.bin | |||
|} | |} | ||
'''type''' : | '''type''' : | ||
* | * 0x1 = normal file | ||
* 0x8000 = directory | * 0x8000 = dir (directory) | ||
* 0x4006 = | * 0x4006 = nenc (non encrypted file) | ||
* | * 0x6 = sys (system file) | ||
'''unk1''' : | '''unk1''' : |
Latest revision as of 23:30, 26 April 2018
- Path: /sce_pfs/files.db
- Size: variable
files.db structure[edit | edit source]
Warning : This structure is still uncertain/not complete
files.db is organized in blocks of 1024 bytes, the first block is the header of the file, its structure is still unknown.
Each block contains 4 sub-blocks :
- Block header
- Filenames (9 entries)
- File informations (9 entries)
- Hashes block?
Note : Numbers are stored in little-endian.
Block header[edit | edit source]
0x10 bytes wide, structure is uncertain.
typedef struct { u32 id; u32 type; u32 nfiles; u32 unk1; } block_header;
id :
- 0xYY : Block identification ? generally 0x02
- 0xffffffff : ???
type
- 0x00 : The block will describe files and parent directories.
- 0x01 : ??? Ignore, changes structure of the current block.
nfiles :
One block describes up to 9 files, although it can be less, nfiles is the number of files described in the current block.
unk1 :
Padding ?
Filenames (9 entries)[edit | edit source]
9 entries of 72 bytes, describing filename and parent directory.
typedef struct { u32 idx; char filename[68]; } fname;
idx :
Describes parent directory of current file entry. (Cf. File informations block)
filename :
Filename of current file entry (68 bytes, null terminated).
File informations (9 entries)[edit | edit source]
9 entries of 0x10 bytes.
typedef struct { u32 idx; u16 type; u16 unk1; u32 size; u32 unk2; } finfo;
idx :
Used to retrieve parent directory for filenames block, each file entry has its own index, 0 is for root.
Example :
File/Dir | idx (fname) | idx (finfo) | Path |
---|---|---|---|
lol.png | 2 | 3 | /images/abcd/lol.png |
abcd/ | 1 | 2 | /images/abcd/ |
images/ | 0 | 1 | /images/ |
eboot.bin | 0 | 4 | /eboot.bin |
type :
- 0x1 = normal file
- 0x8000 = dir (directory)
- 0x4006 = nenc (non encrypted file)
- 0x6 = sys (system file)
unk1 :
???
size :
Size of the current file.
unk2 :
Padding ?
Tools[edit | edit source]
ListDirVita is a simple parser for files.db (Still WIP) [1]