From 4f2d1c0830ad34fa2f12dcc36d6dc62035dfb327 Mon Sep 17 00:00:00 2001 From: kylin_bg Date: Sat, 7 Jun 2025 15:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=8D=E9=98=BB=E6=96=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libusbMod.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libusbMod.c b/libusbMod.c index 083395d..d3e6273 100644 --- a/libusbMod.c +++ b/libusbMod.c @@ -72,12 +72,12 @@ static int handler_pre(struct kprobe *p, struct pt_regs *regs) } } - regs->regs[0] = 0; // 设置 x0 寄存器(返回值)为 0 (成功) - - - // return 0; // KPROBE_OK,默认让原始函数继续执行 - // 如果要阻断,这里返回 1 (KPROBE_HANDLED)x - return 1; + + // 这里一定要设置返回成功,如果不设置返回成功,将会导致一直重复发送; + // regs->regs[0] = 0; // 设置 x0 寄存器(返回值)为 0 (成功) + //这里return 1表示阻断,return 0 表示继续运行 + // return 1; + return 0; } static int __init usb_hook_init(void)