jmpews / Dobby

a lightweight, multi-platform, multi-architecture hook framework.
Apache License 2.0
4.04k stars 845 forks source link

最新代码hook后读取寄存器不正确 #6

Closed bin-y closed 7 years ago

bin-y commented 7 years ago

commit: ac9b68a 使用capstone的版本没有问题,测试代码:

void precall(RegState *rs, ThreadStack *threadstack, CallStack *callstack) {
    printf("enter precall\n");
    printf("arg2:%s\n", (char*)rs->general.regs.x1);
}
void postcall(RegState *rs, ThreadStack *threadstack, CallStack *callstack) {
}

void test_func(char* a1, char* a2) {
    printf("function is called %s %s\n", a1, a2);
}

int main(int argc, char **argv, char **envp) {
    ZzBuildHook((void *)test_func, NULL, NULL, precall, postcall);
    ZzEnableHook((void *)test_func);
    test_func(NULL, "123");
    return;
}
bin-y commented 7 years ago

额……发现问题了,API发生了变化,但是我的编译环境残留了旧的头文件,导致按照旧的API传参仍然编译通过最终导致问题。

jmpews commented 7 years ago

我没看到, 这个 issue 就关了. 😅