如何解决为什么退出代码是这样的,为什么调用的第一个字节是 0x0000 然后是“printf”
我目前正在反转最小的 pe 文件。这是我分析的:
程序打印 * 268b universal tiny PE\n
并返回退出代码26(字符串长度)
(1): Magic DOS Signature header
(2): e_lfanew address of PE header
(3): PE Signature Magic
(4): Machine code 386
(5): Optional Header magic Signature
(6): Address Of EntryPoint : 0x00000107
(7): jump to 0x0000001e
(8): push 0x004000e4 (which is address of the string)
(9): the string at 0x000000e4
(10): call 0x00400044 (which call (a) 0x00000062 which refers to (b) `printf` string )
(11): jump to (12) 0x00000034
(12): add esp,0x4 (to restore the stack due to call)
(13): ret (which should exit the program because we are not in a call ?)
问题:
- 为什么 (a) 是 0x00000062(而不是 0x00000064,因为 printf 从 0x00000064 开始)?
- 为什么程序返回 26(也就是字符串的长度)?
- 我们将如何添加返回特定退出代码的指令?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。