mythril.laser.ethereum.strategy package
Subpackages
Submodules
mythril.laser.ethereum.strategy.basic module
This module implements basic symbolic execution search strategies.
- class mythril.laser.ethereum.strategy.basic.BreadthFirstSearchStrategy(work_list, max_depth, **kwargs)[source]
Bases:
BasicSearchStrategy
Implements a breadth first search strategy I.E.
Execute all states of a “level” before continuing
- get_strategic_global_state() GlobalState [source]
- Returns:
- view_strategic_global_state() GlobalState [source]
- Returns:
- class mythril.laser.ethereum.strategy.basic.DepthFirstSearchStrategy(work_list, max_depth, **kwargs)[source]
Bases:
BasicSearchStrategy
Implements a depth first search strategy I.E.
Follow one path to a leaf, and then continue to the next one
- get_strategic_global_state() GlobalState [source]
- Returns:
- view_strategic_global_state() GlobalState [source]
- Returns:
- class mythril.laser.ethereum.strategy.basic.ReturnRandomNaivelyStrategy(work_list, max_depth, **kwargs)[source]
Bases:
BasicSearchStrategy
chooses a random state from the worklist with equal likelihood.
- get_strategic_global_state() GlobalState [source]
- Returns:
- view_strategic_global_state() GlobalState [source]
- Returns:
- class mythril.laser.ethereum.strategy.basic.ReturnWeightedRandomStrategy(work_list, max_depth, **kwargs)[source]
Bases:
BasicSearchStrategy
chooses a random state from the worklist with likelihood based on inverse proportion to depth.
- get_strategic_global_state() GlobalState [source]
- Returns:
- view_strategic_global_state() GlobalState [source]
- Returns:
mythril.laser.ethereum.strategy.beam module
- class mythril.laser.ethereum.strategy.beam.BeamSearch(work_list, max_depth, beam_width, **kwargs)[source]
Bases:
BasicSearchStrategy
chooses a random state from the worklist with equal likelihood.
- get_strategic_global_state() GlobalState [source]
- Returns:
- view_strategic_global_state() GlobalState [source]
- Returns:
mythril.laser.ethereum.strategy.concolic module
- class mythril.laser.ethereum.strategy.concolic.ConcolicStrategy(work_list: List[GlobalState], max_depth: int, trace: List[List[Tuple[int, str]]], flip_branch_addresses: List[str])[source]
Bases:
CriterionSearchStrategy
Executes program concolically using the input trace till a specific branch
- get_strategic_global_state() GlobalState [source]
This function does the following:- 1) Choose the states by following the concolic trace. 2) In case we have an executed JUMPI that is in flip_branch_addresses, flip that branch. :return:
- class mythril.laser.ethereum.strategy.concolic.TraceAnnotation(trace=None)[source]
Bases:
StateAnnotation
This is the annotation used by the ConcolicStrategy to store concolic traces.
- property persist_over_calls: bool
If this function returns true then laser will propagate the annotation between calls
The default is set to False