MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / load_with_progress

Function load_with_progress

rust/src/lib.rs:127–148  ·  view source on GitHub ↗

Equivalent to [`load`] but with a progress callback. NOTE: The progress callback will _only_ be called when loading BNDBs.

(
    file_path: impl AsRef<Path>,
    mut progress: P,
)

Source from the content-addressed store, hash-verified

125///
126/// NOTE: The progress callback will _only_ be called when loading BNDBs.
127pub fn load_with_progress<P: ProgressCallback>(
128 file_path: impl AsRef<Path>,
129 mut progress: P,
130) -> Option<Ref<BinaryView>> {
131 let file_path = file_path.as_ref().into_bytes_with_nul();
132 let options = c"";
133 let handle = unsafe {
134 BNLoadFilename(
135 file_path.as_ptr() as *mut _,
136 true,
137 options.as_ptr() as *mut c_char,
138 Some(P::cb_progress_callback),
139 &mut progress as *mut P as *mut c_void,
140 )
141 };
142
143 if handle.is_null() {
144 None
145 } else {
146 Some(unsafe { BinaryView::ref_from_raw(handle) })
147 }
148}
149
150/// The main way to open and load files (with options) into Binary Ninja. Make sure you've properly initialized the core before calling this function. See [`crate::headless::init()`]
151///

Callers 2

loadFunction · 0.85
load_with_progressMethod · 0.85

Calls 2

into_bytes_with_nulMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected