Project in binaryninja::project - Rust

pub struct Project { /* private fields */ }
Source§
Source
Source
Source
Source

Create a new project

  • path - Path to the project directory (.bnpr)
  • name - Name of the new project
Source

Open an existing project

  • path - Path to the project directory (.bnpr) or project metadata file (.bnpm)
Source

Check if the project is currently open

Source

Open a closed project

Source

Close a open project

Source

Get the unique id of this project

Source

Get the path of the project

Source

Get the name of the project

Source

Set the name of the project

Source

Get the description of the project

Source

Set the description of the project

Source

Retrieves metadata stored under a key from the project

Source

Stores metadata within the project,

  • key - Key under which to store the Metadata object
  • value - Object to store
Source

Removes the metadata associated with this key from the project

Source
Source

Recursively create files and folders in the project from a path on disk

  • path - Path to folder on disk
  • parent - Parent folder in the project that will contain the new contents
  • description - Description for created root folder
Source

Recursively create files and folders in the project from a path on disk

  • path - Path to folder on disk
  • parent - Parent folder in the project that will contain the new contents
  • description - Description for created root folder
  • progress - ProgressCallback that will be called as the ProjectFolder is being created
Source

Recursively create files and folders in the project from a path on disk

  • parent - Parent folder in the project that will contain the new folder
  • name - Name for the created folder
  • description - Description for created folder
Source

Recursively create files and folders in the project from a path on disk

  • parent - Parent folder in the project that will contain the new folder
  • name - Name for the created folder
  • description - Description for created folder
  • id - id unique ID
Source

Get a list of folders in the project

Source

Retrieve a folder in the project by unique folder id

Source
Source
Source
Source

Create a file in the project from a path on disk

  • path - Path on disk
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
Source

Create a file in the project from a path on disk

  • path - Path on disk
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
  • progress - ProgressCallback that will be called as the ProjectFile is being added
Source

Create a file in the project from a path on disk

  • path - Path on disk
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
  • id - id unique ID
  • creation_time - Creation time of the file
Source

Create a file in the project from a path on disk

  • path - Path on disk
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
  • id - id unique ID
  • creation_time - Creation time of the file
  • progress - ProgressCallback that will be called as the ProjectFile is being created
Source

Create a file in the project

  • contents - Bytes of the file that will be created
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
Source

Create a file in the project

  • contents - Bytes of the file that will be created
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
  • progress - ProgressCallback that will be called as the ProjectFile is being created
Source

Create a file in the project

  • contents - Bytes of the file that will be created
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
  • id - id unique ID
  • creation_time - Creation time of the file
Source

Create a file in the project

  • contents - Bytes of the file that will be created
  • folder - Folder to place the created file in
  • name - Name to assign to the created file
  • description - Description to assign to the created file
  • id - id unique ID
  • creation_time - Creation time of the file
  • progress - ProgressCallback that will be called as the ProjectFile is being created
Source

Get a list of files in the project

Source

Retrieve a file in the project by unique id

Source

Retrieve a file in the project by the path on disk

Source

Retrieve a list of files in the project by the path inside the project.

Because a ProjectFile name is not unique, this returns a list instead of a single ProjectFile.

Source

Retrieve a list of files in the project in a given folder.

Source

Delete a file from the project

Source

A context manager to speed up bulk project operations. Project modifications are synced to disk in chunks, and the project on disk vs in memory may not agree on state if an exception occurs while a bulk operation is happening.

if let Ok(bulk) = project.bulk_operation() {
    for file in std::fs::read_dir("/bin/").unwrap().into_iter() {
        let file = file.unwrap();
        let file_type = file.file_type().unwrap();
        if file_type.is_file() && !file_type.is_symlink() {
            bulk.create_file_from_path("/bin/", None, &file.file_name().to_string_lossy(), "")
                .unwrap();
        }
    }
}

§
§
§
§