const char *KeyChars[] = { "B","C","D","F","G","H","J","K","M", "P","Q","R","T","V","W","X","Y", "2","3","4","6","7","8","9",NULL };
for(ByteCounter=24; ByteCounter >= 0; --ByteCounter) { nCur = 0; for(k=14; k >= 0; --k) { nCur = (nCur * 256) ^ ProductKeyExtract[k]; ProductKeyExtract[k] = nCur / 24; nCur %= 24; } strcat(sCDKey, KeyChars[nCur]); //Insert "-" if( !(ByteCounter % 5) && ByteCounter ) strcat(sCDKey, "-"); }这种方法适用于win7系统,但是win8甚至是win10下获取到的就不准确,应该是另一种算法,有高手指点一下吗,个人感觉是KeyChars结构中内容有变化。
for(ByteCounter=24; ByteCounter >= 0; --ByteCounter) { nCur = 0; for(k=14; k >= 0; --k) { nCur = (nCur * 256) ^ ProductKeyExtract[k]; ProductKeyExtract[k] = nCur / 24; nCur %= 24; } strcat(sCDKey, KeyChars[nCur]); //Insert "-" if( !(ByteCounter % 5) && ByteCounter ) strcat(sCDKey, "-"); }这种方法适用于win7系统,但是win8甚至是win10下获取到的就不准确,应该是另一种算法,有高手指点一下吗,个人感觉是KeyChars结构中内容有变化。
我猜,你正确的初始化应该是const char *KeyChars[] = { 'B','C',........,NULL };