I am currently learning about the stack, in particular how to perform stack overflow attacks. I understand that the buffer is not the size that the program initially set it as, for example if we deployed a buffer like this char buffer [100], when compiled the buffer size will end up being greater than 100. What data does the compiler add to the initial 100 bytes of data?
Asked
Active
Viewed 63 times
0
Us3rname
- 3
- 3
-
You're talking padding and memory alignment. I doubt there'll be enough space to insert anyting useful. Check my answer here (https://reverseengineering.stackexchange.com/questions/14450/gcc-change-the-order-of-variable-declaration/14452#14452). – yaspr Jun 20 '17 at 05:04
1 Answers
0
char buffer [0x100 ]. as local that ends up in stack is filled with junk. (uninitilised buffer )
same buffer if declared as global is zero initialised ie the complete buffer will have 0x0's
compiler can pad your buffer based on alignment
can embed patterns based on debug versus release builds
these are implementation details and subject to chsnge between versions
blabb
- 16,376
- 1
- 15
- 30