Exemple #1
0
    def get_source_class_ext(self, _class):
        c = decompile.DvClass(_class, self.vmx)
        c.process()

        result = c.get_source_ext()

        return result
Exemple #2
0
    def display_all(self, _class) :
        from androguard.decompiler.dad import decompile

        c = decompile.DvClass( _class, self.vmx )
        c.process()

        c.show_source()
Exemple #3
0
def _get_java_code(_class, _vmx):
	try:
		_ms = decompile.DvClass(_class, _vmx)
		_ms.process()
		return _ms.get_source()
	except Exception, e:
		print "Error getting Java source code for: {:s}".format(_class.get_name())
Exemple #4
0
    def display_all(self, _class):
        from androguard.decompiler.dad import decompile

        c = decompile.DvClass(_class, self.vmx)
        c.process()

        lexer = get_lexer_by_name("java", stripall=True)
        formatter = TerminalFormatter()
        result = highlight(c.get_source(), lexer, formatter)
        print result
Exemple #5
0
def _store_java(_vmx, _vms, _args):
    for _vm in _vms:
        for _class in _vm.get_classes():
            try:
                _ms = decompile.DvClass(_class, _vmx)
                _ms.process()
                _f = _file_name(_class.get_name(), _args.dir)
                _ensure_dir(_f)
                with open(_f, "w") as f:
                    _java = str(_ms.get_source())
                    f.write(_java)
            except Exception as e:
                print(
                    ("Could not process {:s}: {:s}".format(_class.get_name(), str(e)))
                )
def _store_java(_vm, _args):
	_vmx = newVMAnalysis(_vm)
	_vmx.create_xref()
	_vm.set_vmanalysis(_vmx)
	_vm.create_python_export()
	#_vm.create_dref(_vmx)

	for _class in _vm.get_classes():
		try:
			_ms = decompile.DvClass(_class, _vmx)
			_ms.process()
			_f = _file_name(_class.get_name(), _args.dir)
			_ensure_dir(_f)
			with open(_f, "w") as f:
				_java = str(_ms.get_source())
				f.write(_java)
		except Exception, e:
			print("Could not process {:s}: {:s}".format(_class.get_name(), str(e)))
Exemple #7
0
 def get_ast_class(self, _class):
     c = decompile.DvClass(_class, self.vmx)
     c.process(doAST=True)
     return c.get_ast()
Exemple #8
0
 def get_source_class(self, _class):
     c = decompile.DvClass(_class, self.vmx)
     c.process()
     return c.get_source()