ida android incompatible debugger server protocol version is 17,expected 19

来源:互联网 发布:phpcms 模板使用php 编辑:程序博客网 时间:2024/06/07 04:11

当我准备用IDA动态调试android的时候,先是用我那个nubia7执行/data/local/tmp/android_server,然后发现是这种情况,

error: only position independent executables (PIE) are supported.

这里写图片描述

于是搜了一下,找到看雪论坛的这个帖子
http://bbs.pediy.com/thread-202895.htm

楼主你的Android是5.0以上的吧,或者IDA pro是6.6及以下的,Android5.0以上的编译选项默认开启了pie,在5.0以下编译的原生应用不能运行,要么你Android刷机降版本,要么用IDA pro6.7 6.8的android_server。

看到这句话,我发现可能是这个android_server文件是很久之前用比较低版本的IDA里面的dbgsrv目录下的文件传上去的,于是这次找到6.8版本的IDA pro中的android_server再传上去就可以了。结果还是不行,然后又看了一下那个帖子,发现可能是我的API版本太高了(android 5.0, API 21)于是我掏出之前买的google nessus(android 4.4 API 19)。
这次没有only position independent executables (PIE) are supported.了,但是IDA中出现了这种情况
这里写图片描述
应该还是androi_server文件是我很久之前上传到这个nesses上的,于是上传了那个IDA 6.8中的比较新的android_server上去,记得给android_server添加执行权限,

# chmod 777 /data/local/tmp/android_server 

再运行一下,发现可以运行了,监听在#23946端口。
这里写图片描述
然后注意到是32-bit的debug server,于是将IDA换成32位的。注意,调试32位的程序得用IDA的32位版,64位的程序用64位版。不然会出错。
然后为了调试,得通过adb将android上的#23946端口转发到本地的相同端口,
这里写图片描述
然后运行一下程序

adb shell am start -D -n com.exaple.cctf/.MainActivity

或者直接在shell里面

# am start -D -n com.exaple.cctf/.MainActivity

启动Activity之后,再将IDA attach到该process。在IDA菜单栏的Debugger那里设置一下。

阅读全文
0 0
原创粉丝点击