def dvmethod(c, dx, doAST=False):
    for m in c.get_methods():
        mx = dx.get_method(m)
        ms = DvMethod(mx)
        ms.process(doAST=doAST)
        if doAST:
            assert ms.get_ast() is not None
            assert isinstance(ms.get_ast(), dict)
            assert 'body' in ms.get_ast()
        else:
            assert ms.get_source() is not None
Esempio n. 2
0
        def andro_dump(vm, vmx, dump_path):
            # Export each decompiled method
            for method in vm.get_methods():
                mx = vmx.get_method(method)

                if method.get_code() is None:
                    continue
                ms = DvMethod(mx)
                ms.process()
                with open(dump_path, 'a+') as outfile:
                    outfile.write(str(method.get_class_name()))
                    outfile.write(str(method.get_name()) + '\n')
                    outfile.write(ms.get_source())
                    outfile.write('\n')
Esempio n. 3
0
File: apk.py Progetto: Rafiot/viper
        def andro_dump(vm, vmx, dump_path):
            # Export each decompiled method
            for method in vm.get_methods():
                mx = vmx.get_method(method)

                if method.get_code() is None:
                    continue
                ms = DvMethod(mx)
                ms.process()
                with open(dump_path, 'a+') as outfile:
                    outfile.write(str(method.get_class_name()))
                    outfile.write(str(method.get_name()) + '\n')
                    outfile.write(ms.get_source())
                    outfile.write('\n')
Esempio n. 4
0
 def test(self):
     for m in c.get_methods():
         mx = dx.get_method(m)
         ms = DvMethod(mx)
         ms.process(doAST=doAST)
         self.assertIsNotNone(ms.get_source())
Esempio n. 5
0
def dvmethod(c, dx, doAST=False):
    for m in c.get_methods():
        mx = dx.get_method(m)
        ms = DvMethod(mx)
        ms.process(doAST=doAST)
        assert ms.get_source() is not None
Esempio n. 6
0
def dvmethod(c, dx, doAST=False):
    for m in c.get_methods():
        mx = dx.get_method(m)
        ms = DvMethod(mx)
        ms.process(doAST=doAST)
        assert ms.get_source() is not None