Skip to content

Instantly share code, notes, and snippets.

^Cbarney@mononoke:~/barneygale-Ashitaka-00bd9be$ ./ashitaka.py
[23:22:55] 0xfe: Server List Ping {}
[23:22:55] 0xff: Disconnect {'reason': u'Shhh!\xa718\xa7150'}
[23:22:55] 0xff: Disconnect {'reason': 'Disconnecting'}
[23:22:58] 0xfe: Server List Ping {}
[23:22:58] 0xff: Disconnect {'reason': u'Shhh!\xa718\xa7150'}
[23:22:58] 0xff: Disconnect {'reason': 'Disconnecting'}
[23:23:09] 0x02: Handshake {'username': u'barneygale'}
[23:23:09] 0x02: Handshake {'connection_hash': u'censored'}
[23:23:10] 0x01: Login request {'username': u'barneygale', 'map_seed': 0, 'unknown2': 0, 'unknown3': 0, 'unknown1': 0, 'unknown4': 0, 'protocol_version': 15}
[00:30:13] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 0, 'unknown1': 0}
[00:30:25] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 1, 'unknown1': 1}
[00:30:25] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 2, 'unknown1': 2}
[00:30:26] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 3, 'unknown1': 3}
[00:30:26] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 4, 'unknown1': 4}
[00:30:27] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 5, 'unknown1': 5}
[00:30:27] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 6, 'unknown1': 6}
[00:30:27] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 7, 'unknown1': 7}
[00:30:27] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 8, 'unknown1': 8}
[00:30:27] <<< 0x2b: UNKNOWN {'unknown2': 0, 'unknown3': 9, 'unknown1': 9}
import socket
import struct
def get_info(host, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.send('\xfe')
assert s.recv(1) == '\xff'
l = struct.unpack('!h', s.recv(2))[0]
d = s.recv(l*2).decode('utf-16be').split(u'\xa7')
[05:35:50] <<< 0x08: Update health {'unknown2': 9, 'unknown3': 0.0, 'unknown1': 19}
[05:36:03] <<< 0x08: Update health {'unknown2': 8, 'unknown3': 0.0, 'unknown1': 19}
[05:36:21] <<< 0x29: UNKNOWN {'unknown2': 17, 'unknown3': 0, 'unknown1': 977986, 'unknown4': 600}
[05:36:21] <<< 0x08: Update health {'unknown2': 12, 'unknown3': 0.800000011920929, 'unknown1': 19}
[05:36:22] <<< 0x08: Update health {'unknown2': 12, 'unknown3': 0.0, 'unknown1': 19}
[05:36:24] <<< 0x29: UNKNOWN {'unknown2': 17, 'unknown3': 0, 'unknown1': 977986, 'unknown4': 600}
[05:36:24] <<< 0x08: Update health {'unknown2': 16, 'unknown3': 0.800000011920929, 'unknown1': 19}
[05:36:29] <<< 0x08: Update health {'unknown2': 16, 'unknown3': 0.0, 'unknown1': 19}
[05:36:34] <<< 0x08: Update health {'unknown2': 15, 'unknown3': 0.0, 'unknown1': 19}
[05:36:41] <<< 0x08: Update health
/* 16 */ public static final ud c = new ud(1).a("potion.moveSpeed");
/* 17 */ public static final ud d = new ud(2).a("potion.moveSlowdown");
/* 18 */ public static final ud e = new ud(3).a("potion.digSpeed");
/* 19 */ public static final ud f = new ud(4).a("potion.digSlowDown");
/* 20 */ public static final ud g = new ud(5).a("potion.damageBoost");
/* 21 */ public static final ud h = new abn(6).a("potion.heal");
/* 22 */ public static final ud i = new abn(7).a("potion.harm");
/* 23 */ public static final ud j = new ud(8).a("potion.jump");
/* 24 */ public static final ud k = new ud(9).a("potion.confusion");
/* 25 */ public static final ud l = new ud(10).a("potion.regeneration");
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:
[02:50:44] <<< 0x17: Add object/vehicle {'entity_id': 306507, 'unknown': 0, 'y': 2144, 'x': 7817, 'z': 12892, 'type': 63}
[02:50:44] <<< 0x1c: Entity velocity {'entity_id': 306507, 'x_velocity': -608, 'z_velocity': -1290, 'y_velocity': 2808}
...
[02:50:49] <<< 0x1d: Destroy entity {'entity_id': 306507}
[11:07:57] <<< 0x08: Update health {'food': 0, 'food_saturation': 0.0, 'health': 10}
[11:08:09] <<< 0x29: Entity effect {'duration': 600, 'amplifier': 0, 'entity_id': 64953, 'effect_id': 10}
[11:08:09] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 11}
[11:08:10] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 12}
[11:08:11] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 13}
[11:08:13] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 14}
[11:08:14] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 15}
[11:08:15] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 16}
[11:08:16] <<< 0x08: Update health {'food': 10, 'food_saturation': 10.0, 'health': 17}
[11:08:18] <<< 0x08: Update health {'food': 10, 'food_saturation
I collect some experience orbs...
[14:31:39] <<< 0x2b: Experience update {'experience_bar': 9, 'total_experience': 19, 'level': 1}
[14:31:39] <<< 0x08: Update health {'food': 16, 'food_saturation': 0.0, 'health': 0}
[14:31:39] <<< 0x1a: Experience orb {'y': 1984, 'x': -1143, 'entity_id': 105560, 'z': 1166, 'count': 7}
[14:31:39] <<< 0x1a: Experience orb {'y': 1984, 'x': -1143, 'entity_id': 105561, 'z': 1166, 'count': 1}
[14:31:39] <<< 0x1a: Experience orb {'y': 1984, 'x': -1143, 'entity_id': 105562, 'z': 1166, 'count': 1}
[14:31:39] <<< 0x1a: Experience orb {'y': 1984, 'x': -1143, 'entity_id': 105563, 'z': 1166, 'count': 7}
[14:31:39] <<< 0x1a: Experience orb {'y': 1984, 'x': -1143, 'entity_id': 105564, 'z': 1166, 'count': 1}
[14:31:39] <<< 0x1a: Experience orb {'y': 1984, 'x': -1143, 'entity_id': 105565, 'z': 1166, 'count': 1}
Let's collect some experience...
[14:24:53] <<< 0x2b: Experience update {'experience_bar': 0, 'total_experience': 0, 'level': 0}
[14:25:03] <<< 0x1a: Experience orb {'y': 2176, 'x': -3489, 'entity_id': 90397, 'z': 2958, 'count': 3}
[14:25:04] <<< 0x2b: Experience update {'experience_bar': 3, 'total_experience': 3, 'level': 0}
[14:25:31] <<< 0x1a: Experience orb {'y': 2272, 'x': -2929, 'entity_id': 91583, 'z': 3450, 'count': 1}
[14:25:31] <<< 0x2b: Experience update {'experience_bar': 4, 'total_experience': 4, 'level': 0}
[14:25:50] <<< 0x1a: Experience orb {'y': 2176, 'x': -3449, 'entity_id': 92768, 'z': 2948, 'count': 3}
[14:25:50] <<< 0x2b: Experience update {'experience_bar': 7, 'total_experience': 7, 'level': 0}
[14:25:58] <<< 0x1a: Experience orb {'y': 2208, 'x': -4015, 'entity_id': 92945, 'z': 3158, 'count': 1}