SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 276 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"

For example, to declare an integer
and have the memory allocated at runtime, you would use something like:
int i = malloc (sizeof (int)); //dynamically allocates an integer, contains
//the pre-existing value of that memory
Stack Section
The stack section is used to keep track of function calls (recursively) and grows from the
higher-addressed memory to the lower-addressed memory on most systems. As we will
see, the fact that the stack grows in this manner allows the subject of buffer overflows to
exist. Local variables exist in the stack section.
Environment/Arguments Section
The environment/arguments section is used to store a copy of system-level variables that
may be required by the process during runtime. For example, among other things, the
path, shell name, and hostname are made available to the running process. This section
is writable, allowing its use in format string and buffer overflow exploits. Additionally,
the command-line arguments are stored in this area. The sections of memory reside in
the order presented. The memory space of a process looks like this:
Buffers
The term buffer refers to a storage place used to receive and hold data until it can be handled
by a process. Since each process can have its own set of buffers, it is critical to keep
them straight.


Pages:
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288