Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Catch UnicodeDecode errors and do nothing. (#135)
Fixes: ``` Traceback (most recent call last): File "<string>", line 7, in <module> File "D:\\dqxclarity\hooking\network_text.py", line 51, in __init__ category = read_string(self.var_address + 40) # var name is 40 bytes in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\\dqxclarity\common\memory.py", line 77, in read_string return PYM_PROCESS.read_string(address, bytes_to_read) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\\dqxclarity\pymem\__init__.py", line 959, in read_string value = pymem.memory.read_string(self.process_handle, address, byte) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\\dqxclarity\pymem\memory.py", line 572, in read_string buff = buff.decode() ^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 0: invalid continuation byte ``` and ``` Traceback (most recent call last): File "<string>", line 7, in <module> File "D:\\dqxclarity\hooking\network_text.py", line 51, in __init__ category = read_string(self.var_address + 40) # var name is 40 bytes in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\\dqxclarity\common\memory.py", line 77, in read_string return PYM_PROCESS.read_string(address, bytes_to_read) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\\dqxclarity\pymem\__init__.py", line 959, in read_string value = pymem.memory.read_string(self.process_handle, address, byte) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\\dqxclarity\pymem\memory.py", line 572, in read_string buff = buff.decode() ^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa4 in position 0: invalid start byte ```
- Loading branch information