I created a python script to pack and unpack the .dat files of FTL.
You can find it here:
https://github.com/bwesterb/ftldat
Kind regards,
UPDATE I have created a stand-alone Windows installer.
- Run the installer found here http://westerbaan.name/~bas/ftldat/ftldat-latest.exe. (You do not need to install Python anymore.)
- Open up a command prompt (Start -> Run... -> "cmd" -> "OK")
- Navigate to the folder with the data.dat and resource.dat.
- To unpack, run ftldat unpack data.dat
This wil create a data.dat-unpacked folder. - WARNING, before packing, make a backup of data.dat. To pack, run ftldat pack data.dat.
- To show the contents and fingerprints of a .dat, run ftldat info --hashes data.dat.
See ftldat -h, ftldat pack -h, etc. for more help.
UPDATE (r6) I have uploaded a new version with some useful new commands.
- add Adds a single file to the datfile. Eg. ftldat add data.dat my-ship.xml data/my_ship.xml
- append Appends a file to an existing file in the datfile. Eg. ftldat append data.dat data/blueprints.xml my-extra-blueprints.txt
- replace Replace a single file in a datfile. Eg. ftldat replace data.dat data/blueprints.xml fully-new-blueprints.xml
- extract Extract a single file to the datfile. Eg. ftldat extract data.dat data/blueprints.xml out.xml
- remove Remove a single file. Eg. ftldat remove data.dat data/events_mantis.xml
- hashes Prints a alphabetic list of filename and md5 hash. Useful for integrity checking. ftldat hashes data.dat
- list Lists the files in the datfile. ftldat list data.dat
These commands are all in-place and thus as fast as they can be. One could use ftldat.exe with these commands to create an installer of a patch. It would be as simple as writing a .bat.
If anyone is interested, I could also add support for patches like XDelta or Uniform Diff. If you script in Python, these commands are fairly easy to use by importing the "FTLPack" class.
UPDATE (r7) Another new command: repack. It will efficiently repack a datfile. Usage: ftldat repack path/to/the/file.dat. This is useful to reduce space overhead after a few add, replace, remove, etc commands.
UPDATE Changed subject.