import struct
data = open(r'C:\git\bt411\content\BTL4.RES', 'rb').read()
labOnly, maxID = struct.unpack_from('<ii', data, 4)
offs = struct.unpack_from('<%dI' % maxID, data, 12)
anims = []
for o in offs:
    if o == 0:
        continue
    rid, rt = struct.unpack_from('<ii', data, o)
    nm = data[o + 8:o + 40].split(b'\0')[0].decode('ascii', 'replace')
    if rt == 16:
        anims.append((rid, nm))
print('type-16 Animation resources:', len(anims))
for rid, nm in sorted(anims, key=lambda x: x[1]):
    print('  id=%4d  %s' % (rid, nm))
