Possible next features of QuickBMS

Doubts, help and support about QuickBMS and other game research tools
saeid0034
Posts: 40
Joined: Sat Mar 14, 2020 7:17 pm

Re: Possible next features of QuickBMS

Post by saeid0034 »

Hi, today I'm testing something whit QuickBMS, in my test I use print many time to know how my script work and get some of variable
During these tests, something came to my mind, what if QuickBMS support something like pause?, when ever we call it, its stop running script until user press some button (just like how its work in cmd and...) i think its can be handy
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

use -V option, it helps alot
and read your script carefully and rewrite it if it's possible
you can also use cleanexit command to exit script (kill process)
read quickbms.txt too, it has many useful things
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

Code: Select all

quickbms.exe -0 -V script.bms file | less

This is what I use for all my works where script.bms is just a work-in-progress script with few "get"s to test what I see with the hex editor.

"less" is part of the cygwin suite that I highly suggest, it's used to keep view the output on the screen and moving backward and forward... something like a pause.

-0 is the option that does not extract any file
-V is the verbose option for debugging purposes (while -v is for scripting and not useful)

That's all :D
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

New beta available.

I added the possibility of specifying multiple arguments in getarray and putarray, example:

Code: Select all

        putarray 0 i NAME OFFSET SIZE
        getarray NAME OFFSET SIZE 0 i

it's the same of:

Code: Select all

        putarray 0 i NAME
        putarray 1 i OFFSET
        putarray 2 i SIZE
        getarray NAME   0 i
        getarray OFFSET 1 i
        getarray SIZE   2 i

I also added the possibility of typing the own content of a variable using: get VAR ???
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

sir alugi, i have a idea for next version of QuickBMS
can you make a repdstring command to replace a number of bytes in file? at first look, it's not useful and importing will does the job, but this command is really helpful in MEMORY_FILE file if we want to replace a few bytes in MEMORY_FILE
repdstring (replace dstring), just like reimport3, for increasing MEMORY_FILE without creating other MEMORY_FILE

for example:

Code: Select all

repdstring MY_STRING 0 MEMORY_FILE2
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

Are you talking about "putdstring"?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

A new beta is available, mainly focused on compatibility with non-Windows platforms and other compilers (clang) and versions of gcc.
For example now it compiles natively on Termux for Android and supports oodle on Linux x86.

I don't have other things to fix or features to add.

My plan is to find some time and desire for answering all the topics in the Game Archive section because it forces me to test quickbms on many file formats and spotting possible errors.
After that I will release the new version.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

im talking a about a command that can increase/inlarge MEMORY_FILEs by replacing a binary variable (for example, a new command with name: repdstring) that can works on both MEMORY_FILE and real files

for example, MEMOEY_FILE1 is "\x0A\x0B\x0C\x0D\x0E"
and we are going to replace some bytes,
MY_BINARY is "\x0F"

Code: Select all

goto 0 MEMOEY_FILE1
repdstring MY_BINARY 3 MEMOEY_FILE1


now, result of MEMOEY_FILE1 is "\x0F\x0D\x0E"
that means we replaced first three byte of MEMOEY_FILE1 with MY_BINARY

it's possible to do this by creating another MEMORY_FILE and append command
but it will saves alot of time and it's faster

and about putdstring, something that really needed is putdstring MY_BINARY ""
set "" instead of a number should act like default size of variable and no need to set length of variable
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

I had in mind to change the behavior of the put* commands if append is enabled.
For example just like with a hex/text editor where the current mode is "overwrite" and in append mode it will become "insert".

Example:

Code: Select all

set MEMORY_FILE binary "0123456789"
goto 4 MEMORY_FILE
append
putdstring "hello" 3 MEMORY_FILE
append
get SIZE asize MEMORY_FILE
log "output.dat" 0 SIZE MEMORY_FILE

I will work on it soon (also because I found a bug with set MEMORY_FILE string in the beta...)
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

sir aluigi, is it possible to implemente single line mode in bms files?

Code: Select all

print "message_1" ; print "message_2"
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

i think QuickBMS can be more optimizer and faster

i did a test for file exporting speed in my system

dump_1.bat (normal dumping) = 24 sec
dump_2.bat (with reserved memory, i mean memory file) = 28 sec

also, there was a lot of operation in dump_2.bms, but there is no any of them in dump_1.bms, i mean storing a few byte in memory and then dumping them at once is faster and better


for example, i remember some ps2 games (talking about old days), there was some games that no loading page included in them or loading was very very faster than other games, such as god of war or ben 10 the protector of earth
data files was readed 2048 by 2048 (or 4096 by 4096?)
maybe i am wrong just about theory of this (not about mechanism and result), but most of games or programs that has padded size or padded offset are fast

maybe QuickBMS can have such option as a new feature
Last edited by Shokoniraya on Mon Feb 15, 2021 6:15 am, edited 2 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

The new beta fully implements the Append + Put* idea.

The one-line scripts work only with the -s option.
I can't support it in the script file.

dump_test.7z is password protected.
Anyway I don't think I can improve much the performance of quickbms without rewriting most of its core (which I'm not going to do)
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: Possible next features of QuickBMS

Post by Shokoniraya »

sorry, password removed. you can check it now
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

Interesting, the problem affects quickbms_4gb_files only because quickbms.exe takes just 5 seconds.
This is going to be a nightmare to figure out...
Good finding btw, it needs to be fixed for sure.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

I think it was only related to disk caching because now the time is the same.
So no problem I suppose.
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: Possible next features of QuickBMS

Post by chrrox »

can you expose PKCS #5 from tomcrypt_pkcs.h
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

If only I would know how to implement it in the Encryption command :D
I think there is no problem to add pkcs_5_alg* but that pkcs_1* is a mess.

I still have to check the other old topic you opened, let me know what else I can add and I will check it ;)
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Possible next features of QuickBMS

Post by tbmq008 »

first of all, i would like to know if there is a similar feature for the getdstring feature except for when it accepts various character encodings other than just ASCII.
i've stumbled upon a unreal pak file that uses various utf16 strings and there are "name size" values placed before them.

if there isn't, what kind of workaround do i have to implement to get around something of that sort.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Possible next features of QuickBMS

Post by aluigi »

I guess you refer to the codepage, if it's a japanese game it'e enough to use the "codepage 932" command at the beginning of the script (or as command-line option -P 932).
tbmq008
Posts: 62
Joined: Thu Nov 26, 2020 2:13 pm

Re: Possible next features of QuickBMS

Post by tbmq008 »

OK

all i want is for quickbms to cover up all available utf16 chars, not by invoking this "get NAME unicode" command, but by something like this

Code: Select all

codepage 1200 # utf16
get name_size long
getdstring base_path name_size
and yet, for whatever reason, i get results like this

Code: Select all

. 0000000000000058 getdstr base_path  "." 10
    2e 00 2e 00 2f 00 2e 00 2e 00                     ..../.....
i should be getting something like this

Code: Select all

. 0000000000000058 getdstr base_path  "../../../" 20
    2e 00 2e 00 2f 00 2e 00 2e 00 2f 00 2e 00 2e 00   ..../...../.....
    2f 00 00 00                                       /...