Topic 5: Stack-smashing and shellcoding Flashcards

1
Q

how does a stack grow?

A

from bottom to top, grows towards lower addresses downwards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a stack pointer?

A

points to the top of the stack (its first element), usually stored in RSP/ESP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a stack used for?

A

store frame pointer, store local variables, pass function arguments, temporarily store register values, return the address of caller function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a stack frame?

A

includes all function-local data, starts below the return address and stops at the stack pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a frame pointer?

A

aka base pointer, marks the highest address in the frame, commonly stored in RBP/EBP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

steps of a function call?

A
  1. prepare arguments
  2. make the call
  3. function prologue
    1. save RBP/EBP
    2. setup new RBP/EBP
  4. callee saves registers that need to be preserved
  5. callee allocates stack space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly