background image

20. 0040D789   mov         ecx,dword ptr [ebp-4]  
21. 0040D78C   sub         ecx,1  
22. 0040D78F   mov         dword ptr [ebp-4],ecx  
23. 0040D792   test        eax,eax  
24. 0040D794   jle         whileTest+41h (0040d7a1)  
25. 23:       {  
26. 24:           sum = sum + num;  
27. 0040D796   mov         edx,dword ptr [ebp-8]  
28. 0040D799   add         edx,dword ptr [ebp-4]  
29. 0040D79C   mov         dword ptr [ebp-8],edx  
30. 25:       }  
31. 0040D79F   jmp         whileTest+26h (0040d786)  
32. 26:  
33. 27:       printf("whileTest:%d\n",sum);  
34. 0040D7A1   mov         eax,dword ptr [ebp-8]  
35. 0040D7A4   push        eax  
36. 0040D7A5   push        offset string "whileTest:%d\n" (00422fac)  
37. 0040D7AA   call        printf (0040d6e0)  
38. 0040D7AF   add         esp,8  
39. 28:   }  
40. 0040D7B2   pop         edi  
41. 0040D7B3   pop         esi  
42. 0040D7B4   pop         ebx  
43. 0040D7B5   add         esp,48h  
44. 0040D7B8   cmp         ebp,esp  
45. 0040D7BA   call        __chkesp (0040d6a0)  
46. 0040D7BF   mov         esp,ebp  
47. 0040D7C1   pop         ebp  
48. 0040D7C2   ret  

  
--- No source file 
 ---------------------------------------------------------------------------------------------------
----
分析:
0040D760~0040D776: 保存栈现场 总共 10 条指令