|
[求助]lstrlenA问题
找到答案了。^_^谢谢各位 我的系统是 xp/sp2, 下面是 kernel32!lstrlenA 函数的主要部分: 7C80BDB6 > 6A 08 PUSH 8 7C80BDB8 68 F0BD807C PUSH kernel32.7C80BDF0 7C80BDBD E8 0467FFFF CALL kernel32.7C8024C6 7C80BDC2 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8] 7C80BDC5 85C0 TEST EAX,EAX 7C80BDC7 0F84 68A80200 JE kernel32.7C836635 7C80BDCD 8365 FC 00 AND DWORD PTR SS:[EBP-4],0 7C80BDD1 8D50 01 LEA EDX,DWORD PTR DS:[EAX+1] ;* 这里给 edx 设置值 7C80BDD4 8A08 MOV CL,BYTE PTR DS:[EAX] 7C80BDD6 40 INC EAX 7C80BDD7 84C9 TEST CL,CL 7C80BDD9 ^75 F9 JNZ SHORT kernel32.7C80BDD4 7C80BDDB 2BC2 SUB EAX,EDX ;* 依此计算字符串长度 7C80BDDD 834D FC FF OR DWORD PTR SS:[EBP-4],FFFFFFFF 7C80BDE1 E8 1B67FFFF CALL kernel32.7C802501 7C80BDE6 C2 0400 RETN 4 由于上面的取当前字符后给 EAX 增 1 了, 所以, 遇到了结束字节 00 时, EAX 指向了 00 的下一个字符. 为了使得长度准确, 同样起始地址 (EDX) 也要增 1, 所以才有 lea edx, [eax+1]. 当然了, 也可以有其它的计算方法, 只是 ms 选择了这个方法而已. |
|
|
|
[求助]lstrlenA问题
我在调试的时候也发现了,会去除用户名的第一位字符 就是edx指向的ASCII串edx, dword ptr [406349]。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值