#!/usr/bin/perl # # Simple registration checker. # # Usage: perl regchk.pl game1\*.trn game2\*.trn ... # # This checks for duplicate registrations. When two of the TRNs # specified on the command line contain the same registration, # this will tell you. This does not actually decrypt the keys. # foreach (@ARGV) { open FILE, "< $_" or die "can't open $_: $!"; binmode FILE; seek FILE, -248, 2; read FILE, $info, 200 and push @{$user{$info}}, $_; close FILE; } foreach (keys %user) { print "The files ", join(", ", @{$user{$_}}), " use the same reginfo\n" if @{$user{$_}} != 1; }