angr.knowledge_base¶
Representing the artifacts of a project.
- class angr.knowledge_base.KnowledgeBase¶
Bases:
objectRepresents a “model” of knowledge about an artifact.
Contains things like a CFG, data references, etc.
- functions: FunctionManager
- variables: VariableManager
- defs: KeyDefinitionManager
- cfgs: CFGManager
- types: TypesStore
- propagations: PropagationManager
- xrefs: XRefManager
- decompilations: StructuredCodeManager
- obfuscations: Obfuscations
- rtdb: RuntimeDb
- __init__(project, obj=None, name=None)¶
- property callgraph¶
- property unresolved_indirect_jumps¶
- property resolved_indirect_jumps¶
- has_plugin(name)¶
- get_plugin(name)¶
- register_plugin(name, plugin)¶
- release_plugin(name)¶
- get_knowledge(requested_plugin_cls)¶
Type inference safe method to request a knowledge base plugin Explicitly passing the type of the requested plugin achieves two things: 1. Every location using this plugin can be easily found with an IDE by searching explicit references to the type 2. Basic type inference can deduce the result type and properly type check usages of it
If there isn’t already an instance of this class None will be returned to make it clear to the caller that there is no existing knowledge of this type yet. The code that initially creates this knowledge should use the register_plugin method to register the initial knowledge state :type requested_plugin_cls:
type[TypeVar(K, bound=KnowledgeBasePlugin)] :param requested_plugin_cls:- Return type:
Optional[TypeVar(K, bound=KnowledgeBasePlugin)]- Returns:
Instance of the requested plugin class or null if it is not a known plugin
- Parameters:
requested_plugin_cls (type[K])
- request_knowledge(requested_plugin_cls)¶
- Return type:
TypeVar(K, bound=KnowledgeBasePlugin)- Parameters:
requested_plugin_cls (type[K])