Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

found this ex but it doesnt seems to work.... please help...
sub decodekey { my @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'); return "No key found\n" if ($_[0] eq ""); my @id = split(/,/,shift); my $key=""; for (my $i=28; $i>=0; $i--) { if (($i+1)%6) { my $ac=0; for (my $j=66; $j>=52; $j--) { $ac<<=8; $ac+=hex $id[$j]; $id[$j]=sprintf("%x",($ac/24)&255); $ac%=24; } $key=$digits[$ac].$key; } else { $key='-'.$key; } } return $key; }

Replies are listed 'Best First'.
Re: Get windows cd key
by thanos1983 (Parson) on Mar 14, 2017 at 16:09 UTC
      The output is BBBB-..... I expect to get the key from the registry

        Getting the key from the registry and decodeing it are two wholy differnt things

        See the links thanos1983 posted for where/how to get the key from the registry (for XP)

        I'm pretty sure that's because the original code may have been written against a 32-bit version of windows, but you are on a 64-bit version. Can you confirm this?