# Crysis 2 (script 0.2) # supports both retail and mpdemo # script for QuickBMS http://quickbms.aluigi.org quickbmsver 0.4.10b # correct reimporting granted from this version getdstring SIGN 2 if SIGN == "PK" print "the input file is already decrypted, open it normally as a ZIP" cleanexit endif get NIGEL_SIZE asize math i = 0 do goto -10 get PKSIZE long get OFFSET long if i == 0 set CRYSIS2_KEY binary "\xc9\x68\xfb\x67\x8f\x9b\x42\x67\x85\x39\x9e\x84\xf9\xb9\x9d\xc4" # retail elif i == 1 set CRYSIS2_KEY binary "\xf3\x85\x0a\x96\xb7\x4a\xbe\x07\x12\x60\x4a\x4d\xe8\x03\xa1\x16" # mpdemo else print "no valid key found, contact me!" cleanexit endif math i += 1 encryption xxtea CRYSIS2_KEY "" 0 16 log MEMORY_FILE OFFSET PKSIZE encryption "" "" get PK_sign long MEMORY_FILE while PK_sign != 0x02014b50 goto 0 MEMORY_FILE ComType deflate for PKOFF = 0 < PKSIZE get PK_sign short MEMORY_FILE get sign short MEMORY_FILE get ver_made short MEMORY_FILE get ver_need short MEMORY_FILE get flag short MEMORY_FILE get method short MEMORY_FILE get modtime short MEMORY_FILE get moddate short MEMORY_FILE get crc long MEMORY_FILE get comp_size long MEMORY_FILE get uncomp_size long MEMORY_FILE get name_len short MEMORY_FILE get extra_len short MEMORY_FILE get comm_len short MEMORY_FILE get disknum short MEMORY_FILE get int_attr short MEMORY_FILE get ext_attr long MEMORY_FILE get rel_offset long MEMORY_FILE getdstring name name_len MEMORY_FILE getdstring extra extra_len MEMORY_FILE getdstring comment comm_len MEMORY_FILE savepos PKOFF MEMORY_FILE math offset = rel_offset math offset += name_len math offset += 0x1e if uncomp_size == 0 set method long 0 endif if method == 0 Log name offset uncomp_size elif method == 8 CLog name offset comp_size uncomp_size elif method == 11 encryption xxtea CRYSIS2_KEY "" 0 16 CLog name offset comp_size uncomp_size encryption "" "" else print "unsupported compression method %method% at offset %PKOFF%, contact me!" cleanexit endif next