ebooted - EBOOT editor and (un)packer
-------------------------------------

Copyright (c) 2009, Tobias Theuer <tobi at unhol dot de>
Licensed under ISC license, see license.txt

filesize.py Copyright (c) Martijn Faassen, Startifact <faassen at startifact com>
Licensed under ZPL 2.1, see zpl.txt

ebooted is a program for unpacking and packing PlayStation Portable executable
files, usually called EBOOT.PBP. Right now that is all it does, later versions
will include features to edit the PARAM.SFO files (metadata about the program)
and extract files from converted PSX games' DATA.PSAR files.
It most likely won't work with retail games but should work with all homebrew
files and converted PSX games.

It is programmed in python so you need python in version 2.5 or 2.6 installed
and in the path.

For Windows users who are not that into command line arguments I have some
simple batch files, look at the bottom of the file for infos about them.


How to use the pbp (un)packer:
------------------------------

Open a command line and enter:

python pbp.py -f FILE [options] [files]

Options:
  --version             show program's version number and exit
  -h, --help            show help message and exit
  -f FILE, --file=FILE, --eboot=FILE
                        the FILE (usually EBOOT.PBP) to read/write
  -l, --list            list the files packed in FILE (default action)
  -u, --unpack          unpack the specified (or all) files in FILE. Use 'all'
                        or specific filenames to unpack
  -p, --pack            pack the specified files (or all files in the
                        specified directory) into FILE
  -d DIRECTORY, --directory=DIRECTORY
                        directory to where to unpack to / directory which
                        stores all the files to be packed with their proper
                        names
  -w, --overwrite       overwrite existing files (!)
  -v, --verbose         give detailed reports

  Specific file options:
    alternative/additionally to the --directory option you can (for
    unpacking) use 'all', or specify the files inside the FILE to pack

    --param.sfo=PARAM.SFO
    --icon0.png=ICON0.PNG
    --icon1.pmf=ICON1.PMF
    --pic0.png=PIC0.PNG
    --pic1.png=PIC1.PNG
    --snd0.at3=SND0.AT3
    --data.psp=DATA.PSP
    --data.psar=DATA.PSAR

Packing and unpacking eboots can take a few minutes for big files, so be
patient.

Examples:
---------

To list the files packed in a file D:\path\to\EBOOT.PBP :

python pbp.py -l -f D:\path\to\EBOOT.PBP


To unpack all files from a file D:\path\to\EBOOT.PBP into a directory this\dir\

python pbp.py -u -f D:\path\to\EBOOT.PBP -d this\dir\ all

If the directory doesn't exist it will be created.


To pack all files you previously unpacked into C:\this\dir\ into
D:\path\to\new\EBOOT.PBP

python pbp.py -p -f D:\path\to\new\EBOOT.PBP -d C:\this\dir\


To pack all files you previously unpacked into C:\this\dir\ into 
D:\path\to\new\EBOOT.PBP but replace the icon0.png with C:\new_icon0.png

python pbp.py -p -f D:\path\to\new\EBOOT.PBP -d C:\this\dir\ --icon0.png=C:\new_icon0.png

You could of course just replace the file in the directory.


If you want detailed information you can add the -v option, if you want to
overwrite existing files, use the -w option.


Batch files:
------------

If you want to use the simplified batch files:

To list the files packed in a file D:\path\to\EBOOT.PBP :

list.bat D:\path\to\EBOOT.PBP

To unpack all files from a file D:\path\to\EBOOT.PBP into a directory this\dir\

unpack.bat D:\path\to\EBOOT.PBP this\dir\

To pack all files from C:\this\dir into EBOOT.PBP

pack.bat EBOOT.PBP C:\this\dir


Help & Bugs:
------------

If you need help, experience errors or find bugs in the program, just post in
the QJ.net forums in the thread about the program.


Future versions:
----------------

Planned features for future versions:
- edit param.sfo files (edit game metadata like name or parental level)
- (un)pack converted PSX games' data.psar (retrieve the original iso and change
  the boot image)
- easy to use, text-based user interface

Features I will MAYBE implement:
- Quickmode to replace single files a eboot quickly without unpacking and
  repacking it.
- A graphical user interface (GUI)
