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

Function cb_get_relocation_info

rust/src/relocation.rs:428–452  ·  view source on GitHub ↗
(
        ctxt: *mut c_void,
        bv: *mut BNBinaryView,
        arch: *mut BNArchitecture,
        result: *mut BNRelocationInfo,
        count: usize,
    )

Source from the content-addressed store, hash-verified

426 }
427
428 extern "C" fn cb_get_relocation_info<R>(
429 ctxt: *mut c_void,
430 bv: *mut BNBinaryView,
431 arch: *mut BNArchitecture,
432 result: *mut BNRelocationInfo,
433 count: usize,
434 ) -> bool
435 where
436 R: 'static + RelocationHandler<Handle = CustomRelocationHandlerHandle<R>> + Send + Sync,
437 {
438 let custom_handler = unsafe { &*(ctxt as *mut R) };
439 let bv = unsafe { BinaryView::ref_from_raw(BNNewViewReference(bv)) };
440 let arch = unsafe { CoreArchitecture::from_raw(arch) };
441 let result = unsafe { core::slice::from_raw_parts_mut(result, count) };
442 let mut info = result
443 .iter()
444 .map(RelocationInfo::from_raw)
445 .collect::<Vec<_>>();
446 let ok =
447 custom_handler.get_relocation_info(bv.as_ref(), arch.as_ref(), info.as_mut_slice());
448 for (result, info) in result.iter_mut().zip(info.iter()) {
449 *result = info.as_raw();
450 }
451 ok
452 }
453
454 extern "C" fn cb_apply_relocation<R>(
455 ctxt: *mut c_void,

Callers

nothing calls this directly

Calls 5

mapMethod · 0.80
iterMethod · 0.45
get_relocation_infoMethod · 0.45
as_refMethod · 0.45
as_rawMethod · 0.45

Tested by

no test coverage detected