# coding=utf-8import osimport time'''@author: xingjun.xyf@contact: deathmemory@163.com@file: pass.py@time: 2020年11月9日 7:43 下午@desc: 启动 app 挂起, 附加 IDA 后按回车键继续运行'''# 穿越packagename = "com.autonavi.cprotectortest"launcherAct = "com.autonavi.cprotectortest.MainActivity"def getPidByLine(line):retarray = line.split(" ")for cell in retarray:if cell.isdigit():return cellreturn Nonedef killLastProc():os.system("adb shell am force-stop " + packagename)retval = os.popen("adb shell ps | grep " + packagename)line = retval.readline()pid = getPidByLine(line)if pid is not None:os.system("adb shell su -c kill -9 " + pid)print("kill last proc")def main():killLastProc()lauchFull = packagename + "/" + launcherActos.system("adb shell am start -D -n " + lauchFull)time.sleep(1)retval = os.popen("adb shell ps | grep " + packagename)line = retval.readline()print("ps line:\n" + line)pid = getPidByLine(line)print("pid: " + pid)adbforward = "adb forward tcp:7788 jdwp:" + pidos.system(adbforward)print(adbforward)raw_input("wait for ida attach ...\nif ida has been attached press [Enter] key")jdbconnect = "jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=7788"os.system(jdbconnect)print(jdbconnect)if __name__ == '__main__':main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。