0

How can I get input from user with IdaPython?

When I tried str = input() ,I got error RuntimeError: input(): lost.sys.stdin

1 Answer 1

1

You can use the ask_* functions from the ida_kernwin module.

For example:

  • ask_long: Display a dialog box and wait for the user to input an number
  • ask_str: Display a dialog box and wait for the user to input a text string
  • ask_file: Display a dialog box and wait for the user to input a file name
  • ask_form: Display a dialog box and wait for the user

There are also the choose_* functions if you want the user to choose something from the database (function, segment, structure). And fully customisable forms (see this example).

4
  • how do I install ida_kernwin ? is there a build in option to get string without install module? Mar 25, 2020 at 9:30
  • The ida_kernwin module is part of IDAPython. Try pasting the following code into the interpreter in the Output window: ida_kernwin.ask_str("Default value", 0, "Please enter string")
    – neat
    Mar 25, 2020 at 10:27
  • I tried import ida_kerwin and I get ` No moudle named 'ida_kerwin'` Mar 25, 2020 at 10:52
  • 1
    ida_kernwin, not ida_kerwin, and it should already be imported
    – neat
    Mar 25, 2020 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.