parameters: (bin_path, glibc_version, verbose, libc_path, libm_path)
docstring: Analyse objdump informations, get glibc functions > glibc_version
      and print former glibc dependent versions of the very same functions
      found in libm and libc
docstring_summary: Analyse objdump informations, get glibc functions > glibc_version
      and print former glibc dependent versions of the very same functions
      found in libm and libc
docstring_tokens: Analyse objdump informations get glibc functions > glibc_version and print former glibc dependent versions of the very same functions found in libm and libc
function: def get_glibc_functions(bin_path, glibc_version, verbose, libc_path, libm_path):
      """ Analyse objdump informations, get glibc functions > glibc_version
      and print former glibc dependent versions of the very same functions
      found in libm and libc
  
      """
      bin_paths = get_bin_path(os.path.abspath(bin_path))
      functions = []
      # Looking for GLIBC dependencies with objdump -T
      for path in bin_paths:
          process = subprocess.Popen(["objdump", "-T", path],
                                     stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE)
          result = process.stdout.readlines()
          for function in result:
              index = function.find("GLIBC_")
              if index >= 0:
                  subfunction = function[index:].rstrip()
                  index = subfunction.find(" ")
                  if index:
                      version = subfunction[6:index]
                      # Compare versions
                      if StrictVersion(version) >= StrictVersion(glibc_version):
                          if verbose:
                              print ("{0} glibc found in {1}:\n{2}"
                                     ).format(version,
                                              os.path.basename(path),
                                              function)
                          functions.append(subfunction[index+1:])
      if len(functions) == 0:
          "No dependencies > to {0} found.".format(glibc_version)
          return
      functions = list(set(functions))
      for function in functions:
          process = subprocess.Popen(["readelf", "-s", libc_path],
                                     stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE)
          process2 = subprocess.Popen(["readelf", "-s", libm_path],
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.PIPE)
          result = process.stdout.readlines() + process2.stdout.readlines()
          print "====== for {0}:".format(function)
          for entry in result:
              if function in entry:
                  print entry
function_tokens: def get_glibc_functions ( bin_path , glibc_version , verbose , libc_path , libm_path ) : bin_paths = get_bin_path ( os . path . abspath ( bin_path ) ) functions = [ ] # Looking for GLIBC dependencies with objdump -T for path in bin_paths : process = subprocess . Popen ( [ "objdump" , "-T" , path ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) result = process . stdout . readlines ( ) for function in result : index = function . find ( "GLIBC_" ) if index >= 0 : subfunction = function [ index : ] . rstrip ( ) index = subfunction . find ( " " ) if index : version = subfunction [ 6 : index ] # Compare versions if StrictVersion ( version ) >= StrictVersion ( glibc_version ) : if verbose : print ( "{0} glibc found in {1}:\n{2}" ) . format ( version , os . path . basename ( path ) , function ) functions . append ( subfunction [ index + 1 : ] ) if len ( functions ) == 0 : "No dependencies > to {0} found." . format ( glibc_version ) return functions = list ( set ( functions ) ) for function in functions : process = subprocess . Popen ( [ "readelf" , "-s" , libc_path ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) process2 = subprocess . Popen ( [ "readelf" , "-s" , libm_path ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) result = process . stdout . readlines ( ) + process2 . stdout . readlines ( ) print "====== for {0}:" . format ( function ) for entry in result : if function in entry : print entry