由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C的问题,高手请指点
相关主题
why int** cannot convert to const int** ?C++: define a reference always reference the same object
How to see the content of a library filetypedef
为什么需要定义 = 和 copy ctora question about CAST
Excel VBA protection.C++: How to read until the end of file?
C++ string类输入数据的问题c或者c++中变量保存在什么地方怎么看呢?
what's wrong with this C++ code?帮帮看看这段tree insertion
关于在rotated sorted array中查找的问题怎样用Java或者Matlab获取文件的created time, accessed time, modified time?
Do the two statements cost the same amount of time?perl能不能一次把一个str中的a替换成x,b替换成y? (转载)
相关话题的讨论汇总
话题: when话题: place话题: return话题: wrong话题: function
进入Programming版参与讨论
1 (共1页)
p**********g
发帖数: 9385
1
今天被问了一个问题
"When a function call in C will return to wrong place?"
完全不知所云,有谁知道吗?
X****r
发帖数: 3557
2
Depends on what does 'wrong place' mean. If it means 'a place
different from the original caller site of this particular
function invocation', then modifying the return address stored
in the stack frame would cause that. How to do it is highly
architecture-dependent. A non-standard use of setjmp/longjmp
may achieve the same, too.

【在 p**********g 的大作中提到】
: 今天被问了一个问题
: "When a function call in C will return to wrong place?"
: 完全不知所云,有谁知道吗?

p**********g
发帖数: 9385
3
Thank you for the answer! My next question is:
Under what kind of scenarios, we would want to modify the
return address in the stack frame?

【在 X****r 的大作中提到】
: Depends on what does 'wrong place' mean. If it means 'a place
: different from the original caller site of this particular
: function invocation', then modifying the return address stored
: in the stack frame would cause that. How to do it is highly
: architecture-dependent. A non-standard use of setjmp/longjmp
: may achieve the same, too.

p***o
发帖数: 1252
4
When you want to hack your iphone, wii, kindle, etc, etc
http://en.wikipedia.org/wiki/Stack_buffer_overflow

【在 p**********g 的大作中提到】
: Thank you for the answer! My next question is:
: Under what kind of scenarios, we would want to modify the
: return address in the stack frame?

1 (共1页)
进入Programming版参与讨论
相关主题
perl能不能一次把一个str中的a替换成x,b替换成y? (转载)C++ string类输入数据的问题
Any better way to declare a function?what's wrong with this C++ code?
c++之极弱问关于在rotated sorted array中查找的问题
一个const_cast问题Do the two statements cost the same amount of time?
why int** cannot convert to const int** ?C++: define a reference always reference the same object
How to see the content of a library filetypedef
为什么需要定义 = 和 copy ctora question about CAST
Excel VBA protection.C++: How to read until the end of file?
相关话题的讨论汇总
话题: when话题: place话题: return话题: wrong话题: function