Page 1 of 1

quickbms string xor then filexor

Posted: Sat Oct 20, 2012 3:57 pm
by finale00
I read in two strings

Code: Select all

getdstring str1 16
getdstring str2 16
Then I want to xor them

Code: Select all

string str1 ^= str2
Now I want to use the result as my filexor key

Code: Select all

filexor str1
log NAME OFFSET SIZE
filexor ""
But the result isn't right.

When I print out str1, it's just two bytes for some reason.
Is this the right way to do it?

This is the logic I want to reproduce

Code: Select all

for (int i = 0; i < size; i++)
   data[i] ^= str1[i % 16] ^ str2[i % 16]
So I should be able to xor the two strings first and then use the result for filexor'ing.

Re: quickbms string xor then filexor

Posted: Tue Oct 30, 2012 8:47 pm
by aluigi
use:
encryption xor str1

and if str1 contains some zeroes specify also its size
encryption xor str1 "" 0x10

filexor wants a hex string to work so it's not good in this case.