FWIW, I've been using that same Perl one-liner from undeath, expanded for readability and converted to a standalone script:
The inverse could be used to perform the conversion in the other direction.
Out of curiosity - what is the use case for converting to all HEX?
Code:
#!/usr/bin/env perl
# Credit: undeath, https://hashcat.net/forum/thread-3522.html
while (<>) {
if ($_ =~ m/\$HEX\[([A-Fa-f0-9]+)\]/) {
print pack("H*", $1), "\n"
} else {
print $_;
}
}
The inverse could be used to perform the conversion in the other direction.
Out of curiosity - what is the use case for converting to all HEX?
~