/usr/lib/radare/bin/syms-dump 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #!/usr/bin/env perl
#
# Symbol dumper
#
# Dumps binary strings of the symbols of a library.
#
# --pancake
#
$|=1;
my $file=$ARGV[0];
my $limit=$ARGV[1];
my $delta=$ARGV[2];
my $offset=0;
my $count=int($limit); # byte counter
$limit=-1 if ($limit<1);
#print $count;
if ( $file eq "") {
print "Usage: symdump [elf] [limit-bytes] [delta-offset]\n";
exit(1);
}
open FD, "objdump -wd $file|" or die "Cannot exec objdump -wd $file\n";
while(<FD>) {
_sym:
if (/.*\ <(.*)>:/) {
$name = $1;
if ($name=~/-/) {
next;
}
print "$name ";
while(<FD>) {
chomp($_);
if (/>:/) {
print "\n";
goto _sym;
}
last if (/section/);
last if (/\.\.\./);
# objdump output sucks, and those regexps too :D
$str=$_;
$str=~s/.*://g; # drop offset
$str=~s/^\s*//g; # drop prefix spaces
$str=~s/\ \ \s*.*$//g;
$str=~s/\t.*$//g;
$str=~s/\t//g;
$str=~s/\ \ /\ /g;
$str=~s/\n//g;
@bytes=split(/ /,$str);
foreach $i (0 .. $#bytes) {
$offset++;
next if ($offset<=$delta);
print $bytes[$i];
$count--;
last if ($count==0);
}
last if ($count==0);
}
print "\n";
}
$offset=0;
$count=int($limit);
}
close FD;
exit(0);
|