core.models

Data structures for memory dump analysis.

deprecated_kwarg(cls, old_name, new_name)[source]

Let a dataclass constructor accept a deprecated keyword.

Map old_name to new_name when the caller supplies only the old name. If both names are supplied, leave validation to the constructor.

Parameters:
  • old_name (str)

  • new_name (str)

class CryptoSecret[source]

Bases: object

Store a cryptographic secret and its protocol identifier.

Equality and hashing use the secret type and value.

secret_type: str
identifier: bytes
secret_value: bytes
protocol: str = 'TLS'
property client_random: bytes

Backward-compatible alias for identifier.

__init__(secret_type, identifier, secret_value, protocol='TLS')
Parameters:
Return type:

None

TLSSecret

alias of CryptoSecret

class KeyOccurrence[source]

Bases: object

A found key occurrence in a dump file.

offset: int
secret: CryptoSecret
context_before: bytes
key_bytes: bytes
context_after: bytes
property context_start_offset: int
__init__(offset, secret, context_before, key_bytes, context_after)
Parameters:
Return type:

None

class DumpFile[source]

Bases: object

Identify a dump file, its recorded phase, and its capture format.

path: Path
timestamp: str
phase_prefix: str
phase_name: str
canonical_phase: str | None = None
kind: str = 'raw'
property full_phase: str
property canonical_or_raw: str
__init__(path, timestamp, phase_prefix, phase_name, canonical_phase=None, kind='raw')
Parameters:
  • path (Path)

  • timestamp (str)

  • phase_prefix (str)

  • phase_name (str)

  • canonical_phase (str | None)

  • kind (str)

Return type:

None

class RunDirectory[source]

Bases: object

Group a run’s dump files, secrets, and capture status.

The metadata is optional. A capture can be present, absent, or unreadable.

path: Path
library: str
protocol_version: str
run_number: int
dumps: List[DumpFile]
secrets: List[CryptoSecret]
secret_source: str = 'none'
phase_mappings: Dict[str, str]
meta: 'DatasetMeta' | None = None
capture_path: Path | None = None
capture_status: str = 'absent'
property tls_version: str

Backward-compatible alias for protocol_version.

get_dump_for_phase(phase)[source]
Parameters:

phase (str)

Return type:

DumpFile | None

available_phases()[source]
Return type:

List[str]

__init__(path, library, protocol_version, run_number, dumps=<factory>, secrets=<factory>, secret_source='none', phase_mappings=<factory>, meta=None, capture_path=None, capture_status='absent')
Parameters:
  • path (Path)

  • library (str)

  • protocol_version (str)

  • run_number (int)

  • dumps (List[DumpFile])

  • secrets (List[CryptoSecret])

  • secret_source (str)

  • phase_mappings (Dict[str, str])

  • meta (Optional['DatasetMeta'])

  • capture_path (Optional[Path])

  • capture_status (str)

Return type:

None

class ComparisonRegion[source]

Bases: object

Aligned regions across dumps for multi-run comparison.

secret_type: str
key_length: int
context_size: int
run_data: List[Tuple[bytes, bytes, bytes]]
__init__(secret_type, key_length, context_size, run_data=<factory>, run_labels=<factory>, run_offsets=<factory>)
Parameters:
Return type:

None

run_labels: List[str]
run_offsets: List[int]