let's say I read 0x32 and want it to print "00110010".
Code: Select all
get TEST byte
print ?
Code: Select all
get TEST byte
print ?
Code: Select all
get TEST byte
print "%TEST%"
aluigi wrote:There is no binary printing output in quickbms.
Code: Select all
0x12345678
305419896 0000000012345678 0000000000002215053170
0000000000000000000000000000000000010010001101000101011001111000
305419896 .4Vx 3.0541989600000000000e+008
00000000000000000102031011121320 18.52.86.120
JDIVTY SNFZ4 Wed 05 Sep 1979 22:51:36
0.00000000 1.508974781700064e-315
01 Jan 1601 00:00:30
aluigi wrote:If you need to convert a number in binary you can use a tool like my calcc:
http://aluigi.altervista.org/mytoolz.htm#calcc
Example for number 0x12345678:Code: Select all
0x12345678
305419896 0000000012345678 0000000000002215053170
0000000000000000000000000000000000010010001101000101011001111000
305419896 .4Vx 3.0541989600000000000e+008
00000000000000000102031011121320 18.52.86.120
JDIVTY SNFZ4 Wed 05 Sep 1979 22:51:36
0.00000000 1.508974781700064e-315
01 Jan 1601 00:00:30
It's not like having the output directly in quickbms but if you need to visualize only few numbers it's good.
Code: Select all
math VAR = 0x12345678
callfunction TOBIT 1
print "%STR%"
startfunction TOBIT
set STR string ""
for TMP = VAR != 0
xmath TMP2 "TMP & 1"
string STR + TMP2
next TMP u>> 1
string STR r STR
endfunction
aluigi wrote:A simple converter to bits is the following:Code: Select all
math VAR = 0x12345678
callfunction TOBIT 1
print "%STR%"
startfunction TOBIT
set STR string ""
for TMP = VAR != 0
xmath TMP2 "TMP & 1"
string STR + TMP2
next TMP u>> 1
string STR r STR
endfunction
That thing of counting the left zeroes depends, honestly quickbms is not done for these things
Code: Select all
startfunction TOBIT
set STR string ""
math TEST = 8
for TMP = NOTEBITS != 0
math TEST - 1
xmath TMP2 "TMP & 1"
string STR + TMP2
next TMP u>> 1
for i = 0 < TEST
string STR + 0
next i
string STR r STR
endfunction