Description

This is basically the same script as http://community.spiceworks.com/scripts/show/1773-acrobat-x-license-key-finder but it was rewritten in AutoIT because AutoIT has built in SQLite functionality. (the vbs version only works on version X) There is no need to download any other files to use this script (other than AutoIT so that you can compile it)

Update: This has been tested to work on version 8 and X of Acrobat Reader. It probably works on 7, and 9 but XI seems to have moved the serial number again and it did not work on my test machine.

Source Code

#include <SQLite.au3>
#include <SQLite.dll.au3>


For $i = 1 To 10
	;This is a loop to enumerate all of the registry keys in the Acrobat key
	Local $adobeVersion = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Adobe Acrobat", $i)

	If @error <> 0 Then ExitLoop
	;If there are no more adobe keys, we are done

	If $adobeVersion < 10 Then
		;If the version is 9 or older look in the registration key in the registry
		$encSerial = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Adobe Acrobat\" & $adobeVersion & "\Registration", "SERIAL")
		If @error <> 0 Then ContinueLoop
	Else
		;Versions 10 and newer store the value in the cache.db file on the local computer instead of the registry
		$encSerial = _QueryCacheFile()
		If @error <> 0 Then ContinueLoop
	EndIf

	$decrypted = _DecodeAdobeKey($encSerial)
	MsgBox(4096, "Adobe Acrobat Key", "Adobe Acrobat " & $adobeVersion & " Serial Number: " & $decrypted)

Next




Func _QueryCacheFile()
	;If you want to specyfy the location of your cache file type it in between the quotes.
	$strCacheFile = @ScriptDir & "\cache.db"
	$strCacheFile = _FindCacheFile($strCacheFile)
	If @error <> 0 Then
		SetError (-1)
		Return 0
	EndIf



	Local $hQuery, $aRow, $sMsg, $sAdobeEncryptedKey
	_SQLite_Startup()
	_SQLite_Open($strCacheFile) ; open :memory: Database
	_SQLite_Query(-1, "select value from domain_data where key='SN';", $hQuery) ; the query
	_SQLite_FetchData($hQuery, $aRow)
	If @error <> 0 Then
		SetError(-1)
		Return 0
	EndIf

	$sAdobeEncryptedKey &= $aRow[0]


	Return $sAdobeEncryptedKey
EndFunc   ;==>_QueryCacheFile





Func _DecodeAdobeKey($sAdobeEncryptedKey)
	;Cipher code converted from Sam Gleske's javascript found at: http://www.pages.drexel.edu/~sag47/adobe/
	;His code was Converted from the source for "Enchanted Keyfinder"
	;original algorithm by Dave Hope (http://www.davehope.co.uk)


	If $sAdobeEncryptedKey = 0 Then
		SetError(-1)
		Return 0
	EndIf

	Local $AdobeCipher[24]
	Local $sAdobeDecryptedKey


	$AdobeCipher[0] = "0000000001"
	$AdobeCipher[1] = "5038647192"
	$AdobeCipher[2] = "1456053789"
	$AdobeCipher[3] = "2604371895"
	$AdobeCipher[4] = "4753896210"
	$AdobeCipher[5] = "8145962073"
	$AdobeCipher[6] = "0319728564"
	$AdobeCipher[7] = "7901235846"
	$AdobeCipher[8] = "7901235846"
	$AdobeCipher[9] = "0319728564"
	$AdobeCipher[10] = "8145962073"
	$AdobeCipher[11] = "4753896210"
	$AdobeCipher[12] = "2604371895"
	$AdobeCipher[13] = "1426053789"
	$AdobeCipher[14] = "5038647192"
	$AdobeCipher[15] = "3267408951"
	$AdobeCipher[16] = "5038647192"
	$AdobeCipher[17] = "2604371895"
	$AdobeCipher[18] = "8145962073"
	$AdobeCipher[19] = "7901235846"
	$AdobeCipher[20] = "3267408951"
	$AdobeCipher[21] = "1426053789"
	$AdobeCipher[22] = "4753896210"
	$AdobeCipher[23] = "0319728564"

	;decode the adobe key
	For $i = 0 To 23

		If (Mod($i, 4) = 0) And ($i > 0) Then
			;every 4 characters add a "-"
			$sAdobeDecryptedKey = $sAdobeDecryptedKey & "-"
		EndIf

		;Grab the next number from the adobe encrypted key. Add one to 'i' because it isn't base 0
		$j = StringMid($sAdobeEncryptedKey, $i + 1, 1)

		;Add one to J because it isn't base 0 and grab that numbers position in the cipher
		$k = StringMid($AdobeCipher[$i], $j + 1, 1)

		$sAdobeDecryptedKey = $sAdobeDecryptedKey & $k

	Next

	Return $sAdobeDecryptedKey
EndFunc   ;==>_DecodeAdobeKey



Func _FindCacheFile($CacheFile)
	If (Not $CacheFile = "") And (FileExists($CacheFile)) Then
		$FindCacheFile = $CacheFile
	ElseIf FileExists("c:\Program Files (x86)\Common Files\Adobe\Adobe PCD\cache\cache.db") Then
		$FindCacheFile = "c:\Program Files (x86)\Common Files\Adobe\Adobe PCD\cache\cache.db"
	ElseIf FileExists("c:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db") Then
		$FindCacheFile = "c:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db"
	Else
		MsgBox(0, "", "Can't find the cache.db file")
		SetError(-1)
		Return 0
	EndIf
	Return $FindCacheFile
EndFunc   ;==>_FindCacheFile
3 Spice ups

Badass. Worked great. Downloaded non install version of AutoIt and this worked great (just copied that code to a .au3 file and opened it) Voila :slight_smile:

worked like a charm. gotta be connected to the network/internet tho.

Hi, I don’t know anything about IT/computer language; I just want to find my adobe suite X license key… So I downloaded AutoIT, cut&pasted the script above, and saved it as an .au3 file. I tried opening it but nothing happened and it just takes me to the same format I did the cut&pasting on. Help please!

@megw, What OS are you trying this on? What version of Adobe are you trying to find the key for? Are you running this as Administrator? Several possibilities of where the problem could be. You’re doing File > Open > in AutoIT, right?

Right click on the file and click “Run Script” or press F5 if you have the script open in SciTe. (the autoit editor) You can also look at the link in the description to try the VBScript version of this program that I wrote. The only down side to it is that it does not detect older license keys than version X.

Thank you very much for sharing this. Saved me a load of work this week. :slight_smile: You rock.