few fixes here and there and multi-core processing for dictionary based hash attack

This commit is contained in:
Miroslav Stampar
2011-07-04 19:58:41 +00:00
parent da049110df
commit b8ffcf9495
8 changed files with 225 additions and 101 deletions

View File

@@ -25,7 +25,7 @@ from lib.core.settings import PYVERSION
shared = advancedDict()
class ThreadData():
class _ThreadData(threading.local):
"""
Represents thread independent data
"""
@@ -44,6 +44,8 @@ class ThreadData():
self.shared = shared
self.valueStack = []
ThreadData = _ThreadData()
def getCurrentThreadUID():
return hash(threading.currentThread())
@@ -52,13 +54,12 @@ def readInput(message, default=None):
def getCurrentThreadData():
"""
Returns current thread's dependent data
Returns current thread's local data
"""
threadUID = getCurrentThreadUID()
if threadUID not in kb.threadData:
kb.threadData[threadUID] = ThreadData()
return kb.threadData[threadUID]
global ThreadData
return ThreadData
def exceptionHandledFunction(threadFunction):
try: