@any developer
well, the development of QuickBMS continues with new enhancements and support to other useful and less useful stuff (and yes, the usual bugfixes).
for example in the new version I have decided to use the OpenSSL library that through its EVP interface allows to use any encryption algorithm supported by this great library (included any ecb, cbc, ofb and other modes) using the same function! :)
regarding the various algorithms I guess that for the moment there is nothing else to add natively, after all if the algorithms used by the games are not standards like zlib or lzo there is not much to do.
anyway I have added the possibility to choose the parameters of the lzss algorithm, so for example for a game like The Settlers II would be enough to specify 'comtype lzss "10 4 2 0"' for supporting its compression with non-default parameters.
and the following is a small funny/crazy/mad/stupid thing I have created in a couple of minutes, it's a conversion in BMS scripting of the LZSS algorithm to prove that the custom compression algorithms can be implemented even in the scripting language... obviously the performances are not excellents (22 seconds for decompressing 20 megabytes) but it works and is a good demonstration:
Code: Select all
# example of lzss decompression function written in 100% bms scripting!!!
# remember that QuickBMS supports the LZSS algorithm natively so this one
# is only a funny demonstration of a script-only function
set NAME string "unpacked.dat"
get ZSIZE asize
math SIZE = ZSIZE
math SIZE *= 10
log MEMORY_FILE 0 ZSIZE
callfunction LZSS_BMS_DUMP
# you must set: MEMORY_FILE (input), ZSIZE (input size), MEMORY_FILE2 (output), SIZE (max size)
startfunction LZSS_BMS_DUMP
set EI long 12
set EJ long 4
set P long 2
set rless long P
set init_chr long 0x20
set N long 1
math N <<= EI
set F long 1
math F <<= EJ
# pre-allocate memory for faster performances
putvarchr MEMORY_FILE3 N 0
for i = 0 < N
putvarchr MEMORY_FILE3 i init_chr
next i
putvarchr MEMORY_FILE2 SIZE 0
math r = N
math r -= F
math r -= rless
math N -= 1
math F -= 1
math src = 0
math dst = 0
math srcend = ZSIZE
math dstend = SIZE
math flags = 0
for src = 0 < srcend
if flags & 0x100
else
getvarchr flags MEMORY_FILE src
math src += 1
math flags |= 0xff00
endif
if flags & 1
getvarchr c MEMORY_FILE src
math src += 1
putvarchr MEMORY_FILE2 dst c
math dst += 1
putvarchr MEMORY_FILE3 r c
math r += 1
math r &= N
else
getvarchr i MEMORY_FILE src
math src += 1
getvarchr j MEMORY_FILE src
math src += 1
math TMP = j
math TMP >>= EJ
math TMP <<= 8
math i |= TMP
math j &= F
math j += P
for k = 0 <= j
math TMP = i
math TMP += k
math TMP &= N
getvarchr c MEMORY_FILE3 TMP
putvarchr MEMORY_FILE2 dst c
math dst += 1
putvarchr MEMORY_FILE3 r c
math r += 1
math r &= N
next k
endif
math flags >>= 1
next
math SIZE = dst
log NAME 0 SIZE MEMORY_FILE2
endfunction
hope you like the idea and in case of doubts about the scripting language or what is possible or not possible to do with it remember to read quickbms.txt or to contact me or to watch the various existent bms scripts.