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
alex8224
V2EX  ›  Python

将任意 Bytecode 注入运行中的 Python 进程

  •  
  •   alex8224 ·
    alex8224 · 2015-05-21 16:57:47 +08:00 · 3476 次点击
    这是一个创建于 3234 天前的主题,其中的信息可能已经有所发展或是发生改变。

    今天我从 Btrace 这个项目得到灵感, 结合 Pyasite (https://kenai.com/projects/btrace)
    Byteplay ( https://github.com/serprex/bytepla) ,实现了一个简陋版本的例子,实现对正在运行的Python进程进行在线调试.
    因为内容太长, 需要到 http://segmentfault.com/a/1190000002783940 看原文.

    3 条回复    2015-05-22 11:39:01 +08:00
    ratazzi
        1
    ratazzi  
       2015-05-21 20:03:30 +08:00
    gevent 自带的 backdoor 也可以做到类似的效果
    Keyes
        2
    Keyes  
       2015-05-21 20:09:58 +08:00
    不知道能不能注入到EVE(没错CCP那个沙盒游戏)中来做点坏事/:坏笑
    alex8224
        3
    alex8224  
    OP
       2015-05-22 11:39:01 +08:00
    @Keyes EVE如果对库进行过一些裁剪,就不行了 :)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5292 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:45 · PVG 13:45 · LAX 22:45 · JFK 01:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.