Created
May 23, 2020 22:37
-
-
Save roycewilliams/4078fe865e682085a3ecfdb5eb6034a6 to your computer and use it in GitHub Desktop.
unhex-full.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Created: 2016-06-15 | |
# Credit: undeath, https://hashcat.net/forum/thread-3522.html | |
use utf8; | |
#use open ':std', ':encoding(UTF-8)'; | |
while (<>) { | |
if ($_ =~ m/(.*):\$HEX\[([A-Fa-f0-9]+)\]/) { | |
print $1 . ':' . pack("H*", $2), "\n" | |
} elsif ($_ =~ m/(.*):HEX\[([A-Fa-f0-9]+)\]/) { | |
print $1 . ':' . pack("H*", $2), "\n" | |
} elsif ($_ =~ m/^\$HEX\[([A-Fa-f0-9]+)\]/) { | |
print pack("H*", $1), "\n" | |
} elsif ($_ =~ m/^HEX\[([A-Fa-f0-9]+)\]/) { | |
print pack("H*", $1), "\n" | |
} else { | |
print $_; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment