0

I have developed a idapython script and I run it using the following command: idat.exe -S"myscript.py" -L"logs.txt" -A .\mylib.so

In myscript.py I appended the exit(0) in order to stop idat.exe, otherwise the command above never ends. But when I open the logs.txt file I find the following lines:

myscript.py: Traceback (most recent call last):
  File "C:\Program Files\IDAPro\python\3\ida_idaapi.py", line 616, in IDAPython_ExecScript
    exec(code, g)
  File "myscript.py", line 49, in <module>
    exit(0)
  File "<frozen _sitebuiltins>", line 26, in __call__
SystemExit: 0
 -> OK

So, my question is, what is the correct way to stop the execution of idat.exe when I run a script with -A?

1
  • idaapi.qexit(0) Commented Jul 19, 2023 at 16:27

1 Answer 1

1

For IDA 7.0+ you may better use ida_pro.qexit(0).

Stop execution of IDC program, close the database and exit to OS code: code to exit with

https://hex-rays.com/products/ida/support/idadoc/197.shtml

Your Answer

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

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