Replies: 1 comment
-
你是不是初始化为默认的 shared 模式,但是用了 unique 模式的 proxy 函数? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
为什么我用readelf -s libandroid.so是这样的结果:
189: 00003001 2 FUNC GLOBAL DEFAULT 6 AAssetDir_close
190: 00003003 2 FUNC GLOBAL DEFAULT 6 AAssetDir_getNextFileName
191: 00003005 2 FUNC GLOBAL DEFAULT 6 AAssetDir_rewind
192: 00003007 2 FUNC GLOBAL DEFAULT 6 AAssetManager_fromJava
193: 00003009 2 FUNC GLOBAL DEFAULT 6 AAssetManager_open
194: 0000300b 2 FUNC GLOBAL DEFAULT 6 AAssetManager_openDir
195: 0000300d 2 FUNC GLOBAL DEFAULT 6 AAsset_close
196: 0000300f 2 FUNC GLOBAL DEFAULT 6 AAsset_getBuffer
197: 00003011 2 FUNC GLOBAL DEFAULT 6 AAsset_getLength
198: 00003013 2 FUNC GLOBAL DEFAULT 6 AAsset_getLength64
199: 00003015 2 FUNC GLOBAL DEFAULT 6 AAsset_getRemainingLength
200: 00003017 2 FUNC GLOBAL DEFAULT 6 AAsset_getRemainingLength
201: 00003019 2 FUNC GLOBAL DEFAULT 6 AAsset_isAllocated
202: 0000301b 2 FUNC GLOBAL DEFAULT 6 AAsset_openFileDescriptor
203: 0000301d 2 FUNC GLOBAL DEFAULT 6 AAsset_openFileDescriptor
204: 0000301f 2 FUNC GLOBAL DEFAULT 6 AAsset_read
205: 00003021 2 FUNC GLOBAL DEFAULT 6 AAsset_seek
206: 00003023 2 FUNC GLOBAL DEFAULT 6 AAsset_seek64
hook成功,确没有回调
I/shadowhook_tag: shadowhook: hook_sym_name(libandroid.so, AAssetManager_open, 0x79f046944c) OK. return: 0x79ff626620. 0 - OK
`typedef void (*type_t)(AAssetManager *, const char *, int);
static void proxy(AAssetManager *assetManager, const char *filename, int mode)
{
// do something
LOG("do something %s", "before");
((type_t)orig)(assetManager, filename, mode);
LOG("do something %s", "after");
// do something
}
stub = shadowhook_hook_sym_name(
"libandroid.so",
"AAssetManager_open",
(void *)proxy,
(void **)&orig);
`
Beta Was this translation helpful? Give feedback.
All reactions