# gjol / Gu Jianqi Tan online / 《古剑奇谭网络版》 # script for QuickBMS http://quickbms.aluigi.org idstring "ZPKG" getdstring DUMMY 12 get DUMMY longlong get DUMMY longlong get DUMMY longlong get DUMMY longlong get DUMMY longlong get DUMMY longlong get ARCHIVE_SIZE asize savepos OFFSET for OFFSET = OFFSET != ARCHIVE_SIZE getdstring DUMMY 16 get SIZE longlong get CHUNK_SIZE long math CHUNKS = SIZE math CHUNKS / CHUNK_SIZE if SIZE % CHUNK_SIZE math CHUNKS + 1 endif for x = 0 < CHUNKS get CHUNK_ZSIZE long putarray 0 x CHUNK_ZSIZE next x savepos OFFSET comtype blosc # lzf and fastlzah fail on some files # some files use blosc, others use lzma get TEST short if TEST == 0x005d comtype lzma_dynamic # the others don't work... endif putvarchr MEMORY_FILE SIZE 0 log MEMORY_FILE 0 0 append for x = 0 < CHUNKS getarray CHUNK_ZSIZE 0 x if CHUNK_ZSIZE == CHUNK_SIZE log MEMORY_FILE OFFSET CHUNK_SIZE else clog MEMORY_FILE OFFSET CHUNK_ZSIZE CHUNK_SIZE endif math OFFSET + CHUNK_ZSIZE next x append log "" 0 SIZE MEMORY_FILE goto OFFSET next