Batch Analysis

This program forces the IDA Disassembler in "batch" analysis mode if it is started in the following way : ida -Sanalysis.idc file.
  
static main() {
  auto x,y;

  Message("Waiting for the end of auto analys...\n");
  Wait();

  x = SegStart(BeginEA());
  y = SegEnd(BeginEA());
  Message("Analysing area %08X - %08X...\n",x,y);
  AnalyseArea(x,y);
  Wait();		// wait for code segment analysis to finish

  Message("\n\n------ Creating output file.... --------\n");
  WriteTxt("ida.out",0,0xFFFFFFFF);
  Message("All done, exiting...\n");
  Exit(0);				// exit to OS, error code 0 - success
}