码迷,mamicode.com
首页 > 其他好文 > 详细

汇编查看StackFrame栈帧

时间:2015-05-04 17:29:57      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

INCLUDE Irvine32.inc
myProc PROTO, x:DWORD, y:DWORD

.data
.code
main proc
    mov eax,0EAEAEAEAh
    mov ebx,0EBEBEBEBh
    INVOKE myProc, 1111h, 2222h
    exit
main endp
myProc proc uses eax ebx, x:DWORD, y:DWORD
    LOCAL a:DWORD, b:DWORD

    PARAMS = 2
    LOCALS = 2
    SAVED_REGS = 2
    mov a,0AAAAh
    mov b,0BBBBh    
    inc x
    inc y
    INVOKE WriteStackFrame, PARAMS, LOCALS,SAVED_REGS
    ret
myProc endp

end main

Alt+8查看

--- D:\Irvine\Examples\Project32\ShowStackFrame.asm ----------------------------
    mov eax,0EAEAEAEAh
00401020  mov         eax,0EAEAEAEAh  
    mov ebx,0EBEBEBEBh
00401025  mov         ebx,0EBEBEBEBh  
    INVOKE myProc, 1111h, 2222h
0040102A  push        2222h  
0040102F  push        1111h  
00401034  call        myProc (0401040h)  
    exit
00401039  push        0  
0040103B  call        _ExitProcess@4 (0402064h)  
main endp
myProc proc uses eax ebx, x:DWORD, y:DWORD
00401040  push        ebp  
00401041  mov         ebp,esp  
00401043  add         esp,0FFFFFFF8h  
00401046  push        eax  
00401047  push        ebx  
    LOCAL a:DWORD, b:DWORD

    PARAMS = 2
    LOCALS = 2
    SAVED_REGS = 2
    mov a,0AAAAh
00401048  mov         dword ptr [a],0AAAAh  
    mov b,0BBBBh    
0040104F  mov         dword ptr [b],0BBBBh  
    inc x
00401056  inc         dword ptr [x]  
    inc y
00401059  inc         dword ptr [y]  
    INVOKE WriteStackFrame, PARAMS, LOCALS,SAVED_REGS
0040105C  push        2  
0040105E  push        2  
00401060  push        2  
00401062  call        _WriteStackFrame@12 (0401F6Fh)  
    ret
00401067  pop         ebx  
00401068  pop         eax  
00401069  leave  
0040106A  ret         8  
--- 无源文件 ---------------------------------------------

 

汇编查看StackFrame栈帧

标签:

原文地址:http://www.cnblogs.com/wucg/p/4476283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!