srounet / Pymem

A python library for windows, providing the needed functions to start working on your own with memory editing.
MIT License
303 stars 45 forks source link

read_string method need a encoding parameter #120

Closed huangyiyang89 closed 7 months ago

huangyiyang89 commented 7 months ago

def read_string(handle, address, byte=50,encoding='utf-8'): buff = pymem.Pymem.read_bytes(handle, address, byte) i = buff.find(b'\x00') if i != -1: buff = buff[:i] buff = buff.decode(encoding) return buff