Get the Start Address of a thread from a process and terminate it individually

1

What I want to do is open up to check if a process is open, view the thread list, identify it by the Start Address, and end a thread specific to the process. I can do it manually by the processhacker, but I need a script for it.

Itriedtomakeapython,becauseitisthelanguagethatIammoreaccustomedto,Ievenmanagedtolistthethreadsoftheprocess,butIcannotfindtheStartAddressorfinishthespecificthread.Woulditbepossibletodothisinpython?Ifnot,withwhatlanguageshouldIdoit?Andhow?

Inpythontolistthreadswouldbesomethinglikethis

importpsutilPROCNAME="processo.exe"
for proc in psutil.process_iter():
    if proc.name() == PROCNAME:
         threads = psutil.Process(proc.pid)
         for thread in threads.threads():
             print(thread)
    
asked by anonymous 17.03.2018 / 11:02

0 answers