vscode idapython debug
vscode idapython debug
1、在脚本中嵌入debugpy
import sys
#python3.exe -m pip install debugpy
# sys.path.append(r"D:\IDA Pro 7.6\Lib\site-packages\debugpy")
import debugpy
DEBUG_HOST = '127.0.0.1'
DEBUG_PORT = 5678
# required for hosted Python (e.g. Maya)
# got it from pyenv python >>> print(sys.executable)
#python_path=sys.executable #r"D:\IDA Pro 7.6\python3.exe"
#debugpy.configure(python=python_path)
debugpy.listen((DEBUG_HOST, DEBUG_PORT),in_process_debug_adapter=True)
idaapi.msg('listen\n')
'''
try:
debugpy.listen((DEBUG_HOST, DEBUG_PORT),in_process_debug_adapter=True)
idaapi.msg('listen\n')
except RuntimeError as e:
# except Exception as e:
idaapi.msg(str(e))
if "Only one usage of each socket address" in str(e):
pass
'''
debugpy.wait_for_client()
idaapi.msg('breakpoint\n')
debugpy.breakpoint()
2、vscode python附加
launch.json
配置python attach
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Attach ",
"type": "python",
"request": "attach",
"justMyCode": false,
"port": 5678,
"host": "127.0.0.1",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}",
}
]
}
]
}
settings.json
方便调试,非必要
{
//add this
"python.autoComplete.extraPaths": [
"D:\\IDA Pro 7.6\\python\\3"
],
"python.analysis.extraPaths": [
"D:\\IDA Pro 7.6\\python\\3"
]
}
参考链接
https://community.shotgridsoftware.com/t/remote-debugging/3869/9
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!