Skip to content

PPF (PlayStation Patch File)

DSG (Destitute Streetdwelling Guttersnipe) edited this page Aug 23, 2023 · 2 revisions

PPF 3.0 intro

copied pdx-ppf3.zip/readme.txt from Romhacking.net - Utilities - PPF

also available at ppf/readme.txt at master · meunierd/ppf

PPF (Playstation Patch File) Version 3.0 Full Distribution
----------------------------------------------------------


About PPF3.0 and the intention for this upgrade
-----------------------------------------------

PPF3.0 is a further development of PPF2.0 which is still used to distribute
(mainly) Playstation patches. Actually, as I stated in the PPF2.0 readme, I
did not want to develop further versions of this tool.  So, to avoid confusion 
let me explain why I did so:

PPF2.0 is restricted compatible with large files (for example DVD-Images >3GB).
Since DVD releases are being spread more and more and since DVD-Burners have
become more affordable I thought it is better to develop a new PPF version
NOW than not have such a tool when it is needed. Also, I have included
several new features which are useful for other platforms than Playstation 1&2. 

For now I think DVD images are not interesting for most of the people in the
scene but I think this will change in the near future and I also think it will
be neccessary to have a running system for patches which covers DVD stuff also.


Whats new ?
-----------

As stated above I added some new features to PPF but also i removed some of the
old ones, or to be exact one feature had to go. So here is the new feature-list:

- Image filesize checking is GONE.
  Over the years it became clear that this feature was simply too inaccurate
  and confused most of the users with warnings which were mostly incorrect.

- Image Identification / Blockcheck was enlarged. (+Imagetype)
  You can either fully DISABLE or ENABLE the blockcheck for a specific patch,
  plus the blockcheck now supports GI (PrimoDVD) images. GI is the common format
  used for distributing DVD-Images.

- Undo data.
  You can optionally choose to include UNDO data in your patch so the users can
  undo your patch anytime.

- Fast
  Its a hell of alot faster than PPF2.0.
  
- Large files support.
  PPF3.0 supports files up to 9,223,372,036,854,775,807 Byte. enough ?

Contents of the distribution
----------------------------

1. If you take a look into the folder "PPFBIN" you will find the commandline
   tools for both Make and ApplyPPF3. The commandline tools are precompiled for
   several platforms which includes: Windows, Linux and MAC OS-X.
   You will find descriptions of these tools in the respective directory.

2. Developers may want to take a look into the folder "PPFDEV". Here you can find
   everything which is needed to start doing your own PPF3.0 tools. ANSI-C source
   for Make aswell as Apply PPF3.0 is included. Furthermore you will find a file
   called "PPF3.txt" which is needed to study the new PPF3.0 file structure.

3. Also for everyone who is not able to use commandline tools for applying I have
   included version 3.0 of the wellknown PPF-O-MATIC program in the folder PPFGUI
   You will find that there is a WINDOWS as well as a "MAC" version included. The
   Windows version is fully compatible with Windows 9x/NT/2K/XP of course.
   The MAC version is for OS-X.


Last notes / thanks.
--------------------

I hope you like the idea which comes along with PPF3.0 as well as the new
features I have included in this version. Not everything was coded by me so
here's a list of tools which were coded by others or were influenced by them:

- PPF-O-MATIC v3.0 MAX OS-X Version was coded by Hu Kares.
- PPF-O-MATIC v3.0 WIindows Version was coded by Zweifeld/Paradox.

I want to say 'thank you' to the following people: Everyone that used PPF tools
so far, this includes mainly big groups like Kalisto, Paradox, Static, Lightforce
and Echelon (Dreamcast). Also, all the independent people who chose the PPF
format to distribute patches. Hu Kares for his fine MAC conversions and fixing
some bugs in the PPF3.0 draft and of course Zweifeld, for PPF-O-MATIC3 Windows.
Last but not least, Scal/Paradox for correcting my miserable
english docs ;-)

Thank you.

Signed,
Icarus of Paradox

PPF 3.0 file format

copied pdx-ppf3.zip/ppfdev/PPF3.txt from Romhacking.net - Utilities - PPF

also available at ppf/ppfdev/PPF3.txt at master · meunierd/ppf

.-----------------------------------------------------------------.
| PLAYSTATION PATCH FILE VERSION 3.0 FILE-STRUCTURE FOR DEVELOPERS|
'-----------------------------------------------------------------'

1. The PPF 3.0 Header:

@START_PPF30HEADER
.----------+--------+----------------------------------------------.
| POSITION |  SIZE  |              E X P L A N A T I O N           |
+----------|--------|----------------------------------------------+
| 00-04    |   05   | PPF-Magic: "PPF30"                           |
+----------|--------|----------------------------------------------+
| 05       |   01   | Encoding Method:                             |
|          |        | - 0x00 = is a PPF 1.0 Patch                  |
|          |        | - 0x01 = is a PPF 2.0 Patch                  |
|          |        | - 0x02 = is a PPF 3.0 Patch                  |
+----------|--------|----------------------------------------------+
| 06-55    |   50   | Patch Description                            |
+----------|--------|----------------------------------------------+
| 56       |   01   | Imagetype:                                   |
|          |        | - 0x00 = BIN (any)                           |
|          |        | - 0x01 = GI (PrimoDVD)                       |
+----------|--------|----------------------------------------------+
| 57       |   01   | Blockcheck/Patchvalidation:                  |
|          |        | - 0x00 = Disabled                            |
|          |        | - 0x01 = Enabled                             |
|          |        | If disabled applyppf won't validate the patch|
|          |        | also the 1024 byte block won't be available. |
+----------|--------|----------------------------------------------+
| 58       |   01   | Undo data:                                   |
|          |        | - 0x00 = Not available                       |
|          |        | - 0x01 = Available                           |
|          |        | If available applyppf will be able to        |
|          |        | restore a previous patched bin to back to its|
|          |        | original state. Patchsize increases of course|
+----------|--------|----------------------------------------------+
| 59       |   01   | Dummy:                                       |
|          |        | Not used.                                    |
+----------|--------|----------------------------------------------+
| 60-1083  | 1024   | Binary block:                                |
|          |        | It is used for patchvalidation.              |
|          |        | If Imagetype = 0x00 then its data starting   |
|          |        | from 0x9320.                                 |
|          |        | If Imagetype = 0x01 then its data starting   |
|          |        | from 0x80A0.                                 |
|          |        | If Blockcheck = 0x00 then this block won't be|
|          |        | available.                                   |
+----------|--------|----------------------------------------------+
| 1084-X   |   XX   | The Patch itself.. see below for structure!  |
'----------+--------+----------------------------------------------'
@END_PPF30HEADER - TOTAL HEADER-SIZE = 1084 BYTE with validation and
                                         60 BYTE without validation.


2. The PPF 3.0 Patch Itself (Encoding Method #2)

@START_PPF30PATCH

FORMAT : yyyyyyyyyyyyyyyy , zz , dd/uu[..]

         yyyyyyyyyyyyyyyy  = Offset in file. [64 bit integer]
         zz                = Number of bytes that will be changed. [u_char]
         dd/uu             = Patch data following undo data (if present) [char array]
         
EXAMPLES:

Starting from file offset 0x15F9D0 replace 3 byte with 01,02,03:
D0 F9 15 00 00 00 00 00 - 03 - 01 02 03

Starting from file offset 0x15F9D0 undo 3 byte to 0A,0A,0A which
were formerly patched to 01,02,03:

D0 F9 15 00 00 00 00 00 - 03 - 01 02 03 0A 0A 0A

PPF3.0 is able to patch binfiles up to:
9,223,372,036,854,775,807 byte.

Be careful! Endian format is Intel!
@END_PPF30PATCH


3. The PPF 3.0 Fileid area

@START_FILEID

The fileid area is used to store additional patch information of
the PPF 3.0 file. I implemented this following the AMIGA standard
of adding a fileid to e.g. .txt files. You dont have to add a
FILE_ID to the PPF 3.0 patch. It for your pleasure only!

For developers:
A file_id area begins with @BEGIN_FILE_ID.DIZ and ends with
@END_FILE_ID.DIZ (Amiga BBS standard). Between @BEGIN_FILE_ID.DIZ
and @END_FILE_ID.DIZ you will find the File_Id and followed after
@END_FILE_ID.DIZ you will find an unsigned short (2 byte) with the length
of the FILE_ID.DIZ!

A File_ID.diz file cannot exceed 3072 byte.

If you want to do a PPF3.0 Applier be sure to check for an
existing FILE_ID area, because it is located after the PATCH DATA!

@END_FILEID

file_id.diz

copied pdx-ppf3.zip/file_id.diz from Romhacking.net - Utilities - PPF

  ________/\________  /\_____  ________ ____
  \_____  \ \_____  \/  \___ \/    \   |   / 
    /  ___/| \|  /  /  | \ |  \  |  \     /  
 Mb/   |   _  \  \  \  _  \    \    /     \  
  /    |___|   \_|\__\_|   \___/___/___|   \ 
 /_____|---|____\------|____\-PRESENTS-|____\
 PPF3.0 FULL DISTRIBUTION [SRC/WIN/LINUX/MAC]
Clone this wiki locally