QBMS Compression

Doubts, help and support about QuickBMS and other game research tools
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

QBMS Compression

Post by michalss »

Hi Aluigi,

I have 1 sugestion to you mate. :) Is there any chance you can do single file (de)compression natively without the bms sctipt ? Someting like qbms <compression> <type(compress,decompress)> InfileName OutFilename.
that would be absolutely perfect :)

- also to make possible to attach it as assemlby to .Net and use your classes and Unmanaged libs ?


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

Re: QBMS Compression

Post by aluigi »

I have just improved the -s option to allow multiple commands using the ';' separator.
So in the next version of quickbms that I will release, it's enough to use something like the following:

Code: Select all

quickbms -s "comtype zlib ; get ZSIZE asize ; xmath SIZE \"ZSIZE * 10\" ; clog \"dump.dat\" 0 ZSIZE SIZE" "" input_file.dat output_folder


*update*
Note that various decompression algorithms are sensitive to the output uncompressed size, so if you specify a wrong SIZE the algorithm may fail, crash or fill the whole SIZE with bad data.
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: QBMS Compression

Post by michalss »

yeah thx this is perfect exactly i need :)

And my other question please ? Is it possible to do such a thing about .Net assemblies ?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QBMS Compression

Post by aluigi »

What you mean exactly?
I don't know much about .Net.
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: QBMS Compression

Post by michalss »

for example to use your compressions in .NET as unmanaged code
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QBMS Compression

Post by aluigi »

I think you need to compile one or more compression functions as dll with the stdcall calling convention.
Then you should be able to use them in .NET
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: QBMS Compression

Post by michalss »

aluigi wrote:I think you need to compile one or more compression functions as dll with the stdcall calling convention.
Then you should be able to use them in .NET



Well i was playing with your qbms code and i have to admin it is over my head. :( Temporarly i used qbms and wrote special class for it in .NET using compressions, but it is not very friendly sort of speak. It would be nice to actually use qbms to use in .NET projects. This is example i was talking about : http://www.codeproject.com/Articles/141 ... Applicatio
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QBMS Compression

Post by aluigi »

You must not play with all the quickbms code. Check the C and H files in src\compression and check also unz.c.
The decompression functions are very simple and usually need only the input buffer, input size, output buffer and often also the output size.

What compression algorithms do you need?
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: QBMS Compression

Post by michalss »

aluigi wrote:You must not play with all the quickbms code. Check the C and H files in src\compression and check also unz.c.
The decompression functions are very simple and usually need only the input buffer, input size, output buffer and often also the output size.

What compression algorithms do you need?



Well most common one :) It would be gr8 all of them but it would be to much work i guess.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QBMS Compression

Post by aluigi »

zlib/deflate, lzma, bzip, gzip, lz4 and some others already have a .net implementation, others like those of Nintendo are natively in .NET (I translated them to C).
For the others I think the easiest solution is to use quickbms.exe that will handle everything.