Quantcast
Channel: Python extension for WinDbg
Viewing all 1625 articles
Browse latest View live

Released: PYKD BOOTSTRAPPER 2.0 (Jun 23, 2016)

$
0
0
PYKD BOOTSTRAPPER is a windbg extension. It is a simple dll file (pykd.dll). It DOES NOT contain pykd functionality. I is designed to locate and initialize python core inside windbg. Then you can use any python packages and of course pykd.

Using pykd bootstrapper - is recommended way to use pykd with windbg.

To install pykd.dll you should:

1. Locate your windbg installation place ( for example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 )
2. Unpack pykd.dll to the 'ext' directory.

To load pykd.dll:

Run command:
.load pykd

Show help for pykd bootstrapper:

0:000> !pykd.help

usage:

!help
	print this text

!info
	list installed python interpreters

!py [version] [options] [file]
	run python script or REPL

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	Options:
	-g --global  : run code in the common namespace
	-l --local   : run code in the isolated namespace

	command samples:
	"!py"                          : run REPL
	"!py --local"                  : run REPL in the isolated namespace
	"!py -g script.py 10 "string"" : run script file with argument in the common namespace

!pip [version] [args]
	run pip package manager

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	pip command samples:
	"pip list"                   : show all installed packages
	"pip install pykd"           : install pykd
	"pip install --upgrade pykd" : upgrade pykd to the latest version
	"pip show pykd"              : show info about pykd package

List all available python core

0:000> !pykd.info

Installed python

Version:        Status:     Image:
------------------------------------------------------------------------------
* 2.7 x86-64    Unloaded    C:\Windows\SYSTEM32\python27.dll
  3.5 x86-64    Unloaded    C:\Users\user\AppData\Local\Programs\Python\Python35\python35.dll

To run scripts or REPL use command:

!pykd.py
  • To run REPL with the default python: !py
  • To run REPL with the specified python: !py -3
  • To run script with the default python: !py script.py arg1 arg2
  • To run script with the specified python: !py script.py arg1 arg2
  • To run REPL in local scope ( all objects will be destruct after quit() ): !py --local
  • To run script in global scope ( all objects stay to live ): !py --global script.py

You can use "shebang line" to note python version. Insert first line to a script file:
 #! python2

Or

 #! python3.5

To managed python packages use command:

!pykd.pip

Show package list
0:000> !pip -3.5 list
pip (7.1.2)
pykd (0.3.1.1)
setuptools (18.2)
wheel (0.29.0)

Show package info:
0:000> !pip -3.5 show pykd
---
Metadata-Version: 2.0
Name: pykd
Version: 0.3.1.1
Summary: python windbg extension
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\users\user\appdata\local\programs\python\python35\lib\site-packages
Requires: 

Install or upgrade package:
0:000> !pip -3.5 install --upgrade pykd
Collecting pykd
  Downloading pykd-0.3.1.3-cp35-none-win_amd64.whl (3.3MB)
Installing collected packages: pykd
  Found existing installation: pykd 0.3.1.1
    Uninstalling pykd-0.3.1.1:
      Successfully uninstalled pykd-0.3.1.1
Successfully installed pykd-0.3.1.3

Updated Release: PYKD BOOTSTRAPPER 2.0 (Jun 23, 2016)

$
0
0
PYKD BOOTSTRAPPER is a windbg extension. It is a simple dll file (pykd.dll). It DOES NOT contain pykd functionality. I is designed to locate and initialize python core inside windbg. Then you can use any python packages and of course pykd.

Using pykd bootstrapper - is recommended way to use pykd with windbg.

To install pykd.dll you should:

1. Locate your windbg installation place ( for example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 )
2. Unpack pykd.dll to the 'ext' directory.

To load pykd.dll:

Run command:
.load pykd

Show help for pykd bootstrapper:

0:000> !pykd.help

usage:

!help
	print this text

!info
	list installed python interpreters

!py [version] [options] [file]
	run python script or REPL

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	Options:
	-g --global  : run code in the common namespace
	-l --local   : run code in the isolated namespace

	command samples:
	"!py"                          : run REPL
	"!py --local"                  : run REPL in the isolated namespace
	"!py -g script.py 10 "string"" : run script file with argument in the common namespace

!pip [version] [args]
	run pip package manager

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	pip command samples:
	"pip list"                   : show all installed packages
	"pip install pykd"           : install pykd
	"pip install --upgrade pykd" : upgrade pykd to the latest version
	"pip show pykd"              : show info about pykd package

List all available python core

0:000> !pykd.info

Installed python

Version:        Status:     Image:
------------------------------------------------------------------------------
* 2.7 x86-64    Unloaded    C:\Windows\SYSTEM32\python27.dll
  3.5 x86-64    Unloaded    C:\Users\user\AppData\Local\Programs\Python\Python35\python35.dll

To run scripts or REPL use command:

!pykd.py
  • To run REPL with the default python: !py
  • To run REPL with the specified python: !py -3
  • To run script with the default python: !py script.py arg1 arg2
  • To run script with the specified python: !py script.py arg1 arg2
  • To run REPL in local scope ( all objects will be destruct after quit() ): !py --local
  • To run script in global scope ( all objects stay to live ): !py --global script.py

You can use "shebang line" to note python version. Insert first line to a script file:
 #! python2

Or

 #! python3.5

To managed python packages use command:

!pykd.pip

Show package list
0:000> !pip -3.5 list
pip (7.1.2)
pykd (0.3.1.1)
setuptools (18.2)
wheel (0.29.0)

Show package info:
0:000> !pip -3.5 show pykd
---
Metadata-Version: 2.0
Name: pykd
Version: 0.3.1.1
Summary: python windbg extension
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\users\user\appdata\local\programs\python\python35\lib\site-packages
Requires: 

Install or upgrade package:
0:000> !pip -3.5 install --upgrade pykd
Collecting pykd
  Downloading pykd-0.3.1.3-cp35-none-win_amd64.whl (3.3MB)
Installing collected packages: pykd
  Found existing installation: pykd 0.3.1.1
    Uninstalling pykd-0.3.1.1:
      Successfully uninstalled pykd-0.3.1.1
Successfully installed pykd-0.3.1.3

Edited Issue: [pykd_bootstrapper] '!py C:' crashes windbg [14058]

$
0
0
subj
Comments: ** Comment from web user: kernelnet **

fixed 2.0.0.7

Created Unassigned: [0.3.x] dbgCommand skips text output from breakpoints [14060]

$
0
0
>bp ntdll!NtCreateFile "py C:/temp/test.py"
>g
ntdll!NtCreateFile:
"string from test.py" <-- as expected

>!py
>>>dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>>quit()
ntdll!NtCreateFile:
<-- no expected output

Edited Unassigned: [0.3.x] dbgCommand skips text output from breakpoints [14060]

$
0
0
```
>bp ntdll!NtCreateFile "py C:/temp/test.py"
>g
ntdll!NtCreateFile:
"string from test.py" <-- as expected

>!py
>>>dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>>quit()
ntdll!NtCreateFile:
<-- no expected output

```

Created Issue: [0.3.x] unhandled exception after use bp with dbgCommand [14061]

$
0
0
```
0:000> !py
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>> go()
ModLoad: 00007fff`c1280000 00007fff`c1405000 C:\WINDOWS\SYSTEM32\PROPSYS.dll
ModLoad: 00007fff`c7820000 00007fff`c78bf000 C:\WINDOWS\System32\clbcatq.dll
pykd.executionStatus.Break
>>> quit()
c0000005 Exception in pykd.py debugger extension.
PC: 00007fff`af415a90 VA: 00000000`00000000 R/W: 0 Parameter: 00000000`00000000

```

Edited Issue: [0.3.x] unhandled exception after use bp with dbgCommand [14061]

$
0
0
```
0:000> !py
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>> go()
ModLoad: 00007fff`c1280000 00007fff`c1405000 C:\WINDOWS\SYSTEM32\PROPSYS.dll
ModLoad: 00007fff`c7820000 00007fff`c78bf000 C:\WINDOWS\System32\clbcatq.dll
pykd.executionStatus.Break
>>> quit()
c0000005 Exception in pykd.py debugger extension.
PC: 00007fff`af415a90 VA: 00000000`00000000 R/W: 0 Parameter: 00000000`00000000

```

Source code checked in, #91172

$
0
0
[pykd_ext_2.0] fixed : issue #14058, 14060, 14061

Released: PYKD BOOTSTRAPPER 2.0 (Jun 23, 2016)

$
0
0
PYKD BOOTSTRAPPER is a windbg extension. It is a simple dll file (pykd.dll). It DOES NOT contain pykd functionality. I is designed to locate and initialize python core inside windbg. Then you can use any python packages and of course pykd.

Using pykd bootstrapper - is recommended way to use pykd with windbg.

To install pykd.dll you should:

1. Locate your windbg installation place ( for example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 )
2. Unpack pykd.dll to the 'ext' directory.

To load pykd.dll:

Run command:
.load pykd

Show help for pykd bootstrapper:

0:000> !pykd.help

usage:

!help
	print this text

!info
	list installed python interpreters

!py [version] [options] [file]
	run python script or REPL

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	Options:
	-g --global  : run code in the common namespace
	-l --local   : run code in the isolated namespace

	command samples:
	"!py"                          : run REPL
	"!py --local"                  : run REPL in the isolated namespace
	"!py -g script.py 10 "string"" : run script file with argument in the common namespace

!pip [version] [args]
	run pip package manager

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	pip command samples:
	"pip list"                   : show all installed packages
	"pip install pykd"           : install pykd
	"pip install --upgrade pykd" : upgrade pykd to the latest version
	"pip show pykd"              : show info about pykd package

List all available python core

0:000> !pykd.info

Installed python

Version:        Status:     Image:
------------------------------------------------------------------------------
* 2.7 x86-64    Unloaded    C:\Windows\SYSTEM32\python27.dll
  3.5 x86-64    Unloaded    C:\Users\user\AppData\Local\Programs\Python\Python35\python35.dll

To run scripts or REPL use command:

!pykd.py
  • To run REPL with the default python: !py
  • To run REPL with the specified python: !py -3
  • To run script with the default python: !py script.py arg1 arg2
  • To run script with the specified python: !py script.py arg1 arg2
  • To run REPL in local scope ( all objects will be destruct after quit() ): !py --local
  • To run script in global scope ( all objects stay to live ): !py --global script.py

You can use "shebang line" to note python version. Insert first line to a script file:
 #! python2

Or

 #! python3.5

To managed python packages use command:

!pykd.pip

Show package list
0:000> !pip -3.5 list
pip (7.1.2)
pykd (0.3.1.1)
setuptools (18.2)
wheel (0.29.0)

Show package info:
0:000> !pip -3.5 show pykd
---
Metadata-Version: 2.0
Name: pykd
Version: 0.3.1.1
Summary: python windbg extension
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\users\user\appdata\local\programs\python\python35\lib\site-packages
Requires: 

Install or upgrade package:
0:000> !pip -3.5 install --upgrade pykd
Collecting pykd
  Downloading pykd-0.3.1.3-cp35-none-win_amd64.whl (3.3MB)
Installing collected packages: pykd
  Found existing installation: pykd 0.3.1.1
    Uninstalling pykd-0.3.1.1:
      Successfully uninstalled pykd-0.3.1.1
Successfully installed pykd-0.3.1.3

Updated Release: PYKD BOOTSTRAPPER 2.0 (июн 23, 2016)

$
0
0
PYKD BOOTSTRAPPER is a windbg extension. It is a simple dll file (pykd.dll). It DOES NOT contain pykd functionality. I is designed to locate and initialize python core inside windbg. Then you can use any python packages and of course pykd.

Using pykd bootstrapper - is recommended way to use pykd with windbg.

To install pykd.dll you should:

1. Locate your windbg installation place ( for example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 )
2. Unpack pykd.dll to the 'ext' directory.

To load pykd.dll:

Run command:
.load pykd

Show help for pykd bootstrapper:

0:000> !pykd.help

usage:

!help
	print this text

!info
	list installed python interpreters

!py [version] [options] [file]
	run python script or REPL

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	Options:
	-g --global  : run code in the common namespace
	-l --local   : run code in the isolated namespace

	command samples:
	"!py"                          : run REPL
	"!py --local"                  : run REPL in the isolated namespace
	"!py -g script.py 10 "string"" : run script file with argument in the common namespace

!pip [version] [args]
	run pip package manager

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	pip command samples:
	"pip list"                   : show all installed packages
	"pip install pykd"           : install pykd
	"pip install --upgrade pykd" : upgrade pykd to the latest version
	"pip show pykd"              : show info about pykd package

List all available python core

0:000> !pykd.info

Installed python

Version:        Status:     Image:
------------------------------------------------------------------------------
* 2.7 x86-64    Unloaded    C:\Windows\SYSTEM32\python27.dll
  3.5 x86-64    Unloaded    C:\Users\user\AppData\Local\Programs\Python\Python35\python35.dll

To run scripts or REPL use command:

!pykd.py
  • To run REPL with the default python: !py
  • To run REPL with the specified python: !py -3
  • To run script with the default python: !py script.py arg1 arg2
  • To run script with the specified python: !py script.py arg1 arg2
  • To run REPL in local scope ( all objects will be destruct after quit() ): !py --local
  • To run script in global scope ( all objects stay to live ): !py --global script.py

You can use "shebang line" to note python version. Insert first line to a script file:
 #! python2

Or

 #! python3.5

To managed python packages use command:

!pykd.pip

Show package list
0:000> !pip -3.5 list
pip (7.1.2)
pykd (0.3.1.1)
setuptools (18.2)
wheel (0.29.0)

Show package info:
0:000> !pip -3.5 show pykd
---
Metadata-Version: 2.0
Name: pykd
Version: 0.3.1.1
Summary: python windbg extension
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\users\user\appdata\local\programs\python\python35\lib\site-packages
Requires: 

Install or upgrade package:
0:000> !pip -3.5 install --upgrade pykd
Collecting pykd
  Downloading pykd-0.3.1.3-cp35-none-win_amd64.whl (3.3MB)
Installing collected packages: pykd
  Found existing installation: pykd 0.3.1.1
    Uninstalling pykd-0.3.1.1:
      Successfully uninstalled pykd-0.3.1.1
Successfully installed pykd-0.3.1.3

Commented Issue: [0.3.x] dbgCommand skips text output from breakpoints [14060]

$
0
0
```
>bp ntdll!NtCreateFile "py C:/temp/test.py"
>g
ntdll!NtCreateFile:
"string from test.py" <-- as expected

>!py
>>>dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>>quit()
ntdll!NtCreateFile:
<-- no expected output

```
Comments: ** Comment from web user: ussrhero **

fixed in bootstrapper 2.0.0.8

Edited Issue: [0.3.x] dbgCommand skips text output from breakpoints [14060]

$
0
0
```
>bp ntdll!NtCreateFile "py C:/temp/test.py"
>g
ntdll!NtCreateFile:
"string from test.py" <-- as expected

>!py
>>>dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>>quit()
ntdll!NtCreateFile:
<-- no expected output

```

Edited Issue: [0.3.x] unhandled exception after use bp with dbgCommand [14061]

$
0
0
```
0:000> !py
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>> go()
ModLoad: 00007fff`c1280000 00007fff`c1405000 C:\WINDOWS\SYSTEM32\PROPSYS.dll
ModLoad: 00007fff`c7820000 00007fff`c78bf000 C:\WINDOWS\System32\clbcatq.dll
pykd.executionStatus.Break
>>> quit()
c0000005 Exception in pykd.py debugger extension.
PC: 00007fff`af415a90 VA: 00000000`00000000 R/W: 0 Parameter: 00000000`00000000

```

Commented Issue: [0.3.x] unhandled exception after use bp with dbgCommand [14061]

$
0
0
```
0:000> !py
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> dbgCommand("bp ntdll!NtCreateFile \"!py C:/temp/test.py\"")
>>> go()
ModLoad: 00007fff`c1280000 00007fff`c1405000 C:\WINDOWS\SYSTEM32\PROPSYS.dll
ModLoad: 00007fff`c7820000 00007fff`c78bf000 C:\WINDOWS\System32\clbcatq.dll
pykd.executionStatus.Break
>>> quit()
c0000005 Exception in pykd.py debugger extension.
PC: 00007fff`af415a90 VA: 00000000`00000000 R/W: 0 Parameter: 00000000`00000000

```
Comments: ** Comment from web user: ussrhero **

fixed in pykd bootstrapper 2.0.0.8

Created Issue: [pykd_ext_2.0] dbgCommand('q') leads to windbg hung [14066]

$
0
0
Run this script:

```
pykd.dbgCommand('q')
```

Expected: debug session is closed
In fact: windbg is hang

Edited Issue: [pykd_ext_2.0] dbgCommand('q') leads to windbg hung [14066]

$
0
0
Run this script:

```
pykd.dbgCommand('q')
```

Expected: debug session is closed
In fact: windbg is hang

Source code checked in, #91173

$
0
0
[pykd_ext_2.0] fixed : issue 14066 (dbgCommand('q') leads to windbg hung)

Released: PYKD BOOTSTRAPPER 2.0 (Jun 23, 2016)

$
0
0
PYKD BOOTSTRAPPER is a windbg extension. It is a simple dll file (pykd.dll). It DOES NOT contain pykd functionality. I is designed to locate and initialize python core inside windbg. Then you can use any python packages and of course pykd.

Using pykd bootstrapper - is recommended way to use pykd with windbg.

To install pykd.dll you should:

1. Locate your windbg installation place ( for example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 )
2. Unpack pykd.dll to the 'ext' directory.

To load pykd.dll:

Run command:
.load pykd

Show help for pykd bootstrapper:

0:000> !pykd.help

usage:

!help
	print this text

!info
	list installed python interpreters

!py [version] [options] [file]
	run python script or REPL

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	Options:
	-g --global  : run code in the common namespace
	-l --local   : run code in the isolated namespace

	command samples:
	"!py"                          : run REPL
	"!py --local"                  : run REPL in the isolated namespace
	"!py -g script.py 10 "string"" : run script file with argument in the common namespace

!pip [version] [args]
	run pip package manager

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	pip command samples:
	"pip list"                   : show all installed packages
	"pip install pykd"           : install pykd
	"pip install --upgrade pykd" : upgrade pykd to the latest version
	"pip show pykd"              : show info about pykd package

List all available python core

0:000> !pykd.info

Installed python

Version:        Status:     Image:
------------------------------------------------------------------------------
* 2.7 x86-64    Unloaded    C:\Windows\SYSTEM32\python27.dll
  3.5 x86-64    Unloaded    C:\Users\user\AppData\Local\Programs\Python\Python35\python35.dll

To run scripts or REPL use command:

!pykd.py
  • To run REPL with the default python: !py
  • To run REPL with the specified python: !py -3
  • To run script with the default python: !py script.py arg1 arg2
  • To run script with the specified python: !py script.py arg1 arg2
  • To run REPL in local scope ( all objects will be destruct after quit() ): !py --local
  • To run script in global scope ( all objects stay to live ): !py --global script.py

You can use "shebang line" to note python version. Insert first line to a script file:
 #! python2

Or

 #! python3.5

To managed python packages use command:

!pykd.pip

Show package list
0:000> !pip -3.5 list
pip (7.1.2)
pykd (0.3.1.1)
setuptools (18.2)
wheel (0.29.0)

Show package info:
0:000> !pip -3.5 show pykd
---
Metadata-Version: 2.0
Name: pykd
Version: 0.3.1.1
Summary: python windbg extension
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\users\user\appdata\local\programs\python\python35\lib\site-packages
Requires: 

Install or upgrade package:
0:000> !pip -3.5 install --upgrade pykd
Collecting pykd
  Downloading pykd-0.3.1.3-cp35-none-win_amd64.whl (3.3MB)
Installing collected packages: pykd
  Found existing installation: pykd 0.3.1.1
    Uninstalling pykd-0.3.1.1:
      Successfully uninstalled pykd-0.3.1.1
Successfully installed pykd-0.3.1.3

Updated Release: PYKD BOOTSTRAPPER 2.0 (июн 23, 2016)

$
0
0
PYKD BOOTSTRAPPER is a windbg extension. It is a simple dll file (pykd.dll). It DOES NOT contain pykd functionality. I is designed to locate and initialize python core inside windbg. Then you can use any python packages and of course pykd.

Using pykd bootstrapper - is recommended way to use pykd with windbg.

To install pykd.dll you should:

1. Locate your windbg installation place ( for example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 )
2. Unpack pykd.dll to the 'ext' directory.

To load pykd.dll:

Run command:
.load pykd

Show help for pykd bootstrapper:

0:000> !pykd.help

usage:

!help
	print this text

!info
	list installed python interpreters

!py [version] [options] [file]
	run python script or REPL

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	Options:
	-g --global  : run code in the common namespace
	-l --local   : run code in the isolated namespace

	command samples:
	"!py"                          : run REPL
	"!py --local"                  : run REPL in the isolated namespace
	"!py -g script.py 10 "string"" : run script file with argument in the common namespace

!pip [version] [args]
	run pip package manager

	Version:
	-2           : use Python2
	-2.x         : use Python2.x
	-3           : use Python3
	-3.x         : use Python3.x

	pip command samples:
	"pip list"                   : show all installed packages
	"pip install pykd"           : install pykd
	"pip install --upgrade pykd" : upgrade pykd to the latest version
	"pip show pykd"              : show info about pykd package

List all available python core

0:000> !pykd.info

Installed python

Version:        Status:     Image:
------------------------------------------------------------------------------
* 2.7 x86-64    Unloaded    C:\Windows\SYSTEM32\python27.dll
  3.5 x86-64    Unloaded    C:\Users\user\AppData\Local\Programs\Python\Python35\python35.dll

To run scripts or REPL use command:

!pykd.py
  • To run REPL with the default python: !py
  • To run REPL with the specified python: !py -3
  • To run script with the default python: !py script.py arg1 arg2
  • To run script with the specified python: !py script.py arg1 arg2
  • To run REPL in local scope ( all objects will be destruct after quit() ): !py --local
  • To run script in global scope ( all objects stay to live ): !py --global script.py

You can use "shebang line" to note python version. Insert first line to a script file:
 #! python2

Or

 #! python3.5

To managed python packages use command:

!pykd.pip

Show package list
0:000> !pip -3.5 list
pip (7.1.2)
pykd (0.3.1.1)
setuptools (18.2)
wheel (0.29.0)

Show package info:
0:000> !pip -3.5 show pykd
---
Metadata-Version: 2.0
Name: pykd
Version: 0.3.1.1
Summary: python windbg extension
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: c:\users\user\appdata\local\programs\python\python35\lib\site-packages
Requires: 

Install or upgrade package:
0:000> !pip -3.5 install --upgrade pykd
Collecting pykd
  Downloading pykd-0.3.1.3-cp35-none-win_amd64.whl (3.3MB)
Installing collected packages: pykd
  Found existing installation: pykd 0.3.1.1
    Uninstalling pykd-0.3.1.1:
      Successfully uninstalled pykd-0.3.1.1
Successfully installed pykd-0.3.1.3

Source code checked in, #91176

$
0
0
Branched from $/pykd/branch/0.3.x
Viewing all 1625 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>