我目前正在试图建立在Python RDP客户端和我碰到一个LEN检查以下问题来了;蟒蛇LEN计算
来源:http://msdn.microsoft.com/en-us/library/cc240836%28v=prot.10%29.aspx
81 2a -> ConnectData::connectPDU length = 298 bytes Since the most significant bit of the first byte (0x81) is set to 1 and the following bit is set to 0, the length is given by the low six bits of the first byte and the second byte. Hence, the value is 0x12a, which is 298 bytes.
这听起来很奇怪。
对于正常LEN检查,我只是使用:struct.pack(">h",len(str(PacketLen)))
但在这种情况下,我真的没有看到上述我如何计算LEN。
任何帮助将不胜感激!
感谢您的! 我仍然收到错误DOH: struct.error: 'H' 格式要求-32768 <=号<= 32767 任何想法,为什么? – n00bz0r 2012-03-22 17:29:18
因为'h'是有符号的类型,您很可能希望将未签名版,'H' – SingleNegationElimination 2012-03-22 17:38:28
传说,谢谢你们! – n00bz0r 2012-03-22 17:39:49