|
|
|
[原创]反汇编学习笔记--溢出初探(存疑)
还是把题结了吧。 问题就在sprintf()函数,该函数在构造 字符串时 \n(0x0A) 会占一位 然后后面还有 0x00 做为结束符 就是这样最后多出的一位0x00把 i的值给覆盖掉了 其实文章中我的分析注释已经基本写清楚了,只是觉的 怎么会多加一位 0x00,因为在我的脑海中记得是 \n就是字符串的结束符了啊 这次是我第一次在看雪发帖。。。 文章比较粗浅,只是自己的在学习反汇编中的一篇笔记。 要学的东西好多啊,革命尚未成功,我还需继续努力啊! 谢谢 sessiondiy 的热情回帖。 |
|
[原创]反汇编学习笔记--溢出初探(存疑)
sprintf 结束后,覆盖确实覆盖了13个byte的数据 导致的结果吧 c[i].b 2byte 和 i(4个byte) 的最低一位的btye也被覆盖了 覆盖为 0 了。 这些都是由于sprintf()造成的 本以为是\n(0x0A)是字符串的结束, 但是后面似乎 还多出了一byte 0x00 难道所有的这种构造字符串的都是已 0x00结束吗? |
|
[原创]反汇编学习笔记--溢出初探(存疑)
注意 0A,00 覆盖掉的是 c[1].b的值 而不是 i 从跟踪的来两次循环来看 第一次的时候i不会收到影响 i++ 使其从 0变为1 c[0].b 会被覆盖成 30 0A c[1].a中一位会被覆盖成00 第二次的时候 c[1].b 被修改成 31 0A sprintf 只会覆盖 c[1].b的值 i的值到底是谁改的? 是什么原理了? |
|
|
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值