volatility3.plugins.linux.graphics.fbdev module

class Fbdev(context, config_path, progress_callback=None)[source]

Bases: PluginInterface

Extract framebuffers from the fbdev graphics subsystem

Parameters:
  • context (ContextInterface) – The context that the plugin will operate within

  • config_path (str) – The path to configuration data within the context configuration data

  • progress_callback (Optional[Callable[[float, str], None]]) – A callable that can provide feedback at progress points

build_configuration()

Constructs a HierarchicalDictionary of all the options required to build this component in the current context.

Ensures that if the class has been created, it can be recreated using the configuration built Inheriting classes must override this to ensure any dependent classes update their configurations too

Return type:

HierarchicalDict

property config: HierarchicalDict

The Hierarchical configuration Dictionary for this Configurable object.

property config_path: str

The configuration path on which this configurable lives.

property context: ContextInterface

The context object that this configurable belongs to/configuration is stored in.

classmethod convert_fb_raw_buffer_to_image(context, kernel_name, fb)[source]

Convert raw framebuffer pixels to an image.

Parameters:

fb (Framebuffer) – the relevant Framebuffer object

Returns:

A PIL Image object

Documentation:
include/uapi/linux/fb.h:

/* Interpretation of offset for color fields: All offsets are from the right, * inside a “pixel” value, which is exactly ‘bits_per_pixel’ wide (means: you * can use the offset as right argument to <<). A pixel afterwards is a bit * stream and is written to video memory as that unmodified.

classmethod dump_fb(context, kernel_name, open_method, fb, convert_to_png_image)[source]

Dump a Framebuffer buffer to disk.

Parameters:
  • fb (Framebuffer) – the relevant Framebuffer object

  • convert_to_image – a boolean specifying if the buffer should be converted to an image

Return type:

str

Returns:

The filename of the dumped buffer.

classmethod get_requirements()[source]

Returns a list of Requirement objects for this plugin.

Return type:

List[RequirementInterface]

classmethod make_subconfig(context, base_config_path, **kwargs)

Convenience function to allow constructing a new randomly generated sub-configuration path, containing each element from kwargs.

Parameters:
  • context (ContextInterface) – The context in which to store the new configuration

  • base_config_path (str) – The base configuration path on which to build the new configuration

  • kwargs – Keyword arguments that are used to populate the new configuration path

Returns:

The newly generated full configuration path

Return type:

str

property open

Returns a context manager and thus can be called like open

classmethod parse_fb_info(fb_info)[source]

Parse an fb_info struct :type fb_info: ObjectInterface :param fb_info: an fb_info kernel object live instance

Return type:

Framebuffer

Returns:

A Framebuffer object

Documentation:
https://docs.kernel.org/fb/api.html:
  • struct fb_fix_screeninfo stores device independent unchangeable information about the frame buffer device and the current format.

Those information can’t be directly modified by applications, but can be changed by the driver when an application modifies the format. - struct fb_var_screeninfo stores device independent changeable information about a frame buffer device, its current format and video mode, as well as other miscellaneous parameters.

classmethod parse_fb_pixel_bitfields(fb_var_screeninfo)[source]

Organize a framebuffer pixel format into a dictionary. This is needed to know the position and bitlength of a color inside a pixel.

Parameters:

fb_var_screeninfo (ObjectInterface) – a fb_var_screeninfo kernel object instance

Return type:

Dict[str, Tuple[int, int, int]]

Returns:

The color fields mappings

Documentation:
include/uapi/linux/fb.h:
struct fb_bitfield {

__u32 offset; /* beginning of bitfield / __u32 length; / length of bitfield / __u32 msb_right; / != 0 : Most significant bit is right */

};

run()[source]

Executes the functionality of the code.

Note

This method expects self.validate to have been called to ensure all necessary options have been provided

Returns:

A TreeGrid object that can then be passed to a Renderer.

set_open_method(handler)

Sets the file handler to be used by this plugin.

Return type:

None

classmethod unsatisfied(context, config_path)

Returns a list of the names of all unsatisfied requirements.

Since a satisfied set of requirements will return [], it can be used in tests as follows:

unmet = configurable.unsatisfied(context, config_path)
if unmet:
    raise RuntimeError("Unsatisfied requirements: {}".format(unmet)
Return type:

Dict[str, RequirementInterface]

version = (1, 0, 0)
class Framebuffer(id, xres_virtual, yres_virtual, line_length, bpp, size, color_fields, fb_info)[source]

Bases: object

Framebuffer object internal representation. This is useful to unify a framebuffer with precalculated properties and pass it through functions conveniently.

bpp: int

Bits Per Pixel

color_fields: Dict[str, Tuple[int, int, int]]
fb_info: ObjectInterface
id: str
line_length: int
size: int
xres_virtual: int
yres_virtual: int