def get_static_fields(ca: ClassAnalysis, dx: Analysis) -> StaticFieldWriteInfo: field_to_writes: StaticFieldWriteInfo = {} fields = [x for x in ca.get_fields()] field: FieldClassAnalysis for field in filter(is_static, fields): field_to_writes[field] = decode_clear_sets(check_writes(field), dx) return field_to_writes
def _get_javab64_xref(_class, _vmx): _java_b64 = base64.b64encode(_get_java_code(_class, _vmx)) _xref = None try: _xref = ClassAnalysis(_class).get_xref_from() if _xref: _xref = [_m[0] for _m in _xref.items] except AttributeError as e: print("Error {} occured".format(e)) return _java_b64, _xref
def __init__(self, class_ana: ClassAnalysis, from_str=False): self.name = class_ana.name self.method_info = {} if from_str: # Needn't search every method again. self.crypto_name_matched = None return self.crypto_name_matched = match_crypto_name(class_ana.name) for meth in class_ana.get_methods(): meth_ana = MethodCryptoAnalysis(meth) if meth_ana.matched: self.method_info[meth_ana.name] = meth_ana
def find_method(analysis: ClassAnalysis, name: str) -> MethodClassAnalysis: meth: MethodClassAnalysis for meth in analysis.get_methods(): if meth.name == name: return meth return None
def find_getCam(analysis: ClassAnalysis) -> MethodClassAnalysis: meth: MethodClassAnalysis for meth in analysis.get_methods(): if meth.name == 'getCameraInstance': return meth