binaryninja::database

Struct Database

source
pub struct Database { /* private fields */ }

Implementations§

source§

impl Database

source

pub fn snapshot_by_id(&self, id: SnapshotId) -> Option<Ref<Snapshot>>

Get a snapshot by its id, or None if no snapshot with that id exists

source

pub fn snapshots(&self) -> Array<Snapshot>

Get a list of all snapshots in the database

source

pub fn current_snapshot(&self) -> Option<Ref<Snapshot>>

Get the current snapshot

source

pub fn set_current_snapshot(&self, value: &Snapshot)

source

pub fn set_current_snapshot_id(&self, id: SnapshotId)

Sets the current snapshot to the SnapshotId.

No validation is done to ensure that the id is valid.

source

pub fn write_snapshot_data<N: BnStrCompatible>( &self, parents: &[SnapshotId], file: &BinaryView, name: N, data: &KeyValueStore, auto_save: bool, ) -> SnapshotId

source

pub fn write_snapshot_data_with_progress<N, P>( &self, parents: &[SnapshotId], file: &BinaryView, name: N, data: &KeyValueStore, auto_save: bool, progress: P, ) -> SnapshotId

source

pub fn trim_snapshot(&self, id: SnapshotId) -> Result<(), ()>

Trim a snapshot’s contents in the database by id, but leave the parent/child hierarchy intact. Future references to this snapshot will return False for has_contents

source

pub fn remove_snapshot(&self, id: SnapshotId) -> Result<(), ()>

Remove a snapshot in the database by id, deleting its contents and references. Attempting to remove a snapshot with children will raise an exception.

source

pub fn has_global<S: BnStrCompatible>(&self, key: S) -> bool

source

pub fn global_keys(&self) -> Array<BnString>

Get a list of keys for all globals in the database

source

pub fn globals(&self) -> HashMap<String, String>

Get a dictionary of all globals

source

pub fn read_global<S: BnStrCompatible>(&self, key: S) -> Option<BnString>

Get a specific global by key

source

pub fn write_global<K: BnStrCompatible, V: BnStrCompatible>( &self, key: K, value: V, ) -> bool

Write a global into the database

source

pub fn read_global_data<S: BnStrCompatible>(&self, key: S) -> Option<DataBuffer>

Get a specific global by key, as a binary buffer

source

pub fn write_global_data<K: BnStrCompatible>( &self, key: K, value: &DataBuffer, ) -> bool

Write a binary buffer into a global in the database

source

pub fn file(&self) -> Ref<FileMetadata>

Get the owning FileMetadata

source

pub fn analysis_cache(&self) -> Ref<KeyValueStore>

Get the backing analysis cache kvs

source

pub fn reload_connection(&self)

source

pub fn write_analysis_cache(&self, val: &KeyValueStore) -> Result<(), ()>

source

pub fn snapshot_has_data(&self, id: SnapshotId) -> bool

Trait Implementations§

source§

impl Debug for Database

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ToOwned for Database

source§

type Owned = Ref<Database>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.