#!/bin/sh
readelf -l /bin/sh \
| grep '^  *NOTE  *' \
| while read Type Offset VirtAddr PhysAddr FileSiz MemSiz rest
do
  ofs=$( echo "ibase=16; ${VirtAddr#0x} - 08048000" | bc )
  size=$( echo "ibase=16; ${FileSiz#0x}" | bc )
  od -Ax -j $ofs -N $size /bin/bash -c
done
