Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- if (@ARGV[0] eq "") { @ARGV[0] = "g.in"; }
- $HTML = @ARGV[0];
- open(HTML);
- @fileinput = <HTML>;
- $i = 0; $text = "";
- foreach $line(@fileinput) {
- if ($i == 0) {
- $i = 1;
- $hash = substr($line, 0, 13);
- $salt = substr($hash, 0, 2);
- } else {
- $text = $text.' '.$line;
- }
- }
- close (HTML);
- # To lowercase
- $text = lc($text);
- # Extract only letter and spaces
- $text =~ s/[^a-z ]//g;
- $text =~ s/\n//g;
- # Put words in array
- @words_raw = split(' ', $text);
- # Remove duplicated words in array
- %seen = (); @words = grep { ! $seen{$_} ++ } @words_raw;
- $i = 0; %words = ();
- open (MYFILE, '>>log.txt');
- foreach $word(@words) {$words{$i} = $word;$i++;print MYFILE $word."\n";}
- close (MYFILE);
- # Test all combinations
- @glues = ('2','4','6','8');
- while (($k1, $word) = each(%words)) {
- $l1 = length($word);
- delete($words{$k1});
- if ($l1 != 0 && 7 > $l1) {
- while (($k2, $word2) = each(%words)) {
- $length = length($word2) + $l1;
- if ($length != $l1) {
- if ($length > 3 && 8 > $length) {
- foreach $glue(@glues) {
- if (crypt($word.$glue.$word2, $salt) eq $hash) {
- print $word.$glue.$word2."\n";
- exit;
- } elsif (crypt($word2.$glue.$word, $salt) eq $hash) {
- print $word2.$glue.$word."\n";
- exit;
- }
- }
- }
- } else {
- delete($words{$k2});
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement