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进去以后实例的方法有this指针么?如何使用this? #15

Open
xiaoyao66 opened this issue Nov 13, 2019 · 2 comments
Open

Comments

@xiaoyao66
Copy link

需要用到被hook对象的实例属性以及其他方法,如果有this的话如何调用原实例的属性和方法?(特别是内部属性和内部方法)

@xiangyuecn
Copy link
Contributor

可以通过线程上下文来传递变量,你可以把实例保存到CallContext.LogicalSetData内,然后我们的hook方法内读取到上下文存储的变量,然后通过反射调用私有属性、方法。

@newonejoe
Copy link

可以通过线程上下文来传递变量,你可以把实例保存到CallContext.LogicalSetData内,然后我们的hook方法内读取到上下文存储的变量,然后通过反射调用私有属性、方法。

我也遇到类似的问题了,能不能提供实例?

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

3 participants