@@ -38,7 +38,7 @@ def __init__(self):
3838 "core_name" : None ,
3939 "essid" : None ,
4040 "file" : None ,
41- "ncpus" : 1 }
41+ "ncpus" : None }
4242 self .pyrit_obj = None
4343
4444 def progressbar (self , idx , max_idx ):
@@ -208,10 +208,15 @@ def batchprocess(self):
208208 cp = cpyrit .CPyrit (ncpus = self .options ["ncpus" ])
209209 if self .options ["core_name" ] is not None :
210210 core = cp .getCore (self .options ["core_name" ])
211- print "Selected core '%s' (%i CPUs) " % ( core .name , cp . ncpus )
211+ print "Selected core '%s'" % core .name ,
212212 else :
213213 core = cp .getCore ()
214- print "Using default core '%s' (%i CPUs)" % (core .name , cp .ncpus )
214+ print "Using default core '%s'" % core .name ,
215+ if core .ctype == 'GPU' :
216+ print "(Device '%s')" % core .devicename
217+ else :
218+ print "(%i CPUs)" % cp .ncpus
219+
215220 comptime = 0
216221 rescount = 0
217222 essids = self .pyrit_obj .list_essids ()
@@ -240,8 +245,6 @@ def batchprocess(self):
240245 print "%i PMKs to do." % len (passwords )
241246
242247 if len (passwords ) > 0 :
243- #We slice the workunit to smaller parts since calc_pmklist won't return on KeyboardInterrupt
244- #the overhead of slicing is minimal
245248 for pwslice in xrange (0 ,len (passwords ), 15000 ):
246249 pwset = passwords [pwslice :pwslice + 15000 ]
247250 t = time .time ()
@@ -276,19 +279,19 @@ def benchmark(self):
276279 print "%i PMKs in %.2f seconds: %.2f PMKs/s" % (len (pws ), t , len (pws ) / t )
277280 md = md5 .new ()
278281 map (md .update , [x [1 ] for x in res ])
279- print "Result hash: %s" % md . hexdigest () , {True : "OK" , False : "FAILED" }[md .hexdigest () == "ef747d123821851a9bd1d1e94ba048ac" ]
282+ print "Result hash:" , {True : "OK" , False : "FAILED" }[md .hexdigest () == "ef747d123821851a9bd1d1e94ba048ac" ]
280283 print ""
281284
282285 if 'Nvidia CUDA' in [x [0 ] for x in c .listCores ()]:
283286 core = c .getCore ('Nvidia CUDA' )
284- print "Testing GPU core '%s'... " % core .name
287+ print "Testing GPU core '%s' (Device '%s') " % ( core .name , core . devicename )
285288 t = time .time ()
286289 res = sorted (core .solve ('foo' , pws ))
287290 t = time .time () - t
288291 print "%i PMKs in %.2f seconds: %.2f PMKs/s" % (len (pws ), t , len (pws ) / t )
289292 md = md5 .new ()
290293 map (md .update , [x [1 ] for x in res ])
291- print "Result hash: %s" % md . hexdigest () , {True : "OK" , False : "FAILED" }[md .hexdigest () == "ef747d123821851a9bd1d1e94ba048ac" ]
294+ print "Result hash:" , {True : "OK" , False : "FAILED" }[md .hexdigest () == "ef747d123821851a9bd1d1e94ba048ac" ]
292295 print ""
293296
294297if __name__ == "__main__" :
0 commit comments