6

Currently, I'm generating a bunch of .idb files in a batch via idaw.exe -B <FILE>. (I'm using IDA Pro 6.8.) This process also creates many .asm files - one for each .idb file created. I don't need these files, so they just get ignored/deleted.

Is there a way to generate .idb files from the command line without also generating the .asm files?

Samantha
  • 225
  • 2
  • 5

1 Answers1

9

At the bottom of the help page you can see the following:

For batch mode, IDA must be invoked with the following command line:

ida -B input-file

which is equivalent to:

ida -c -A -Sanalysis.idc input-file

I.e. the actual analysis and writing of .asm is done by analysis.idc. Looking into it, we can see:

static main()
{
  // turn on coagulation of data in the final pass of analysis
  set_inf_attr(INF_AF, get_inf_attr(INF_AF) | AF_DODATA | AF_FINAL);
  // .. and plan the entire address space for the final pass
  auto_mark_range(0, BADADDR, AU_FINAL);

msg("Waiting for the end of the auto analysis...\n"); auto_wait();

msg("\n\n------ Creating the output file.... --------\n"); auto file = get_idb_path()[0:-4] + ".asm";

auto fhandle = fopen(file, "w"); gen_file(OFILE_ASM, fhandle, 0, BADADDR, 0); // create the assembler file msg("All done, exiting...\n"); qexit(0); // exit to OS, error code 0 - success }

So just make your own copy of the script, remove the part writing out .asm file (gen_file call), and run IDA with your own script:

ida -c -A -Smyanalysis.idc -Lida.log input-file

Igor Skochinsky
  • 36,553
  • 7
  • 65
  • 115
  • This was a while ago, but where are the msg prints directed? This script file still looks identical to what you have posted here. I don't see any of those prints when running the script as shown. – sherrellbc May 13 '20 at 17:03
  • 1
    @sherrellbc set IDALOG=ida.log or use -Lida.log switch – Igor Skochinsky May 19 '20 at 07:04
  • If a Python script is used as the argument for -S, is ida_auto.auto_wait() a sufficient call to have a similar effect as auto_wait from the analysis.idc script? – sherrellbc Sep 30 '20 at 15:59