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

Function debug_lowpan

hail-fuzz/src/debugging/check.rs:458–479  ·  view source on GitHub ↗
(vm: &mut Vm, debug: DebugConfig)

Source from the content-addressed store, hash-verified

456}
457
458fn debug_lowpan(vm: &mut Vm, debug: DebugConfig) {
459 if debug.output.is_some() {
460 const USART_SERIAL_PUTCHAR: u64 = 0x2a1c;
461 register_char_out_printer(vm, USART_SERIAL_PUTCHAR, "r1");
462 }
463
464 let reg_r0 = vm.cpu.arch.sleigh.get_varnode("r0").unwrap();
465
466 // Fragment offset is not bounds-checked in `sicslowpan::input`
467 let out = debug.clone();
468 vm.hook_address(0x4806, move |cpu, _addr| {
469 let r0 = cpu.read_reg(reg_r0);
470 // uncomp_hdr_len + (uint16_t)(frag_offset << 3) > UIP_BUFSIZE
471 if r0 >= 400 {
472 out.error(
473 cpu,
474 &format!("uncomp_hdr_len + (frag_offset << 3) > UIP_BUFSIZE (size = {r0})"),
475 bug(LOWPAN_SENDER, 2),
476 );
477 }
478 });
479}
480
481fn debug_utasker_modbus(vm: &mut Vm, debug: DebugConfig) {
482 if debug.output.is_some() {

Callers 1

initFunction · 0.85

Calls 4

bugFunction · 0.85
cloneMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected