#!perl

# DLLList.pl
#
# Copyright (c) 2001 Symbian Ltd. All Rights Reserved
#
# Last revised 6 July 2001

my $epocroot = $ENV{EPOCROOT};
$dir = $epocroot."epoc32\\release\\wins\\udeb";
&listdirectory($dir);

sub listdirectory
{
 local($dir);
 local(@lines);
 local($subdir);
 local($lvl_counter);
 local($list_length);  $dir = $_[0];
 if(opendir (DIR, $dir))
 {
   @lines = readdir (DIR);
   closedir (DIR);
   $lvl_counter = 2;
   $list_length = ( scalar @lines );
   while ($lvl_counter < $list_length)
   {
      $subdir = $dir."\\".$lines[$lvl_counter];
      if(opendir (SUBDIR, $subdir))
      {
         closedir (SUBDIR);
         &listdirectory($subdir);
      }
      else
      {
         &processnames($subdir);
      }
      $lvl_counter++;
      }
   }
}

sub processnames
	{
	open file, $_[0] or problem("Cannot open $_[0]") and return;
	binmode file;
	read file, $leftbuf, 512;
	close file;
	my ($uid1, $uid2, $uid3, $checksum) = unpack "V4", $leftbuf;
	if ($leftbuf =~ /^\x4D\x5A.{38}\x00{20}(....)/s)
		{
		print ("$_[0]\n");
		}
	}