So, generalised, you want to get ther value of c from the equation a=((longlong)(b+((b/4)+(b*32)+c))%(longlong)pow(2.0, 32)*
Right?
*right-shifiting by x is the divizion by 2x, left-shifting my x is multiplying by 2x and xoring is addition with modulo the number of compinations with that data type.
Cool, but there's only one problem. It's not an equation! that doesn't mean that when you xor x with (x>>2)+(x<<5)+y you again get x! You ahve to think of the x on the left side of the equation ,and the xs on the right size of the equation as different variables!
Depending on how information you have to work with, the problem may or may not have a solution.
If all you have is the final value of X, then there's no solution because the operation is destructive. The combination of addition and XOR loses information.
If you have both the initial and final values of X, then it does have a solution:
1 2
//Let x0 be the initial value and x1 the final value.
Y=(x1^x0)-(x0>>2)-(x0<<5);
Hellos,
i have the initial X and final but one more problem that this function is in loop, and each time Y is unknown, so, if i want to find out all Y from final to initial X it won't be possible since every loop cycle the X before XOR is unknown..
i knew this, but i had a hope as well that it could be possible =/
anyways, thanks for all your relpies, i found out smth new about xor :)
Woah, what's the problem? If you know the initial x, then you could do it very easily! You just have to store each value in thenfunction to osme variable! If the loop goes to 2, it would be