ScriptedProcess#
- class lldb.plugins.scripted_process.ScriptedProcess(exe_ctx, args)#
The base class for a scripted process.
Most of the base class methods are
@abstractmethodthat 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 a dictionary containing the process capabilities.
Get the list of loaded images for the scripted process.
Get the memory region for the scripted process, containing a
Get the scripted process identifier.
Get some metadata for the scripted process.
Get scripted thread plugin name.
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.
- Parameters:
attach_info (lldb.SBAttachInfo) β The information related to the
to. (process we're attaching) β
- Returns:
An SBError with error code 0.
- Return type:
- create_breakpoint(addr, error)#
- Create a breakpoint in the scripted process from an address.
This is mainly used with interactive scripted process debugging.
- Parameters:
addr (int) β Address at which the breakpoint should be set.
error (lldb.SBError) β Error object.
- Returns:
- A valid breakpoint object that was created a the specified
address. None if the breakpoint creation failed.
- Return type:
- get_capabilities()#
Get a dictionary containing the process capabilities.
- Returns:
bool]: The dictionary of capability, with the capability name as the key and a boolean flag as the value. The dictionary can be empty.
- Return type:
Dict[str
- 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:
- A list of
scripted_imagedictionaries containing for each entry the library UUID or its file path and its load address. None if the list is empty.
- A list of
- Return type:
List[scripted_image]
- get_memory_region_containing_address(addr)#
- Get the memory region for the scripted process, containing a
specific address.
- Parameters:
addr (int) β Address to look for in the scripted process memory regions.
- Returns:
- The memory region containing the address.
None if out of bounds.
- Return type:
- get_process_id()#
Get the scripted process identifier.
- Returns:
The scripted process identifier.
- Return type:
int
- get_process_metadata()#
Get some metadata for the scripted process.
- Returns:
- A dictionary containing metadata for the scripted process.
None if the process as no metadata.
- Return type:
Dict
- abstract get_scripted_thread_plugin()#
Get scripted thread plugin name.
- Returns:
Name of the scripted thread plugin.
- Return type:
str
- get_threads_info()#
Get the dictionary describing the processβ Scripted Threads.
- Returns:
The dictionary of threads, with the thread ID as the key and a Scripted Thread instance as the value. The dictionary can be empty.
- Return type:
Dict
- abstract is_alive()#
Check if the scripted process is alive.
- Returns:
True if scripted process is alive. False otherwise.
- Return type:
bool
- abstract read_memory_at_address(addr, size, error)#
- Get a memory buffer from the scripted process at a certain address,
of a certain size.
- Parameters:
addr (int) β Address from which we should start reading.
size (int) β Size of the memory to read.
error (lldb.SBError) β Error object.
- Returns:
- An SBData buffer with the target byte size and
byte order storing the memory read.
- Return type:
- resume(should_stop=True)#
Simulate the scripted process resume.
- Parameters:
should_stop (bool) β If True, resume will also force the process
it. (state to stopped after running) β
- Returns:
An SBError with error code 0.
- Return type:
- write_memory_at_address(addr, data, error)#
Write a buffer to the scripted process memory.
- Parameters:
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 of the memory to read.
- Return type:
size (int)