mythril.support package
Submodules
mythril.support.loader module
This module contains the dynamic loader logic to get on-chain storage data and dependencies.
- class mythril.support.loader.DynLoader(eth: EthJsonRpc | None, active=True)[source]
Bases:
object
The dynamic loader class.
- dynld(dependency_address: str) Disassembly | None [source]
- Parameters:
dependency_address
- Returns:
mythril.support.lock module
mythril.support.model module
- mythril.support.model.get_model(constraints, minimize=(), maximize=(), solver_timeout=None)[source]
Returns a model based on given constraints as a tuple :param constraints: Tuple of constraints :param minimize: Tuple of minimization conditions :param maximize: Tuple of maximization conditions :param solver_timeout: The solver timeout :return:
- mythril.support.model.solver_worker(constraints, minimize=(), maximize=(), solver_timeout=None)[source]
Returns a model based on given constraints as a tuple :param constraints: Tuple of constraints :param minimize: Tuple of minimization conditions :param maximize: Tuple of maximization conditions :param solver_timeout: The timeout for solver :return:
mythril.support.opcodes module
mythril.support.signatures module
The Mythril function signature database.
- class mythril.support.signatures.SQLiteDB(path)[source]
Bases:
object
Simple context manager for sqlite3 databases.
Commits everything at exit.
- class mythril.support.signatures.SignatureDB(*args, **kwargs)[source]
Bases:
object
- add(byte_sig: str, text_sig: str) None [source]
Adds a new byte - text signature pair to the database. :param byte_sig: 4-byte signature string :param text_sig: resolved text signature :return:
- get(byte_sig: str, online_timeout: int = 2) List[str] [source]
Get a function text signature for a byte signature 1) try local cache 2) try online lookup (if enabled; if not flagged as unavailable)
- Parameters:
byte_sig – function signature hash as hexstr
online_timeout – online lookup timeout
- Returns:
list of matching function text signatures
- import_solidity_file(file_path: str, solc_binary: str = 'solc', solc_settings_json: str | None = None)[source]
Import Function Signatures from solidity source files.
- Parameters:
solc_binary
solc_settings_json
file_path – solidity source code file path
- Returns:
- static lookup_online(byte_sig: str, timeout: int, proxies=None) List[str] [source]
Lookup function signatures from 4byte.directory.
- Parameters:
byte_sig – function signature hash as hexstr
timeout – optional timeout for online lookup
proxies – optional proxy servers for online lookup
- Returns:
a list of matching function signatures for this hash
mythril.support.source_support module
mythril.support.start_time module
mythril.support.support_args module
mythril.support.support_utils module
This module contains utility functions for the Mythril support package.
- class mythril.support.support_utils.Singleton[source]
Bases:
type
A metaclass type implementing the singleton pattern.
- mythril.support.support_utils.get_code_hash(code) str [source]
- Parameters:
code – bytecode
- Returns:
Returns hash of the given bytecode