@@ -88,7 +88,7 @@ def __init__(
8888 Arguments:
8989 - path: path of the directory that holds the target executable
9090 - filename: filename of the target executable
91- - deps: list of summary jars
91+ - deps: list of summary zips
9292 - hints: Dictionary with items to add to the userdata file
9393 - elf/mips/arm: modifiers (default is x86 PE)
9494 """
@@ -455,7 +455,7 @@ def _analyze_until_stable(
455455 preamble_cutoff : int = 12 ) -> int :
456456 cwd = os .getcwd ()
457457 os .chdir (self .path ) # temporary change in directory
458- functionsjarfile = UF .get_functionsjar_filename (self .path , self .filename )
458+ functionszipfile = UF .get_functionszip_filename (self .path , self .filename )
459459 analysisdir = UF .get_analysis_dir (self .path , self .filename )
460460 cmd = [self .chx86_analyze , "-summaries" , self .chsummaries ]
461461 cmd .extend (["-preamble_cutoff" , str (preamble_cutoff )])
@@ -510,7 +510,7 @@ def _analyze_until_stable(
510510 cmd .append ("-fail_on_function_failure" )
511511
512512 cmd .extend (["-analyze" , self .filename ])
513- jarcmd = ["jar " , "cf" , functionsjarfile , "-C " , analysisdir , "functions" ]
513+ zipcmd = ["zip " , "-r " , functionszipfile , "functions" ]
514514 print_progress_update ("Analyzing "
515515 + self .filename
516516 + " (max "
@@ -543,17 +543,17 @@ def _analyze_until_stable(
543543 or (count > iterations ))
544544
545545 if isfinished :
546- chklogger .logger .debug ("execute command %s" , " " .join (jarcmd ))
547- subprocess .call (jarcmd , stderr = subprocess .STDOUT )
546+ chklogger .logger .debug ("execute zip command %s" , " " .join (zipcmd ))
547+ subprocess .call (zipcmd , stderr = subprocess .STDOUT , cwd = analysisdir )
548548 fincmd = cmd + ["-collectdata" ]
549549 if self .use_ssa :
550550 fincmd = fincmd + ["-ssa" ]
551551 if self .no_varinvs :
552552 fincmd = fincmd + ["-no_varinvs" ]
553553 chklogger .logger .debug ("execute command %s" , " " .join (fincmd ))
554554 result = self ._call_analysis (fincmd , timeout = timeout )
555- chklogger .logger .debug ("execute command %s" , " " .join (jarcmd ))
556- subprocess .call (jarcmd , stderr = subprocess .STDOUT )
555+ chklogger .logger .debug ("execute zip command %s" , " " .join (zipcmd ))
556+ subprocess .call (zipcmd , stderr = subprocess .STDOUT , cwd = analysisdir )
557557 count += 1
558558 (stable , results , r_update ) = self ._get_results ()
559559 print_progress_update (r_update + " " + self .filename )
@@ -563,11 +563,12 @@ def _analyze_until_stable(
563563 print ("\n " .join (lines ))
564564 return isstable == "yes"
565565
566- chklogger .logger .debug ("execute command %s" , " " .join (jarcmd ))
567- subprocess .call (jarcmd , stderr = subprocess .STDOUT )
566+ chklogger .logger .debug ("execute zip command %s" , " " .join (zipcmd ))
567+ subprocess .call (zipcmd , stderr = subprocess .STDOUT , cwd = analysisdir )
568568 result = self ._call_analysis (cmd , timeout = timeout )
569569 if result != 0 :
570- chklogger .logger .debug ("return cwd %s" , cwd )
570+ chklogger .logger .error ("zip command failed with return code %s, "
571+ "changing back to folder %s" , result , cwd )
571572 os .chdir (cwd ) # return to original directory
572573 print ("\n " .join (lines ))
573574 return result
0 commit comments