反汇编系列(四) while

#include"stdio.h"
int function(int a,int b)
{
    int c=a+b;
    int i=0;
    while(i<50)
    {
        c=c+i;
    }
    return c;
}
void main()
{
    function(1,2);
} 


--- c:\users\wangchao\desktop\test\test\main.cpp -------------------------------
#include "stdio.h"
int function(int a,int b)
{
00AE1A40 push ebp
00AE1A41 mov ebp,esp
00AE1A43 sub esp,0D8h
00AE1A49 push ebx
00AE1A4A push esi
00AE1A4B push edi
00AE1A4C lea edi,[ebp-0D8h]
00AE1A52 mov ecx,36h
00AE1A57 mov eax,0CCCCCCCCh
00AE1A5C rep stos dword ptr es:[edi]
    int c=a+b;
00AE1A5E mov eax,dword ptr [a]
00AE1A61 add eax,dword ptr [b]
00AE1A64 mov dword ptr [c],eax
    int i=0;
00AE1A67 mov dword ptr [i],0
    while(i<50)
00AE1A6E cmp dword ptr [i],32h
00AE1A72 jge function+3Fh (0AE1A7Fh)
    {
        c=c+i;
00AE1A74 mov eax,dword ptr [c]
00AE1A77 add eax,dword ptr [i]
00AE1A7A mov dword ptr [c],eax
    }
00AE1A7D jmp function+2Eh (0AE1A6Eh)
    return c;
00AE1A7F mov eax,dword ptr [c]
}
00AE1A82 pop edi
00AE1A83 pop esi
00AE1A84 pop ebx
00AE1A85 mov esp,ebp
00AE1A87 pop ebp

00AE1A88 ret

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值