Bobber
April 28th, 2012, 12:52
Which i can't seem to figure out....
Hi all, so i am taking a look at a program and the registration routine is very simple but i can't seem to figure out 1 math problem, i just can't wrap my head around it so maybe anybody here can shed some light on it.
So the program generates a random number and makes a internet check with this number and the server replies with another number.
then the function is called iCheckCode(sentMsg, ReciviedMsg, 0);
then it checks if iCheckCode is correct.
I have a valid key so i am not looking to crack the program, just interested to see how its working, i checked the replies a few times and the result is always 35.
iCheckCode(731125647,1065029583,0) == 35
iCheckCode(720425132,1059830289,0) == 35
iCheckCode(22698512, 849307505) == 35
etc.
but i just cant figure out what the math is doing to make it work in the other direction and why its always coming out at 35, that's what i would like to learn and understand, if anybody with a bit of knowledge could help that would be great.
Thanks for your time.
Hi all, so i am taking a look at a program and the registration routine is very simple but i can't seem to figure out 1 math problem, i just can't wrap my head around it so maybe anybody here can shed some light on it.
Code:
int iCheckCode(unsigned int iParamA, unsigned int iParamB, unsigned int iParamC)
{
int a = _SomeFunction(iParamB, iParamB);
int b = _SomeFunction(iParamA, iParamB);
int b2 = _SomeFunction(b, b);
int b3 = _SomeFunction(b, b2);
int result = _SomeFunction(a, b3);
}
unsigned int _SomeFunction(unsigned int arg1, unsigned int arg2)
{
unsigned int loc8;
unsigned int p = 1145225233;
unsigned int loc1 = arg1 >> 16;
unsigned int loc2 = arg1 & 65535;
unsigned int loc3 = arg2 >> 16;
unsigned int loc4 = arg2 & 65535;
unsigned int loc5 = loc1 * loc3 % p;
unsigned int loc6 = (loc1 * loc4 % p + loc2 * loc3 % p) % p;
unsigned int loc7 = loc2 * loc4 % p;
loc8 = 0;
while (loc8 < 32)
{
loc5 = (loc5 + loc5) % p;
++loc8;
}
loc8 = 0;
while (loc8 < 16)
{
loc6 = (loc6 + loc6) % p;
++loc8;
}
return (loc7 + (loc5 + loc6) % p) % p;
}
So the program generates a random number and makes a internet check with this number and the server replies with another number.
then the function is called iCheckCode(sentMsg, ReciviedMsg, 0);
then it checks if iCheckCode is correct.
I have a valid key so i am not looking to crack the program, just interested to see how its working, i checked the replies a few times and the result is always 35.
iCheckCode(731125647,1065029583,0) == 35
iCheckCode(720425132,1059830289,0) == 35
iCheckCode(22698512, 849307505) == 35
etc.
but i just cant figure out what the math is doing to make it work in the other direction and why its always coming out at 35, that's what i would like to learn and understand, if anybody with a bit of knowledge could help that would be great.
Thanks for your time.