Skip to content

Instantly share code, notes, and snippets.

@CaptBoykin
Last active May 23, 2019 07:22
Show Gist options
  • Save CaptBoykin/8124b7607c78f123221df0e861011b12 to your computer and use it in GitHub Desktop.
Save CaptBoykin/8124b7607c78f123221df0e861011b12 to your computer and use it in GitHub Desktop.
Simple hook-stops for GDB
set disassembly-flavor intel
unset env LINES
unset env COLUMNS
// if x86
define hook-stop
echo \n=========================================\n
i r $eax $ebx $ecx $edx $edi $esi $ebp
echo =========================================\n
x/5i $pc-5
echo =========================================\n
x/5i $esp
echo =========================================\n
x/20xw $esp
echo =========================================\n\n
end
// if x86_64
define hook-stop
echo \n=========================================\n
i r $rax $rbx $rcx $rdx $rdi $rsi $rbp
echo =========================================\n
x/10i $pc-5
echo =========================================\n
x/5i $rsp
echo =========================================\n
x/20xw $rsp
echo =========================================\n\n
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment