Leser: 1
4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl
# Hash Analyzer 0.1 (c) 2006 by eSpy
# use module
use strict;
use warnings;
use XML::Simple;
# variables
my $file = 'hashdb.xml';
my $hash = '4TKMer2ittZ7c';
# create object
my $xml = XML::Simple->new();
# read xml file
my $hashdb = $xml->XMLin($file);
# parsing hash
foreach my $entry (@{$hashdb->{hash}})
{
if ($hash =~ /$entry->{regexp}/)
{
print "\nPossible Hash types:\n\n";
foreach my $type (@{$entry->{type}})
{
print $type."\n";
}
last;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="iso-8859-1"?>
<hashdb>
<hash regexp="^[0-9a-fA-F]{4}$">
<type>CRC-16-CCITT</type>
<type>CRC-16</type>
<type>FCS-16</type>
</hash>
<hash regexp="^[0-9a-zA-Z]{13}$">
<type>DES (Unix)</type>
</hash>
</hashdb>
QuoteCan't use string ("DES (Unix)") as an ARRAY ref while "strict refs" in use at hash.pl line 25.
foreach my $type (ref($entry->{type}) eq 'ARRAY' ? @{$entry->{type}} : $entry->{type})
4 Einträge, 1 Seite |