Skip to main content

Module relation_inference

Module relation_inference 

Source
Expand description

Relation Inference - Memory relationship graph construction.

Infers relationships between heap allocations by analyzing pointer patterns, content similarity, and allocation metadata.

§Supported Relations

RelationMeaningSignal
OwnerA holds a pointer into BPointer scan + RangeMap
SliceA is a sub-region of BPointer falls inside B (not at start)
CloneA is a copy of BSame type/size/stack + content match

§Architecture

ActiveAllocation + MemoryView
       │
       ▼
  UTI Engine (TypeGuess)
       │
       ▼
  RangeMap (address → alloc index)
       │
       ▼
  Relation Engine (Owner / Slice / Clone)
       │
       ▼
  RelationGraph

Structs§

CloneConfig
Configuration for clone detection.
ContainerConfig
Configuration for container relation detection.
GraphBuilderConfig
Configuration for the relation graph builder.
InferenceRecord
Inference record combining allocation metadata with memory content.
RangeMap
An index structure that maps memory addresses to allocation indices.
RelationEdge
An edge in the relation graph.
RelationGraph
A relation graph connecting allocations.
RelationGraphBuilder
Builds a relation graph from active allocations.

Enums§

Relation
A relationship between two allocations in the graph.

Functions§

detect_clones
Detect Clone relationships among all inference records.
detect_containers
Detect Contains relationships between Container and HeapOwner allocations.
detect_owner
Detect Owner relationships by scanning an allocation’s memory for pointers.
detect_shared
detect_slice
Detect Slice relationships for all allocations.