Translating...

This commit is contained in:
danogentili 2016-06-28 17:21:10 +02:00
parent d4bdc545a4
commit ddd92f5b30
4 changed files with 2 additions and 3 deletions

BIN
TL.php

Binary file not shown.

2
TL.py
View File

@ -117,8 +117,8 @@ def deserialize(bytes_io, type_=None, subtype=None):
"""
:type bytes_io: io.BytesIO object
"""
print type_
assert isinstance(bytes_io, io.BytesIO)
# Built-in bare types
if type_ == 'int': x = struct.unpack('<i', bytes_io.read(4))[0]
elif type_ == '#': x = struct.unpack('<I', bytes_io.read(4))[0]

Binary file not shown.

View File

@ -106,12 +106,11 @@ class Session:
if not crc32(packet_length_data + packet[0:-4]) == struct.unpack('<I', packet[-4:])[0]:
raise Exception("CRC32 was not correct!")
x = struct.unpack("<I", packet[:4])
print x[0]
auth_key_id = packet[4:12]
if auth_key_id == b'\x00\x00\x00\x00\x00\x00\x00\x00':
# No encryption - Plain text
(message_id, message_length) = struct.unpack("<8sI", packet[12:24])
print struct.unpack("<8sI", packet[12:24])
data = packet[24:24+message_length]
elif auth_key_id == self.auth_key_id:
message_key = packet[12:28]