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

Function read_cstr

hail-fuzz/src/debugging/check.rs:572–577  ·  view source on GitHub ↗
(buf: &'a mut [u8], cpu: &mut icicle_vm::cpu::Cpu, ptr: u64)

Source from the content-addressed store, hash-verified

570}
571
572fn read_cstr<'a>(buf: &'a mut [u8], cpu: &mut icicle_vm::cpu::Cpu, ptr: u64) -> &'a [u8] {
573 buf[0] = 0;
574 let _ = cpu.mem.read_bytes(ptr, buf, perm::NONE);
575 let len = buf.find_byte(0).unwrap_or(buf.len());
576 &buf[..len]
577}
578
579fn register_write_printer(vm: &mut Vm, addr: u64, data_reg: &str, len_reg: &str) {
580 tracing::debug!("registering `write(data={data_reg}, len={len_reg})` hook at {addr:#x}");

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected