Open justcodedroid opened 4 years ago
尝试了很多次,看不出问题在哪。
issue没人处理么?
尝试了很多次,看不出问题在哪。
感觉是 10010L ,这个值有问题,这个东西是 执行 "initialize(Ljava/lang/String;)J"
之后返回的jni层的一个指针,你乱传应该不行。。
[22:52:01 768] WARN [com.github.unidbg.AbstractEmulator] (AbstractEmulator:406) - emulate RX@0x40073b79[libshield.so]0x73b79 exception sp=unidbg@0xbffff6d8, msg=Invalid memory read (UC_ERR_READ_UNMAPPED), offset=131ms
请问解决了吗,我也遇见一样的问题了- -
我和lz代码几乎一样,但是遇到了同样的问题,最后一步总不对,@qiang 我传入的也是 initialize返回的指针地址
` package com;
import java.io.File; import java.io.IOException; import java.net.URLDecoder; import java.nio.charset.Charset;
import com.github.unidbg.Emulator; import com.github.unidbg.Module; import com.github.unidbg.debugger.DebuggerType; import com.github.unidbg.file.FileResult; import com.github.unidbg.file.IOResolver; import com.github.unidbg.file.linux.AndroidFileIO; import com.github.unidbg.linux.android.AndroidARMEmulator; import com.github.unidbg.linux.android.AndroidResolver; import com.github.unidbg.linux.android.dvm.AbstractJni; import com.github.unidbg.linux.android.dvm.BaseVM; import com.github.unidbg.linux.android.dvm.DalvikModule; import com.github.unidbg.linux.android.dvm.DvmClass; import com.github.unidbg.linux.android.dvm.DvmObject; import com.github.unidbg.linux.android.dvm.StringObject; import com.github.unidbg.linux.android.dvm.VM; import com.github.unidbg.linux.android.dvm.VaList; import com.github.unidbg.memory.Memory; import com.github.unidbg.utils.Inspector;
import okhttp3.FormBody; import okhttp3.FormBody.Builder; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.Interceptor; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.ResponseBody; import okhttp3.internal.http.RealInterceptorChain; import okio.Buffer; import okio.BufferedSink; import okio.Okio; import okio.Sink;
public class XhsService extends AbstractJni implements IOResolver {
}
` 下面是日志
[22:51:54 350] INFO [com.github.unidbg.linux.ARMSyscallHandler] (ARMSyscallHandler:802) - pthread_clone child_stack=RW@0x40236dd0, thread_id=1, fn=RX@0x40073251[libshield.so]0x73251, arg=null, flags=[CLONE_VM, CLONE_FS, CLONE_FILES, CLONE_SIGHAND, CLONE_THREAD, CLONE_SYSVSEM] JNIEnv->FindClass(android/app/ActivityThread) was called from RX@0x4000a4e9[libshield.so]0xa4e9 JNIEnv->CallStaticObjectMethodV(class android/app/ActivityThread, currentApplication() => android.app.Application@3590fc5b) was called from RX@0x40009e75[libshield.so]0x9e75 JNIEnv->FindClass(com/xingin/shield/http/XhsHttpInterceptor) was called from RX@0x400735eb[libshield.so]0x735eb JNIEnv->RegisterNatives(com/xingin/shield/http/XhsHttpInterceptor, RW@0x4008e0d0[libshield.so]0x8e0d0, 4) was called from RX@0x400735ff[libshield.so]0x735ff RegisterNative(com/xingin/shield/http/XhsHttpInterceptor, initializeNative()V, RX@0x40074095[libshield.so]0x74095) RegisterNative(com/xingin/shield/http/XhsHttpInterceptor, intercept(Lokhttp3/Interceptor$Chain;J)Lokhttp3/Response;, RX@0x40073b29[libshield.so]0x73b29) RegisterNative(com/xingin/shield/http/XhsHttpInterceptor, initialize(Ljava/lang/String;)J, RX@0x40073911[libshield.so]0x73911) RegisterNative(com/xingin/shield/http/XhsHttpInterceptor, destroy(J)V, RX@0x40073ad5[libshield.so]0x73ad5) JNIEnv->FindClass(android/content/Context) was called from RX@0x40073697[libshield.so]0x73697 JNIEnv->FindClass(java/lang/String) was called from RX@0x400736af[libshield.so]0x736af JNIEnv->FindClass(android/content/SharedPreferences) was called from RX@0x400736c7[libshield.so]0x736c7 JNIEnv->FindClass(android/content/SharedPreferences$Editor) was called from RX@0x400736df[libshield.so]0x736df JNIEnv->FindClass(android/content/pm/PackageManager) was called from RX@0x400736f7[libshield.so]0x736f7 JNIEnv->FindClass(okhttp3/Request) was called from RX@0x4007370f[libshield.so]0x7370f JNIEnv->FindClass(okhttp3/HttpUrl) was called from RX@0x40073727[libshield.so]0x73727 JNIEnv->FindClass(okhttp3/Request$Builder) was called from RX@0x4007373f[libshield.so]0x7373f JNIEnv->FindClass(okhttp3/RequestBody) was called from RX@0x40073757[libshield.so]0x73757 JNIEnv->FindClass(okhttp3/Headers) was called from RX@0x4007376f[libshield.so]0x7376f JNIEnv->FindClass(okio/Buffer) was called from RX@0x40073785[libshield.so]0x73785 JNIEnv->FindClass(okhttp3/Interceptor$Chain) was called from RX@0x4007379d[libshield.so]0x7379d JNIEnv->FindClass(java/util/List) was called from RX@0x400737b3[libshield.so]0x737b3 JNIEnv->FindClass(java/nio/charset/Charset) was called from RX@0x400737cb[libshield.so]0x737cb JNIEnv->FindClass(com/xingin/shield/http/ContextHolder) was called from RX@0x400737e1[libshield.so]0x737e1 JNIEnv->FindClass(okhttp3/Response) was called from RX@0x400737f7[libshield.so]0x737f7 JNIEnv->FindClass(okhttp3/ResponseBody) was called from RX@0x4007380d[libshield.so]0x7380d JNIEnv->FindClass(com/xingin/shield/http/Base64Helper) was called from RX@0x40073823[libshield.so]0x73823 JNIEnv->FindClass(android/app/Application) was called from RX@0x40073381[libshield.so]0x73381 JNIEnv->CallObjectMethodV(android.app.Application@3590fc5b, getPackageManager() => android.content.pm.PackageManager@397fbdb) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->FindClass(android/content/pm/PackageManager) was called from RX@0x400733b1[libshield.so]0x733b1 JNIEnv->FindClass(android/app/Application) was called from RX@0x4000a413[libshield.so]0xa413 JNIEnv->CallObjectMethodV(android.app.Application@3590fc5b, getPackageName() => "com.xingin.xhs") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(android.content.pm.PackageManager@397fbdb, getPackageInfo("com.xingin.xhs", 0x40) => android.content.pm.PackageInfo@6aaceffd) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->FindClass(android/content/pm/PackageInfo) was called from RX@0x400733e9[libshield.so]0x733e9 JNIEnv->FindClass(android/content/pm/Signature) was called from RX@0x40073405[libshield.so]0x73405 JNIEnv->GetObjectField(android.content.pm.PackageInfo@6aaceffd, signatures [Landroid/content/pm/Signature; => [Lcom.github.unidbg.linux.android.dvm.api.Signature;@49dc7102) was called from RX@0x40073429[libshield.so]0x73429 JNIEnv->GetArrayLength([Lcom.github.unidbg.linux.android.dvm.api.Signature;@49dc7102 => 1) was called from RX@0x40073437[libshield.so]0x73437 JNIEnv->GetObjectArrayElement([Lcom.github.unidbg.linux.android.dvm.api.Signature;@49dc7102, 0) was called from RX@0x40073465[libshield.so]0x73465 JNIEnv->CallIntMethodV(android.content.pm.Signature@68c72235, hashCode() => 0xbf6f07ea) was called from RX@0x40009d61[libshield.so]0x9d61 Find native function Java_com_xingin_shield_http_XhsHttpInterceptor_initializeNative()V => RX@0x40074095[libshield.so]0x74095 JNIEnv->CallStaticObjectMethodV(class java/nio/charset/Charset, defaultCharset() => java.nio.charset.Charset@10959ece) was called from RX@0x40009e75[libshield.so]0x9e75 JNIEnv->CallObjectMethodV(android.app.Application@3590fc5b, getPackageManager() => android.content.pm.PackageManager@3a6bb9bf) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(android.app.Application@3590fc5b, getPackageName() => "com.xingin.xhs") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(android.content.pm.PackageManager@3a6bb9bf, getPackageInfo("com.xingin.xhs", 0x20000) => android.content.pm.PackageInfo@65f095f8) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->FindClass(android/content/pm/PackageInfo) was called from RX@0x4000a9cb[libshield.so]0xa9cb JNIEnv->GetIntField(android.content.pm.PackageInfo@65f095f8, versionCode => 0x613334) was called from RX@0x4000a9e9[libshield.so]0xa9e9 JNIEnv->GetStaticObjectField(class com/xingin/shield/http/ContextHolder, deviceId Ljava/lang/String; => "93879ae5-2581-38c1-aaa3-22096955417e") was called from RX@0x40074505[libshield.so]0x74505 JNIEnv->NewStringUTF("xy-ter-str") was called from RX@0x40074513[libshield.so]0x74513 JNIEnv->GetStringUtfChars("93879ae5-2581-38c1-aaa3-22096955417e") was called from RX@0x40074535[libshield.so]0x74535 JNIEnv->ReleaseStringUTFChars("93879ae5-2581-38c1-aaa3-22096955417e") was called from RX@0x40074573[libshield.so]0x74573 JNIEnv->NewStringUTF("platform=android&build=6370100&deviceId=93879ae5-2581-38c1-aaa3-22096955417e") was called from RX@0x40074589[libshield.so]0x74589 JNIEnv->NewStringUTF("xy-platform-info") was called from RX@0x400745b3[libshield.so]0x745b3 JNIEnv->NewStringUTF("shield") was called from RX@0x400745dd[libshield.so]0x745dd Find native function Java_com_xingin_shield_http_XhsHttpInterceptor_intercept(Lokhttp3/Interceptor$Chain;J)Lokhttp3/Response; => RX@0x40073b29[libshield.so]0x73b29 JNIEnv->CallObjectMethodV(okhttp3.Interceptor$Chain@79da8dc5, request() => okhttp3.Request@7e5afaa6) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okhttp3.Request@7e5afaa6, url() => okhttp3.HttpUrl@63a12c68) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okhttp3.HttpUrl@63a12c68, encodedPath() => "/api/sns/v1/system_service/check_code") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okhttp3.HttpUrl@63a12c68, encodedQuery() => "zone=86&phone=17611262716&code=111111&platform=android&deviceId=93879ae5-2581-38c1-aaa3-22096955417e&device_fingerprint=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&device_fingerprint1=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&versionName=6.37.0.1&channel=xiaohongshu&sid=&lang=zh-Hans&t=1587888231&fid=1587721176107ca47573a1e9a5c3fc0862f0ecb0d305&sign=485d645326477f685ae6f5c0a2d97daf") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okhttp3.Request@7e5afaa6, body() => okhttp3.RequestBody@fa49800) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okhttp3.Request@7e5afaa6, headers() => okhttp3.Headers@71238fc2) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->NewObjectV(class okio/Buffer, <init>() => okio.Buffer@2a54a73f) was called from RX@0x4000b549[libshield.so]0xb549 JNIEnv->CallObjectMethodV(okio.Buffer@2a54a73f, writeString("/api/sns/v1/system_service/check_code", java.nio.charset.Charset@10959ece) => okio.Buffer@2a54a73f) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okio.Buffer@2a54a73f, writeString("zone=86&phone=17611262716&code=111111&platform=android&deviceId=93879ae5-2581-38c1-aaa3-22096955417e&device_fingerprint=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&device_fingerprint1=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&versionName=6.37.0.1&channel=xiaohongshu&sid=&lang=zh-Hans&t=1587888231&fid=1587721176107ca47573a1e9a5c3fc0862f0ecb0d305&sign=485d645326477f685ae6f5c0a2d97daf", java.nio.charset.Charset@10959ece) => okio.Buffer@2a54a73f) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallIntMethodV(okhttp3.Headers@71238fc2, size() => 0x2) was called from RX@0x40009d61[libshield.so]0x9d61 JNIEnv->CallObjectMethodV(okhttp3.Headers@71238fc2, name(0x0) => "xy-common-params") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->GetStringUtfChars("xy-common-params") was called from RX@0x40073c69[libshield.so]0x73c69 JNIEnv->CallObjectMethodV(okhttp3.Headers@71238fc2, value(0x0) => "platform=android&deviceId=93879ae5-2581-38c1-aaa3-22096955417e&device_fingerprint=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&device_fingerprint1=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&versionName=6.37.0.1&channel=xiaohongshu&sid=&t=1587888232&fid=1587721176107ca47573a1e9a5c3fc0862f0ecb0d305&uis=light&identifier_flag=0") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->ReleaseStringUTFChars("xy-common-params") was called from RX@0x40073cd7[libshield.so]0x73cd7 JNIEnv->CallObjectMethodV(okhttp3.Headers@71238fc2, name(0x1) => "User-Agent") was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->GetStringUtfChars("User-Agent") was called from RX@0x40073c69[libshield.so]0x73c69 JNIEnv->ReleaseStringUTFChars("User-Agent") was called from RX@0x40073cd7[libshield.so]0x73cd7 JNIEnv->CallObjectMethodV(okio.Buffer@2a54a73f, writeString("platform=android&deviceId=93879ae5-2581-38c1-aaa3-22096955417e&device_fingerprint=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&device_fingerprint1=2020042212064946aa912284e39630dbaf67a13ad903f401bd83ef18e40e80&versionName=6.37.0.1&channel=xiaohongshu&sid=&t=1587888232&fid=1587721176107ca47573a1e9a5c3fc0862f0ecb0d305&uis=light&identifier_flag=0", java.nio.charset.Charset@10959ece) => okio.Buffer@2a54a73f) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallObjectMethodV(okio.Buffer@2a54a73f, writeString("platform=android&build=6370100&deviceId=93879ae5-2581-38c1-aaa3-22096955417e", java.nio.charset.Charset@10959ece) => okio.Buffer@2a54a73f) was called from RX@0x40009885[libshield.so]0x9885 JNIEnv->CallVoidMethodV(okhttp3/RequestBody, writeTo(okio.Buffer@2a54a73f)) was called from RX@0x400098d5[libshield.so]0x98d5 [22:51:54 526] WARN [com.github.unidbg.arm.AbstractARMEmulator] (AbstractARMEmulator$1:54) - memory failed: address=0x29a4, size=1, value=0x0 [22:51:54 527] WARN [com.github.unidbg.AbstractEmulator] (AbstractEmulator:354) - emulate RX@0x40073b29[libshield.so]0x73b29 exception sp=unicorn@0xbffff6d0, msg=Invalid memory read (UC_ERR_READ_UNMAPPED), offset=30ms -1 null