Einzelnen Beitrag anzeigen

ASM

Registriert seit: 16. Aug 2004
165 Beiträge
 
Delphi 7 Enterprise
 
#5

AW: Decode MS Office Product Key

  Alt 22. Jan 2015, 21:58
There are two heavy basic mistakes in your code, besides several strong syntactic flaws, which cause failure to resolve the correct ProductKey.

Most importantly:
Since MS Office 10 the algorithm required to calculate the proper ProductKey from DigitalProductID has changed:
Now, calculation within function DecodeProductKey() has to be started beginning at offset $328 (instead beginning at offset $34 that is valid for former Office versions).

Furthermore:
Within your code of function ExtractDigitalPID(), after collecting the Subkeynames by Reg.GetKeyNames(temp), you are using SubKeyName := temp.Strings[0], i.e. you are using implicitly the SubKeyName at fixed Index position 0 of collected Stringlist.
This doesn't consider, however, that the right SubkeyName which will provide the DigitalProductID value required to perform calculation
might not be located at Index position 0 but rather more often than not it will be located somewhere between Index 0 and Index no. temp.count-1.
Thus, you have to search your collection of SubKeynames through all indices until finding the right one presenting the value name 'DigitalProductID'.

Comment added to make it more clearly:
MS Office 10 refers to Office 2010 = version 14.0

I'm sorry for any misinterpretation likely to have occured.

Geändert von ASM (23. Jan 2015 um 11:13 Uhr)
  Mit Zitat antworten Zitat