/usr/lib/radare/bin/syms-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 | #!/usr/bin/env perl
#
# Dump a radare script that flags all symbols at it's _FILE_ offset.
#
# author: pancake
#
my $target = $ARGV[0];
if (( $target eq "" ) || ( $target eq "-h" )) {
print STDERR "Usage: rsc syms-flag [file] > file.syms.flags\n";
exit 1;
}
print "fs symbols\n";
my $base = qx(rsc elf-base-addr $target | head -n 1); chomp($base);
my @syms = split(/\n/, qx(rsc syms $target));
for my $i (0 .. @syms) {
my ($addr, $name) = split(/ /,$syms[$i]);
next if ($name eq "");
$name=~s/\@.*//;
$name=~s/-/_/;
$name="sym_$name";
if ($base>0) {
eval "\$addr=$addr-$base;";
} else {
eval "\$addr=$addr;";
}
printf "f $name @ 0x%x\n", $addr if ($addr<0x99999);
}
print STDERR @syms." symbols added.\n" if ( $ENV{"VERBOSE"} );
|