Copy and paste?

Doubts, help and support about QuickBMS and other game research tools
OwocekTV
Posts: 33
Joined: Fri Feb 20, 2015 7:24 pm

Copy and paste?

Post by OwocekTV »

Is there any function in QBMS script to copy from file some bits and paste them to other place or other file?
Something like 838286568
copy "28" or copy 0x4-0x5
if not, it would be really useful, thanks :D
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Copy and paste?

Post by aluigi »

The String command allows to manipulate strings and you can use something like:

Code: Select all

set VAR string "838286568"
string VAR << 3
string VAR >> 4
print "%VAR%"
The operators of the String command are not intuitive but with some tests you can reach your result.
OwocekTV
Posts: 33
Joined: Fri Feb 20, 2015 7:24 pm

Re: Copy and paste?

Post by OwocekTV »

Oh thanks, It's works nicely!
Also, is there a command to put var into a new file?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Copy and paste?

Post by aluigi »

Yes, quickbms has both "get" and "put" commands :)
I suggest you to use Put with a memory file to make things easier:

Code: Select all

set VAR string "838286568"
string VAR << 3
string VAR >> 4
print "%VAR%"

log MEMORY_FILE 0 0 # initialize
putct VAR string -1 MEMORY_FILE # because put string adds also a 0x00 byte
put 0x0d byte MEMORY_FILE # carriage-return (optional)
put 0x0a byte MEMORY_FILE # line-feed (optional)

get SIZE asize MEMORY_FILE
log "dump.txt" 0 SIZE MEMORY_FILE