cozy.side_effect
¶
Module Contents¶
Classes¶
This class encapsulates the idea of a side effect whose body may consist of mixed symbolic and concrete values. |
|
This class encapsulates the idea of a side effect whose body previously consisted of mixed symbolic and concrete |
Functions¶
|
Attaches a side effect to the passed state. |
|
Gets the side effects attached to a specific state |
|
Gets the side effects from the given channel attached to a specific state. An empty list is returned for channels |
|
|
- class cozy.side_effect.PerformedSideEffect(state_history: angr.state_plugins.SimStateHistory, body, concrete_post_processor=None, label=None)¶
This class encapsulates the idea of a side effect whose body may consist of mixed symbolic and concrete values.
- Parameters:
state_history (SimStateHistory) – The point in execution at which the side effect was performed.
body – The body must be a mixture of string-keyed Python dictionaries, Python lists, Python tuples, and claripy concrete and symbolic values.
concrete_post_processor – The optional post processing function to apply to concretized versions of the
side effect’s body if post processing is required. :param label: The label to apply to the side effect, used to align instances of side effects when making comparisons. For example, if you have two call sites to a network send function, you would want different labels for the two different call locations.
- class cozy.side_effect.ConcretePerformedSideEffect(base_effect: PerformedSideEffect, state_history: angr.state_plugins.SimStateHistory, body, concrete_post_processor=None, label=None)¶
This class encapsulates the idea of a side effect whose body previously consisted of mixed symbolic and concrete values, but now consists of only concrete values (ie, BVV and FPV). At the point of the construction, this concrete value has not yet been passed through the user provided concrete_post_processor, whose job is to take the concrete value and transform the BVV values into ordinary Python values. The purpose of concrete_post_processor for instance could be to transform a two’s complement BVV that is negative into a negative Python integer. This will make the display more readable to the user. Hence, the concrete_post_processor can be viewed as a post-processing function.
- Parameters:
base_effect (PerformedSideEffect) – The non-symbolic side effect that was concretized.
state_history (SimStateHistory) – The point in execution at which the side effect was performed.
body – The body must be a mixture of string-keyed Python dictionaries, Python lists, Python tuples, and claripy concrete values.
concrete_post_processor – The optional post processing function to apply to concretized versions of the
side effect’s body if post processing is required. :param label: The label to apply to the side effect, used to align instances of side effects when making comparisons. For example, if you have two call sites to a network send function, you would want different labels for the two different call locations.
- property mapped_body¶
- cozy.side_effect.perform(state: angr.SimState, channel: str, body, concrete_post_processor=None, label=None)¶
Attaches a side effect to the passed state.
- Parameters:
state (SimState) – The state in which the side effect should be performed and attached to.
channel (str) – The name of the channel in which the side effect should be performed. Different side effects should be sent down different channels. For example, the virtual print side effect channel is different from the networking side effect channel.
body – The body must be a mixture of string-keyed Python dictionaries, Python lists, Python tuples, claripy concrete values, and claripy symbolic values. This should represent the payload of the side effect.
concrete_post_processor – The optional post processing function to apply to concretized versions of the side effect’s body if post processing is required.
label – The label to apply to the side effect, used to align instances of side effects when making comparisons. For example, if you have two call sites to a network send function, you would want different labels for the two different call locations.
- cozy.side_effect.get_effects(state: angr.SimState) dict[str, list[PerformedSideEffect]] ¶
Gets the side effects attached to a specific state
- Parameters:
state (SimState) – The state from which we should retrieve the side effects.
- Return type:
dict[str, list[PerformedSideEffect]]
- Returns:
All side effects attached to this state. Each entry in the dictionary is a different channel.
- cozy.side_effect.get_channel(state: angr.SimState, channel: str) list[PerformedSideEffect] ¶
Gets the side effects from the given channel attached to a specific state. An empty list is returned for channels in which the channel has not yet been used.
- Parameters:
state (SimState) – The state from which we should retrieve the side effects channel.
channel (str) – The name of the channel
- Return type:
list[PerformedSideEffect]
- Returns:
A list of side effects for the requested channel.
- cozy.side_effect.levenshtein_alignment(lst_a, lst_b, key=None)¶
- cozy.side_effect.test_levenshtein_alignment()¶