mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 19:53:22 +08:00

[0.3.x] added : class targetThread ( representing process in the target system ) git-svn-id: https://pykd.svn.codeplex.com/svn@89654 9b283d60-5439-405e-af05-b73fd8c4d996
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
import unittest
|
|
import pykd
|
|
import target
|
|
import time
|
|
|
|
class ProcessTest(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
pykd.startProcess( target.appPath )
|
|
pykd.startProcess( target.appPath )
|
|
pykd.startProcess( target.appPath )
|
|
|
|
def tearDown(self):
|
|
pykd.killAllProcesses()
|
|
|
|
def testGetCurrentProcess(self):
|
|
proc = pykd.targetProcess.getCurrent()
|
|
self.assertNotEqual(0, proc.systemID() )
|
|
self.assertNotEqual(0, proc.peb() )
|
|
|
|
def testEnumThreads(self):
|
|
proc = pykd.targetProcess.getCurrent()
|
|
threadNumber = proc.getNumberThreads()
|
|
self.assertLess(0, threadNumber)
|
|
for i in xrange(threadNumber):
|
|
thread = proc.thread(i)
|
|
self.assertNotEqual(0, thread.systemID() )
|
|
self.assertNotEqual(0, thread.teb() )
|
|
|
|
def testEnumProcesses(self):
|
|
processNumber = pykd.targetProcess.getNumber()
|
|
for i in xrange(processNumber):
|
|
proc = pykd.targetProcess.getProcess(i)
|
|
self.assertNotEqual(0, proc.systemID() )
|
|
self.assertNotEqual(0, proc.peb() )
|
|
|
|
|
|
|
|
|
|
|