Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bin-y opened this issue Oct 25, 2017 · 2 comments
Closed

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

bin-y opened this issue Oct 25, 2017 · 2 comments

Comments

@bin-y
Copy link

bin-y commented Oct 25, 2017

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
Copy link
Author

bin-y commented Oct 25, 2017

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

@bin-y bin-y closed this as completed Oct 25, 2017
@jmpews
Copy link
Owner

jmpews commented Oct 26, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants