I found this script on the web somewhere, and I've been working through it to get it to be able to run. I've guessed my way through some syntax errors (see, perl isn't that tough, once you know one language, they're all the same
) but that only got me so far. This is the script:
#!/usr/bin/perl
use Digest::MD5 qw(md5_hex);
printf "Usage: file.pl email id";
$$pad = pack("H2048 ",
"00000000963007772c610eeeba51099...e0cc31bdf05ä8def022d");
@pad = unpack("L256", $pad);
@owner = unpack("C", $ARGV[0 ]);
@regid = reverse unpack("C", pack("H", substr($ARGV[1], 5, 4).substr($ARGV[1], 10, 4)));
@tab = (@regid, @owner);
$$g = $$pad[71];
foreach $$c(@tab)
{
$$i = ($$c^$g) & 0xff;
$$g = ($$g>>8)^ $$pad[$i ];
}
$$key = $$g << 16;
$$g = ($$g>>8)^($$pad[$g & 0xff ]);
$$g = ($$g>>8)^($$pad[$g & 0xff ]);
$$key = $$key|((($$g>>16)^$g) & 0xffff);
$$keystr = uc(unpack("H * ", pack("N", $key)));
$$digest = md5_hex("$keystr\n");
$$keystr = $$keystr.uc(substr($digest, 0, 4));
$$keystr = ~ s/^(..)(..)(..)(..)(..)(..)$/\1-\2-\3-\4-\5-\6 /;
printf "key: %s\n ", $$keystr;
It seems to get hooked up on $$g = $$pad[71]; and I'm not sure why.
#!/usr/bin/perl
use Digest::MD5 qw(md5_hex);
printf "Usage: file.pl email id";
$$pad = pack("H2048 ",
"00000000963007772c610eeeba51099...e0cc31bdf05ä8def022d");
@pad = unpack("L256", $pad);
@owner = unpack("C", $ARGV[0 ]);
@regid = reverse unpack("C", pack("H", substr($ARGV[1], 5, 4).substr($ARGV[1], 10, 4)));
@tab = (@regid, @owner);
$$g = $$pad[71];
foreach $$c(@tab)
{
$$i = ($$c^$g) & 0xff;
$$g = ($$g>>8)^ $$pad[$i ];
}
$$key = $$g << 16;
$$g = ($$g>>8)^($$pad[$g & 0xff ]);
$$g = ($$g>>8)^($$pad[$g & 0xff ]);
$$key = $$key|((($$g>>16)^$g) & 0xffff);
$$keystr = uc(unpack("H * ", pack("N", $key)));
$$digest = md5_hex("$keystr\n");
$$keystr = $$keystr.uc(substr($digest, 0, 4));
$$keystr = ~ s/^(..)(..)(..)(..)(..)(..)$/\1-\2-\3-\4-\5-\6 /;
printf "key: %s\n ", $$keystr;
It seems to get hooked up on $$g = $$pad[71]; and I'm not sure why.