(vm: &mut Vm, debug: DebugConfig)
| 376 | } |
| 377 | |
| 378 | fn debug_gps_tracker(vm: &mut Vm, debug: DebugConfig) { |
| 379 | if debug.output.is_some() { |
| 380 | const UART_WRITE: u64 = 0x83cc4; |
| 381 | register_char_out_printer(vm, UART_WRITE, "r1"); |
| 382 | } |
| 383 | |
| 384 | // Stack overflow in `USB_SendStringDescriptor` |
| 385 | const USB_SEND_STRING_DESCRIPTOR: u64 = 0x8424c; |
| 386 | let reg_r1 = vm.cpu.arch.sleigh.get_varnode("r1").unwrap(); |
| 387 | vm.hook_address(USB_SEND_STRING_DESCRIPTOR, move |cpu, _addr| { |
| 388 | let w_len = cpu.read_reg(reg_r1); |
| 389 | if w_len > 0xc000 { |
| 390 | debug.error(cpu, &format!("USB_SendStringDescriptor with wLength={w_len:#x}"), 30); |
| 391 | } |
| 392 | }); |
| 393 | } |
| 394 | |
| 395 | fn debug_usb(vm: &mut Vm, debug: DebugConfig) { |
| 396 | if debug.output.is_some() { |
no test coverage detected