@staticmethod
def _read_c_string(fp, ptr):
    """Read a NULL-terminated C string from fp at ptr"""
    fp.seek(ptr)
    chunk = fp.read(50)
    chunks = [chunk]
    while chunk.find(b'\x00') == -1:
        chunk = fp.read(50)
        if not chunk or len(chunks) > 10:
            break
        chunks.append(chunk)
    data = b''.join(chunks)
    return data[:data.find(b'\x00')]
