/usr/lib/radare/bin/syms-xrefs 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 | #!/usr/bin/env perl
#
# Show possible inverse references to symbols of a binary.
#
# author: pancake <pancake@youterm.com>
#
$target = $ARGV[0];
if ($target eq "") {
print "Usage: symxrefs [a.out] [arch]\n";
exit 1;
}
$arch = $ARGV[1];
if ($arch eq "") {
system("./xrefs -a help");
exit 1;
}
@syms = split(/\n/,`objdump -d $target | grep '>:' | awk '{print "0x"\$1}'`);
@nams = split(/\n/,`objdump -d $target | grep '>:' | awk '{print \$2}' | cut -c 2-`);
for($i=0;$i<=$#syms;$i++) {
# XXX why 0x1000000.. ?
eval("\$off = ".$syms[$i]." - 0x10000000;");
@xrefs = split(/\n/,`./xrefs -q -a $arch $target $off`);
if ($#xrefs!=-1) {
printf "0x%x : ".$nams[$i]." {\n", $off;
for($j=0;$j<=$#xrefs;$j++) {
print " ".$xrefs[$j]."\n";
}
print "}\n";
}
}
|