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 »

@HPAndroid
Can you provide some information about your system like available RAM and version of operating system?
And can you check if you have that problem even when you run quickbms from command-line?

Example:

Code: Select all

quickbms.exe C:\Users\Q.Viet\Downloads\Compressed\mod\fightnight.bms C:\Users\Q.Viet\Downloads\Compressed\mod\main.136.com.ea.game.fifa14_row.obb C:\Users\Q.Viet\Downloads\Compressed\mod\136
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 »

Ok I can replicate it :D
It's caused by something in the folders, the idea came when I have seen the paths you used in your test.

Current work-around:
Use a short folder name like c:\quickbms instead of your home folder.
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 »

Ok problem found.
It was a stupid bug in make_dir where an useless small buffer was used to contain the absolute path of the folder.
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 »

I have fixed everything and found also the reason of the 280 Mb... lz4x.c and lz4x_new.c, yes that code is hunger of memory because it's meant to be a stand-alone tool and not a library but still lot of memory for absolutely nothing.
Now the amount of total RAM taken by quickbms is... 60 Mb :D

Ah quickbms 0.9.2 will be released tomorrow.
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

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

Post by chrrox »

how do you use -p correctly?
I keep getting an error
- error in src\extra\xalloc.c line 618: xdbg_malloc()

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

and it seems once i get this I have to restart the process I was scanning to make it work again.

I am using a script like this.

Code: Select all

endian big
for
set MEMORY_FILE binary ""
FindLoc OFFSET string \x55\x6E\x69\x74\x79\x46\x53\x00\x00\x00\x00 0 ""
goto OFFSET
getdstring NULL 0x1E
get SIZE long
print "%OFFSET% %SIZE%"
log MEMORY_FILE OFFSET 0x400
putvarchr MEMORY_FILE SIZE 0x400
get SIZE2 asize MEMORY_FILE
print "%SIZE2%"
string NAME p "%08x." SIZE
if SIZE < 0x2000000
log NAME 0 SIZE MEMORY_FILE
endif
next
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 »

-p is used only for authorizing the usage of processes, for example if you use:

quickbms script.bms process://file.exe

it will ask you to specify -p

quickbms -p script.bms process://file.exe
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 »

QuickBMS 0.9.2 is now available.
bugmenot
Posts: 45
Joined: Sun Oct 09, 2016 6:27 pm

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

Post by bugmenot »

aluigi wrote:The problem is not directly related to quickbms but in Windows not liking multiple consecutive path delimiters.

For example:
- WORKS: "res/file.png"
- DOES NOT WORK: "res//file.png" or "res\\\\\\file.png"

Basically it's a problem happening probably only the 0.1% of times but I'm happy you found it :)

It will be fixed in 0.9.1

Ah I have seen your last edit, the problem with the utf8 folder is known and will be fixed too.

The problem is fixed. Thanks once again.
angeloyt
Posts: 1
Joined: Wed Dec 05, 2018 9:57 am

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

Post by angeloyt »

i need help im currently using windows 10 acer laptop and well everytime i try to open reimport.bat it opens for about 0.5 sec then crashes ive also tried other reimport.bat but the same thing happens, if you guys know any solutions or alternative please reply
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 »

@angeloyt
Can you post a screenshot with the details of the error?
you should probably have both an output from quickbms (in the black window) and one from Windows.

Then try this simple test, open reimport.bat and add -9 at the end, for example:

Code: Select all

quickbms.exe -G -w -r -9

Relaunch reimport.bat and tell me if it crashes.

If it doesn't crash it means it's a bug in one of your drivers or monitoring tools, this senseless behaviour has been fully documented some times and not related to quickbms, you can find info in section "6) Notes" of quickbms.txt
Nameless
Posts: 25
Joined: Tue Dec 20, 2016 8:18 pm

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

Post by Nameless »

Why such case gives error?

Code: Select all

set WORD string "test"
set TEST long 0
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 »

Because test is recognized as variable.
In quickbms variable names and variable contents are handled in the same way when read from the script because they are interchangable and quotes are optional.

The following are both the same:
set WORD string test
set WORD string "test"

Some versions ago I introduced a double check to avoid that a quoted text may be used as variable name in other locations:

Code: Select all

- Variable 1 ("test") at line 2 is constant but the script tries to edit it.
  Do you want to continue anyway (y/N)?
Nameless
Posts: 25
Joined: Tue Dec 20, 2016 8:18 pm

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

Post by Nameless »

Okay then. Not a big deal. Though sometimes qbms rules are really weird...
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 »

I agree with you.
The reason is that quickbms started in 2009 for supporting the original mexscript language where test and "test" are the same.
That's also why there are no escaped strings by default except where specified (search cstring in quickbms.txt).
And what about "idstring FILENUM TEXT" where all the other commands have FILENUM as last argument?
Overall everything works well and these small weird things don't give much problems, at least to me after over 2000 scripts :D
Nameless
Posts: 25
Joined: Tue Dec 20, 2016 8:18 pm

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

Post by Nameless »

Almost forgot about another issue. From my experience getvarchr doesn't accept signed types. Why? This forces me to make variables negative manually each time when I need it.

Also code like this doesn't work as expected:

Code: Select all

set VAR signed_short 0xFFFF
print "%VAR%"


I expect VAR to be -1, but it shows 65535. It seems like signed types work only with get command.
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 »

signed variables where added only for the Get command.
Added to my TODO for the next release.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

Code: Select all

  offset           filesize   filename
--------------------------------------
- enter in folder F:\Nexon\Need for Speed(TM) EDGE\Data\Win32
- open input file F:\Nexon\Need for Speed(TM) EDGE\Data\Win32\vehicles1.sb

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

*EH* ExceptionCode      c00000fd stack overflow
*EH* ExceptionFlags     00000000
*EH* ExceptionAddress   77497C97
                        77430000 + 00067c97 msvcrt.dll
*EH* NumberParameters   00000002
*EH*                    00000000
*EH*                    00642000

Last script line before the error or that produced the error:
  119 putarray 0 0 flag_02
whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
testing_grounds.7z is here if you want to test this mess
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 »

Because you are recursively calling the function dice_filesystem tons of times consuming all the stack.

Nested functions should never be invoked with the "1" argument that keeps the variables, except if there is a real reason for that.

In your case doesn't matter since with or without 1 it gets called forever.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

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

Post by AnonBaiter »

alright, so i decided to go from this

Code: Select all

      if flag_02 == 0x01
         get value variable4 filenum
         callfunction dice_filesystem 1
      elif flag_02 == 0x02
         get value variable4 filenum
         callfunction dice_filesystem 1
to this

Code: Select all

      if flag_02 == 0x01
         get value variable4 filenum
      elif flag_02 == 0x02
         get value variable4 filenum
because this whole "callfunction dice_filesystem" didn't work out too well regardless of "argument" and could force the interpreter to call it quits for larger(as in, beyond 1-3MB) .sb/.toc files anyway
and thanks to you no the bug has been fixed and the script can actually handle said files now
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 »

I think your code (without 1) was correct because that's how Arrays and Dbojectes should be handled in the Frostbite engine.
I use the same in my frostbite.bms script but I guess this NFS uses a slightly different format, after all TOC/SB are ever a mess.