quickbms base64

Doubts, help and support about QuickBMS and other game research tools
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

quickbms base64

Post by chrrox »

how would i get quickbms to decode
"3B%2FSyp2P5gvIlf3bAxXj8pcBjnm4jS2aoXDtLE7nY94%3D"
into
"\xDC\x1F\xD2\xCA\x9D\x8F\xE6\x0B\xC8\x95\xFD\xDB\x03\x15\xE3\xF2\x97\x01\x8E\x79\xB8\x8D\x2D\x9A\xA1\x70\xED\x2C\x4E\xE7\x63\xDE"
also is there a better way to do this operation?

TMP equals "109E6CC5199B3EA8223385618408649DAC033AB1"
and I want to split it into
109E6CC5
199B3EA8
22338561

Code: Select all

string TMP p "%s" QUICKBMS_HEXHASH
string TMP - 16
set KEY0 TMP
set KEY1 TMP
set KEY2 TMP

string KEY0 > 16
string KEY1 > 8
string KEY1 < 8
string KEY2 < 16

print "%KEY0%"
print "%KEY1%"
print "%KEY2%"

set TMP string "$"
string TMP += KEY0
set TKEY0 long TMP

set TMP string "$"
string TMP += KEY1
set TKEY1 long TMP

set TMP string "$"
string TMP += KEY2
set TKEY2 long TMP

print "%TKEY0%"
print "%TKEY1%"
print "%TKEY2%"
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: quickbms base64

Post by aluigi »

I have the impression that there are two different questsions there, anyway this script should answer both (???):

Code: Select all

set VAR string "3B%2FSyp2P5gvIlf3bAxXj8pcBjnm4jS2aoXDtLE7nY94%3D"
string VAR w VAR    # URL encoding (%2F)
string VAR U VAR    # base64
getvarchr KEY0 VAR 0 long
getvarchr KEY1 VAR 4 long
getvarchr KEY2 VAR 8 long
print "%KEY0|X%"
print "%KEY1|X%"
print "%KEY2|X%"
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: quickbms base64

Post by chrrox »

Yes I had 2 questions lol.
The base64 command worked perfectly.
The 2nd part worked but was not what i was looking for.
I want to take a string and get the first 8 characters of it 3 times
and convert that into a number.
"109E6CC5199B3EA8223385618408649DAC033AB1"
becomes
0x109E6CC5
0x199B3EA8
0x22338561
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: quickbms base64

Post by aluigi »

Code: Select all

set VAR string "109E6CC5199B3EA8223385618408649DAC033AB1"
string VAR h VAR    # URL encoding (%2F)
endian big
getvarchr KEY0 VAR 0 long
getvarchr KEY1 VAR 4 long
getvarchr KEY2 VAR 8 long
print "%KEY0|X%"
print "%KEY1|X%"
print "%KEY2|X%"
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: quickbms base64

Post by chrrox »

That worked great thanks :D