Is it possible to use quickbms to have a script that can scan multiple files and dump 16bytes long hashes/hex values and save them to a txt file?
Lets say I have multiple samples as example below where starting offset is 20, from where I want the hash to begin and end in 16bytes long to be saved each hash string in one line.
QuickBMS to dump hex values, or hashes
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: QuickBMS to dump hex values, or hashes
It's a bit more complicated that what it looks like and it depends by how do you want to store the hash in the output file, I mean the format (probably just a sequence of 00112233...ff)
-
- Posts: 104
- Joined: Wed Mar 23, 2016 5:11 am
Re: QuickBMS to dump hex values, or hashes
Oh I didn't know it could be complicated, all I wanted was what you see highlighted to be saved as it is.
The search function would reach offset 0x20 in this sample above, obviously I would have to change offsets depending on input or the byte length I want to be saved.
And starting that offset to save 16 bytes as are seen, no special formatting, spaces or other fancy output:
Then it would scan next file and save the hash in another line, so on and so forth.
But based on your sequence example its same thing, right?
The search function would reach offset 0x20 in this sample above, obviously I would have to change offsets depending on input or the byte length I want to be saved.
And starting that offset to save 16 bytes as are seen, no special formatting, spaces or other fancy output:
Code: Select all
32F61FB3097C71DA784036D129061CC7
next file hash
next file hash
etc
Then it would scan next file and save the hash in another line, so on and so forth.
But based on your sequence example its same thing, right?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: QuickBMS to dump hex values, or hashes
So you can just use this simple script:
quickbms.exe script.bms folder > list.txt
Code: Select all
goto 0x20
set HASH string ""
for x = 0 < 16
get TMP byte
string TMP p "%02X" TMP
string HASH + TMP
next x
print "%HASH%"
quickbms.exe script.bms folder > list.txt
-
- Posts: 104
- Joined: Wed Mar 23, 2016 5:11 am
Re: QuickBMS to dump hex values, or hashes
Thank you so much, it works great.
And if I need in a file to save between 3 up to 7 hashes, is this correct, or theres a better way?
And if I need in a file to save between 3 up to 7 hashes, is this correct, or theres a better way?
Code: Select all
goto 0x110
set HASH string ""
for x = 0 < 16
get TMP byte
string TMP p "%02X" TMP
string HASH + TMP
next x
print "%HASH%"
goto 0x1C0
set HASH string ""
for x = 0 < 16
get TMP byte
string TMP p "%02X" TMP
string HASH + TMP
next x
print "%HASH%"
goto 0x270
set HASH string ""
for x = 0 < 16
get TMP byte
string TMP p "%02X" TMP
string HASH + TMP
next x
print "%HASH%"
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: QuickBMS to dump hex values, or hashes
Code: Select all
callfunction DUMP 1 0x110
callfunction DUMP 1 0x1C0
callfunction DUMP 1 0x270
startfunction DUMP
goto DUMP_ARG1
set HASH string ""
for x = 0 < 16
get TMP byte
string TMP p "%02X" TMP
string HASH + TMP
next x
print "%HASH%"
endfunction
-
- Posts: 104
- Joined: Wed Mar 23, 2016 5:11 am
Re: QuickBMS to dump hex values, or hashes
Thank you, definitely a cleaner way of doing it.