我在 Intel x86_64、Ubuntu 64bit、Python3、Pwntools v4.3.1 上进行测试
$ python
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pwn import *
>>> addr = 0xbffffb78
>>> print(p32(addr))
b'x\xfb\xff\xbf'
在我看来,正确的打包结果0xbffffb78
应该是\x78\xfb\xff\xbf
.
但为什么b'x\xfb\xff\xbf
会发生?\x78 在哪里?
什么是正确的包装方式,而不是使用p32()
?