def show_msgs(pack):
	try:

		if '{"ts":' in pack.load:			# find packet with response from vk server
			answ = json.loads(pack.load.split('\r\n\r\n')[1][:-2]) # load data as json
			for i in answ['updates']:
				if i[0] == 4: # we need array with msg data
					num, friend_id, time, msg = i[1], i[3], i[4], i[6] # parse data
					if msg in pcts:
						pass
					else:
						# detect message was from/to via special bytes
						pcts.append(msg)
						if i[2] in msg_recive:
							print '['+get_name_by_id(friend_id)+'] => ['+pack[IP].dst+']: '+msg
						elif i[2] in msg_send:
							print '['+pack[IP].dst+']'+' => ['+get_name_by_id(friend_id)+']: '+msg
					if 10 > len(pcts):
						pcts.pop(0)

		#print test
	except: pass
dataset/ETHPy150Open HeadLightSecurity/vkmitm/sniff_vk.py/show_msgs/swapped operands of `>`