ScriptedProcess#

class lldb.plugins.scripted_process.ScriptedProcess(exe_ctx, args)#

The base class for a scripted process.

Most of the base class methods are @abstractmethod that need to be overwritten by the inheriting class.

Attributes Summary

Methods Summary

attach(attach_info)

Simulate the scripted process attach.

create_breakpoint(addr, error)

Create a breakpoint in the scripted process from an address.

get_capabilities()

Get a dictionary containing the process capabilities.

get_loaded_images()

Get the list of loaded images for the scripted process.

get_memory_region_containing_address(addr)

Get the memory region for the scripted process, containing a

get_process_id()

Get the scripted process identifier.

get_process_metadata()

Get some metadata for the scripted process.

get_scripted_thread_plugin()

Get scripted thread plugin name.

get_threads_info()

Get the dictionary describing the process' Scripted Threads.

is_alive()

Check if the scripted process is alive.

launch()

Simulate the scripted process launch.

read_memory_at_address(addr, size, error)

Get a memory buffer from the scripted process at a certain address,

resume([should_stop])

Simulate the scripted process resume.

write_memory_at_address(addr, data, error)

Write a buffer to the scripted process memory.

Attributes Documentation

capabilities = None#
loaded_images = None#
memory_regions = None#
metadata = None#
threads = None#

Methods Documentation

attach(attach_info)#

Simulate the scripted process attach.

Args:

attach_info (lldb.SBAttachInfo): The information related to the process we’re attaching to.

Returns:

lldb.SBError: An SBError with error code 0.

create_breakpoint(addr, error)#
Create a breakpoint in the scripted process from an address.

This is mainly used with interactive scripted process debugging.

Args:

addr (int): Address at which the breakpoint should be set. error (lldb.SBError): Error object.

Returns:
SBBreakpoint: A valid breakpoint object that was created a the specified

address. None if the breakpoint creation failed.

get_capabilities()#

Get a dictionary containing the process capabilities.

Returns:

Dict[str:bool]: The dictionary of capability, with the capability name as the key and a boolean flag as the value. The dictionary can be empty.

get_loaded_images()#

Get the list of loaded images for the scripted process.

scripted_image = {
    uuid = "c6ea2b64-f77c-3d27-9528-74f507b9078b",
    path = "/usr/lib/dyld"
    load_addr = 0xbadc0ffee
}
Returns:
List[scripted_image]: A list of scripted_image dictionaries

containing for each entry the library UUID or its file path and its load address. None if the list is empty.

get_memory_region_containing_address(addr)#
Get the memory region for the scripted process, containing a

specific address.

Args:
addr (int): Address to look for in the scripted process memory

regions.

Returns:
lldb.SBMemoryRegionInfo: The memory region containing the address.

None if out of bounds.

get_process_id()#

Get the scripted process identifier.

Returns:

int: The scripted process identifier.

get_process_metadata()#

Get some metadata for the scripted process.

Returns:
Dict: A dictionary containing metadata for the scripted process.

None if the process as no metadata.

abstract get_scripted_thread_plugin()#

Get scripted thread plugin name.

Returns:

str: Name of the scripted thread plugin.

get_threads_info()#

Get the dictionary describing the process’ Scripted Threads.

Returns:

Dict: The dictionary of threads, with the thread ID as the key and a Scripted Thread instance as the value. The dictionary can be empty.

abstract is_alive()#

Check if the scripted process is alive.

Returns:

bool: True if scripted process is alive. False otherwise.

launch()#

Simulate the scripted process launch.

Returns:

lldb.SBError: An SBError with error code 0.

abstract read_memory_at_address(addr, size, error)#
Get a memory buffer from the scripted process at a certain address,

of a certain size.

Args:

addr (int): Address from which we should start reading. size (int): Size of the memory to read. error (lldb.SBError): Error object.

Returns:
lldb.SBData: An SBData buffer with the target byte size and

byte order storing the memory read.

resume(should_stop=True)#

Simulate the scripted process resume.

Args:

should_stop (bool): If True, resume will also force the process state to stopped after running it.

Returns:

lldb.SBError: An SBError with error code 0.

write_memory_at_address(addr, data, error)#

Write a buffer to the scripted process memory.

Args:

addr (int): Address from which we should start reading. data (lldb.SBData): An SBData buffer to write to the process memory. error (lldb.SBError): Error object.

Returns:

size (int): Size of the memory to read.