Skip to content

Instantly share code, notes, and snippets.

View dexter3k's full-sized avatar

Alexander dexter3k

View GitHub Profile
import socket
import struct
import json
def unpack_varint(s):
d = 0
for i in range(5):
b = ord(s.recv(1))
d |= (b & 0x7F) << 7*i
if not b & 0x80: