cheatsheet

GDB CheatSheet

Simple Sample Code #include <stdio.h> #include <stdlib.h> void unreachableFunction(void) { printf("\nI'm hacked! I'm a hidden function! :-)\n"); exit (0); } int main(void) { printf("Hello World!"); printf("01234567890 ..."); return 0; } Compile with Debug Info, 32Bit and 64Bit gcc -m32 -ggdb -o eipExample_32 eipExample.c gcc -ggdb -o eipExample_64 eipExample.c run gdb eipExample_32 Intel Syntax (gdb) set disassembly-flavor intel Run Programm (gdb) r Starting program: /home/hacker/test_gdb/eipExample_32 Hello World!01234567890 ...[Inferior 1 (process 4775) exited normally] Set Breakpoint at main (gdb) b main Breakpoint 1 at 0x1205: file eipExample.