push ebp
+---------+
+ 引數M +
+ --------+
+ return +
+---------+<-----ebp
+old ebp +
+ +
+++++++ <-----esp
+ +
+ +
+---------+
move ebp esp
+---------+
+ 引數M +
+ --------+<---ebp+8
+ return +
+---------+<---ebp+4
+old ebp +
+ +
+++++++ <----ebp = esp
+ +
+ +
+---------+
我的理解應該是這樣吧,為啥看有的書里面總是下面這樣的呢?
+---------+
+ 引數M +
+ --------+<-----ebp+4是引數M
+ return +
+---------+<-----ebp指向return address
+old ebp +
+ +
+++++++
+ +
+ +
+---------+
uj5u.com熱心網友回復:
ebp指向的是堆疊底啊, esp 才是指向堆疊頂,確定沒搞錯?(Intel 堆疊是從高地址向低地址增長的)push ebp
+---------+
+ 引數M +
+ --------+
+ return +
+---------+<-----ebp
+old ebp +
+ +
+++++++ <-----esp
+ +
+ +
+---------+
move ebp esp
+---------+
+ 引數M +
+ --------+<---ebp+8
+ return +
+---------+<---ebp+4
+old ebp +
+ +
+++++++ <----ebp = esp
+ +
+ +
+---------+
push eax
+---------+
+ 引數M +
+ --------+<---ebp+8
+ return +
+---------+<---ebp+4
+old ebp +
+++++++ <----ebp
+ eax +
+++++++<--- esp
+ +
+ +
+ +
+---------+
uj5u.com熱心網友回復:
入堆疊: 先 - 4,再把資料拷貝到 esp 指向的地址出堆疊:先把資料復制出來,然后 + 4
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/107396.html
標籤:內核源代碼研究區
下一篇:centOS
