/usr/lib/radare/bin/elf-base-addr 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 | #!/bin/sh
#
# Shows the base address of an ELF binary
#
# --pancake
#
if [ -z "$1" ]; then
echo "Usage: elf-base-addr [elf-program]"
exit 1
fi
if [ -n "`file $1 | grep relocat`" ]; then
# object files get text as base address for text symbols
readelf -S src/hack.o | grep text | grep PROGBITS | awk '{print "0x"$6}'
else
readelf -l $1 | grep LOAD | column -t | awk '{print $3}'
fi
|