strlen和strcpy的识别
来源:互联网 发布:淘宝助理图片不显示 编辑:程序博客网 时间:2024/04/28 02:41
字符串处理函数通常会被编译器优化为内联函数,本文试分析VS2015下O2优化的strlen和strcpy的识别特征。
n = strlen(szHello);00409EA2 8D 45 E8 lea eax,[szHello] ;取字符串首地址00409EA5 83 C4 08 add esp,8 ;无关代码00409EA8 8D 50 01 lea edx,[eax+1] ;首地址加1 00409EAB 0F 1F 44 00 00 nop dword ptr [eax+eax] ;作用不明00409EB0 8A 08 mov cl,byte ptr [eax] ;逐个取字符00409EB2 40 inc eax ;自增00409EB3 84 C9 test cl,cl ;判断是否为'\0'00409EB5 75 F9 jne main+30h (0409EB0h) ;do循环首 00409EB7 2B C2 sub eax,edx ;计算长度
strlen特征:
lea eax,[String]lea edx,[eax+1]未知语句mov cl,[eax]inc eaxtest cl,cljne LoopBeginsub eax,edx
strcpy(szBuff, szHello);00409EA5 33 C0 xor eax,eax ;eax清000409EA7 66 0F 1F 84 00 00 00 00 00 nop word ptr [eax+eax] ;未知语句 00409EB0 8A 4C 05 D4 mov cl,byte ptr szHello[eax] ;逐个取字符00409EB4 8D 40 01 lea eax,[eax+1] ;仅仅是让eax递增 为什么要用这句呢 是因为其他类型也适用吗 要不inc eax岂不是更快00409EB7 88 4C 05 E7 mov byte ptr [ebp+eax-19h],cl ;逐个赋值00409EBB 84 C9 test cl,cl 00409EBD 75 F1 jne main+30h (0409EB0h)
strcpy特征 :
xor eax,eax未知语句mov cl,String[eax]lea eax,[eax+1]mov [ebp+eax-ArraryLength],cltest cl,cljne LoopBegin
0 0
- strlen和strcpy的识别
- 关于strlen和strcpy的一点问题
- strlen和strcpy的简单实现
- strcpy 和strlen函数的模拟实现
- strcpy和strlen
- strcpy和strlen找错
- strcpy,strlen的源代码
- 实现strcpy和strlen函数
- strcpy函数和strlen函数
- strcpy函数和strlen函数
- 实现strcpy和strlen函数
- strcpy和strlen功能实现
- 模拟实现strcpy和strlen
- C++ strcpy、strcat、strcmp和strlen的实现
- strcpy/strlen/strcmp的实现
- 字符串处理(三)strcpy、strncpy和strlen
- c语言总结:strcpy和strlen
- <代码收藏>字定义strlen和strcpy
- python打开网络图片并缩放
- android:inputType属性和setInputType()方法参数对应整理
- 如何在Eclipse中配置Tomcat
- nginx配置完全解读
- C# Winform 跨线程更新UI控件常用方法总结(转)
- strlen和strcpy的识别
- http get post put delete 区别
- 无限轮播
- stack, queue, dequeue, heap和priority_queue
- 如何使用js动态创建table,并隔行换色
- butterknife
- 微信支付之扫码支付相关代码(Java)(转载)
- openCV 在ubuntu 虚拟机中的linux中安装,并且运行用控制台运行自行写helloworld
- 让apache开启.htaccess--让thinkphp框架的index.php在U地址不用写