1

I am trying to disassemble a few Arm Cortex-M3 .elf binaries and run a custom IDAPython script (script.py) from the command line (in batch mode). I have been able to do that with the following command:

/path_to_idapro/idat -B -parm:ARMv7-M -logfile.log -S"/path_to_script/script.py arg1" elf_to_disassemble 

However, I need to load an SVD file before running script.py so that my analysis will be complete. In IDA Pro GUI, I do the following:

  • Edit > Plugins > SVD file management
  • Select the SVD file

How can I pass the SVD file (e.g., /path_to_SVD/STM32F103.svd) as an argument to my previous command?

I have already searched the command line switches of IDA Pro https://www.hex-rays.com/products/ida/support/idadoc/417.shtml, and to my understanding, there isn’t such an option.

I am currently using IDA Pro v7.6 in Ubuntu 20.04.3 LTS.

1 Answer 1

0

You can run plugins from a script as follows:

import ida_loader arg = 0 ida_loader.load_and_run_plugin("svdimport", arg) 

Where arg has size_t type. This normally allows you to select plugin modes, but does not allow you to pass strings to your plugin.

Thus, I think there are two not-so-pleasant options:

  • generate idb manually and only then analyse it in batch mode (doesn't make much sense when analysing at scale)
  • use a custom SVD Loader Plugin with a hardcoded file value or passed through configuration file (check out this and this as an input pointers)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.