Skip to content

Instantly share code, notes, and snippets.

@CallMarl
Last active October 15, 2020 09:43
Show Gist options
  • Save CallMarl/b77ac9c2b070451343566aedec54bd64 to your computer and use it in GitHub Desktop.
Save CallMarl/b77ac9c2b070451343566aedec54bd64 to your computer and use it in GitHub Desktop.
GDB usual command
# Set assembleur display as intel norme
set disassembly-flavor intel
# Enable step mode
set step-mode on
# Follow child
set follow-fork-mode child
# Run gdb
gdb
# Run gdb debugging programe
gdb ./programe_name
# Get program function list
info function
i fu
# Get program function list maching regex
i func funcname
# Disassemble function
dissemble function_name
disass function_name
d function_name
# Get register detail
info register
info register $eax
i r
i r $eax
# Display memory in hexa
x/x *0x00000000
x/x $ebp
# Display memory in string
x/s *0x00000000
x/s $esp + 0x5
# Display memory in decimal
x/d *0x00000000
x/d $edi + 0x5
# Display memory int decimal
x/16b *0x00000000
# move step by step
step
step 10
s
s 10
# setup breakpoint
breakpoint *0x00000000
breakpoint function_name
b *0x00000000
breakpoint *function_name
# continue to next breakpoink
continue
c
# get the process memory info
info proc map
# find string in address range
find 0x00000000, 0x00000000, "/bin/sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment