使用IDA修改arm64的so,实现微信log输出

1. adb pull 出来/data/data/com.tencent.mm/tinker/patch-c87a69a6/lib/lib/arm64-v8a/libwechatxlog.so 

2. 分析xlog的开源代码,找到关键字

3. 用IDA打开libwechatxlog.so,搜索关键字,从而定位函数。

4. 根据汇编指令的跳转逻辑,修改汇编指令,使其执行logcat输出。使用在线翻译工具,实现汇编指令的16进制转换。

http://armconverter.com/hextoarm/

http://armconverter.com

5. 使用IDA apply patch,然后将修改过的libwechatxlog.so重新push回去,kill wechat,就能在logcat看见微信的log输出了。

 

02-07 16:04:36.403  7493  7493 I MicroMsg.AppBrandDesktopAnimController: [, , 7493]:alvinluo hideBackgroundView refresh isEnableDynamicBackground: true, lastEnable: true
02-07 16:04:36.403  7493  7493 I MicroMsg.AppBrandDesktopAnimController: [, , 7493]:alvinluo hideBackgroundView SurfaceView onPause and set GONE
02-07 16:04:36.403  7493  7493 I MicroMsg.GLThread: [, , 7493]:onPause tid=1742
02-07 16:04:36.403  7493  7493 I MicroMsg.GLThread: [, , 7493]:onPause waiting for mPaused.
02-07 16:04:36.411  7493  8091 I MicroMsg.DynamicBgSurfaceView: [, , 8091]:alvinluo DynamicBackgroundSurfaceView.Renderer onPause
02-07 16:04:36.411  7493  8091 I MicroMsg.GLThread: [, , 8091]:mPaused is now true tid=1742
02-07 16:04:36.412  7493  8091 I MicroMsg.GLThread: [, , 8091]:releasing EGL surface because paused tid=1742
02-07 16:04:36.413  7493  7493 I MicroMsg.DynamicBgSurfaceView: [, , 7493]:alvinluo onVisibilityChanged: 8
02-07 16:04:36.413  7493  7493 I MicroMsg.GLThread: [, , 7493]:surfaceDestroyed tid=1742
02-07 16:04:36.414  7493  8091 I MicroMsg.GLThread: [, , 8091]:noticed surfaceView surface lost tid=1742
02-07 16:04:36.414  7493  7493 I MicroMsg.DynamicBgSurfaceView: [, , 7493]:alvinluo surfaceDestroyed
02-07 16:04:36.416  7493  7493 I MicroMsg.AppBrandDesktopAnimController: [, , 7493]:alvinluo hideBackgroundView GradientColorView set GONE
02-07 16:04:36.417  7493  7493 I MicroMsg.AppBrandDesktopAnimController: [, , 7493]:alvinluo setIgnoreInLayout false

你可能感兴趣的:(android)