def _safe_wstring_at(self, buff, offset):
idx = 0
length = 0
while offset + idx + 1 < len(buff):
if buff[offset+idx] == b'\x00' and buff[offset+idx+1] == b'\x00':
return ct.wstring_at(ct.addressof(buff) + offset, length)
idx += 2
length += 1
return None # terminating null char not found
评论列表
文章目录