Ejemplo n.º 1
0
    def with_apk(self, apk_file):
      if apk_file.is_valid_APK():
        d = dvm.DalvikVMFormat( apk_file.get_dex() )
        dx = analysis.uVMAnalysis( d )

        return self.with_apk_direct(apk_file, d, dx)
      return {}
Ejemplo n.º 2
0
 def __init__(self, name):
     vm = auto_vm(name)
     if vm is None:
         raise ValueError('Format not recognised: %s' % name)
     self.vma = analysis.uVMAnalysis(vm)
     self.classes = dict((dvclass.get_name(), dvclass)
                         for dvclass in vm.get_classes())
Ejemplo n.º 3
0
  def create_adex(self, log, dexobj):
    """
      This method is called in order to create a VMAnalysis object

      :param log: an object which corresponds to a unique app
      :param dexobj: a :class:`DalvikVMFormat` object

      :rytpe: a :class:`VMAnalysis` object
    """
    return analysis.uVMAnalysis(dexobj)
Ejemplo n.º 4
0
    def create_adex(self, log, dexobj):
        """
      This method is called in order to create a VMAnalysis object

      :param log: an object which corresponds to a unique app
      :param dexobj: a :class:`DalvikVMFormat` object

      :rytpe: a :class:`VMAnalysis` object
    """
        return analysis.uVMAnalysis(dexobj)
Ejemplo n.º 5
0
    def analyze(self):
        self.__a = analysis.uVMAnalysis(self.__bc)
        self.__bc.set_vmanalysis(self.__a)

        self.__g = ganalysis.GVMAnalysis(self.__a, None)

        self.__bc.set_gvmanalysis(self.__g)

        self.__bc.create_xref()
        self.__bc.create_dref()
Ejemplo n.º 6
0
    def with_dex(self, dex_file):
      """
            @param dex_file : a buffer

            @rtype : return the risk of the dex file (from 0.0 to 100.0)
      """
      d = dvm.DalvikVMFormat( dex_file )
      dx = analysis.uVMAnalysis( d )

      return self.with_dex_direct(d, dx)
Ejemplo n.º 7
0
    def analyze(self):
        self.__a = analysis.uVMAnalysis( self.__bc )
        self.__bc.set_vmanalysis( self.__a )

        self.__g = ganalysis.GVMAnalysis( self.__a, None )

        self.__bc.set_gvmanalysis( self.__g )

        self.__bc.create_xref()
        self.__bc.create_dref()