1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| bufBuffer est un Buffer sur 2048
HKEY_LOCAL_MACHINE est un entier = 0x80000002
KEY_QUERY_VALUE est un entier = 0x1
KEY_WOW64_64KEY est un entier = 0x0100
RetourFonction est un entier // Type C :LONG
phkResult est un entier système // Type C :PHKEY
lpcbData est un entier système
lpcbData = 2048
i,j sont des entiers
keyStartIndex est un entier = 53
keyEndIndex est un entier = keyStartIndex + 15
decodeLength est un entier = 29
decodeStringLength est un entier = 15
decodedChars est un Buffer sur 29 octets
hexPid est un tableau dynamique d' octets
digits est un Buffer = "BCDFGHJKMPQRTVWXY2346789"
RetourFonction=API("ADVAPI32.DLL","RegOpenKeyExA",HKEY_LOCAL_MACHINE, ...
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",0, KEY_QUERY_VALUE |
KEY_WOW64_64KEY,&phkResult)
RetourFonction=API("ADVAPI32.DLL","RegQueryValueExA",phkResult,
"DigitalProductId",0,0,&bufBuffer,&lpcbData)
POUR i = keyStartIndex A keyEndIndex
TableauAjoute(hexPid,bufBuffer[[i]])
FIN
POUR i = decodeLength A 1 PAS -1
SI (modulo(i,6) = 0)
decodedChars[[i]]= Asc("-")
SINON
digitMapIndex est un entier = 0
POUR j = decodeStringLength A 1 PAS -1
byteValue est un entier = bitDécaleGauche(digitMapIndex,8) | hexPid[j]
hexPid[j] = byteValue / 24
digitMapIndex = modulo(byteValue,24)
decodedChars[[i]] = digits[[digitMapIndex+1]]
FIN
FIN
FIN
Trace (decodedChars) |
Partager