反汇编:循环语句各个版本对比
4.6.循环语句各版本对比
代码及相关分析来自于《加密与解密》
时间2021年0311
1.do循环
【示例代码1】
int _tmain(int argc, _TCHAR* argv[]) { int nCount = 0; do { printf("%d\r\n", nCount); nCount++; } while (nCount < argc); return 0; }

x64-debug版本:

x64-release版本:

x86-debug版本:

x86-release版本:

2.while循环
【示例代码2】
int _tmain(int argc, _TCHAR* argv[]) { int nCount = 0; while (nCount < argc) { printf("%d\r\n", nCount); nCount++; } return 0; }
分析:

x64-debug版本:

x64-release版本:

x86-debug版本:

x86-release版本:

3.for循环
【示例代码3】
int _tmain(int argc, _TCHAR* argv[]) { for (int nCount = 0; nCount < argc; nCount++) { printf("%d\r\n", nCount); } return 0; }
分析:

x64-debug版本:

x64-release版本:

x86-debug版本:(与x64类似,具体看前几张图片)

x86-release版本:(与x64类似,具体看前几张图片)


浙公网安备 33010602011771号