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

Function cb_apply_relocation

rust/src/relocation.rs:454–471  ·  view source on GitHub ↗
(
        ctxt: *mut c_void,
        bv: *mut BNBinaryView,
        arch: *mut BNArchitecture,
        reloc: *mut BNRelocation,
        dest: *mut u8,
        len: usize,
    )

Source from the content-addressed store, hash-verified

452 }
453
454 extern "C" fn cb_apply_relocation<R>(
455 ctxt: *mut c_void,
456 bv: *mut BNBinaryView,
457 arch: *mut BNArchitecture,
458 reloc: *mut BNRelocation,
459 dest: *mut u8,
460 len: usize,
461 ) -> bool
462 where
463 R: 'static + RelocationHandler<Handle = CustomRelocationHandlerHandle<R>> + Send + Sync,
464 {
465 let custom_handler = unsafe { &*(ctxt as *mut R) };
466 let bv = unsafe { BinaryView::ref_from_raw(BNNewViewReference(bv)) };
467 let arch = unsafe { CoreArchitecture::from_raw(arch) };
468 let reloc = unsafe { Relocation::from_raw(reloc) };
469 let dest = unsafe { core::slice::from_raw_parts_mut(dest, len) };
470 custom_handler.apply_relocation(bv.as_ref(), arch.as_ref(), &reloc, dest)
471 }
472
473 extern "C" fn cb_get_operand_for_external_relocation<R>(
474 ctxt: *mut c_void,

Callers

nothing calls this directly

Calls 2

apply_relocationMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected