An python vm injector with debug tools, based on gdb.

NtesEyes, updated đŸ•Ĩ 2022-11-06 03:13:56


PyPI version


Pylane is a python vm injector with debug tools, based on gdb and ptrace. Pylane uses gdb to trace python process, inject and run some code in its python vm.



use inject command to inject a python script in an process:

pylane inject <PID> <YOUR_PYTHON_FILE>

use shell command to inject an interactive shell:

pylane shell <PID>

Pylane shell features:

  • use IPython as its interactive interface, support magic functions like ? and %
  • support remote automatic completion
  • provide debug toolkit functions, such as:
  • lookup class or instance by name
  • get source code of an object
  • print all threads' stack and locals


pip install pylane

pylane should be installed in virtualenv the target process uses or in os python lib.


Support Linux and BSD


The IPython and click version in should not be fixed

opened on 2022-10-08 07:37:35 by DIYer22

Please merge pull requests of

And update pypi package

Fails to check PID in Mac OS

opened on 2019-02-19 04:19:39 by die4live



v0.0.8 bugfix release 2019-09-26 09:01:52

  1. use getoutput in module commands for python2

v0.0.7 bugfix release 2019-09-25 07:50:38

  1. use ps instead of /proc to check if process is exists
  2. handle c api return types in gdb to support those python release without symbols

0.0.6 2019-02-01 08:25:04

2019-01-10 10:10:48

v0.0.4 2019-01-08 10:20:14

init release 2018-03-29 05:11:24

python gdb debug