I'm trying to exploit a buffer overflow for an assignment, and I have to access the environment var开发者_StackOverflow社区iables (read one of them), but I have no clue where to look for them. I'm using gdb to inspect memory, but I just can't find the environment variables.
There's a global variable (char **environ
) which should exist in the running executable's symbol table, if that was compiled with the -g
option.
I hope that you have found since time. Environment varialbes are stocked on the esp register, by example on my current exercice, I can show the environment variables with this command (starti is for break at the first instruction):
(gdb) starti
(gdb) x/50s $esp+450
精彩评论