Author Topic: pfs_builder.exe usage  (Read 3608 times)

Offline Graphene

  • Useful Idiot
  • ***
  • Posts: 108
    • View Profile
pfs_builder.exe usage
« on: September 27, 2020, 06:41:15 PM »
This was either undocumented or unknown.

General usage instructions can be obtained by just running pfs_builder.exe without any arguments. These are:

usage: [-s<number>] [-q] [-n<number>] [-v] [-f<number>] [-k<number>] [-d] <dest path> <param file>
-s : generate PFS image for 0:gamedata(default), 1:savedata, 2:AC ROOT, 3:ACID DIR.
-q : quiet mode (no message).
-n : random number seed (32bit-HEX, default 0).
-v : print svn revision of source code.
-f : set DB format version (default:latest).
-k : set key type. 0:type2(default), 1:type3.
-d : generate PFS DB only.

There are actually more options, but the main issue was structure of param file, that is not documented anywhere.

param file structure:

Here is how param file should be structured:

1. Each new line of param file indicates file or folder that will be added to PFS
2. Lines can be commented with "#"
3. Each line must contain 4 or 5 parameters:
     1. Input file/directory name
     2. Output file/directory name for PFS result
     3. PFS param 1 (described below)
     4. PFS param 2 (described below)
     5 (optional). PFS file seed
4. Parameters in line are separated by tabbing (0x09 HEX code). Line must also end with 0x09.

Detailed description of parameters:

PFS param 1 is used to determine PFS access mode. Available options are:
(nothing. Tabbing still must be preserved)
rw (read/write)
ro (read only)
sys (ex. sce_sys dircetory or clearsign/keystone files)

PFS param 2 is used to determine how PFS should treat file/directory. Available options are:
(nothing. Tabbing still must be preserved)
dir (treat input as directory)
acidir (?, maybe treat input as addcont included directory (PFS-in-PFS))
npfs (?, maybe copy that file without including it in PFS)
nenc (do not encrypt that file)
nicv (?)

PFS file seed is optional parameter. It is a string of 40 characters in HEX format that will be used as encryption seed for the file/directory. If not set, common options seed will be used.

Hidden modes:

Some of these modes can not be set by input arguments, only by directly editing pfs_builder.exe executable:

FakeSetting;
GdgpSetting;
GpwrSetting;
AcSetting;
SdSetting;
PackSetting;
AcroSetting;
RedirectRoSetting;
RedirectSetting;
AcContSetting;