Home Software Java Windows ProductId Recovery
Windows ProductId Recovery PDF Print E-mail
Written by jjk   

It's a pitty if you lost your product key for windows and can't find it to reinstall your system. As the informations from the windows system information page are encrypted, you can't use them directly as you need a product key instead of the "DigitalProductId".

As i'm currenty facing this issue, and i can't find a java implementation of the decrypt algorithm, i created my own from C# resources i found.

 char[] digits = { 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'M', 'P', 'Q', 'R',
 'T', 'V', 'W', 'X', 'Y', '2', '3', '4', '6', '7', '8', '9' };
char[] decodedKey = new char[25];

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter 30 character productId hex: ");
String binaryCodeStr = br.readLine();
if (binaryCodeStr.length() != 30)
throw new IllegalArgumentException("length not equals 30 characters!");

char[] binaryKeyChar = new char[30];
for (int i = 0; i < binaryCodeStr.length(); i++) {
binaryKeyChar[i] = binaryCodeStr.charAt(i);
}
byte[] binaryKey = Hex.decodeHex(binaryKeyChar);

int i, j, k;
for (i = decodedKey.length - 1; i >= 0; i--) {
k = 0;
for (j = binaryKey.length - 1; j >= 0; --j) {
k = (k << 8) + (binaryKey[j] & 0xff);
binaryKey[j] = (byte) (Math.floor(k / 24d));
k = k % 24;
}
decodedKey[i] = digits[k];
}
StringBuffer result = new StringBuffer();
for (int l = 0; l < decodedKey.length; l++) {
result.append(decodedKey[l]);
if ((l % 5 == 4) && (l != decodedKey.length - 1))
result.append('-');
}
System.out.println(result.toString());

I think anybody who understand java can get this snippet run. This information is only intended to be used in a legal way to recover already owned licences.

 
Copyright © 2024 Projekte / Projects. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.
https://www.getdigital.de - Gadgets und mehr für Computerfreaks