(buf: &'a mut [u8], cpu: &mut icicle_vm::cpu::Cpu, ptr: u64)
| 570 | } |
| 571 | |
| 572 | fn 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 | |
| 579 | fn 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}"); |