Linux tool for reading stack values

I would like to know if there is a Linux tool that allows you to read the values ​​of the program stack? For example, when you run a binary program file containing the line:

foo(parameter);

      

the parameter will be pushed onto the stack and I would like to know if it has a tool to access it.

thank.

+2


source to share


3 answers


Since you've tagged this as security

, you probably want to read Smashing the Stack for Fun and Profit:



http://insecure.org/stf/smashstack.html

+3


source


Gdb?



Glibc also has some backtrace functions. http://www.gnu.org/s/libc/manual/html_node/Backtraces.html

+5


source


Yes, it looks like you just want to start the debugger. If you compile your program with the -g option, you can use gdb like:

gdb myprogram

Now set a breakpoint in your function and you can view the values ​​of the variables in the current scope.

If you are a C newbie, you should take the time to learn gdb (the Gnu debugger).

+4


source







All Articles