Skip to content

Instantly share code, notes, and snippets.

@yarjor
Created September 30, 2018 11:48
Show Gist options
  • Save yarjor/82bfe100322d67b8ce605f2154c1cc1d to your computer and use it in GitHub Desktop.
Save yarjor/82bfe100322d67b8ce605f2154c1cc1d to your computer and use it in GitHub Desktop.
[Get IP control offset] works for simple bof binaries. #eip #overflow #memorycorrupt #binary #radare2 #r2 #systemd #coredump #ragg2 #crash #debruijn
get_eip_control() {
(ragg2 -P 1024 -r | $*) && echo "No eip control found" && return 1
(coredumpctl dump > eip_control.core) 2>/dev/null
local eip=$(r2 -qc "dr eip" eip_control.core | tail -n 1)
echo "Offset to control EIP: $(r2 -qc "wopO $eip" --)"
rm eip_control.core
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment