#!/bin/sh
target=${1:-/bin/bash}
entry_point=$( \
	readelf -l $target \
	| sed -ne 's/^Entry point 0x//p' \
	| tr a-f A-F \
)
entry_point_ofs=$( echo "ibase=16; $entry_point - 08048000" | bc )
ndisasm -e $entry_point_ofs -U $target | sed -e '/hlt/q'

