couldn't get this working but...
it has a "base"
Code:
dim $binString, $binCode, $DecodedKey[24],$i,$j,$KeyChars,$Result
$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'
$binString=ucase(ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId")) ;16 bytes
$binCode=""+baseconverter(left($binString,2),16,2)+baseconverter(substr($binString,3,2),16,2)+baseconverter(substr($binString,5,2),16,2)+baseconverter(substr($binString,7,2),16,2)
For $i=24 to 0
$A = 0
For $j=14 to 0 ;we want the first 15 bytes, right?
; $A = (A shl 8) + substr($binCode,$j,1) , not sure about this. shift left but should the resulting number have extra zeros added or not?
$A = $A*256 + baseconverter(substr($binCode,1+$j*8,8),2,10)
; $binCode=left($binCode,$j*8) + baseconverter($A/24,10,2) + substr($binCode,$j*8+9)
$A = $A mod 24
next
$DecodedKey[$i] = $KeyChars[$A]
next
For $i = 0 to 24
$Result = $Result + $DecodedKey[$i]
if (($i + 1) mod 5 = 0) and ($i < 24)
$Result = $Result + '-'
endif
next
$Result ?
"press any-key"
get $
Function BaseConverter($v,$f,$t)
dim $,$e,$y,$n,$x,$z
$=0
$t=$+$t
$f=$+$f
$e=($f>36)|($t>36)|($f<2)|($t<2)
$y=1.
for $n=len($v) to 1 step -1
$x=ASC(UCASE(substr($v,$n,1)))
$z=($x-48-($x>64)*7)
IF ($z<0)|(($x>57)&($x<65))|$e|($z>($f-1))
EXIT 1
ENDIF
$=$y*$z+$
$y=$y*$f
next
$n=""
While $
$x=INT($-(INT($/$t)*$t))
$=($-$x)/$t
$n=CHR($x+48+($x>9)*7)+$n
Loop
$BaseConverter=$n
Endfunction