1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Do not use next if we mean return

This commit is contained in:
jsteube 2019-02-19 12:50:57 +01:00
parent 1c7e6d0eaf
commit 89f2ea1bec
19 changed files with 53 additions and 53 deletions

View File

@ -64,7 +64,7 @@ sub module_verify_hash
$index2 = index ($hash, '$', $index2 + 1);
next if $index2 < 1;
return if $index2 < 1;
$iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7);
@ -74,7 +74,7 @@ sub module_verify_hash
# get salt
my $index3 = rindex ($hash, '$');
next if $index3 < 1;
return if $index3 < 1;
my $salt = substr ($hash, $index2, $index3 - $index2);

View File

@ -64,7 +64,7 @@ sub module_verify_hash
$index2 = index ($hash, '$', $index2 + 1);
next if $index2 < 1;
return if $index2 < 1;
$iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7);
@ -74,7 +74,7 @@ sub module_verify_hash
# get salt
my $index3 = rindex ($hash, '$');
next if $index3 < 1;
return if $index3 < 1;
my $salt = substr ($hash, $index2, $index3 - $index2);

View File

@ -63,7 +63,7 @@ sub module_verify_hash
$index2 = index ($hash, '$', $index2 + 1);
next if $index2 < 1;
return if $index2 < 1;
$iter = substr ($hash, $old_index + 7, $index2 - $old_index - 7);
@ -73,7 +73,7 @@ sub module_verify_hash
# get salt
my $index3 = rindex ($hash, '$');
next if $index3 < 1;
return if $index3 < 1;
my $salt = substr ($hash, $index2, $index3 - $index2);

View File

@ -145,21 +145,21 @@ sub module_verify_hash
my $index1 = index ($line, "::");
next if $index1 < 1;
return if $index1 < 1;
my $index2 = index ($line, ":", $index1 + 2);
next if $index2 < 1;
return if $index2 < 1;
$index2 = index ($line, ":", $index2 + 1);
next if $index2 < 1;
return if $index2 < 1;
my $salt = substr ($line, 0, $index2 - 32);
$index2 = index ($line, ":", $index2 + 1);
next if $index2 < 1;
return if $index2 < 1;
$salt .= substr ($line, $index2 + 1, 16);

View File

@ -33,7 +33,7 @@ sub module_verify_hash
my $line = shift;
# scrypt
next unless (substr ($line, 0, 7) eq 'SCRYPT:');
return unless (substr ($line, 0, 7) eq 'SCRYPT:');
# get hash
my $index1 = index ($line, ":", 7);

View File

@ -57,7 +57,7 @@ sub module_verify_hash
my $line = shift;
# Cisco $8$ - PBKDF2-HMAC-SHA256
next unless (substr ($line, 0, 3) eq '$8$');
return unless (substr ($line, 0, 3) eq '$8$');
# get hash
my $index1 = index ($line, "\$", 3);

View File

@ -53,7 +53,7 @@ sub module_verify_hash
my $line = shift;
# Cisco $9$ - scrypt
next unless (substr ($line, 0, 3) eq '$9$');
return unless (substr ($line, 0, 3) eq '$9$');
# get hash
my $index1 = index ($line, "\$", 3);

View File

@ -92,24 +92,24 @@ sub module_verify_hash
# Office 2013
my ($hash_in, $word) = split ":", $line;
next unless defined $hash_in;
next unless defined $word;
return unless defined $hash_in;
return unless defined $word;
my @data = split /\*/, $hash_in;
next unless scalar @data == 8;
return unless scalar @data == 8;
next unless (shift @data eq '$office$');
next unless (shift @data eq '2013');
return unless (shift @data eq '$office$');
return unless (shift @data eq '2013');
my $iter = shift @data;
next unless (shift @data eq '256');
next unless (shift @data eq '16');
return unless (shift @data eq '256');
return unless (shift @data eq '16');
next unless (length $data[0] == 32);
next unless (length $data[1] == 32);
next unless (length $data[2] == 64);
return unless (length $data[0] == 32);
return unless (length $data[1] == 32);
return unless (length $data[2] == 64);
my $salt = shift @data;
my $param = shift @data;

View File

@ -76,20 +76,20 @@ sub module_verify_hash
# Office Old $3 $4
my ($hash_in, $word) = split ":", $line;
next unless defined $hash_in;
next unless defined $word;
return unless defined $hash_in;
return unless defined $word;
my @data = split /\*/, $hash_in;
next unless scalar @data == 4;
return unless scalar @data == 4;
my $signature = shift @data;
next unless (($signature eq '$oldoffice$3') || ($signature eq '$oldoffice$4'));
return unless (($signature eq '$oldoffice$3') || ($signature eq '$oldoffice$4'));
next unless (length $data[0] == 32);
next unless (length $data[1] == 32);
next unless (length $data[2] == 40);
return unless (length $data[0] == 32);
return unless (length $data[1] == 32);
return unless (length $data[2] == 40);
my $salt = shift @data;
my $param = shift @data;

View File

@ -37,7 +37,7 @@ sub module_verify_hash
my $line = shift;
# Django (PBKDF2-SHA256)
next unless (substr ($line, 0, 14) eq 'pbkdf2_sha256$');
return unless (substr ($line, 0, 14) eq 'pbkdf2_sha256$');
# get hash
my $index1 = index ($line, "\$", 14);

View File

@ -38,12 +38,12 @@ sub module_verify_hash
my ($hash, undef, undef, $salt, $word) = split ":", $line;
next unless (length $hash == 16);
next unless (length $salt == 32);
return unless (length $hash == 16);
return unless (length $salt == 32);
next unless defined $hash;
next unless defined $salt;
next unless defined $word;
return unless defined $hash;
return unless defined $salt;
return unless defined $word;
$word = pack_if_HEX_notation ($word);

View File

@ -36,7 +36,7 @@ sub module_verify_hash
my $line = shift;
# Cram MD5
next unless (substr ($line, 0, 10) eq '$cram_md5$');
return unless (substr ($line, 0, 10) eq '$cram_md5$');
# get hash
my $index1 = index ($line, "\$", 10);

View File

@ -154,12 +154,12 @@ sub module_verify_hash
my ($hash_in, $word) = split ":", $line;
next unless defined $hash_in;
next unless defined $word;
return unless defined $hash_in;
return unless defined $word;
my @data = split /\*/, $hash_in;
next unless scalar @data == 11;
return unless scalar @data == 11;
my $V = shift @data; $V = substr ($V, 5, 1);
my $R = shift @data;

View File

@ -41,12 +41,12 @@ sub module_verify_hash
{
my $line = shift;
next unless (substr ($line, 0, 5) eq 'sha1:');
return unless (substr ($line, 0, 5) eq 'sha1:');
# iterations
my $index1 = index ($line, ":", 5);
next if $index1 < 1;
return if $index1 < 1;
my $iter = substr ($line, 5, $index1 - 5);

View File

@ -370,15 +370,15 @@ sub module_verify_hash
my $signature = $tmp_data[1];
next unless ($signature eq 'DPAPImk');
return unless ($signature eq 'DPAPImk');
my @data = split ('\*', $tmp_data[2]);
next unless (scalar @data == 9);
return unless (scalar @data == 9);
my $version = shift @data;
next unless ($version == 1 || $version == 2);
return unless ($version == 1 || $version == 2);
my $context = shift @data;
my $SID = shift @data;
@ -389,15 +389,15 @@ sub module_verify_hash
my $cipher_len = shift @data;
my $cipher = shift @data;
next unless (length ($cipher) == $cipher_len);
return unless (length ($cipher) == $cipher_len);
if ($version == 1)
{
next unless ($cipher_len == 208);
return unless ($cipher_len == 208);
}
elsif ($version == 2)
{
next unless ($cipher_len == 288);
return unless ($cipher_len == 288);
}
my $dpapimk_salt = substr ($hash, length ('$DPAPImk$'));

View File

@ -71,7 +71,7 @@ sub module_verify_hash
my @data = split (/\*/, $hash);
next unless scalar @data == 4;
return unless scalar @data == 4;
my (undef, $macap, $macsta, $essid) = @data;

View File

@ -53,8 +53,8 @@ sub module_verify_hash
my ($digest, $word) = split (':', $line);
next unless defined $digest;
next unless defined $word;
return unless defined $digest;
return unless defined $word;
my @data = split ('\*', $digest);

View File

@ -59,7 +59,7 @@ sub module_verify_hash
# tokenize
my @data = split ('\*', $hash);
next unless scalar @data == 12;
return unless scalar @data == 12;
my $signature = shift @data;
my $cipher_type = shift @data;

View File

@ -73,7 +73,7 @@ sub module_verify_hash
# tokenize
my @data = split ('\*', $hash);
next unless scalar @data == 12;
return unless scalar @data == 12;
my $signature = shift @data;
my $cipher_type = shift @data;