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");

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

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