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

Native Hook能否提供一份简单的样例 #35

Closed
Lua12138 opened this issue Sep 18, 2019 · 5 comments
Closed

Native Hook能否提供一份简单的样例 #35

Lua12138 opened this issue Sep 18, 2019 · 5 comments

Comments

@Lua12138
Copy link

  • SandInlineHookSym
  • SandInlineHook

这些方法的入参以及返回值,使用方法的样例

感谢

@18712886438
Copy link

b685a17#diff-5a61c7e6afd536d37cb7f9a205b9e8edL13

可以看一下这块,有提供了示例的

@Lua12138
Copy link
Author

b685a17#diff-5a61c7e6afd536d37cb7f9a205b9e8edL13

可以看一下这块,有提供了示例的

感谢。另外有一个疑问,对于初始化Hook的时机有要求必须再Application.onCreate之后嘛?

我尝试了再Application构造方法中进行一些Hook,会有一些奇奇怪怪的crash

@18712886438
Copy link

b685a17#diff-5a61c7e6afd536d37cb7f9a205b9e8edL13
可以看一下这块,有提供了示例的

感谢。另外有一个疑问,对于初始化Hook的时机有要求必须再Application.onCreate之后嘛?

我尝试了再Application构造方法中进行一些Hook,会有一些奇奇怪怪的crash

这个不清楚了,不行可以试试edxposed

@ganyao114
Copy link
Collaborator

b685a17#diff-5a61c7e6afd536d37cb7f9a205b9e8edL13
可以看一下这块,有提供了示例的

感谢。另外有一个疑问,对于初始化Hook的时机有要求必须再Application.onCreate之后嘛?

我尝试了再Application构造方法中进行一些Hook,会有一些奇奇怪怪的crash

fixed

@Lua12138
Copy link
Author

Lua12138 commented Jan 8, 2021

如果要hook c++中的方法,那么应该如何写这个代码呢?

例如希望Hook OpenSL ES中的方法

	SLresult (*CreateAudioRecorder) (
		SLEngineItf self,
		SLObjectItf * pRecorder,
		SLDataSource *pAudioSrc,
		SLDataSink *pAudioSnk,
		SLuint32 numInterfaces,
		const SLInterfaceID * pInterfaceIds,
		const SLboolean * pInterfaceRequired
	);

又比如希望hook某个c++类的方法,例如

ExampleClass::exampleMethod(int a, char* b)

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