#########################################
#Ida batch mode test code by obaby
#2012.03.13
#Mars Security
#http://www.h4ck.org.cn
#Email:root@h4ck.ws
#########################################
import sys
import os
import subprocess
# Fill these feilds with ur own ida file path and the idc file u want to execute!
idcScriptFileName = "batchmode.idc"
ida32qFilePath = '"F:Crackl@bHex-Rays.IDA.Pro.Advanced.v6.1ida61idaq.exe"'
ida64qFilePath = "F:Crackl@bHex-Rays.IDA.Pro.Advanced.v6.1ida61idaq64.exe"
ida32wFilePath ='"F:Crackl@bHex-Rays.IDA.Pro.Advanced.v6.1ida61idaw.exe"'
ida64wFilePath = "F:Crackl@bHex-Rays.IDA.Pro.Advanced.v6.1ida61idaw64.exe"
#The binary file list text
TargetList = "F:/Python 2.6/_eric4project/idabatchmode/list.txt"
TargetFile_object = open(TargetList, "r").readlines()
for eachline in TargetFile_object:
#print eachline,
#print eachline
eachline = eachline.replace('n','').replace('r', '')
if os.path.exists(eachline):
tmpExecStr = ida32wFilePath " -A -c -S" idcScriptFileName " " '"' eachline '"' #fixup the space in the file path
print tmpExecStr,
#os.system(tmpExecStr) #singl process with cmdwindow
#os.popen(tmpExecStr) singl process without cmdwindow
subprocess.Popen(tmpExecStr) #mulity process with cmd window
print ("All Process have been started!")