Types

Contains all the type alias/definitions used by the module

This module contains all definitions of the type aliases and the generic enums used by qbindiff.

qbindiff.types.Addr

An integer representing an address within a program

qbindiff.types.AdjacencyMatrix

Boolean nxn-Dimensional array. It’s the adjacency matrix representation of the graph.

qbindiff.types.Anchors

Pair of lists of user defined index correspondences. Default None.

qbindiff.types.Dtype

Numpy data type

qbindiff.types.ExtendedMapping

An extended version of RawMapping with two more lists recording pairing similarity and induced number of squares.

qbindiff.types.FeatureValue: TypeAlias = float | dict[str, float]

Type of a feature value.

qbindiff.types.FeatureVectors

Float nxd-Dimensional array. Each n rows is represented as a dimensionnal feature vector.

class qbindiff.types.GenericPass(*args, **kwargs)[source]

Callback function type for Passes

qbindiff.types.Graph

A generic Graph, iterable over the nodes

qbindiff.types.Idx

An integer representing an index in a matrix.

qbindiff.types.Item: TypeAlias = typing.Any

Item, entity being matched. The only constraint is to be hashable

class qbindiff.types.Match(primary, secondary, similarity, confidence, squares)

Match represent the matching between two functions and can hold the similarity between the two

confidence

Alias for field number 3

primary

Alias for field number 0

secondary

Alias for field number 1

similarity

Alias for field number 2

squares

Alias for field number 4

qbindiff.types.Matrix

Arbitrary nxd-Dimensional array. Used to represent a matrix.

qbindiff.types.PathLike: TypeAlias = str | pathlib.Path

Path

qbindiff.types.Positive

Float greater than zero

qbindiff.types.Ratio

Float bewteen 0 and 1

qbindiff.types.RawMapping

Pair of lists of indexes that are mapped together.

qbindiff.types.SimMatrix

Float nxm-Dimensional array. Records the pairwise similarity scores between nodes of both graphs to diff.

qbindiff.types.SparseMatrix

Float nxm-Dimensional array. A sparse version of the above SimMatrix

qbindiff.types.SparseVector

Float n-Dimensional sparse array.

qbindiff.types.Vector

Arbitrary d-Dimensional array. Used to represent a vector.

enum qbindiff.types.Distance(value)[source]

Enum of different (supported) distances used to compute the similarity matrix based on chosen features.

Member Type:

int

Valid values are as follows:

canberra = <Distance.canberra: 0>

canberra distance

euclidean = <Distance.euclidean: 1>

euclidean distance

cosine = <Distance.cosine: 2>

cosine distance

jaccard_strong = <Distance.jaccard_strong: 3>

custom distance