while
00B113E5 cmp dword ptr [i],0Ah
00B113E9 jge main+44h (0B11404h)
{
printf("dsfdsafdsa");
00B113EB mov esi,esp
00B113ED push 0B15858h
00B113F2 call dword ptr ds:[0B19114h]
00B113F8 add esp,4
00B113FB cmp esi,esp
00B113FD call __RTC_CheckEsp (0B11136h)
}
00B11402 jmp main+25h (0B113E5h)
- 判断语句在执行体前面,jmp回跳语句在执行体之后,回跳到判断语句test或者cmp
flag:
cmp
jge flag_finish
{
}
jmp flag
flag_finish:
do while
00EA13DE mov dword ptr [i],0
do{
printf("dsfdsafdsa");
00EA13E5 mov esi,esp
00EA13E7 push 0EA5858h
00EA13EC call dword ptr ds:[0EA9114h]
00EA13F2 add esp,4
00EA13F5 cmp esi,esp
00EA13F7 call __RTC_CheckEsp (0EA1136h)
i++;
00EA13FC mov eax,dword ptr [i]
00EA13FF add eax,1
00EA1402 mov dword ptr [i],eax
} while (i <= 10);
00EA1405 cmp dword ptr [i],0Ah
00EA1409 jle main+25h (0EA13E5h)
flag:
{
}
cmp
jle flag
for
00D013DE mov dword ptr [i],0
for (int i = 0; i < 10; i++)
00D013E5 mov dword ptr [ebp-14h],0
00D013EC jmp main+37h (0D013F7h)
00D013EE mov eax,dword ptr [ebp-14h]
00D013F1 add eax,1
00D013F4 mov dword ptr [ebp-14h],eax
00D013F7 cmp dword ptr [ebp-14h],0Ah
00D013FB jge main+56h (0D01416h)
{
printf("dsfdsafdsa");
00D013FD mov esi,esp
00D013FF push 0D05858h
00D01404 call dword ptr ds:[0D09114h]
00D0140A add esp,4
00D0140D cmp esi,esp
00D0140F call __RTC_CheckEsp (0D01136h)
}
00D01414 jmp main+2Eh (0D013EEh)
- 先初始化自增量,然后跳转到flag2执行,然后回跳到flag1增加量+1,。执行体中有跳出循环的比较语句
flag0:
自增量初始化
jmp flag2
flag1:
自增量加1
flag2:
cmp
jge flag_finish
{
}
jmp flag1
flag_finish:
if … else if … else
00DC362E mov dword ptr [i],0Ah
if (i > 5)
00DC3635 cmp dword ptr [i],5
00DC3639 jle main+44h (0DC3654h)
{
printf("i > 5");
00DC363B mov esi,esp
00DC363D push 0DC5858h
00DC3642 call dword ptr ds:[0DC9114h]
00DC3648 add esp,4
00DC364B cmp esi,esp
00DC364D call __RTC_CheckEsp (0DC1136h)
00DC3652 jmp main+7Ah (0DC368Ah)
}
else if (i < 5)
00DC3654 cmp dword ptr [i],5
00DC3658 jge main+63h (0DC3673h)
{
printf("i < 5");
00DC365A mov esi,esp
00DC365C push 0DC5860h
00DC3661 call dword ptr ds:[0DC9114h]
00DC3667 add esp,4
00DC366A cmp esi,esp
00DC366C call __RTC_CheckEsp (0DC1136h)
}
else {
00DC3671 jmp main+7Ah (0DC368Ah)
printf("i == 5");
00DC3673 mov esi,esp
00DC3675 push 0DC58B8h
00DC367A call dword ptr ds:[0DC9114h]
00DC3680 add esp,4
00DC3683 cmp esi,esp
00DC3685 call __RTC_CheckEsp (0DC1136h)
}
return 0;
00DC368A xor eax,eax
flag1:
cmp
jle flag2:
{
}
jmp flag_finish
flag2:
cmp
jle flag_finish
{
}
flag3:
{
}
flag_finish:
switch
00BB362E mov dword ptr [i],0Ah
switch (i)
00BB3635 mov eax,dword ptr [i]
00BB3638 mov dword ptr [ebp-0D0h],eax
00BB363E cmp dword ptr [ebp-0D0h],1
00BB3645 je main+39h (0BB3649h)
00BB3647 jmp main+52h (0BB3662h)
{
case 1:
printf("1");
00BB3649 mov esi,esp
00BB364B push 0BB5858h
00BB3650 call dword ptr ds:[0BB9114h]
00BB3656 add esp,4
00BB3659 cmp esi,esp
00BB365B call __RTC_CheckEsp (0BB1136h)
break;
00BB3660 jmp main+69h (0BB3679h)
default:
printf("default");
00BB3662 mov esi,esp
00BB3664 push 0BB5860h
00BB3669 call dword ptr ds:[0BB9114h]
00BB366F add esp,4
00BB3672 cmp esi,esp
00BB3674 call __RTC_CheckEsp (0BB1136h)
break;
}
return 0;
00BB3679 xor eax,eax
flag1:
cmp
je flag1_1
jmp flag2
flag1_1:
{
}
flag2:
cmp
je flag2_2
jmp flag_default
flag2_2:
{
}
flag_default:
{
}