def create_taint_trail(self, taintindex, silent=False, space=False): os.chdir(self.apppath) cmd = [ self.config.analyzer, '-summaries', self.jdksummaries, '-taintorigin', str(taintindex) ] self.add_dependencies(cmd) self.add_excludes(cmd) if self.verbose: cmd.append('-verbose') if self.dbg: cmd.append('-dbg') self.add_jars(cmd) if not silent: print('Executing: ' + ' '.join(cmd)) try: stdout = subprocess.DEVNULL if silent else sys.stdout result = subprocess.call(cmd, cwd=self.apppath, stdout=stdout, stderr=subprocess.STDOUT) except OSError as e: raise UF.CHJOSErrorInAnalyzer(cmd, e) except subprocess.CalledProcessError as e: raise UF.CHJProcessErrorInAnalyzer(cmd, e) if result == 0: return else: raise UF.CHJCodeHawkAnalyzerError(cmd, result)
def rungui(self): os.chdir(self.apppath) cmd = [self.config.gui, '-summaries', self.jdksummaries] self.add_dependencies(cmd) self.add_excludes(cmd) self.add_jars(cmd) print('Running the gui: ' + ' '.join(cmd)) try: result = subprocess.call(cmd, cwd=self.apppath, stderr=subprocess.STDOUT) except OSError as e: raise UF.CHJOSErrorInAnalyzer(cmd, e) except subprocess.CalledProcessError as e: raise UF.CHJProcessErrorInAnalyzer(cmd, e) if result == 0: return else: raise UF.CHJCodeHawkAnalyzerError(cmd, result)
def analyze(self, intervalsonly=False): os.chdir(self.apppath) cmd = [self.config.analyzer, '-summaries', self.jdksummaries] self.add_dependencies(cmd) self.add_excludes(cmd) if self.verbose: cmd.append('-verbose') self.add_jars(cmd) print('Executing: ' + ' '.join(cmd)) try: result = subprocess.call(cmd, cwd=self.apppath, stderr=subprocess.STDOUT) except OSError as e: raise UF.CHJOSErrorInAnalyzer(cmd, e) except subprocess.CalledProcessError as e: raise UF.CHJProcessErrorInAnalyzer(cmd, e) if result == 0: return else: raise UF.CHJCodeHawkAnalyzerError(cmd, result)
def translate_only(self): os.chdir(self.apppath) cmd = [ self.config.analyzer, '-summaries', self.jdksummaries, '-translate_only' ] self.add_dependencies(cmd) self.add_excludes(cmd) self.add_jars(cmd) print('Executing: ' + ' '.join(cmd)) try: result = subprocess.call(cmd, cwd=self.apppath, stderr=subprocess.STDOUT) except OSError as e: raise UF.CHJOSErrorInAnalyzer(cmd, e) except subprocess.CalledProcessError as e: raise UF.CHJProcessErrorInAnalyzer(cmd, e) if result == 0: return else: raise UF.CHJCodeHawkAnalyzerError(cmd, result)