Writing plugin : IDA Pro crashes when I launch a thread

316 views Asked by At

IDA pro craches when I try to start thread into the run method, any idea ??

Is there some restriction for running thread in ida ? because I found nothing in documentation, writing plugin ida.

import idaapi
from threading import Thread
import time

class Listener(Thread):
    def __init__(self):
        Thread.__init__(self)

    def run(self):
        time.sleep(3)

class myplugin_t(idaapi.plugin_t):
    flags = idaapi.PLUGIN_UNL

    def init(self):
        return idaapi.PLUGIN_OK

    def run(self, arg):
        t1 = Listener();
        t1.start();
        t1.join();

    def term(self):
        pass

def PLUGIN_ENTRY():
    return myplugin_t()

PS: The same problem is found when I write the plugin in c++

1

There are 1 answers

0
LRBH10 On

In python, you can use

thread.start_new_thread(functionname, ()) # the second arguments is for args

which works in ida pro.

For c++, Any ida ?