mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-26 09:58:16 +00:00
Merge pull request #2848 from philsmd/patch-4
fixes #2840: minor code style changes for OpenEdge tests
This commit is contained in:
commit
906e597dba
@ -41,14 +41,19 @@ sub PE_encode
|
|||||||
my @target = (0) x 16;
|
my @target = (0) x 16;
|
||||||
my $hash = 17;
|
my $hash = 17;
|
||||||
|
|
||||||
for (my $i=0; $i<5; $i++) {
|
for (my $i = 0; $i < 5; $i++)
|
||||||
for (my $j=0; $j<$word_str_len; $j++) {
|
{
|
||||||
|
for (my $j = 0; $j < $word_str_len; $j++)
|
||||||
|
{
|
||||||
my $idx = 15 - ($j % 16);
|
my $idx = 15 - ($j % 16);
|
||||||
|
|
||||||
$scratch[$idx] ^= ord ($word[$j]);
|
$scratch[$idx] ^= ord ($word[$j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (my $j=0; $j<16; $j+=2) {
|
for (my $j = 0; $j < 16; $j += 2)
|
||||||
for (my $k=15; $k>=0; $k--) {
|
{
|
||||||
|
for (my $k = 15; $k >= 0; $k--)
|
||||||
|
{
|
||||||
$hash = (($hash & 0xffff) >> 8 ^ $PE_CONST[($hash & 0xff)] ^ $PE_CONST[$scratch[$k]]);
|
$hash = (($hash & 0xffff) >> 8 ^ $PE_CONST[($hash & 0xff)] ^ $PE_CONST[$scratch[$k]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,20 +62,27 @@ sub PE_encode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $low;
|
for (my $i = 0; $i < 16; $i++)
|
||||||
for (my $i=0; $i<16; $i++) {
|
{
|
||||||
$low = $scratch[$i] & 0x7f;
|
my $low = $scratch[$i] & 0x7f;
|
||||||
|
|
||||||
if ($low >= 65 && $low <= 90 || $low >= 97 && $low <= 122) {
|
if ($low >= 65 && $low <= 90)
|
||||||
|
{
|
||||||
$target[$i] = $low;
|
$target[$i] = $low;
|
||||||
} else {
|
}
|
||||||
|
elsif ($low >= 97 && $low <= 122)
|
||||||
|
{
|
||||||
|
$target[$i] = $low;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$target[$i] = ((($scratch[$i] & 0xff) >> 4) + 0x61) & 0xff;
|
$target[$i] = ((($scratch[$i] & 0xff) >> 4) + 0x61) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
$target[$i] = chr ($target[$i]);
|
$target[$i] = chr ($target[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return join '', @target;
|
return join ('', @target);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub module_generate_hash
|
sub module_generate_hash
|
||||||
|
Loading…
Reference in New Issue
Block a user