Passes

FeaturePass

class qbindiff.passes.FeaturePass(distance: Distance)[source]

Bases: object

Run all the feature extractors previously registered and compute the similarity matrix

Parameters:

distance – distance to compute the similarity of type py:class:qbindiff.types.Distance

distance(key: str) Distance[source]

Returns the correct distance for the given feature key

register_extractor(extractor: FeatureExtractor, distance: Distance | None = None) None[source]

Register a feature extractor optionally specifying a distance to use. The class will be called when the visitor will traverse the graph.

ZeroPass

class qbindiff.passes.ZeroPass(sim_matrix: ndarray, primary: Program, secondary: Program, primary_mapping: dict[Any, int], secondary_mapping: dict[Any, int])[source]

Bases:

Set to zero all the -1 entries in the similarity matrix