Package rekall :: Module config :: Class CommandMetadata
[frames] | no frames]

Class CommandMetadata

source code


A class that carried a plugin's configuration.

A plugin is responsible for declaring its metadata by calling this
configuration object's methods from the args() class method.

There are two things that plugin must declare:

add_*_arg(): Calling these functions declares an argument for this
   plugin. See the documentation for that method for details.

add_metadata(): This method provides additional metadata about this plugin.

Instance Methods
 
__init__(self, plugin_cls=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_description(self, description) source code
 
add_positional_arg(self, name, type='string')
Declare a positional arg.
source code
 
add_argument(self, short_opt, long_opt=None, **options)
Add a new argument to the command.
source code
 
add_requirement(self, requirement)
Add a requirement for this plugin.
source code
 
Metadata(self) source code
 
ApplyDefaults(self, args)
Update args with the defaults.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, plugin_cls=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

add_argument(self, short_opt, long_opt=None, **options)

source code 
Add a new argument to the command.

This method is used in the args() class method to add a new command line
arg to the plugin. It is similar to the argparse add_argument() method
but it adds a type parameter which conveys higher level information
about the argument. Currently supported types:

- ArrayIntParser: A list of integers (possibly encoded as hex strings).
- ArrayStringParser: A list of strings.
- Float: A float.
- IntParser: An integer (possibly encoded as a hex string).
- Boolean: A flag - true/false.
- ChoiceArray: A comma separated list of strings which must be from the
    choices parameter.

add_requirement(self, requirement)

source code 

Add a requirement for this plugin.

Currently supported requirements:

  • profile: A profile must exist for this plugin to run.
  • physical_address_space: A Physical Address Space (i.e. an image file) must exist for this plugin to work.

ApplyDefaults(self, args)

source code 

Update args with the defaults.

If an option in args is None, we update it with the default value for this option.