Home > Software engineering >  Doing how to get the Product Key
Doing how to get the Product Key

Time:09-21

Const char * KeyChars []={

"B", "C", "D", "F", "G", "H" and "J", "K", "M",

"P", "Q", "R", "T", "V", "W", "X", "Y",

"2", "3", "4", "6", "7", "eight" and "9", NULL

};


For (ByteCounter=24; ByteCounter & gt;=0; - ByteCounter)

{

NCur=0;



For (k=14; K & gt;=0; - k)

{

NCur=(nCur * 256) ^ ProductKeyExtract [k].



ProductKeyExtract [k]=nCur/24;

NCur %=24;

}



Strcat (sCDKey KeyChars [nCur]);



//Insert ", "

if( ! (ByteCounter % 5) & amp; & ByteCounter)

Strcat (sCDKey, "-");

}

This method is suitable for Windows 7, but doing even win10 get is not accurate, it should be another algorithm, are there any ace to give directions, personal feeling is KeyChars structure of content have change,

CodePudding user response:

Top a

CodePudding user response:

ProductKeyExtract

KeyChars

The two variable parameters, you can ensure that it has Windows 7 and Win10 all the same?

CodePudding user response:

refer to the second floor cvbtvbwu response:
ProductKeyExtract

KeyChars

The two variable parameters, you can ensure that it has Windows 7 and Win10 all the same?
it is not clear why access to and the system is not the same, continue to study

CodePudding user response:

No one will be the problem

CodePudding user response:

Who can solve this problem for 100 points

CodePudding user response:

 for (k=14; K & gt;=0; - k) 

{

NCur=(nCur * 256) ^ ProductKeyExtract [k].



ProductKeyExtract [k]=nCur/24;

NCur %=24;

}


Is the key to see the calculation of different systems, the results are different,,

CodePudding user response:

refer to 6th floor shen_wei response:
 for (k=14; K & gt;=0; - k) 

{

NCur=(nCur * 256) ^ ProductKeyExtract [k].



ProductKeyExtract [k]=nCur/24;

NCur %=24;

}


Is the key to see the calculation of different systems, the result is not the same,,


Such calculations is very pure arithmetic calculation, have nothing to do with the operating system

CodePudding user response:

refer to 7th floor worldy response:
Quote: refer to the sixth floor shen_wei response:

 for (k=14; K & gt;=0; - k) 

{

NCur=(nCur * 256) ^ ProductKeyExtract [k].



ProductKeyExtract [k]=nCur/24;

NCur %=24;

}


Is the key to see the calculation of different systems, the result is not the same,,


This calculation is very pure arithmetic calculation, have nothing to do with the operating system


After all the calculations, here, to calculate the value of the array to obtain the value!!!!!! Assumes that the calculation value is different, the array is dead, and how to explain?

CodePudding user response:

NCur=(nCur * 256) ^ ProductKeyExtract [k]

According to your initialization logic, red part is the pointer value rather than the character values, this is not to be?
My guess is that you should correct initialization is

Const char * KeyChars []={

'B', 'C',... The NULL

};
  • Related