Error with quickbms dk2_compress

Doubts, help and support about QuickBMS and other game research tools
cfarl
Posts: 11
Joined: Sun Nov 05, 2017 12:45 am

Error with quickbms dk2_compress

Post by cfarl »

Hi!
I'm getting and error when running the a script in a particular .lha decompressed file from Dead Space.

My script:

Code: Select all

comtype dk2_compress
get ZSIZE asize
goto 2
endian big
get SIZE threebyte
get NAME basename
string NAME = "primeiro_comp.LH2"
clog NAME 0 ZSIZE SIZE

My file: https://drive.google.com/open?id=13PVC2x2KV2IOc03Tp1FfkYnGi6PE6Kkg

My call to quickbms:

Code: Select all

quickbms.exe -o comprimir-lh2.bms primeiro_descom.LH2

QuickBms Error Message:

Code: Select all

QuickBMS generic files extractor and reimporter 0.8.3
by Luigi Auriemma
e-mail: me@aluigi.org
web:    aluigi.org
        (Jan 21 2018 - 15:18:31)

                   quickbms.aluigi.org  Homepage
                            zenhax.com  ZenHAX Forum
                               @zenhax  Twitter & Scripts

- open input file C:\danger\traducoes\traducao-dead space\erro_quickbms\primeiro_descom.LH2
- open script comprimir-lh2.bms
- set output folder .

  offset   filesize   filename
--------------------------------------
  00000000 4410368    primeiro_comp.LH2

-------------------
*EXCEPTION HANDLER*
-------------------
An error or crash occurred:

*EH* ExceptionCode      80000001 guard page violation
*EH* ExceptionFlags     00000000
*EH* ExceptionAddress   012b7ddf
                        012A0000 + 00017ddf quickbms.exe
*EH* NumberParameters   00000002
*EH*                    00000000
*EH*                    0e2ee000

Last script line before the error or that produced the error:
  8   clog NAME 0 ZSIZE SIZE

Can you help me?

Thanks in advance!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Error with quickbms dk2_compress

Post by aluigi »

I have no idea of what you want to do, really.
Anyway if you want just to compress the file:

Code: Select all

comtype dk2_compress
get SIZE asize
clog "new_file" 0 SIZE SIZE
cfarl
Posts: 11
Joined: Sun Nov 05, 2017 12:45 am

Re: Error with quickbms dk2_compress

Post by cfarl »

Your script works as a charm!
But even using it, I got the same error with the file I provided up.... :(
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Error with quickbms dk2_compress

Post by aluigi »

Interesting.
Unfortunately the dk2/qfs compressor has not been written by me so I have no ideas, but it looks like it's a bit messy and buggy, that explains why it wants to access data outside the buffer.
I will check it for the next version of quickbms, maybe I will find a solution by myself.

It's interesting that the issue seems to happen just with your file :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Error with quickbms dk2_compress

Post by aluigi »

Ok the problem seems to be the necessity of having 1028 zeroes after the file... definitely a bad thing.
I will fix it by myself.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Error with quickbms dk2_compress

Post by aluigi »

*edit* wrong
cfarl
Posts: 11
Joined: Sun Nov 05, 2017 12:45 am

Re: Error with quickbms dk2_compress

Post by cfarl »

ok, this new script works with the first file, but not with this.... https://drive.google.com/open?id=1ifLH2R2ZHyGtXTYlJLo7Kcy7mIwUALOu :(

Code: Select all

QuickBMS generic files extractor and reimporter 0.8.3
by Luigi Auriemma
e-mail: me@aluigi.org
web:    aluigi.org
        (Jan 21 2018 - 15:18:31)

                   quickbms.aluigi.org  Homepage
                            zenhax.com  ZenHAX Forum
                               @zenhax  Twitter & Scripts

- open input file C:\Users\admin\Desktop\Traducoes\Dead Space\criar_novo_str\primeiro_descom.LH2
- open script tools\comprimir-lh2.bms
- set output folder .

  offset   filesize   filename
--------------------------------------
  00000000 244715     primeiro_comp.LH2

-------------------
*EXCEPTION HANDLER*
-------------------
An error or crash occurred:

*EH* ExceptionCode      80000001 guard page violation
*EH* ExceptionFlags     00000000
*EH* ExceptionAddress   000c7ddf
                        000B0000 + 00017ddf quickbms.exe
*EH* NumberParameters   00000002
*EH*                    00000000
*EH*                    0d04e000

Last script line before the error or that produced the error:
  10  clog NAME 0 TMP SIZE MEMORY_FILE
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Error with quickbms dk2_compress

Post by aluigi »

my mistake, forget my previous post, there is no work-around
cfarl
Posts: 11
Joined: Sun Nov 05, 2017 12:45 am

Re: Error with quickbms dk2_compress

Post by cfarl »

No problem, Aluigi. Thanks for your help, and for this great tool you made.
With best regards,
cfarl
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Error with quickbms dk2_compress

Post by aluigi »

The bug will be fixed in the upcoming quickbms 0.8.4.
It was extremely easy to fix so I have no idea why the author preferred to create a bug on purpose (as described in his comments) rather than adding a simple check on 2 pointers, it doesn't seem a "requirement" of the algorithm... mah.