https://cand-w18.unexploitable.systems/l/lab02/note-on-gdb.txt
check the build ID of exe:
readelf -n /path/to/binary
check the ID in core file:
# 先安裝 sudo apt-get install elfutils
eu-unstrip -n --core /path/to/core
例如:
ubuntu 查看 core dump 文件生成位置:
cat /proc/sys/kernel/core_pattern
bt
bt full
info line * 0x123456 # 查看地址對應的代碼行, 也可用 addr2line
info symbol 0x123456 # 同上
info frame
info registers
x/i $pc
x/10x $esp
info threads
info target
info sharedlib