angr.angrdb.serializers.structured_code

class angr.angrdb.serializers.structured_code.ConstFormatsSerializer

Bases: object

Serialize/deserialize the constant formats dictionary.

static to_json(const_formats)
Return type:

dict[int, dict[str, dict[str, bool]]]

Parameters:

const_formats (dict[tuple[int, int, str], dict[str, bool]])

static from_json(data)
Return type:

dict[tuple[int, int, str], dict[str, bool]]

Parameters:

data (dict[int, dict[str, dict[str, str | bool]]])

class angr.angrdb.serializers.structured_code.StructuredCodeManagerSerializer

Bases: object

Serialize/deserialize a structured code manager.

static dump(session, db_kb, code_manager)

Store every decompilation cache as its fully serialized protobuf bytes (the decompilation_caches table). Caches that cannot be serialized (e.g. dummy or rust-flavor codegens) fall back to the legacy structured_code rows storing codegen metadata only.

Parameters:
Returns:

static dict_strkey_to_intkey(d)
Return type:

dict[int, Any]

Parameters:

d (dict[str, Any])

static load(session, db_kb, kb)

Load decompilation caches: fully serialized caches from the decompilation_caches table first, then legacy structured_code rows (from this database or from old databases) for any key not already loaded.

Parameters:
Return type:

StructuredCodeManager

Returns:

A loaded structured code manager