Пример #1
0
#!/usr/bin/python3
import sys
sys.path.append('..')
from urbit.util import strings, from_le
from urbit.cue import cue
import binascii
import sys

if sys.version_info[0:2] < (3, 0):
    print("Requires python3", file=sys.stderr)
    exit(1)

packets_hex = [
    b'015facce8d9c058f07fe0c1de0910b234b7b1b38cc871bdc1ce0a99b2b939b17700102180e684598dee8eae6c4022e40809e2d10f7000f3ea137b634bb30397e011720e0db00cf2d21b9b4303790a9b73ab6b26e01fc69d272fb40582aef165dca0be778d9ff16700102360ef0db422a7393cb0309aa63a3eb1640002000d760ee0bdb19a0ab73142627574607b254c6c696a7178000abab8a60d505ddec397738522c00ce480b60bfdc07a40d43534fabf3a2849e009f722de001046801bc6c1d85b195b9815cbdb19995b54085d5b1e5750bb800018506f0b875c5164696d6962607a2046217e60642562607c21416e6d62d0001f0e4e9a5a993f8ec75a2a95b4d7c63b1003cf69b4b8373cb236ba14b7393cb736ba17b73732b136b414b239bcba36b69994ba3232b3b6b810b9b23ab9b6b114b2383cbc36b414b7373cbc317700102043ddcae0b880001e600ef2d28b434b63438902190a637b7b56e01172020a543715dc004081008e0612b284ceecd0d44a86c6cad4cae2dccad5bc00408c0096844c6dadac4022e4040a0017c6f1185b9a595b181a0bcd1a195c98dc9a5d195c9a585a5802cb195a5b9750bb80001b806f86e1d85c9c995d1812c95b1b1e5750b4000fc895733d0b78be0420d47fef5b2f6b3055c80808c037cb7944090cadce4f24082ead8e8ba050c808000efada13a39bab43990ac3039bb34b76e01ec5d150a2e552063df415c6cd2a82b2aa1052040be712d300b5a78071820ce58814836dc0266090069402f9257269657e62616700102cc385c7a0be04e3e994bd82588ae13f2b7209293106b001efbb185c1cd9589b5cca5b1a195d1b5d085b99995cdb5b8a589d195cdb5b490a5b9b9958db5b0a5d1b5959db59085b1c195e1b5b8a5cdcdd5b90b9800010001bc6d4dd195d995b981a0b4c991bdb5a5b9bda580109595750b4000655146405a867ed28423e24d108b13b3055480804987c4fb0210d00ffb5dc072f724ef1911ae53457d5eaf'
]
# see ++meal in zuze.hoon
d = []
for packet in packets_hex:
    packet = binascii.a2b_hex(packet)
    num = from_le(packet)
    cake = cue(num)
    print(cake)
    #print(urbit_util.format_hexnum(num))
    print(strings(cake))

#d = ((d[1] & ((1<<8192)-1)) << 8191) | d[0]
#d = (d[1]<<8192) | d[0]

#print(cue(d))
Пример #2
0
def dump_urbit_packet(args, timestamp, srcaddr, sport, dstaddr, dport, data):
    try:
        # Urbit header and payload
        urhdr = unpack('<L', data[0:4])[0]
        proto = urhdr & 7
        mug = (urhdr >> 3) & 0xfffff
        yax = (urhdr >> 23) & 3
        yax_bytes = 1<<(yax+1)
        qax = (urhdr >> 25) & 3
        qax_bytes = 1<<(qax+1)
        crypto = (urhdr >> 27)
        sender = from_le(data[4:4+yax_bytes])
        receiver = from_le(data[4+yax_bytes:4+yax_bytes+qax_bytes])
        payload = data[4+yax_bytes+qax_bytes:]
        if crypto == 2: # %fast
            keyhash = from_le(payload[0:16])
            payload = payload[16:]
        else:
            keyhash = None
    except (IndexError, struct.error):
        print('Warn: invpkt')
        return

    # Decode packet if crypto known
    decrypted = False
    if crypto in [0,1]: # %none %open
        decrypted = True
    if crypto == 2 and keyhash in args.keys: # %fast
        payload = from_le(payload)
        payload = de_crua(args.keys[keyhash], payload)
        payload = to_le(payload)
        decrypted = True
    # Print packet
    hdata = [('proto', str(proto)),
             ('mug', '%05x' % mug),
             ('crypto', crypto_name(crypto))]
    if keyhash is not None and (args.always_show_keyhashes or not decrypted):
         hdata += [('keyhash', format_hexnum(keyhash))]

    if srcaddr is not None:
        metadata = ''
        if args.show_timestamps:
            metadata += colorize(datetime.datetime.utcfromtimestamp(timestamp).strftime('%H%M%S.%f'), COLOR_TIMESTAMP) + ' '
        metadata += (colorize(ipv4str(srcaddr), COLOR_IP) + v_colon + colorize(str(sport), COLOR_IP) + ' ' +
                colorize(pname(sender), COLOR_RECIPIENT) + ' ' +
                v_arrow + ' ' +
                colorize(ipv4str(dstaddr), COLOR_IP) + v_colon + colorize(str(dport), COLOR_IP) + ' ' +
                colorize(pname(receiver), COLOR_RECIPIENT))
    else:
        metadata = ('    %fore ' + # nested packet
                colorize(pname(sender), COLOR_RECIPIENT) + ' ' +
                v_arrow + ' ' +
                colorize(pname(receiver), COLOR_RECIPIENT))

    print( metadata + v_colon + ' ' +
            ' '.join(colorize(key, COLOR_HEADER) + v_equal + colorize(value, COLOR_VALUE) for (key,value) in hdata))
    if decrypted: # decrypted or unencrypted data
        if args.show_raw:
            print('    ' + colorize(hexstr(payload), COLOR_DATA))
        cake = cue(from_le(payload))
        if cake[0] == 1701998438: # %fore
            subpacket = to_le(cake[1][1][1])
            dump_urbit_packet(args, None, None, None, None, None, subpacket)
        else:
            if args.show_nouns:
                sys.stdout.write('    ')
                dump_noun(cake, sys.stdout)
                sys.stdout.write('\n')
    else: # [sealed]
        print('    [' + colorize(hexstr(payload), COLOR_DATA_ENC)+']')
Пример #3
0
import sys

if sys.version_info[0:2] < (3, 0):
    print("Requires python3", file=sys.stderr)
    exit(1)

packets_hex = [
    b'01dfec4dae1cf00002b40900f81458db600500020a0d0002b40002fe58981c3cce900108a8bfa58fedcf9577f6c7e36666958f9306000400a51500f4dfb85839cfb31e23eaa2ea0bf7dc82ece195a6d8f1730f5565009d55a715cbb1a2f1858b07470ae9b4cd61023a554a6c8cbb109f9606e6ff036aca98121fb4ab84d08ae2e26f380ae829d3d4050cd6669b3aad8774a48d1ab39cbc2c6e90ecaa821ced8c419cdbb40fc477776d4bee5cfe9963444dd5844abd4a59d2c594e43d24802ccf72212d4d597ec5b975ce120ee7d53b62e509da99e4bda4fd8895704c7e0146e22b387de3acf1aee9392c8f5a7ea6331d13f1e6c39462c0429411d70591016e6a2de2669891602296b1701b517a8caf2e5b01233970fc95659a28d3f1d093bbd2b5a23f3fe47d93215ba4629059a35efc494fd1c65e90730b6c6c1defac6c32e00204141a40000000000000c042b35604c54803000060812f73077cb2bab572c0677b932307aef705de8d1de81ada00cf1d5a1a5d39c07fc5164696d696262fe1ca04f8d985b9819095c981308585b901c003841dc5e6f6d7f37c425d2bbe812648e809cec30fe8409a292c9dcf78807b82aaebe2d747b3ed8c16ad8a8efcecbdea536546c4fc3bd44ea146165b62b5646387dc9520b57c8f5dd58878b5a993d88ef1064eeb1849d80459cb90898106eccbea01db492c9f2999a442aabe46f8abeafc769e7dc9d15374b1fc93cce109e9ec5179a5617fc7cc7270843f03d15636819253fc2d45cf9c2cb156d340d69d804fa139fba7431443b2caac8fb8e6861204207527f8cefffb8029709121e64c436ce16cefd81a0ef88ac90653d9484171655e865c32b46bd6c8dd8cd987a5f34bb92bd96327ed3f472c1046e1b2d36db0ea542e1400a4ca3fe6c662971e8c1f07ff1f20b900a0ffb2873d400653b77d31fa37f937d096f86753faed634b75cf8d45707db187fec27e2ed0363ecfece6e9e60740cb7c1fa67093d97262a76c354f185b58fb956f56cc9078f89888cd29652b810a896f11e0c986efaf4db322b2e28debab059c67b4cd3731b5c9970397d121dba09fcd102a8d1624e2c5250d4b6919c4b26927db793f37d56ad973abad8e9259a07971ec76b437bfc57540943ad977043a26080286cbe3e7127d1fe1ef1b9c36dd6e5531c220ad809bd9b80a304338b76d9a6e5fe2d97c51caf237f98732fc7d1f463d426103ae683b57b0e453ca23f6596e5799ea2169754a97958c187c8825af8a64473406f2dd7561269d0e4ebede2b1f0ae4716593810108200000000000000007062ce461a4010000b08694c780bf96e67606f856c98985b9814895c1d589b1a58d014003849dc8637b65d05f164f6b9bec888da8f76ae991c9ce0e5be9bbb97f5a0458a26594a3aaf9759c6b7fbb25ac82e8454b3481c218f6f7f0d93ccf352f9715223e967bfccc0e8e25e484257445fcf67d2d7b12b3ed72e56372e63dd1d5bce07da2f5a5d3539534486cde5c7afc0f45c9',
    b'01dfec4dae1cf00002b409000c792ab96f018080420380002d80803f1626078fe3900108a8bfa58fedcf9577f6c7e36666958f9306004ab77062b2072c8950258e3d03da9730f30d9bbb9fa9926c3473beec14d8533683b8afc55a94921a30d2e54a6b8a7ef5227e62e3856131d7c3a39a2e4d75777875c736a8998c45fc61be01258787ad450b1d3288b5c588efa6b81e44efaccf52723b08c357a0d758055489e5f0c66bfa5871bb4e358a9243d59926a3fc8eba73011a007ce44299aa89d57b3e5099bed39fc1072c1700f45ff229981941d9b7f3cbc3597d97632dd4f6d1bca35e24918de57036be0fd1a906f1064edfc6b8e66b42f2491842fe819bbf86cbb23f52c6699e078057b72aafbf5c88e3d16236d12d91079d05400521c9e9ab27a93099d0086ebc4214cb41c19ccd878505a967b543bbdf1fdff6eec5d484d74aff5da8aa74449af5cb4f16e2181c6940047bf08a256b118a1c8af723406e75c78a4aeab55b2335ddb01f2201ab3124ac598a9fc8b73e3500d78d5e0b1941cf2066a90c6e049a2d5c9d8395a415d0877f7f98be37852398ae2abe8afd99774d83974cd7ab199ded53de2e04d870d645606401c10a7f86310e605dd32f0ac84861e0a13760b0d212baf6fc06f5aecc041000000000000080104d07f230d20000005843ca63c01fd30b930b001e20ec2ee5798a18eb68525dd3ef1f292d7e810675c09a4d4c66b4aa42d339ffe3b7f004fc1ece6e6f67b20ccc2fa3e25f36b9ee4ddafa054f61914a6cf9b2c97a36a1fd91a2c23e2f66bd69c833a9be9a33c8663177e4304735da4bbea6589ef02d93d3a3cbb4ce94048b2d26f3aefbfbea0b8d3204aed4c127c1f04af1134ce862749eee6c97a735ae1aed8749e3b32470a507981ca78231ee4146206738ed6940ea7169dc7caaa3dad018e88607f9292413688fe3c98e45e1b954dbef115fcf4b8369c93f68c6d1dacd2bc4bf1efd14de00b648a95e67b31386c6e68d1c282b78dcbb778b22186151ad3d088c084ea435a0e69512d40ec295754b9af479d9e6eaca02c0ff51d42a2c07e4330a372d7134a5990a13ab9076d61fa4c183f1e1cb68af228ce5401feb928a2a1a086124a5a48d9d392c2f698d7b3e6c3dba7621995e316229d8894ce2eab6b3a8bf3149ee24ad1f678b48e8826ee4a85f1e9cb196cc7bb07abd4f192dbd89bfc5b9db67fbce289f6d87f1bfbe839a2ac53d630207eec888a0ff20fc4042fb27db323f7e6cbed5981f170044f18088ad47f4fd34fea5d0e6d06db1be12ec61b677c46c1e3889aca6fd1a41fc5d4a9d4ad1073c29b8790261f65d2cb7920a80796889f8beb4d7040013786dfdec0017c2d71ff14b0e29b30012ce93e44ddbdc39d35c60cb5e40ae6dd67eb9b9746e7a2e9d0fdc54daf556e78a98'
]
# see ++meal in zuze.hoon
d = []
for packet in packets_hex:
    packet = binascii.a2b_hex(packet)
    num = urbit_util.from_le(packet)
    cake = cue(num)
    assert (urbit_util.num_to_term(cake[0]) == '%fore')
    inner = cake[1][1][1]
    print(urbit_util.format_hexnum(inner & ((1 << 96) - 1)))
    inner >>= 96  # drop routing info
    inner_cake = cue(inner)
    assert (urbit_util.num_to_term(inner_cake[0]) == '%carp')
    #print(inner_cake)
    inner2_skin = inner_cake[1][0]
    inner2_idx = inner_cake[1][1][0]
    inner2_cnt = inner_cake[1][1][1][0]
    inner2_hdr = inner_cake[1][1][1][1][0]
    inner2 = inner_cake[1][1][1][1][1]
    d.append(inner2)
    #print(binascii.b2a_hex(to_le(inner2_hdr)))
    #print(binascii.b2a_hex(to_le(inner2)))
Пример #4
0
def dump_urbit_packet(args, timestamp, srcaddr, sport, dstaddr, dport, data):
    try:
        # Urbit header and payload
        urhdr = unpack('<L', data[0:4])[0]
        proto = urhdr & 7
        mug = (urhdr >> 3) & 0xfffff
        yax = (urhdr >> 23) & 3
        yax_bytes = 1 << (yax + 1)
        qax = (urhdr >> 25) & 3
        qax_bytes = 1 << (qax + 1)
        crypto = (urhdr >> 27)
        sender = from_le(data[4:4 + yax_bytes])
        receiver = from_le(data[4 + yax_bytes:4 + yax_bytes + qax_bytes])
        payload = data[4 + yax_bytes + qax_bytes:]
        if crypto == 2:  # %fast
            keyhash = from_le(payload[0:16])
            payload = payload[16:]
        else:
            keyhash = None
    except (IndexError, struct.error):
        print('Warn: invpkt')
        return

    # Decode packet if crypto known
    decrypted = False
    if crypto in [0, 1]:  # %none %open
        decrypted = True
    if crypto == 2 and keyhash in args.keys:  # %fast
        payload = from_le(payload)
        payload = de_crua(args.keys[keyhash], payload)
        payload = to_le(payload)
        decrypted = True
    # Print packet
    hdata = [('proto', str(proto)), ('mug', '%05x' % mug),
             ('crypto', crypto_name(crypto))]
    if keyhash is not None and (args.always_show_keyhashes or not decrypted):
        hdata += [('keyhash', format_hexnum(keyhash))]

    if srcaddr is not None:
        metadata = ''
        if args.show_timestamps:
            metadata += colorize(
                datetime.datetime.utcfromtimestamp(timestamp).strftime(
                    '%H%M%S.%f'), COLOR_TIMESTAMP) + ' '
        metadata += (colorize(ipv4str(srcaddr), COLOR_IP) + v_colon +
                     colorize(str(sport), COLOR_IP) + ' ' +
                     colorize(pname(sender), COLOR_RECIPIENT) + ' ' + v_arrow +
                     ' ' + colorize(ipv4str(dstaddr), COLOR_IP) + v_colon +
                     colorize(str(dport), COLOR_IP) + ' ' +
                     colorize(pname(receiver), COLOR_RECIPIENT))
    else:
        metadata = (
            '    %fore ' +  # nested packet
            colorize(pname(sender), COLOR_RECIPIENT) + ' ' + v_arrow + ' ' +
            colorize(pname(receiver), COLOR_RECIPIENT))

    print(metadata + v_colon + ' ' + ' '.join(
        colorize(key, COLOR_HEADER) + v_equal + colorize(value, COLOR_VALUE)
        for (key, value) in hdata))
    if decrypted:  # decrypted or unencrypted data
        if args.show_raw:
            print('    ' + colorize(hexstr(payload), COLOR_DATA))
        cake = cue(from_le(payload))
        if cake[0] == 1701998438:  # %fore
            subpacket = to_le(cake[1][1][1])
            dump_urbit_packet(args, None, None, None, None, None, subpacket)
        else:
            if args.show_nouns:
                sys.stdout.write('    ')
                dump_noun(cake, sys.stdout)
                sys.stdout.write('\n')
    else:  # [sealed]
        print('    [' + colorize(hexstr(payload), COLOR_DATA_ENC) + ']')
Пример #5
0
#!/usr/bin/python3
import sys
sys.path.append('..')
from urbit.util import strings, from_le
from urbit.cue import cue
import binascii
import sys

if sys.version_info[0:2] < (3,0):
    print("Requires python3", file=sys.stderr)
    exit(1)

packets_hex = [
    b'015facce8d9c058f07fe0c1de0910b234b7b1b38cc871bdc1ce0a99b2b939b17700102180e684598dee8eae6c4022e40809e2d10f7000f3ea137b634bb30397e011720e0db00cf2d21b9b4303790a9b73ab6b26e01fc69d272fb40582aef165dca0be778d9ff16700102360ef0db422a7393cb0309aa63a3eb1640002000d760ee0bdb19a0ab73142627574607b254c6c696a7178000abab8a60d505ddec397738522c00ce480b60bfdc07a40d43534fabf3a2849e009f722de001046801bc6c1d85b195b9815cbdb19995b54085d5b1e5750bb800018506f0b875c5164696d6962607a2046217e60642562607c21416e6d62d0001f0e4e9a5a993f8ec75a2a95b4d7c63b1003cf69b4b8373cb236ba14b7393cb736ba17b73732b136b414b239bcba36b69994ba3232b3b6b810b9b23ab9b6b114b2383cbc36b414b7373cbc317700102043ddcae0b880001e600ef2d28b434b63438902190a637b7b56e01172020a543715dc004081008e0612b284ceecd0d44a86c6cad4cae2dccad5bc00408c0096844c6dadac4022e4040a0017c6f1185b9a595b181a0bcd1a195c98dc9a5d195c9a585a5802cb195a5b9750bb80001b806f86e1d85c9c995d1812c95b1b1e5750b4000fc895733d0b78be0420d47fef5b2f6b3055c80808c037cb7944090cadce4f24082ead8e8ba050c808000efada13a39bab43990ac3039bb34b76e01ec5d150a2e552063df415c6cd2a82b2aa1052040be712d300b5a78071820ce58814836dc0266090069402f9257269657e62616700102cc385c7a0be04e3e994bd82588ae13f2b7209293106b001efbb185c1cd9589b5cca5b1a195d1b5d085b99995cdb5b8a589d195cdb5b490a5b9b9958db5b0a5d1b5959db59085b1c195e1b5b8a5cdcdd5b90b9800010001bc6d4dd195d995b981a0b4c991bdb5a5b9bda580109595750b4000655146405a867ed28423e24d108b13b3055480804987c4fb0210d00ffb5dc072f724ef1911ae53457d5eaf'
]
# see ++meal in zuze.hoon
d = []
for packet in packets_hex:
    packet = binascii.a2b_hex(packet)
    num = from_le(packet)
    cake = cue(num)
    print(cake)
    #print(urbit_util.format_hexnum(num))
    print(strings(cake))

#d = ((d[1] & ((1<<8192)-1)) << 8191) | d[0]
#d = (d[1]<<8192) | d[0]

#print(cue(d))
Пример #6
0
import sys

if sys.version_info[0:2] < (3,0):
    print("Requires python3", file=sys.stderr)
    exit(1)

packets_hex = [
    b'01dfec4dae1cf00002b40900f81458db600500020a0d0002b40002fe58981c3cce900108a8bfa58fedcf9577f6c7e36666958f9306000400a51500f4dfb85839cfb31e23eaa2ea0bf7dc82ece195a6d8f1730f5565009d55a715cbb1a2f1858b07470ae9b4cd61023a554a6c8cbb109f9606e6ff036aca98121fb4ab84d08ae2e26f380ae829d3d4050cd6669b3aad8774a48d1ab39cbc2c6e90ecaa821ced8c419cdbb40fc477776d4bee5cfe9963444dd5844abd4a59d2c594e43d24802ccf72212d4d597ec5b975ce120ee7d53b62e509da99e4bda4fd8895704c7e0146e22b387de3acf1aee9392c8f5a7ea6331d13f1e6c39462c0429411d70591016e6a2de2669891602296b1701b517a8caf2e5b01233970fc95659a28d3f1d093bbd2b5a23f3fe47d93215ba4629059a35efc494fd1c65e90730b6c6c1defac6c32e00204141a40000000000000c042b35604c54803000060812f73077cb2bab572c0677b932307aef705de8d1de81ada00cf1d5a1a5d39c07fc5164696d696262fe1ca04f8d985b9819095c981308585b901c003841dc5e6f6d7f37c425d2bbe812648e809cec30fe8409a292c9dcf78807b82aaebe2d747b3ed8c16ad8a8efcecbdea536546c4fc3bd44ea146165b62b5646387dc9520b57c8f5dd58878b5a993d88ef1064eeb1849d80459cb90898106eccbea01db492c9f2999a442aabe46f8abeafc769e7dc9d15374b1fc93cce109e9ec5179a5617fc7cc7270843f03d15636819253fc2d45cf9c2cb156d340d69d804fa139fba7431443b2caac8fb8e6861204207527f8cefffb8029709121e64c436ce16cefd81a0ef88ac90653d9484171655e865c32b46bd6c8dd8cd987a5f34bb92bd96327ed3f472c1046e1b2d36db0ea542e1400a4ca3fe6c662971e8c1f07ff1f20b900a0ffb2873d400653b77d31fa37f937d096f86753faed634b75cf8d45707db187fec27e2ed0363ecfece6e9e60740cb7c1fa67093d97262a76c354f185b58fb956f56cc9078f89888cd29652b810a896f11e0c986efaf4db322b2e28debab059c67b4cd3731b5c9970397d121dba09fcd102a8d1624e2c5250d4b6919c4b26927db793f37d56ad973abad8e9259a07971ec76b437bfc57540943ad977043a26080286cbe3e7127d1fe1ef1b9c36dd6e5531c220ad809bd9b80a304338b76d9a6e5fe2d97c51caf237f98732fc7d1f463d426103ae683b57b0e453ca23f6596e5799ea2169754a97958c187c8825af8a64473406f2dd7561269d0e4ebede2b1f0ae4716593810108200000000000000007062ce461a4010000b08694c780bf96e67606f856c98985b9814895c1d589b1a58d014003849dc8637b65d05f164f6b9bec888da8f76ae991c9ce0e5be9bbb97f5a0458a26594a3aaf9759c6b7fbb25ac82e8454b3481c218f6f7f0d93ccf352f9715223e967bfccc0e8e25e484257445fcf67d2d7b12b3ed72e56372e63dd1d5bce07da2f5a5d3539534486cde5c7afc0f45c9',
    b'01dfec4dae1cf00002b409000c792ab96f018080420380002d80803f1626078fe3900108a8bfa58fedcf9577f6c7e36666958f9306004ab77062b2072c8950258e3d03da9730f30d9bbb9fa9926c3473beec14d8533683b8afc55a94921a30d2e54a6b8a7ef5227e62e3856131d7c3a39a2e4d75777875c736a8998c45fc61be01258787ad450b1d3288b5c588efa6b81e44efaccf52723b08c357a0d758055489e5f0c66bfa5871bb4e358a9243d59926a3fc8eba73011a007ce44299aa89d57b3e5099bed39fc1072c1700f45ff229981941d9b7f3cbc3597d97632dd4f6d1bca35e24918de57036be0fd1a906f1064edfc6b8e66b42f2491842fe819bbf86cbb23f52c6699e078057b72aafbf5c88e3d16236d12d91079d05400521c9e9ab27a93099d0086ebc4214cb41c19ccd878505a967b543bbdf1fdff6eec5d484d74aff5da8aa74449af5cb4f16e2181c6940047bf08a256b118a1c8af723406e75c78a4aeab55b2335ddb01f2201ab3124ac598a9fc8b73e3500d78d5e0b1941cf2066a90c6e049a2d5c9d8395a415d0877f7f98be37852398ae2abe8afd99774d83974cd7ab199ded53de2e04d870d645606401c10a7f86310e605dd32f0ac84861e0a13760b0d212baf6fc06f5aecc041000000000000080104d07f230d20000005843ca63c01fd30b930b001e20ec2ee5798a18eb68525dd3ef1f292d7e810675c09a4d4c66b4aa42d339ffe3b7f004fc1ece6e6f67b20ccc2fa3e25f36b9ee4ddafa054f61914a6cf9b2c97a36a1fd91a2c23e2f66bd69c833a9be9a33c8663177e4304735da4bbea6589ef02d93d3a3cbb4ce94048b2d26f3aefbfbea0b8d3204aed4c127c1f04af1134ce862749eee6c97a735ae1aed8749e3b32470a507981ca78231ee4146206738ed6940ea7169dc7caaa3dad018e88607f9292413688fe3c98e45e1b954dbef115fcf4b8369c93f68c6d1dacd2bc4bf1efd14de00b648a95e67b31386c6e68d1c282b78dcbb778b22186151ad3d088c084ea435a0e69512d40ec295754b9af479d9e6eaca02c0ff51d42a2c07e4330a372d7134a5990a13ab9076d61fa4c183f1e1cb68af228ce5401feb928a2a1a086124a5a48d9d392c2f698d7b3e6c3dba7621995e316229d8894ce2eab6b3a8bf3149ee24ad1f678b48e8826ee4a85f1e9cb196cc7bb07abd4f192dbd89bfc5b9db67fbce289f6d87f1bfbe839a2ac53d630207eec888a0ff20fc4042fb27db323f7e6cbed5981f170044f18088ad47f4fd34fea5d0e6d06db1be12ec61b677c46c1e3889aca6fd1a41fc5d4a9d4ad1073c29b8790261f65d2cb7920a80796889f8beb4d7040013786dfdec0017c2d71ff14b0e29b30012ce93e44ddbdc39d35c60cb5e40ae6dd67eb9b9746e7a2e9d0fdc54daf556e78a98'
]
# see ++meal in zuze.hoon
d = []
for packet in packets_hex:
    packet = binascii.a2b_hex(packet)
    num = urbit_util.from_le(packet)
    cake = cue(num)
    assert(urbit_util.num_to_term(cake[0]) == '%fore')
    inner = cake[1][1][1]
    print(urbit_util.format_hexnum(inner & ((1<<96)-1)))
    inner >>= 96 # drop routing info
    inner_cake = cue(inner)
    assert(urbit_util.num_to_term(inner_cake[0]) == '%carp')
    #print(inner_cake)
    inner2_skin = inner_cake[1][0]
    inner2_idx = inner_cake[1][1][0]
    inner2_cnt = inner_cake[1][1][1][0]
    inner2_hdr = inner_cake[1][1][1][1][0]
    inner2 = inner_cake[1][1][1][1][1]
    d.append(inner2)
    #print(binascii.b2a_hex(to_le(inner2_hdr)))
    #print(binascii.b2a_hex(to_le(inner2)))