radare2/binr/rax2/b2a.pl

29 lines
553 B
Perl
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/perl
# TODO: deprecate and integrate into rax2 / r_print...
#********* sec-utils - th0rpe *********
# process input data and it´s convert to array c
print "char code[] = {";
my $first = 1;
while(<>) {
my $l = length;
for(my $i = 0; $i < $l; $i++) {
if($i % 10 == 0) {
if($first) {
print "\n 0x";
$first = 0;
} else {
print "\n ,0x";
}
print unpack("H*", substr($_, $i, 1));
} else {
print ",0x".
unpack("H*", substr($_, $i, 1));
}
}
}
print "\n };\n";