Advertisement
Guest User

Chrono Clock de/compiling code pasta.

a guest
Feb 24th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. Alright so; ChronoClock requires a debug.dll file to be present on the /data/pack folder for it to read uncompressed .ps3 files, either that or modify the file Start.ps3 to read uncompressed .ps3 files, which is what I'm trying to do.
  2.  
  3. Purple Software uses a custom LZSS compression for .ps3 files:
  4. https://github.com/vn-tools/arc_unpacker/blob/master/src/dec/purple_software/ps2_file_decoder.cc#L37-L76
  5.  
  6. It roughly compares to the stock version of LZSS:
  7. https://github.com/vn-tools/arc_unpacker/blob/master/src/algo/pack/lzss.cc#L215-L258
  8.  
  9. The same file, lzss.cc, also contains an encoder for stock LZSS. A quick glance at both of the decoders reveals that the difference between them is the number and placement of bits used to store offsets and lengths of repetitions. This means one could copy the encoder as-is, and only tweak the way it outputs the computed repetition lengths. Another difference between them is the dictionary size and its initial offset.
  10.  
  11. If one does not want to dive into LZSS too much, one could also skip computing the repetitions altogether, and output something like "0xFF <8 raw bytes of input> 0xFF <8 raw bytes of input>" (give or take the script header ofc). The 0xFF marker here contains 8 control bits, each of which is set to 1, which means "copy the next byte from the source as-is" 8 times. It's trivial to code but I wouldn't use it for anything larger than scripts (e.g. SFX, GFX) cause the data size increase from this approach will be significant.
  12.  
  13. .CPz files are another monster. The code for decompiling them is here:
  14. https://github.com/vn-tools/arc_unpacker/blob/master/src/dec/purple_software/cpz5_archive_decoder.cc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement