Skip to content

Instantly share code, notes, and snippets.

@SeeFlowerX
Last active May 8, 2023 01:54
Show Gist options
  • Save SeeFlowerX/5cb68da79888d0ab5fc00b8250224ccb to your computer and use it in GitHub Desktop.
Save SeeFlowerX/5cb68da79888d0ab5fc00b8250224ccb to your computer and use it in GitHub Desktop.
IDA动态调试步骤
  1. dbgsrv/android_server64推送到/data/local/tmp
adb push android_server64 /data/local/tmp/ida_android_server64
  1. 授予权限
adb shell chmod +x /data/local/tmp/ida_android_server64
  1. 运行ida_android_server64
adb shell
su
cd /data/local/tmp
# 高版本手机需要这一步
export IDA_LIBC_PATH=/apex/com.android.runtime/lib64/bionic/libc.so
./ida_android_server64
  1. 启动APP
adb shell am start -D -n com.test.fgum/.MainActivity
  1. IDA附加
  • adb forward tcp:23946 tcp:23946
  • Debugger -> Attach -> Remote ARMLinux/Android debugger
  • hostname 填写 localhost/127.0.0.1
  • 点击OK,Ctrl+F搜索到目标进程,双击开始附加,等待附加完成
  • Debugger -> Debugger Opitions设置暂停时机,比如Suspend on library load/unload
  1. 查看pid
adb shell "ps -ef | grep com.test.fgum"
  1. 转发jdwp
adb forward tcp:8700 jdwp:16851
  1. jdb连接
jdb -connect com.sun.jdi.SocketAttach:hostname=127.0.0.1,port=8700
  1. 开始调试

此时切换到IDA按F9,就可以开始调试了,然后会依次在加载so的时候停止下来

注意事项:目标APP应当配置android:extractNativeLibs="true",否则IDA无法命中APP的so加载,只能看到APK被加载了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment