0

IDA plugin handles signal only when I click the "hotkey" and not when I execute signal with

$ echo "test" > /tmp/fifo & # created w/ `mkfifo /tmp/fifo`
$ kill -SUIGUSR2 $(pidof ida)

Plugin code;

import idaapi
import signal


def receiveSignal(signalNumber, frame):
    print('Received:', signalNumber)
    print('[+]', open('/tmp/fifo').readline())
    return

class PluginEntry(idaapi.plugin_t):
    flags = 0  # load each time a database is opened in IDA.
    comment = ""
    help = ""
    wanted_name = "A"
    wanted_hotkey = "Alt+S"

    def init(self):
        signal.signal(signal.SIGUSR2, receiveSignal)
        return idaapi.PLUGIN_OK

    def term(self):
        pass

    def run(self, arg):
        print('[-] run')


def PLUGIN_ENTRY():
    return PluginEntry()

When I hit the hotkey;

[-] run
Received: 12
[+] test

Is there a way to make it handle on signal ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.