Skip to content

Instantly share code, notes, and snippets.

@roycewilliams
Created May 23, 2020 22:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roycewilliams/4078fe865e682085a3ecfdb5eb6034a6 to your computer and use it in GitHub Desktop.
Save roycewilliams/4078fe865e682085a3ecfdb5eb6034a6 to your computer and use it in GitHub Desktop.
unhex-full.pl
#!/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