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

Function write_raw_bytes

icicle-cortexm/src/lib.rs:385–402  ·  view source on GitHub ↗
(
    vm: &mut icicle_vm::Vm,
    region: &config::Memory,
    data: &[u8],
)

Source from the content-addressed store, hash-verified

383}
384
385fn write_raw_bytes(
386 vm: &mut icicle_vm::Vm,
387 region: &config::Memory,
388 data: &[u8],
389) -> anyhow::Result<()> {
390 let bytes = &data[region.file_offset as usize..];
391
392 // If file size was not specified, assume it matches the size of the full region.
393 let file_size = region.file_size.unwrap_or(region.size) as usize;
394 let len = usize::min(bytes.len(), file_size);
395 vm.cpu.mem.write_bytes_large(region.base_addr, &bytes[..len], perm::NONE).map_err(|e| {
396 anyhow::format_err!(
397 "failed to write {len:#x} bytes (offset = {:#x}) to {:#x}: {e}",
398 region.file_offset,
399 region.base_addr
400 )
401 })
402}
403
404fn write_ihex_bytes(
405 vm: &mut icicle_vm::Vm,

Callers 1

fuzzware_initMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected