-
Notifications
You must be signed in to change notification settings - Fork 981
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
无法在c++模拟AAssetManager* #62
Comments
使用VirtualModule试下 |
带上测试用例跟so更直观 |
程序没有报错只是无法生成AssetManager* 因为GetLongField这个方法我传了一个随机值,因为AssetManager无法转化成功导致程序不跑后面逻辑了,我想知道怎样让这段代码reinterpret_cast<AssetManager*>(amHandle);能够正确转化 |
`package com.ks.app; import cn.banny.unidbg.LibraryResolver; import java.io.File; public class TestSignSo1 extends AbstractJni implements IOResolver {
} libc.zip |
返回的address不为0就可以跑后面的逻辑 |
但是JNI层AssetManager去读取资源文件好像是有问题的 |
``
|
加载自己的so之前,先参考以上添加虚拟模块 |
添加了可以了,但是碰到了新问题 |
faccessat这个函数模拟有问题,这里只判断了传入是文件路径的情况,还有一种是传入的是已经打开文件的句柄fd,flag=0情况应该是传入的是已经打开的fd还要通过get_dir(fd)才能获取具体路径把 |
有问题的有能力修改就先修改,改好后再发个PR |
只是发现了这个问题,目前还没这个能力改,等大佬来改 |
好的,回头有时间再看下 |
大佬快点更新,卡在这里了。。。。 |
最新的测试用例以及所涉及的文件打包发出来,我运行试下什么异常 |
我用你以前发的测试,发现video_yh_loading_icon.png这个资源不知道在哪?最好把apk下载地址发我去下载 |
检查了access系统调用没问题 |
群主没出现这个乱码,这个乱码应该不是文件地址,addIOResolver之后pathname返回这个乱码,这应该不是文件地址而是fd句柄把 |
这个运行没有跑出结果 请问最后修改什么可以有结果输出? |
在jni中存在以下代码时程序会报错
jlong amHandle = env->GetLongField(obj, gAssetManagerOffsets.mObject);
AssetManager* am = reinterpret_cast<AssetManager*>(amHandle);
if (am != NULL) {
return am;
}
The text was updated successfully, but these errors were encountered: