Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

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

Featured Replies

  • Author
  • Localization

Shokoniraya, posted Sun Feb 28, 2021 11:33 am (62554)


aluigi wrote:
"include" only works with constant filenames because they get immediately loaded while parsing the script.

can you please make it work with string variables in next beta? please fix it to use string var. please...
it's really needed

or atleast make a option to read include script from exe folder instead of bms folder
like this
Code:
include "my_script.bms" 1

1 for reading from exe folder and 0 from bms folder (default)
  • Replies 671
  • Views 51
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

aluigi, posted Mon Mar 01, 2021 10:12 am (62583)


It's a core function so I can't implement string variables.

While for the second request, "include" already does that automatically.
When you use include "file.bms" it will try the following locations in this order:
- bms_folder
- exe_folder
- file_folder
- current_folder
- output_folder

Isn't your file loaded automatically?

Here it works perfectly, just tested.
  • Author
  • Localization

Shokoniraya, posted Mon Mar 01, 2021 1:11 pm (62593)


core function? so many things will messed up if you touch it, i understand

works fine... but can you add a option to force using of a default location? i mean make it optional by adding number
or better, use types!
like below command
Code:
include "my_script.bms" exe_folder

for when we have same bms name in both exe folder and bms folder
  • Author
  • Localization

aluigi, posted Mon Mar 01, 2021 4:30 pm (62597)


It's possible to add that argument but honestly it's not useful at all.
The include feature is rarely used and 100% of times the name of the script is different than the main script, so what would be the advantage?
  • Author
  • Localization

Shokoniraya, posted Tue Mar 02, 2021 11:49 am (62617)


it's useful when we have same bms names in different folders

and can you do something about putdstring command to use default size of variable? i mean without writing length and just set it to "" to use real size of variable
Code:
getdstring MY_STRING 5

putdstring MY_STRING ""





found two problem (tested with last beta)

1) 0x for hex numbers
Code:
set MEMORY_FILE1 binary "0xFE"
goto 0 MEMORY_FILE1
getdstring HEX_NUMBER 4
if HEX_NUMBER = "0xFE"
print "value is right!"
endif

i know 0x used for hex numbers, but has problem with if command as string type

2) writing ] at end of a string that starts with [ while using a function (or [string])
there is no problem out of function, problem happens when used in a function
Code:
set MEMORY_FILE1 binary ""
goto 0 MEMORY_FILE1
callfunction PUT_STRING

startfunction PUT_STRING
putdstring "[a]" 2 MEMORY_FILE1
endfunction PUT_STRING
  • Author
  • Localization

spiritovod, posted Tue Mar 02, 2021 3:24 pm (62623)


@Shokoniraya:
1) Improper usage, should be: "getdstring HEX_NUMBER 4 MEMORY_FILE1". Also, it's not correct in general, since cstring looks different.
2) Also improper usage, should be: "putdstring "[a]" 3 MEMORY_FILE1" (since there are 3 characters in the string). A waaay more incorrect than the case above in general.
Just fyi, a lot of your "code" is working only because of casts and workarounds in quickbms. In all other languages you would be screwed around first few lines of the code. Please don't make this topic a generic stackoverflow board.
  • Author
  • Localization

Shokoniraya, posted Tue Mar 02, 2021 6:07 pm (62627)


1)
Code:
set MEMORY_FILE1 binary "0xFE"
get MEM_SIZE1 asize MEMORY_FILE1
print "%MEM_SIZE1%"
getdstring HEX_NUMBER 4 MEMORY_FILE1
if HEX_NUMBER = 0xFE
print "value is right!"
endif

0xFE readed as a hex number, but if i add ED to 0xFE ("0xFE" to ""0xFEED"), it will be read as real string, but if 0x works as hex, then why it's turn to real string instead of \xFE\xED in outupt?

2) spiritovod, code is correct (based on QuickBMS capabilitys), problem happens in function
Code:
set MEMORY_FILE1 binary ""
goto 0 MEMORY_FILE1
putdstring "[a]" 2 MEMORY_FILE1
get MEM_SIZE1 asize MEMORY_FILE1
log test 0 MEM_SIZE1 MEMORY_FILE1



i know you trying to help, but please check everything and spot people situation before getting mad on someone, i really appreciate your help, guys like sir aluigi and you (and others, sorry i don't have all names) keeping this forum up
unfortunately, QuickBMS has a limitation and can't write more that 4096 lines (am i right? tell me if i wrong), but to be honest, it will be so heavy to compute for long scripts (about QuickBMS) and i can't and don't have much time to do everything by hand, i know how C or other languages works, QuickBMS is a compatible language and you can't just do such things in any language, if i want to create a program with assembly language, i have to spend a lot of time to write many mechanism, that is why QuickBMS is a fast way to do it, a good io and file processor, i know all of this things, please don't make me wrong or a unwise guy
  • Author
  • Localization

spiritovod, posted Tue Mar 02, 2021 6:52 pm (62629)


@Shokoniraya: Scroll up to the case with jumping into "for" cycles. You're getting those results because you're using those functions in a wrong way from the beginning. But instead of "why it doesn't work for me", you're implying that it's quickbms problem - while in 90% cases it's your own problem, who don't understand basic programming logic and it seems you don't want to understand and simply relying on alugi's help for creating more workarounds for your sake. I'm not even close to being mad, but for now this topic looks more like support-for-a-single-person thread with weird requests most of the times.
  • Author
  • Localization

Shokoniraya, posted Tue Mar 02, 2021 10:35 pm (62632)


yes, jumping into a for-next was a stupid thing, but some of them was idea for next release or problem reporting, and they solved with newer beta version, how can i learn it without learning. and it's a forum, someone can read those comments in future and learn some things, just like what people doing with books
programing logic? programing means turning human-reading algorithim to logic mechanism (look at your keyboard or thouch screen, or monitor, it's power and mechanism, anything can be done with mechanism), just like droping domino in any way you want, and know that im doing this as a hobby, i have my own job and own stuff, im not doing this for money or dealing, never! i don't want to push on someone or make him upset, so my sake is my hobby and caring about this programming idea
i don't have any other reason to telling you, spiritovod, and please don't make this post to a back-talk chat page, and i aplogize you if make you sad, im not good at talking with people

to sir aluigi
im just doing this to brought you some idea for next versions of QuickBMS and probably bugs and my hobby, you can rewrite your project and turn it to a fast and powerful language in future (fast, i mean fast scripting), but if you think im making you sad or harming you, please delete my account from your website and database, im not gonna sad
i never used anyone, this is my last comment. sayonara
  • Author
  • Localization

aluigi, posted Wed Mar 03, 2021 11:10 am (62640)


@Shokoniraya
I'm super happy of your contributions, really.
I can even state that you have helped the development of quickbms more than anyone else with your suggestions and bug reports (me included).

Indeed in the beta I have added tons of the things you suggested in the last year.
So for me it's all ok, go forward showing any doubts and suggestions, and then we discuss them together and check if and how implement them.
Don't worry if we get mad at you :D


I like the idea of putdstring VAR -1 and it's easy to implement with just one line of C code (already added in my local beta).
The only "problem" is that putdstring uses a variable as input and not a C string, in short "putdstring "\x41\x42" 2 MEMORY_FILE" will write \x instead of AB.
In case of negative size (you suggested "" but it would be 0 so better to use -1) the size will be the NUL-delimited string keeping zeroes out.
I can bypass that limitation (in case the user needs binary data) with the -J option available also in the quickbmsver command.


Regarding the question of 0xFE I guess you should first convert/cast the string to number with: math NUM = STRING

I don't see any problem with 'putdstring "[a]" 3' since the output is just [a] as expected, there is no mess caused by multidimensional arrays.

I'm not aware of any limitations about 4096 lines but please show me how to replicate the problem.
  • Author
  • Localization

Shokoniraya, posted Wed Mar 03, 2021 8:24 pm (62648)


i don't know what to say, words not enough...
thank you, you have a great heart, but seeing this kind of judgment make me sad when it's not true

(tested with last beta)
that the error of limtation
Error: the BMS script uses more commands than those supported by this tool (4096 / 4096)

and about ] (or [string]) inside a function
here cmd command "quickbms.exe" "script.bms" "script.bms"
any other string can be write but not if starts and ends with [ and ], or if contain such string (like "my[a]string"), but empty [] is fine, like "my[]text"
Code:
set MEMORY_FILE1 binary ""
goto 0 MEMORY_FILE1
callfunction PUT_STRING

startfunction PUT_STRING
putdstring "[a]" 3 MEMORY_FILE1
endfunction PUT_STRING

-------------------
An error or crash occurred:

*EH* ExceptionCode c0000005 access violation
*EH* ExceptionFlags 00000000
*EH* ExceptionAddress 001B944A
000D0000 000e944a quickbms.exe
*EH* NumberParameters 00000002
*EH* 00000001
*EH* 00000008

Last script line before the error or that produced the error:
3 callfunction PUT_STRING
coverage file 0 0% 0 157 . offset 00000000
  • Author
  • Localization

aluigi, posted Wed Mar 03, 2021 10:25 pm (62649)


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.
  • Author
  • Localization

aluigi, posted Thu Mar 04, 2021 7:48 am (62659)


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.
  • Author
  • Localization

aluigi, posted Mon Mar 08, 2021 10:34 pm (62741)


Ah, the new beta is out in case you want to test the fixes.
  • Author
  • Localization

Shokoniraya, posted Sat Mar 20, 2021 9:38 am (62945)


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

name_test.zip

  • Author
  • Localization

aluigi, posted Sat Apr 03, 2021 2:38 am (63189)


That's Windows console that makes a mess.
Use {} instead of * and it will work: -f "{}.png"
  • Author
  • Localization

Shokoniraya, posted Mon Apr 05, 2021 1:06 pm (63231)


two problem

1) commenting
Code:
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)

filter_test.zip

  • Author
  • Localization

aluigi, posted Mon Apr 05, 2021 5:35 pm (63236)


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
  • Author
  • Localization

Theboy, posted Wed Apr 14, 2021 12:19 am (63362)


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

Code:
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.
  • Author
  • Localization

aluigi, posted Wed Apr 14, 2021 11:23 am (63370)


@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
  • Author
  • Localization

donutstrash, posted Thu Apr 29, 2021 1:30 pm (63641)


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

Code:
- 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
  • Author
  • Localization

aluigi, posted Sat May 01, 2021 7:10 pm (63694)


@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.
  • Author
  • Localization

donutstrash, posted Sat May 01, 2021 10:25 pm (63698)


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!
  • Author
  • Localization

z4ruz, posted Wed Jun 02, 2021 2:52 am (64419)


Quote:
-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:
quickbms.exe -X -s "get asz asize; getdstring var asz" "" file


not a bug, but related:

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

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

  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?
  • Author
  • Localization

aluigi, posted Wed Jun 02, 2021 6:58 pm (64444)


-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:
quickbms -V -0 script.bms file.pak



You are right about the additional line feed as visible from cmd.c line 2829:
Code:
                    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:
for
getdstring INPUT 16
string TMP P "%INPUT|dump%"
string TMP print "%TMP%"
next



Yes, feel free to report any problem of the readme here in this same topic.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.