its possible to pass small script to QuickBMS directly

Doubts, help and support about QuickBMS and other game research tools
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

its possible to pass small script to QuickBMS directly

Post by gameside »

Hi, I want to know its possible to don't use bms file and instead pass script to exe itself?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: its possible to pass small script to QuickBMS directly

Post by aluigi »

there is a way via command-line, example:
quickbms -0 -V -s "get DUMMY long ; get DUMMY2 long" "" file.dat

-0 -V are used only for debugging purposes.

Other real examples (also reported in quickbms.txt):

Code: Select all

  quickbms.exe -s "comtype zlib ; get ZSIZE asize ; xmath SIZE \"ZSIZE * 10\" ; clog \"dump.dat\" 0 ZSIZE SIZE" "" input_file.dat output_folder
  quickbms.exe -s "comtype gzip_compress ; get SIZE asize ; clog new.gz 0 SIZE SIZE" "" YOUR_INPUT_FILE


There is even a way to embed a script inside quickbms.exe and it will be used by default without asking to select a script:

Code: Select all

C] Modkit distribution of quickbms.exe
--------------------------------------

In response to a request of a modder, I have decided to add a
simple feature to allow modders and modkits developers to embed a
script in quickbms.exe when they distribute it in their products,
so the user will not be asked to select the script.

How to do it:

- open quickbms.exe with a hex editor
- search the string "SET THIS BYTE X TO 0x00"
- replace the 'X' (0x58) with a NULL (0x00):
  53 45 54 20 54 48 49 53 20 42 59 54 45 20 58 20   SET THIS BYTE X
  53 45 54 20 54 48 49 53 20 42 59 54 45 20 00 20   SET THIS BYTE 

- upx.exe -9 quickbms.exe

- copy /b  quickbms.exe  +  script.bms   output.exe

That's all, anyway if you want to use the "classical" way and being
able to specify options, input file and output folder, it's better
to use the BAT solution with the -G option for the GUI mode:

  EXTRACT.BAT:
    quickbms.exe -G OPTIONS SCRIPT INPUT OUTPUT
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

Re: its possible to pass small script to QuickBMS directly

Post by gameside »

thank you, its exactly what i wanted