PDA

View Full Version : bitwise op question


g0dmoney
12-30-2003, 09:43 PM
hey guys, quick question. I have 4 values, the first 2 values are xor'd by 2 different numbers and the second set of values are xor'd by 2 other different numbers, both lower than the first two.. looks kinda like this:

xor eax,23556958
xor ecx,24390341
push eax
push ecx
.
.
xor eax,14336985
xor ecx,10032531

how can i make the result in the second xor eax equal to the result of the first, and the result of the second xor ecx equal the first? its got me stumped and its prolly somethin really easy im not finding.. the way i explained it may sound fucked up.. sorry if so, i can explain better after some sleep prolly ;p if anyone can help me figure out what i need to do i'd be thankful =]

take care.. gM

sna
12-31-2003, 08:15 AM
first of all you need to decide what you want the result to be.. 0xDEADBEEF ?

xor eax, 0x23556958 = 0xDEADBEEF

so in other words

X ^ 0x23556958 = 0xDEADBEEF

which can be re-written as, and solved

X = 0xDEADBEEF ^ 0x23556958 = 0xFDF8D7B7


using the same technique for your second eax xorer will get you

X = 0xDEADBEEF ^ 0x14336985 = 0xCA9ED76A


cheers sna

g0dmoney
12-31-2003, 02:54 PM
thanks m8 =] didnt think it could be that easy, but you gave a great explanation.. cheers

gM