API Reference¶
Piotr API
This module allows to interact with/instrument Piotr virtual devices in a
pythonic way. It exposes a main class, Piotr
, that is able to
interact with running instances and to automate things.
- class piotr.api.Instance(guest, device)[source]¶
This class represents a Piotr running device instance and allows to interact with it, execute commands into the emulated host and target (if Qemu agent is supported by the device), enumerate and manipulate process.
- Parameters
guest (piotr.qemu.QemuPlatform) – Qemu guest
device (str) – Name of parent device, as referenced in Piotr devices list
- debug(pid, ip='0.0.0.0', port=4444, gdb_executable='gdb-multiarch')[source]¶
Runs a gdb server and attaches it to a process.
- exec_target(command, wait=True)[source]¶
Execute a command in guest.
- Parameters
command (str) – command to execute
return_output (bool) – wait for the process to end and return output
- Returns
command output or executable PID