
[ Writing modules for password_profiling ]


[ Intro ]

Writing additional modules for unsupported filetypes is fairly easy.

As a beginning, just use the dummy module code from below.


[ Structure ] 

Every module must contain an init() function checking for all
programs/modules it needs and return an errorstring or ""/undef if 
init succeded.

The main function in every module is get_words(), which takes a 
filename as an argument and returns the list of words it found
as an array.

When you write a module for this software we would be happy
if you send us a copy so we can include it in the package:

mmo@remote-exploit.org || mjm@remote-exploit.org


-----[ Begin dummy module ]-----

package wlgmod::dummy;

# dummy word extract plugin

sub init {
    return "";
}

sub get_words {
	my $this = shift;
	my $filename = shift;
	my @words;

	open(FILE, "<$filename" ) || die "Cannot open $filename: $!";

	while (<FILE>)
	{
	   my @list = split (/\s/,$_);
	   foreach my $word (@list)
	   {
	       chomp $word;
	       $word =~ s/\s+//mg;
	       $word =~ s/[,.;:?]+//mg;
	       
	       if($word ne "") {
		   push @words, $word;
	       }
	   }
        }
	close(FILE);
	
	return (@words);
}

1;

-----[ End dummy module ]-----
