# # this scripts reads names/information from img files # use IO::Seekable; my $location = $ARGV[0]; if ($location eq "") { $location = "."; } opendir(DIR, $location) or die "Cannot open $location: $!"; my @files = readdir(DIR); closedir(DIR); print "\nProcessing $location...\n\n"; my $count = 0; foreach $filename (@files) { if ($filename =~ /\.img/) { $count++; open(FH, $location . "\\" . $filename) or die "Cannot open $filename: $!"; binmode(FH); seek (FH,73,0); read (FH,$tmp1, 20); seek (FH,101,0); read (FH,$tmp2, 20); $test = $tmp1 . $tmp2; @ch = split(//, $test); $tst = ord $ch[0]; if ($tst < 32 || $tst > 126) { $test = ""; foreach $let (@ch) { $tst = chr(ord $let ^ (hex '0x96')); $test .= $tst; } } ($name, $other) = split (/,/, $test); printf ("%-17.17s %-22.22s %-22.22s\n", $filename, $name, $other); close(FH); } } print "\nListed $count files.\n"; exit;