Buf Intro
Goals
- Stack Frame Overview
- Level 0: Step-by-Step
Needs
Ask Some Questions!
GDB Stuff and Reminders
-
print /a ___
-> prints as a hex address. Can take direct math (i.e. $esp+4) or a dereferenced address if what the address points to is another pointer (i.e.print /a *0x085647fc
will work if 0x085647fc, and the contents of 0x085647fc, are pointers.) NOTE: To get this to work with direct math on a register, we must cast the resulting address of the sum as a pointer to a pointer (i.e.print /a *(void**)($esp+4)
). This was the solution to a problem we had earlier. -
x/x 0x_____
-> is the equivalent of the above, but doesn't need the cast. This says, trust me, I know what this is, just examine this address as a hexadecimal address (i.e.x/x ($esp+4)
is equivalent toprint /a *(void**)($esp+4)
). :$ objdump -d disas.txt
is extremely helpful in this lab.- Stack grows towards lower addresses.
- A byte takes 2 hex numbers.