/usr/lib/radare/bin/syms-dbg-flag is in radare-common 1:1.5.2-6.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 33 34 35 | #!/usr/bin/env perl
#
# Dump a radare script that flags all symbols at it's _MEMORY_ offset.
#
# author: pancake
#
my $target = $ARGV[0];
if (( $target eq "" ) || ( $target eq "-h" )) {
print STDERR "Usage: rsc syms-dbg-flag [file] > file.syms.flags\n";
exit 1;
}
if ( `uname`=~/Darwin/ ) {
system("otool -tv $target|grep -C 1 -e : |grep -v / | awk '{if (/:/){label=\$1;gsub(\":\",\"\",label);next}if (label!=\"\"){print \"f sym\"label\" @ 0x\"\$1;label=\"\"}}'\n");
#rabin -E $target
exit 1;
}
my @syms = split(/\n/,qx(rsc syms $target));
for my $i (0 .. @syms) {
if (!($syms[$i] =~ /fs? [imp_|sym_]/)) {
my ($addr, $name) = split(/ /,$syms[$i]);
$name =~ s/@.*//g;
next if ($name eq "");
print "fs symbols\n";
printf "f sym_$name @ $addr\n";
} else {
print $syms[$i],"\n";
}
}
print STDERR @syms." symbols added.\n";
|