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)
print('maxID', maxID, 'first slots:', offs[:6])
for i, o in enumerate(offs[:8]):
    if o == 0:
        print('slot', i, 'EMPTY')
        continue
    rid, rt = struct.unpack_from('<ii', data, o)
    nm = data[o + 8:o + 40].split(b'\0')[0].decode('ascii', 'replace')
    print('slot %d -> id=%d type=%d name=%r' % (i, rid, rt, nm))
