MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / read

Method read

icicle-cortexm/src/lib.rs:818–829  ·  view source on GitHub ↗
(&mut self, addr: u64, buf: &mut [u8])

Source from the content-addressed store, hash-verified

816
817impl IoMemory for FuzzwareNvicHandler {
818 fn read(&mut self, addr: u64, buf: &mut [u8]) -> icicle_vm::cpu::mem::MemResult<()> {
819 let value = unsafe { fuzzware::handle_sysctl_mmio_read(self.uc, addr, buf.len() as i32) };
820 // This function is extremly hot so we specialize common output sizes, with the most common
821 // (4 byte access) first.
822 match buf.len() {
823 4 => buf.copy_from_slice(&value.to_le_bytes()[..4]),
824 1 => buf.copy_from_slice(&value.to_le_bytes()[..1]),
825 2 => buf.copy_from_slice(&value.to_le_bytes()[..2]),
826 _ => buf.copy_from_slice(&value.to_le_bytes()[..buf.len()]),
827 }
828 Ok(())
829 }
830
831 fn write(&mut self, addr: u64, value: &[u8]) -> icicle_vm::cpu::mem::MemResult<()> {
832 // @fixme? Unlike fuzzware we don't passthrough writes.

Callers

nothing calls this directly

Calls 2

handle_sysctl_mmio_readFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected