exex4 / xx4-bfv-aimassist

A python based external aim assist for Battlefield V
BSD 3-Clause "New" or "Revised" License
70 stars 35 forks source link

I think you could use the package psutil that may not cause the error "unicode decode error" #20

Open WERDXZ opened 2 years ago

WERDXZ commented 2 years ago

while 1:

    #    if (i == 0):
    #        last = not api.Process32First(snapshot, byref(process))
    #    else:
    #        last = not api.Process32Next(snapshot, byref(process))
    #    procname = process.szExeFile
    #    if procname.decode("utf-8").lower() == name.lower():
    #        pid = process.th32ProcessID
    #        break

    #    if (last):
    #        break
    #    i += 1
    for proc in psutil.process_iter():
        # check whether the process name matches
        if proc.name() == name:
            pid = proc.pid
            break