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 [programming, scripting, quickbms.exe tool... NOT games]

Post by aluigi »

You see, you spotted a bug I introduced in the beta that it would have been hard for me to find.
The problem was caused by setting a pointer to NULL and then using it (output->sub_var->*)
Fixed in the local beta that I will upload in the week-end.

I really tought 4096 commands was an extremely big number but apparently I was wrong.
My longest script is probably next_car_game.bms which has 1500 commands.
I'm now checking if I can remove that limit by making the number of commands unlimited.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

Making the number of commands dynamic is a mess.
The only thing I can do is increasing the limit like 8k instead of the current 4k.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

Ah, the new beta is out in case you want to test the fixes.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

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

Post by Shokoniraya »

aluigi wrote:Ah, the new beta is out in case you want to test the fixes.

thank you sir aluigi
everything works great, i think it can be release
but there is a minor problem (minor? don't know what's going on in code, so forgive me if i don't have good notion)
using filter request overwrite
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

That's Windows console that makes a mess.
Use {} instead of * and it will work: -f "{}.png"
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

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

Post by Shokoniraya »

two problem

1) commenting

Code: Select all

get MY_VAR_1 long 0#comment 1
get MY_VAR_2 long#comment 2

Error: invalid datatype long#comment at line 2

Last script line before the error or that produced the error:
2 get MY_VAR_2 long#comment 2


adding # next to the syntax will cause this problem, but not in file number
not a problem and can solve it just with one space before #, but i reported it anyway...

2) using -f (filter)
i think filter option not working as well in newer betas, for example, i can use -f "*file_00_*" in older verions, but in last beta, it's not working (maybe in current betas too)
and i used {} too... but didn't worked

please check batch files in my attached file
all of batch files works fine in older versions (for example: 0.9.1)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

1)
yeah not really a problem :)

2)
I don't why it may have worked in older versions but on Windows I have never seen asterisks working in arguments due to how they get interpreted by the console, no matter if they are enclosed in quotes (that's the crazy thing indeed).
As already suggested, use ever {} instead of *.

P.S.: beta no longer exists now, please refer to version 0.11 for any report
Theboy
Posts: 1
Joined: Tue Apr 13, 2021 11:43 pm

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

Post by Theboy »

Keep getting a error when trying to extract a pak file in unreal tournament 4.

Code: Select all

error in src\extra\xalloc.c line 618: xdbg_malloc()

It says Error: memory allocation problem Not enough memory resources are available to process this command.
Using latest versions of both. Should have plenty of memory running it off a mobile workstation.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

@Theboy
It means the script is not compatible with your file.
The topic for any question/request/issue about UE4 is viewtopic.php?f=9&t=1005
donutstrash
Posts: 2
Joined: Thu Apr 29, 2021 1:25 pm

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

Post by donutstrash »

Keep getting this error when trying to extract an .npk file (signature "nxpk") with the nxpk.bms script:

Code: Select all

- error in src\extra\xalloc.c line 618: xdbg_malloc()

Error: memory allocation problem
       Not enough memory resources are available to process this command.


Game is "Super Mecha Champions" and here's a sample file: https://mega.nz/file/ciQ0SLjK#rDPSDDGwj ... OtZP95gKbc
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

@donutstrash
You are off-topic here because this section is not for games ("NOT games" in the title).

The provided file is probably encrypted, that's why the script fails.
There were also two topics on xentax where that "Super Mecha Champions" is mentioned without any solutions.
donutstrash
Posts: 2
Joined: Thu Apr 29, 2021 1:25 pm

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

Post by donutstrash »

aluigi wrote:@donutstrash
You are off-topic here because this section is not for games ("NOT games" in the title).

The provided file is probably encrypted, that's why the script fails.
There were also two topics on xentax where that "Super Mecha Champions" is mentioned without any solutions.


Ah, I apologise for that. And okay, thank you!
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

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

Post by z4ruz »

-X experimental hex viewer output on the console (support Less-like keys)

am i understand correctly:
it is supposed to view dump of extracted data only. features:
write number - goto offset
enter - go to next 10
^ to skip file

i was thought it can be used as hexdump, but without extraction it output zeros, except for scenario like this:

Code: Select all

quickbms.exe -X -s "get asz asize; getdstring var asz" "" file


not a bug, but related:

Code: Select all

for
getdstring INPUT 16
print "%INPUT|dump%"
next

This script outputs too many new lines. How can I fix that?

Code: Select all


  54 19 f0 ba 04 00 00 00 06 00 00 00 00 00 96 c0   T...............


  5d 1b 00 5e 00 66 6c 6f 61 74 69 6e 67 5f 72 6f   ]..^.floating_ro


  63 6b 5f 63 69 74 79 5f 31 39 32 30 78 31 32 30   ck_city_1920x120




does all errors in readme go here too?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

-X should never be used because it was an experimental mode which is very slow, output example below:
Image

What you want to use is -V -0, all my analysis is done by using these two options:

Code: Select all

quickbms -V -0 script.bms file.pak



You are right about the additional line feed as visible from cmd.c line 2829:

Code: Select all

                    PRINT_FPUTC('\n')
                    PRINT_SHOW_DUMP(var, len)
No idea why I added that line feed there because there is none elsewhere.
But it should not be a real problem I think since it's only a visualization for you.
Anyway there is ever a work-around ;)

Code: Select all

for
getdstring INPUT 16
string TMP P "%INPUT|dump%"
string TMP << 1
print "%TMP%"
next



Yes, feel free to report any problem of the readme here in this same topic.
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

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

Post by z4ruz »

Thank you.

Readme:

Links on cstring:
http://msdn.microsoft.com/en-us/library ... 80%29.aspx - redirects to Download Visual Studio 2005 Retired documentation
http://www.acm.uiuc.edu/webmonkeys/book ... e/1.1.html - dead
Archive.org can be used, but there might be more actual resources.

line # 3046: saepos OFFSET

I think readme can be more handy, like the .chm help files with bookmarks, indexing; or pdf/md with TOC; html. There might be separate tool for interaction with readme and navigation.

---

\x00 doesn't shows in the end of dump; breaks print of reversed dstring + 0H

getdstring var 4
string var1 0H var
print "%var1%"
string var2 r var
string var2 0H var2
print "%var2%"
print "%var|dump%"

\x03\x00\x02\x00
\x03
03 00 02 ...

Also I was surprised getdstring ignores endian.

So far I ended up with this: helper.bms. Would be glad and interested to see alternative solutions, in C as well.

---

while printing as hex, number of characters is always same
get var long;
print %var|1h% # 0x00010203 -
print %var|1% # 6 + # also works with -x switch

---

Some examples on using String VAR S *, please?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

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

Post by spiritovod »

@z4ruz: Consider all string operations in quickbms as operations with null-terminated string, with all consequences. Not really a bug, but if you're converting strings with zero bytes and expecting them to still be there, you should use "0" to escape all bytes. So, in your example "string var2 r var" -> "string var2 0r var" will do. As for dump, I think the problem is around the same, but for example, you can use something like [math SIZE = 4, getdstring var SIZE, ... , print "%var|dumpSIZE%"].
johnz1
Posts: 14
Joined: Thu Jan 17, 2019 4:00 am

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

Post by johnz1 »

Hello

I just upgraded QuickBMS from 0.10.1 to 0.11. I'm running into a problem with reimport (the original, not reimport2 or reimport3). 9 out of 743 files that used to be able to be reimported are now failing because the compressed size is too big. If I switch back to 0.10.1, they all can be reimported without an error. I'm using "nbajamfire.bms" 0.2.3a with QuickBMS to reimport texture files.

I don't see anything in the 0.11 release notes about changing the compression algorithms. I've also noticed that the reimport in 0.11 is much faster than 0.10.1 - which is nice!

Thanks
z4ruz
Posts: 75
Joined: Sun Jan 10, 2021 2:23 pm

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

Post by z4ruz »

Thanks, spiritovod, worked like a charm.

1) xmath issues with array elements.

The sample:
01 00 00 00 02 00 00 00

The script:

Code: Select all

for i = 0 < 1
get ts[i] long
get to[i] long
xmath off_max "ts[i]+to[i]"
next i

The result:
1 + 2 = -1047988322

Options to get correct result:

a. Use math instead

Code: Select all

math ts[i] + to[i] 
# OR:
set off_max ts[i]
math off_max + to[i]

b. Operate xmath on non-array values

Code: Select all

set a1 ts[i]
set a2 to[i]
xmath off_max "a1 + a2"

c. Exotic:

Code: Select all

goto to[i]
goto ts[i] 0 SEEK_CUR
savepos off_max

2) Print array elements as hex issues:

Code: Select all

print "%ts[i]% | hex: %ts[i]|x%" # 1 | hex: 31

3) log size is output as decimal even with -x

4) readme typo at line 4049:
MYFUNCTION_ARG1 amd MYFUNCTION_ARG2.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

@z4ruz

1/2) ok I will check if I can fix them in next release

3) not sure if this is an error, you mean the visualization, right?
Like " 00000000 123 test.txt" to " 00000000 7b test.txt"?

4) ok
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

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

Post by aluigi »

@johnz1
Interesting. I did change the level of compression for zlib data but I limited it to reimport2 only, using a faster less compressed solution.
Since you are experiencing that problem I guess I did a mistake and so reimport uses the same feature.
I will check and fix in next version.