PixelJunk Shooter

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
datahaven
Posts: 2
Joined: Thu May 28, 2015 8:43 pm

PixelJunk Shooter

Post by datahaven »

The following QuickBMS script may be used to extract all of the files from PixelJunk Shooter.

Code: Select all

# Extract PixelJunk Shooter Data
# Adrian Dale 30/05/2015
#
# quickbms.exe ExtractPJS.bms shooter.pkiwin output

open FDDE "pkiwin" 0
open FDDE "pkdwin" 1
get DUMMY long 0
get DUMMY long 0
get FILECOUNT long 0
get DUMMY long 0

ComType zlib

for i = 1 <= FILECOUNT
   get SIZE long 0
   get OFFSET long 0
   get CRC1 long 0
   get CRC2 long 0
   
   clog "" OFFSET SIZE 10000000 1
next i


Unfortunately the file names are not contained inside the archive, so the code uses QuickBMS' auto-extension name feature and incrementing index to name the files. Thank you to Luigi for suggesting that change to my script.

Despite being quite old, PJS is an interesting game to explore. Notably, a large number of the extracted files are commented source code files in what I believe is GameMonkey Script.

Also of interest are the .xml files, which are actually .svg vector format files and viewable in a tool like Inkscape. The other easily recognisable files are .dds graphics files, .wav sound files and .ogg music files.

I suspect you would be unable to mod this game without further detective work. I think that the fields in the archive that I have labelled CRC1 and CRC2 might need to be recalculated if you want to make any changes.

Adrian

Edited 30/05/15 to add improvement to the script. Adrian
Last edited by datahaven on Sat May 30, 2015 9:18 am, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: PixelJunk Shooter

Post by aluigi »

If you use "" instead of NAME then quickbms will automatically guess the extension, just as alternative to func_getTYPE.bms.
datahaven
Posts: 2
Joined: Thu May 28, 2015 8:43 pm

Re: PixelJunk Shooter

Post by datahaven »

aluigi wrote:If you use "" instead of NAME then quickbms will automatically guess the extension, just as alternative to func_getTYPE.bms.


Thank you for the info - I didn't know that!

I've tried this out and it works very well! I've changed the post above to use this feature as it is far more convenient than what I had before.

Thanks,

Adrian
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: PixelJunk Shooter

Post by aluigi »

Instead of "ComType zlib" you can use "comtype zlib_noerror" because you have a file compressed with zlib for which you don't know the decompressed size.
Additionallly zlib_noerror saves the file "as-is" if it's not a valid zlib.
Another alternative algorithm is unzip_dynamic that automatically checks zlib -> deflate -> "as-is".
JakSparro98
Posts: 3
Joined: Mon Sep 28, 2015 9:09 pm

Re: PixelJunk Shooter

Post by JakSparro98 »

datahaven wrote:The following QuickBMS script may be used to extract all of the files from PixelJunk Shooter.

Code: Select all

# Extract PixelJunk Shooter Data
# Adrian Dale 30/05/2015
#
# quickbms.exe ExtractPJS.bms shooter.pkiwin output

open FDDE "pkiwin" 0
open FDDE "pkdwin" 1
get DUMMY long 0
get DUMMY long 0
get FILECOUNT long 0
get DUMMY long 0

ComType zlib

for i = 1 <= FILECOUNT
   get SIZE long 0
   get OFFSET long 0
   get CRC1 long 0
   get CRC2 long 0
   
   clog "" OFFSET SIZE 10000000 1
next i


Edited 30/05/15 to add improvement to the script. Adrian


Hi I have an issue running this script, happily i found this thread and tried this method but i do something wrong, in the prompt there is an "incomplete input file" error but the only two file i have already put into the program, and again i receive an error for the row with the "clog" instruction

i repeat, what is wrong?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: PixelJunk Shooter

Post by Ekey »

JakSparro98
Posts: 3
Joined: Mon Sep 28, 2015 9:09 pm

Re: PixelJunk Shooter

Post by JakSparro98 »

Thanks for the reply but i don't think it wont work, I have read the post in your link and run the program with my borland compiler, no errors but the program seems to be only for pixeljunk eden because I don't have "lump.idx" in the directory of the game.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: PixelJunk Shooter

Post by Ekey »

Well, in this game archives don't contain file names, only HASH, also data not compressed. Here correct script for unpack.

Code: Select all

open FDDE "pkdwin" 0
open FDDE "pkiwin" 1

get VERSION long 1
get NULL long 1
get FILES long 1

for i = 0 < FILES
    get SIZE long 1
    get OFFSET long 1
    get HASH long 1
    log "" OFFSET SIZE 0
next i
JakSparro98
Posts: 3
Joined: Mon Sep 28, 2015 9:09 pm

Re: PixelJunk Shooter

Post by JakSparro98 »

Thanks a lot, your script worked :D