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
Copy and paste?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Copy and paste?
The String command allows to manipulate strings and you can use something like:
The operators of the String command are not intuitive but with some tests you can reach your result.
Code: Select all
set VAR string "838286568"
string VAR << 3
string VAR >> 4
print "%VAR%"
-
- Posts: 33
- Joined: Fri Feb 20, 2015 7:24 pm
Re: Copy and paste?
Oh thanks, It's works nicely!
Also, is there a command to put var into a new file?
Also, is there a command to put var into a new file?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Copy and paste?
Yes, quickbms has both "get" and "put" commands
I suggest you to use Put with a memory file to make things easier:
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