(
ctxt: *mut c_void,
bv: *mut BNBinaryView,
arch: *mut BNArchitecture,
reloc: *mut BNRelocation,
dest: *mut u8,
len: usize,
)
| 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, |
nothing calls this directly
no test coverage detected