def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir) self.make_changes = False self.arr_data_prog = re.compile(self.ARRAY_DATA_PATTERN) self.patterns = [ (r'invoke-direct {(v\d+), v\d+}, ' r'Ljava/lang/String;-><init>\([\[BCI]+\)V', 'Ljava/lang/String;-><init>'), (r'invoke-static {(v\d+)}, Ljava/lang/String;->valueOf' r'\(Ljava/lang/Object;\)Ljava/lang/String;', 'Ljava/lang/String;->valueOf'), (r'invoke-virtual {(v\d+)}, ' r'Ljava/lang/StringBuilder;->toString\(\)Ljava/lang/String;', 'Ljava/lang/StringBuilder;->toString()Ljava/lang/String;'), (r'invoke-virtual {(v\d+)}, ' r'Ljava/lang/StringBuffer;->toString\(\)Ljava/lang/String;', 'Ljava/lang/StringBuffer;->toString()Ljava/lang/String;'), (r'invoke-virtual {(.*?), v\d+, v\d+}, ' r'Ljava/lang/String;->substring\(II\)Ljava/lang/String;', 'Ljava/lang/String;->substring(II)Ljava/lang/String;') ] self.progs = {} for ptn, mtd_filter in self.patterns: self.progs[mtd_filter] = re.compile(ptn)
def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir) # 匹配参数为内置类型的静态调用函数 INVOKE_STATIC_RE = (r'invoke-static.*?{([v\.\d,\s]*)}, (.*?);->(.*?)' r'\(((?:B|S|C|I|J|F|D|Ljava/lang/String;|' r'\[B|\[S|\[C|\[I|\[J|\[F|\[D|\[Ljava/lang/String;' r')*?)\)Ljava/lang/String;') # 任意静态调用函数 ANY_INVOKE_STATIC_RE = ( r'invoke-static.*?{([v\.\d,\s]*)}, (.*?);->(.*?)' r'\(((?:B|S|C|I|J|F|D|L.*?;|' r'\[B|\[S|\[C|\[I|\[J|\[F|\[D|\[Ljava/lang/String;' r')*?)\)(\[B|\[S|\[C|\[I|\[J|\[F|\[D|\[Ljava/lang/String;)') # 匹配proto PROTO_RE = (r'(B|S|C|I|J|F|D|Ljava/lang/String;|' r'\[B|\[S|\[C|\[I|\[J|\[F|\[D|\[Ljava/lang/String;)') NEW_STRING = (r'invoke-direct {(v\d+), v\d+}, ' r'Ljava/lang/String;-><init>\([\[BCI]+\)V') self.invoke_static_ptn = re.compile(INVOKE_STATIC_RE) self.proto_ptn = re.compile(PROTO_RE) self.arr_data_ptn = re.compile(self.ARRAY_DATA_PATTERN) self.move_result_obj_ptn = re.compile(self.MOVE_RESULT_OBJECT) self.new_string_ptn = re.compile(NEW_STRING) self.any_invoke_static_ptn = re.compile(ANY_INVOKE_STATIC_RE)
def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir) self.emu2 = Emulator() # 匹配参数为内置类型的静态调用函数 INVOKE_STATIC_RE = ( r'invoke-static.*?{([(v|p)\.\d,\s]*)}, (.*?);->(.*?)' r'\(((?:B|S|C|I|J|F|D|Ljava/lang/String;|' r'\[B|\[S|\[C|\[I|\[J|\[F|\[D|\[Ljava/lang/String;' r')*?)\)Ljava/lang/String;') # 匹配proto PROTO_RE = (r'(B|S|C|I|J|F|D|Ljava/lang/String;|' r'\[B|\[S|\[C|\[I|\[J|\[F|\[D|\[Ljava/lang/String;)') self.invoke_static_ptn = re.compile(INVOKE_STATIC_RE) self.proto_ptn = re.compile(PROTO_RE) self.arr_data_ptn = re.compile(self.ARRAY_DATA_PATTERN) self.move_result_obj_ptn = re.compile(self.MOVE_RESULT_OBJECT)
def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir)
def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir) self.results = {} # 存放解密结果 self.ptns = [] self.global_variables = {} # 全局变量,模拟执行预设值
def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir) self.results = {} # 存放解密结果
def __init__(self, driver, smalidir): Plugin.__init__(self, driver, smalidir) self.emu2 = Emulator() self.templets = [] if not self.templets: self._init_templets()