[英]Understanding about data type python
Today I've started learn about reverse engineering.今天我开始学习逆向工程。 I met struc.pack(), but I dont know what \\x12 meaning.我遇到了 struc.pack(),但我不知道 \\x12 是什么意思。
from struct import pack
pack('>I', 0x1337)
'\x00\x00\x137'
So \\x137 is equal to 0x1337 (hex) in big-edian?所以 \\x137 等于 big-edian 中的 0x1337 (hex)?
'0x137'
is not a single byte, its actually two different bytes - 0x13
and 0x37
(or the character '7'
) . '0x137'
不是单个字节,它实际上是两个不同的字节 - 0x13
和0x37
(或字符'7'
)。 The hexadecimal value for the ascii value of '7'
is 0x37
, hence you get 0x137
. '7'
的 ascii 值的十六进制值为0x37
,因此您得到0x137
。 Example -例子 -
>>> hex(ord('7'))
'0x37'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.