ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Sep 23, 2017 2:37 pm

All times are UTC




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
 Post subject: QBMS Compression
PostPosted: Thu Nov 06, 2014 10:20 pm 

Joined: Sun Aug 10, 2014 12:49 pm
Posts: 241
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


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Fri Nov 07, 2014 10:30 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6690
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:
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.


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Fri Nov 07, 2014 11:59 am 

Joined: Sun Aug 10, 2014 12:49 pm
Posts: 241
yeah thx this is perfect exactly i need :)

And my other question please ? Is it possible to do such a thing about .Net assemblies ?


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Fri Nov 07, 2014 5:20 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6690
What you mean exactly?
I don't know much about .Net.


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Sat Nov 08, 2014 11:44 am 

Joined: Sun Aug 10, 2014 12:49 pm
Posts: 241
for example to use your compressions in .NET as unmanaged code


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Sat Nov 08, 2014 5:26 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6690
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


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Sat Nov 08, 2014 6:48 pm 

Joined: Sun Aug 10, 2014 12:49 pm
Posts: 241
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


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Sat Nov 08, 2014 10:23 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6690
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?


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Sun Nov 09, 2014 9:56 am 

Joined: Sun Aug 10, 2014 12:49 pm
Posts: 241
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.


Top
   
 Post subject: Re: QBMS Compression
PostPosted: Sun Nov 09, 2014 10:38 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6690
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 10 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited