def unpack_int(buffer, ptr, length):
	""" Unpack an int of specified length from the buffer and advance the pointer """
	return (
		int.from_bytes(buffer[ptr:(ptr+length)], 'little', signed=False),
		ptr + length
		)