parameters: ()
return_statement: return len(config.GOODBB),len(config.ERRORBBALL)
docstring: this function executes the initial test set to determine error handling BBs in the SUT. Such BBs are given zero weights during actual fuzzing.
docstring_summary: this function executes the initial test set to determine error handling BBs in the SUT. Such BBs are given zero weights during actual fuzzing.
docstring_tokens: this function executes the initial test set to determine error handling BBs in the SUT . Such BBs are given zero weights during actual fuzzing .
function: def dry_run():
      ''' this function executes the initial test set to determine error handling BBs in the SUT. Such BBs are given zero weights during actual fuzzing.
  '''
      print "[*] Starting dry run now..."
      tempbad=[]
      dfiles=os.listdir(config.INITIALD)
      if len(dfiles) <3:
          gau.die("not sufficient initial files")
  
      for fl in dfiles:
          tfl=os.path.join(config.INITIALD,fl)
          try:
              f=open(tfl, 'r')
              f.close()
          except:
              gau.die("can not open our own input %s!"%(tfl,))
          (bbs,retc)=execute(tfl)
          if retc < 0:
              print "Signal: %d"% (retc,)
              gau.die("looks like we already got a crash!!")
          config.GOODBB |= set(bbs.keys())
      print "[*] Finished good inputs (%d)"%(len(config.GOODBB),)
      #now lets run SUT of probably invalid files. For that we need to create them first.
      print "[*] Starting bad inputs.."
      lp=0
      badbb=set()
      while lp <2:
          try:
                  shutil.rmtree(config.INPUTD)
          except OSError:
                  pass
  
          os.mkdir(config.INPUTD)
          gau.create_files_dry(30)
          dfiles=os.listdir(config.INPUTD)
          for fl in dfiles:
              tfl=os.path.join(config.INPUTD,fl)
              (bbs,retc)=execute(tfl)
              if retc < 0:
                  print "Signal: %d"% (retc,)
                  gau.die("looks like we already got a crash!!")
              tempbad.append(set(bbs.keys()) - config.GOODBB)
              
          tempcomn=set(tempbad[0])
          for di in tempbad:
              tempcomn.intersection_update(set(di))
          badbb.update(tempcomn)
          lp +=1
      #else:
      #  tempcomn = set()
      ###print "[*] finished bad inputs (%d)"%(len(tempbad),)
      config.ERRORBBALL=badbb.copy()
      print "[*] finished common BB. TOtal such BB: %d"%(len(badbb),)
      for ebb in config.ERRORBBALL:
          print "error bb: 0x%x"%(ebb,)
      time.sleep(5)
      if config.LIBNUM == 2:
          baseadr=config.LIBOFFSETS[1]
          for ele in tempcomn:
              if ele < baseadr:
                  config.ERRORBBAPP.add(ele)
              else:
                  config.ERRORBBLIB.add(ele-baseadr)
                           
      del tempbad
      del badbb
      #del tempgood
      return len(config.GOODBB),len(config.ERRORBBALL)
function_tokens: def dry_run ( ) : print "[*] Starting dry run now..." tempbad = [ ] dfiles = os . listdir ( config . INITIALD ) if len ( dfiles ) < 3 : gau . die ( "not sufficient initial files" ) for fl in dfiles : tfl = os . path . join ( config . INITIALD , fl ) try : f = open ( tfl , 'r' ) f . close ( ) except : gau . die ( "can not open our own input %s!" % ( tfl , ) ) ( bbs , retc ) = execute ( tfl ) if retc < 0 : print "Signal: %d" % ( retc , ) gau . die ( "looks like we already got a crash!!" ) config . GOODBB |= set ( bbs . keys ( ) ) print "[*] Finished good inputs (%d)" % ( len ( config . GOODBB ) , ) #now lets run SUT of probably invalid files. For that we need to create them first. print "[*] Starting bad inputs.." lp = 0 badbb = set ( ) while lp < 2 : try : shutil . rmtree ( config . INPUTD ) except OSError : pass os . mkdir ( config . INPUTD ) gau . create_files_dry ( 30 ) dfiles = os . listdir ( config . INPUTD ) for fl in dfiles : tfl = os . path . join ( config . INPUTD , fl ) ( bbs , retc ) = execute ( tfl ) if retc < 0 : print "Signal: %d" % ( retc , ) gau . die ( "looks like we already got a crash!!" ) tempbad . append ( set ( bbs . keys ( ) ) - config . GOODBB ) tempcomn = set ( tempbad [ 0 ] ) for di in tempbad : tempcomn . intersection_update ( set ( di ) ) badbb . update ( tempcomn ) lp += 1 #else: #  tempcomn = set() ###print "[*] finished bad inputs (%d)"%(len(tempbad),) config . ERRORBBALL = badbb . copy ( ) print "[*] finished common BB. TOtal such BB: %d" % ( len ( badbb ) , ) for ebb in config . ERRORBBALL : print "error bb: 0x%x" % ( ebb , ) time . sleep ( 5 ) if config . LIBNUM == 2 : baseadr = config . LIBOFFSETS [ 1 ] for ele in tempcomn : if ele < baseadr : config . ERRORBBAPP . add ( ele ) else : config . ERRORBBLIB . add ( ele - baseadr ) del tempbad del badbb #del tempgood return len ( config . GOODBB ) , len ( config . ERRORBBALL )