Fix encoding error.

This commit is contained in:
Manuel Amador (Rudd-O) 2022-07-12 05:53:21 +00:00
parent f84379bb33
commit 920805a8fd

View File

@ -35,6 +35,8 @@ PACKFORMAT = "!HbIx"
def set_proc_name(newname):
from ctypes import cdll, byref, create_string_buffer
if isinstance(newname, str):
newname = newname.encode("utf-8")
libc = cdll.LoadLibrary("libc.so.6")
buff = create_string_buffer(len(newname) + 1)
buff.value = newname