GDB basics
Changing to intel syntax
Finding the entry point and sections of a stripped binary
View main function instructions
Setting a break point
Re-run the program
Stepping to the next instruction
Continue running the program
View variables
View registers
Set a value to a register
Display formats
o
=> Display in octal.x
=> Display in hexadecimal.u
=> Display in unsigned, standard base-10 decimal.t
=> Display in binary.
Example using examine command ( x
):
The default size of a single unit is a four-byte unit called a word
,This can be changed by adding the following letters to the end of the examine command.
b
=> A single byte.h
=> A halfword, which is two bytes in sizew
=> A word, which is four bytes in sizeg
=> A giant, which is eight bytes in size
Examples:
Examine command also accepts instruction ( i
) that display the memory as disassembled assembly language instructions.
Working with environment
GDB and other debuggers may add some more env vars, which could change offset of shellcode on the stack, so it's best to remove them.
Last updated