V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shoumu
V2EX  ›  Python

在一个已有的进程上挂接调试器不成功

  •  
  •   shoumu ·
    shoumu · 2013-07-14 14:31:05 +08:00 · 3050 次点击
    这是一个创建于 3910 天前的主题,其中的信息可能已经有所发展或是发生改变。
    再看《Python灰帽子》,其中有一个例子是在已有的进程上挂接调试器,具体的代码如下:
    def attach(self, pid):
    self.h_process = self.open_process(pid)

    if kernel32.DebugActiveProcess(pid):
    self.debugger_active = True
    self.pid = int(pid)
    self.run()
    else:
    print "[*] Unable to attach to the process"
    但是在这里始终不成功,麻烦各位大哥给小弟指点指点
    4 条回复    1970-01-01 08:00:00 +08:00
    timonwong
        1
    timonwong  
       2013-07-14 15:01:08 +08:00
    先检查3个前提条件吧,你给的信息太少了:
    1. Windows only
    2. 安装(并注册)有Debugger(VS, Debugging Tools for Windows, etc)
    3. 目标程序无反制措施
    shoumu
        2
    shoumu  
    OP
       2013-07-14 15:27:45 +08:00
    @timonwong
    1、是windows
    2、有
    3、开的目标程序是计算器
    timonwong
        3
    timonwong  
       2013-07-14 16:10:16 +08:00
    @shoumu
    那是不是在用32位的python开64位的程序?
    shoumu
        4
    shoumu  
    OP
       2013-07-15 18:20:34 +08:00
    @timonwong
    是32位的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4128 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 159ms · UTC 05:26 · PVG 13:26 · LAX 22:26 · JFK 01:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.