Skip to content

Commit 190e736

Browse files
committed
commit
1 parent 1b7ff5e commit 190e736

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

projects/XposedHookWeiXin1/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
**本工程目标——获取某个微信联系人信息**
2+
3+
<<<<<<< HEAD
4+
<!--<img src="image/contact.png" width="280px" height="300px"/>-->
5+
6+
**本工程侧重逆向思路分析,基于[微信7.0.4版本源码](./docs/weixin_7.0.4_source)**
7+
=======
8+
**本工程侧重逆向思路分析,基于[微信7.0.4版本源码](../../docs/weixin_7.0.4_source)**
9+
>>>>>>> 8af92783a2246b98b915f704149e7854009d0fa3
10+
11+
**思路分析**
12+
13+
1. 联系人信息界面activityC肯定是需要从联系人列表点击进入的,activityC有两种方式来得到个人信息并显示:a.通过intent的方式,由前一个界面传递该用户所有信息过去,b.通过intent传递部分信息,比如id,然后再联网或者从本地数据库获取其他信息。
14+
15+
2. 从一个实际体验的效果来看,联网获取肯定是不太合理的,那边现在优先考虑intent方式传递全部数据;
16+
17+
3. 微信打开activityC然后通过adb指令 **adb shell dumpsys activity | grep "mFocusedActivity"** , 我们可以查看到activityC类名为: **com.tencent.mm..plugin.profile.ui.ContactInfoUI**, 即 **activityC == ContactInfoUI**
18+
19+
4. 拿到目标类ContactInfoUI,接下来开始写代码验证intent
20+
21+
```
22+
private void handleContactInfo(final XC_LoadPackage.LoadPackageParam lpparam) {
23+
XposedHelpers.findAndHookMethod(weixinContactInfoClassName, lpparam.classLoader,
24+
"onCreate",Bundle.class, new XC_MethodHook() {
25+
@Override
26+
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
27+
super.beforeHookedMethod(param);
28+
Log.i(TAG, "打印 handleContactInfo beforeHookedMethod:" + param.method);
29+
}
30+
31+
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
32+
@Override
33+
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
34+
super.afterHookedMethod(param);
35+
Activity activity = (Activity) param.thisObject;
36+
Intent intent = activity.getIntent();
37+
Set<String> keys = Objects.requireNonNull(intent.getExtras()).keySet();
38+
for (String string : keys) {
39+
Log.i(TAG, "打印 handleContactInfo keys 内容 :" + string);
40+
}
41+
}
42+
});
43+
}
44+
```
45+
46+
5. 我们拿到了从上一个界面传递过来的intent并做了一个遍历,结果可以看到intent传递过来的数据是极其有限的,所以a方式基本可以被排除;
47+
48+
```
49+
//intent传递的key只打印了以下三个字段:
50+
//Contact_Mobile_MD5
51+
//Contact_User
52+
//CONTACT_INFO_UI_SOURCE
53+
```
54+
55+
6. 到此我们基本可以判断ContactInfoUI界面的数据是通过intent传递过来的某一数据(这里指Contact_User)作为查询条件从本地数据库获取而来;
56+
57+
7. 接下来从代码部分进一步验证,jadx搜索ContactInfoUI,在onCreate方法内部可以看到比较关键的一句话;
58+
59+
```
60+
ad aoO = com.tencent.mm.model.c.XM().aoO(bo.nullAsNil(getIntent().getStringExtra("Contact_User")));
61+
```
62+
63+
8. 跟踪到ad类,可以搜索到一些比较关键性的字: Cursor, 至此可以肯定数据是以Contact_User值为条件从数据库查询而来;
64+
65+
9. 剩下的操作就是操作微信数据库,本工程作为基础部分,不在进行后续操作了;
66+
67+
68+
69+

0 commit comments

Comments
 (0)