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

Function load_view_with_progress

rust/src/lib.rs:239–277  ·  view source on GitHub ↗

Equivalent to [`load_view`] but with a progress callback.

(
    bv: &BinaryView,
    update_analysis_and_wait: bool,
    options: Option<O>,
    mut progress: P,
)

Source from the content-addressed store, hash-verified

237
238/// Equivalent to [`load_view`] but with a progress callback.
239pub fn load_view_with_progress<O, P>(
240 bv: &BinaryView,
241 update_analysis_and_wait: bool,
242 options: Option<O>,
243 mut progress: P,
244) -> Option<Ref<BinaryView>>
245where
246 O: IntoJson,
247 P: ProgressCallback,
248{
249 let options_or_default = if let Some(opt) = options {
250 opt.get_json_string()
251 .ok()?
252 .into_bytes_with_nul()
253 .as_ref()
254 .to_vec()
255 } else {
256 Metadata::new_of_type(MetadataType::KeyValueDataType)
257 .get_json_string()
258 .ok()?
259 .as_ref()
260 .to_vec()
261 };
262 let handle = unsafe {
263 BNLoadBinaryView(
264 bv.handle as *mut _,
265 update_analysis_and_wait,
266 options_or_default.as_ptr() as *mut c_char,
267 Some(P::cb_progress_callback),
268 &mut progress as *mut P as *mut c_void,
269 )
270 };
271
272 if handle.is_null() {
273 None
274 } else {
275 Some(unsafe { BinaryView::ref_from_raw(handle) })
276 }
277}
278
279pub fn install_directory() -> PathBuf {
280 let install_dir_ptr: *mut c_char = unsafe { BNGetInstallDirectory() };

Callers 1

load_viewFunction · 0.85

Calls 4

to_vecMethod · 0.80
into_bytes_with_nulMethod · 0.80
as_refMethod · 0.45
get_json_stringMethod · 0.45

Tested by

no test coverage detected