class libpastis.package.BinaryPackage(main_binary: Path)[source]

Binary Package representing a given target to fuzz along with its shared libraries and additional files required (cmplog, dictionnary etc.). This object is received by fuzzing agents as part of the START message.


main_binary – main executable file path

EXTENSION_BLACKLIST = ['.gt', '.Quokka', '.quokka', '.cmplog']
property arch: Arch

Return the architecture of the binary package (main executable target).



static auto(exe_file: Path | str) BinaryPackage | None[source]

Take a file and try creating a BinaryPackage with it. The exe_file is the main executable file. From that the function will look for quokka, cmplog, dictionary files (in the same directory).


exe_file – main target executable file


a binary package if exe_file if applicable

static auto_directory(exe_file: str | Path) BinaryPackage | None[source]

Create a BinaryPackage with all files it can find in the given directory. The difference with is that all additional files in the directory will be added to the package.


exe_file – main executable in the directory


BinaryPackage if applicable

property callgraph: Path | None

Path to the callgraph file if provided.


path of the quokka file

property cmplog: Path | None

Path to the complog executable file if provided.


path to the complog file

property dictionary: Path | None

Path the to dictionnary file if provided.


path to the dictionnary file

property executable_path: Path

Path to the main executable file to fuzz.



static from_binary(name: str, binary: bytes, extract_dir: Path) BinaryPackage[source]

Convert the binary blob received as a BinaryPackage object. If its an archive, extract it and return the list of files. Files are extracted in /tmp. If directly an executable save it to a file and return its path. Also ensure the executable file is indeed executable in terms of permissions.

  • name – name of executable, or executable name in archive

  • binary – content

  • extract_dir – Path: directory where files should be extracted


list of file paths


FileNotFoundError – if the mime type of the binary is not recognized

is_cmplog() bool[source]

Check if the package contains a cmplog file.


True if contains cmplog

is_dictionary() bool[source]

Check if the package contains a dictionnary.


True if contains a dictionnary

is_quokka() bool[source]

Check if the package contains a quokka file.


True if contains a quokka file

is_standalone() bool[source]

Indicates that this BinaryPackage only contains the program under test and no additional files such as a Quokka database or a cmplog instrumented binary. This is used in pastis-broker when sending the ‘start’ command to agents.

make_package() Path[source]

Pack the BinaryPackage in a zip file.


Path to a .zip file containing the whole package

property name: str

Name of the executable file


name as a string

property platform: Platform

Return the platform of the binary package (main exectuable target).



property quokka: Path | None

Path to the quokka file if provided.


path of the quokka file