aboutsummaryrefslogtreecommitdiff
path: root/dump
blob: d76eb530b1deb1a6ee2bc8a150bfa02a112f9f22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
if [[ $# < 1 ]]; then
  echo >&2 "Usage: $0 id [name1 [name2 ...]]"
  exit 2
fi
id=$1
shift 1
if [[ $# == 0 ]]; then
  names="__libc_start_main_ret system dup2 read write str_bin_sh"
else
  names="$@"
fi
for info in db/*; do
  if [[ -d $info ]] && [[ -e $info/$id.symbols ]]; then
    echo "${info}/${id}.symbols:"
    for name in $names; do
      offset=`cat ${info}/${id}.symbols | grep "^$name " | cut -d' ' -f2`
      echo "offset_${name} = 0x${offset}"
    done
  fi
done