angr.analyses.decompiler.block_similarity

angr.analyses.decompiler.block_similarity.has_similar_stmt(blk1, blk2)

Returns True if blk1 has a statement that is similar to a statement in blk2, False otherwise.

Parameters:
angr.analyses.decompiler.block_similarity.is_similar(ail_obj1, ail_obj2, graph=None, partial=True, max_depth=10, curr_depth=0)

Returns True if the two AIL objects are similar, False otherwise.

Parameters:
angr.analyses.decompiler.block_similarity.index_of_similar_stmts(search_stmts, other_stmts, graph=None, all_positions=False)

Returns the index of the first occurrence of the search_stmts (a list of Statement) in other_stmts (a list of Statement). If all_positions is True, returns a list of all positions.

@return: None or int (position start in other)

Return type:

int | None

angr.analyses.decompiler.block_similarity.in_other(stmts, other, graph=None)

Returns True if the stmts (a list of Statement) is found as a subsequence in other

@return:

angr.analyses.decompiler.block_similarity.longest_ail_subseq(stmts_list, graph=None)

Given a list of List[Statement], it returns the longest List[Statement] that is a subsequence of all the lists. The common List[Statement] most all be in the same order and adjacent to each other. If no common subsequence is found, it returns None.

Parameters:
Return type:

tuple[list[Statement] | None, list[int] | None]

Returns:

Tuple[List[Statement], List[int]], where the first element is the longest common subsequence, and the second element is a list of integers indicating the index of the longest common subsequence in each list of statements.