QuickBMS errors [programming, scripting, quickbms.exe tool... NOT games]

Doubts, help and support about QuickBMS and other game research tools
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

you must wait the next version of quickbms.
ThalonMook
Posts: 4
Joined: Sat Jul 11, 2015 4:53 pm

Re: QuickBMS errors

Post by ThalonMook »

Hi,

any news about the reimport.

If you need a beta tester I will do this.

I have some ohter files that makes problems with reimport.

Cu
Thalon
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

Currently there is no plan for the next version because this is the only thing to add and version 0.6.5 has been released few days ago.
If there is nothing to add also the next week then I will probably release a new minor version with this feature.
ThalonMook
Posts: 4
Joined: Sat Jul 11, 2015 4:53 pm

Re: QuickBMS errors

Post by ThalonMook »

Hi Aluigi,

any news about the new version?

Cu
Thalon
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

I guess I will release it this weekend
NullRd
Posts: 19
Joined: Sat Jun 06, 2015 6:50 pm

Re: QuickBMS errors

Post by NullRd »

"set varsz strlen var" in some cases returns 273

Code: Select all

string teststr = "qwerty"
set testlen strlen teststr
print %testlen%          // - SCRIPT's MESSAGE:  6

set teststr "qwerty"
set testlen strlen teststr
print %testlen%          // - SCRIPT's MESSAGE:  273

set teststr string "asdf"
set testlen strlen teststr
print %testlen%          // - SCRIPT's MESSAGE:  273
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

Good catch.
Basically "set VARSZ strlen VAR" is just a call for "strlen VARSZ VAR", but recently I added the possibility to return the whole size of the variable if a third argument is different than zero. The code in "Set" didn't set this number to zero and so that's why you get those results.
It will be fixed in the next version of quickbms that will be released in the next days.
Thanks.
tigerr101
Posts: 2
Joined: Sun Aug 02, 2015 10:27 am

Re: QuickBMS errors

Post by tigerr101 »

Hello.

I have a problem with extracting voice files from 'Sword Art Online : Infinity moment' and hope to get some help.

At first, I followed
http://wiki.vg-resource.com/wiki/Sword_Art_Online:_Infinity_Moment
for decryption and succeeded to get a lot of extensionless files in sound\ folder, which are .afs2 archives according to the link.

I tried to extract files(.hca) from those archives with QuichBMS 0.6.5 and afs2 script I found here,
http://aluigi.altervista.org/papers/bms/others/awb_afs2.bms
and it worked for some, but almost half of them failed; only gives error message and extract nothing.

Added some examples in ex.zip;
4pro.zip - it is the one perfectly extracted.
4q0e.zip - it gives message <Error : incomplete input file 0'>
t30.zip - it gives message <signature of 4 bytes at offset 0x00000000 doesn't match the one expected by the script : this one : "@UTF">

Thank you.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

The files without "_" suffix are created with the CRI sdk but they are not supported by the cpk.bms script (you can't use awb_afs2.bms on them).
While 4q0e_ (flag 0x020201 instead of 0x020401) doesn't seems to have valid information about the offset and size of the files that are located at offset 0x20, 0x1800 and 0x3520. So there is no way for the script to extract them.
tigerr101
Posts: 2
Joined: Sun Aug 02, 2015 10:27 am

Re: QuickBMS errors

Post by tigerr101 »

aluigi wrote:The files without "_" suffix are created with the CRI sdk but they are not supported by the cpk.bms script (you can't use awb_afs2.bms on them).
While 4q0e_ (flag 0x020201 instead of 0x020401) doesn't seems to have valid information about the offset and size of the files that are located at offset 0x20, 0x1800 and 0x3520. So there is no way for the script to extract them.


Wow. Thanks for your quick response.
hmm..I will forget about files like '4q0e_'. :cry:
'not supported by the cpk.bms' means that files like 't30' are not extracted correctly from .CPK file?(with QuickBMS and cpk.bms?)
or I just need to find another way to unpack afs2 archives?
I would appreciate it if you could give me some advice to extract voice file from them..
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

Just to recap: 4q0e_ and 4pro_ are the only AFS2 archives (but only 4pro_ can be extracted) while the others are CRI archives but they are not supported by cpk.bms.
starcraft2chn
Posts: 1
Joined: Mon Aug 03, 2015 10:23 am

Re: QuickBMS errors

Post by starcraft2chn »

watch here 3 pictures; maybe you can fix this
1st
Image
2nd
Image
3rd
Image

you will make this in a new version? i think this will help; or modify my script?
it is 0.6.6
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

Is it a new error?

I mean, did you have the same problem with quickbms 0.6.5?
If you want to make some tests with the previous version, you can download it from http://aluigi.org/papers/quickbms_0.6.5.zip
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: QuickBMS errors

Post by spider91 »

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

Re: QuickBMS errors

Post by aluigi »

@spider91
Can you provide the samples and script to replicate the problem?
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: QuickBMS errors

Post by spider91 »

Here are sample files and script. Works fine with older versions.

http://www81.zippyshare.com/v/Ej94hFgS/file.html


Also i've made some test with Slog and it doesn't work propperly with MEMORY_FILE's. It saves file named "MEMORY_FILE" to the hdd and that's a "good" file, since file with propper NAME is the same size, but empty. It seems i've deleted sample files with slog, so i can't provide it now. Maybe i'll do another sample later.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

Thanks for the samples.

Regarding slog, you shouldn't use MEMORY_FILEs as output.
It's just a simple log-to-file command so I guess you are using it in a way which is not the one for which it was created :)

My yoyo script is a perfect example of how it should be used:
http://aluigi.org/papers/bms/yoyogames.bms
Zim
Posts: 15
Joined: Sun Aug 30, 2015 12:19 am

Re: QuickBMS errors

Post by Zim »

I've met the same issue as spider91 did with log on 0.6.6a, it's because of append mode:

Causes an error (can't create this file):

Code: Select all

append
log "TestFile" 0 0
Doesn't cause any error (file is created successfully):

Code: Select all

log "TestFile" 0 0
On 0.6.5 both examples are working properly.


Also why we can't use any "0xAB" as a real string? We always get numbers/their bytes instead of strings and even with "0x" or "1x2" etc:

Code: Select all

set TestString string "1x2"           # it's treated as 0x12 number:
print "%TestString%"                  # - SCRIPT's MESSAGE:  18   

string TestString = "1x2"
print "%TestString%"                  # - SCRIPT's MESSAGE:  ↕
Or like this:

Code: Select all

string TestString = "text~1x23~text"
string TestString R "1x2" ""          # doesn't work:
print "%TestString%"                  # - SCRIPT's MESSAGE:  text~1x23~text

string TestString R "1x2~" "~"        # still doesn't work:
print "%TestString%"                  # - SCRIPT's MESSAGE:  text~1x23~text

string TestString R "~1x2" "~"        # now it's working:
print "%TestString%"                  # - SCRIPT's MESSAGE:  text~3~text
but print is fine:

Code: Select all

print "1x2"                           # - SCRIPT's MESSAGE:  1x2

And same problem with "-" which becomes a 0 instead:

Code: Select all

set TestString string "-"
print "%TestString%"                  # - SCRIPT's MESSAGE:  0

string TestString = "-"
print "%TestString%"                  # - SCRIPT's MESSAGE:  0

string TestString = "text-text"
string TestString R "-" ""            # doesn't work:
print "%TestString%"                  # - SCRIPT's MESSAGE:  text-text
Especially that string replace frustrating me.

I understand that this is happening because of QuickBMS is trying to convert such strings to numbers for some reason (which I don't see in documentation) - my bad, I just missed it in Notes, but it's annoying when we want it as a string and we specify it as a string, without any conversions...
Last edited by Zim on Sun Aug 30, 2015 3:03 pm, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: QuickBMS errors

Post by aluigi »

Yeah the tool should create the file if doesn't exist, so it's a bug.
Anyway the correct behaviour would be to create the file and then using the append mode, or the existent file with the same name (if any) will be updated instead of being recreated:

Code: Select all

log "TestFile" 0 0
append
log "TestFile" 0 0
...
I will fix it in the next version.

Instead the behaviour you see with strings is normal and it's written in the Notes of section 6 in quickbms.txt.
It's caused by how number and strings are handled internally.
I agree that it's frustrating, the only thing I can do is making this mechanism more strict so that "-" will remain "-" and "-1" will be considered the number -1, and the same would be valid for strings like "1x2" that is not a hex or number.
Zim
Posts: 15
Joined: Sun Aug 30, 2015 12:19 am

Re: QuickBMS errors

Post by Zim »

aluigi wrote:Instead the behaviour you see with strings is normal and it's written in the Notes of section 6 in quickbms.txt.
Oops I'm sorry my bad, thx for pointing that out! :D

aluigi wrote:I agree that it's frustrating, the only thing I can do is making this mechanism more strict so that "-" will remain "-" and "-1" will be considered the number -1, and the same would be valid for strings like "1x2" that is not a hex or number.
Thank you very much, that would be enough I guess.


Is it possible to use any other string operator besides "=" (copy) with P (Print equivalent) operator (also with p, x, etc), like the most frequent case for me (e.g. used in my logging functions, but with more variables/arguments):

Code: Select all

string TestString = "Value"
string TestString P+ "%TestString%"   # nope, it seems it's still "P=":
print "%TestString%"                  # - SCRIPT's MESSAGE:  Value

Also is it a bug or a limitation?

Code: Select all

string TestString P= "Line1\nLine2"   # well, not a full Print equivalent:
print "%TestString%"                  # - SCRIPT's MESSAGE:  Line1\nLine2

But of course it's easy to find any workaround, like x= "Line1\x0aLine2" or if you need it in P= (e.g. for same logging functions):

Code: Select all

string N = 0x0a0d                     # reverse order because of the little-endian
# set N binary \x0d\x0a               # more strict alternative
string TestString P= "Line1%N%Line2"
print "%TestString%"


Also I remembered more old bug (or maybe it's a hidden feature!) with goto EOF - it's alway seeking to the end offset of the input file (0), not of the specified one, unlike the SEEK_END (so they are not equivalent). You can check it on files of different sizes:

Code: Select all

open FDSE "somefile" 1

get SIZE asize
print "Size(0): %SIZE%"
get SIZE asize 1
print "Size(1): %SIZE%"

goto EOF 1
SavePos OFFSET 1
print "%OFFSET%"         # Size(0)

goto SEEK_END 1
SavePos OFFSET 1
print "%OFFSET%"         # Size(1)

goto 0 1 SEEK_END
SavePos OFFSET 1
print "%OFFSET%"         # Size(1)

goto -1 1
SavePos OFFSET 1
print "%OFFSET%"         # Size(1) - 1


Also as far as I can see, if we are usind -w command-line option then the open command create a file if it doesn't exist and QuickBMS doesn't "terminates with an error if the file doesn't exist", also open FOLDER NAME FILENUM EXISTS will always set EXISTS to 1 in that case. I believe this is important enough to point it out in quickbms.txt.
And thanks for this, I guess - this behavior has more pros than cons (imho): if we need to create a file only if it doesn't exist and then open it (e.g. for "put") - we don't need append & log "file" 0 0 anymore; but we can't check if it already exists just with EXISTS var - but it's not a problem in most cases, cause we can compare its size with 0. Of course it could already exist with 0 size, but the existence of contents is usually more important than the existence of the file itself. Usually :)
Last edited by Zim on Mon Aug 31, 2015 12:25 am, edited 2 times in total.