mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 07:08:19 +00:00
Add some code generator helper scripts
This commit is contained in:
parent
045ac7d8e7
commit
cb791aaf48
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
for (my $i = 0, my $s = 0; $i < 64; $i++, $s++)
|
||||
{
|
||||
printf (" case %2d:\n", $i);
|
||||
|
||||
for (my $j = 64 - 1; $j >= 0; $j--)
|
||||
{
|
||||
if ((($j - $s - 1) >= 0) && (($j - $s - 0) >= 0))
|
||||
{
|
||||
printf (" w[%2d] = amd_bytealign_S (w[%2d], w[%2d], offset_minus_4);\n", $j, $j - $s - 0, $j - $s - 1);
|
||||
}
|
||||
elsif (($j - $s - 0) >= 0)
|
||||
{
|
||||
printf (" w[%2d] = amd_bytealign_S (w[%2d], 0, offset_minus_4);\n", $j, $j - $s - 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf (" w[%2d] = 0;\n", $j);
|
||||
}
|
||||
}
|
||||
|
||||
printf (" break;\n");
|
||||
}
|
27
tools/code_generators/GEN_NV_switch_buffer_by_offset_le_S.pl
Normal file
27
tools/code_generators/GEN_NV_switch_buffer_by_offset_le_S.pl
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
for (my $i = 0, my $s = 0; $i < 64; $i++, $s++)
|
||||
{
|
||||
printf (" case %2d:\n", $i);
|
||||
|
||||
for (my $j = 64 - 1; $j >= 0; $j--)
|
||||
{
|
||||
if ((($j - $s - 1) >= 0) && (($j - $s - 0) >= 0))
|
||||
{
|
||||
printf (" w[%2d] = __byte_perm_S (w[%2d], w[%2d], selector);\n", $j, $j - $s - 1, $j - $s - 0);
|
||||
}
|
||||
elsif (($j - $s - 0) >= 0)
|
||||
{
|
||||
printf (" w[%2d] = __byte_perm_S ( 0, w[%2d], selector);\n", $j, $j - $s - 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf (" w[%2d] = 0;\n", $j);
|
||||
}
|
||||
}
|
||||
|
||||
printf (" break;\n");
|
||||
}
|
Loading…
Reference in New Issue
Block a user