From 5afbd52b61b02db3280a6cc6ef0bbbd061c15412 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 24 Feb 2012 10:57:23 +0000 Subject: [PATCH] more update related to last commits --- lib/core/common.py | 2 +- lib/techniques/blind/inference.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index c501acd24..d1dbbc17b 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -732,9 +732,9 @@ def dataToStdout(data, forceOutput=False): sys.stdout.write(data.encode(UNICODE_ENCODING)) finally: sys.stdout.flush() - setFormatterPrependFlag(len(data) == 1) if kb.get("multiThreadMode"): logging._releaseLock() + setFormatterPrependFlag(len(data) == 1) def dataToSessionFile(data): if not conf.sessionFile or kb.suppressSession: diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index eadb602ca..c625b2656 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -23,6 +23,7 @@ from lib.core.common import goGoodSamaritan from lib.core.common import getPartRun from lib.core.common import incrementCounter from lib.core.common import safeStringFormat +from lib.core.common import setFormatterPrependFlag from lib.core.common import singleTimeWarnMessage from lib.core.data import conf from lib.core.data import kb @@ -319,6 +320,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None progress.update(index) progress.draw(eta) + setFormatterPrependFlag(True) + # Go multi-threading (--threads > 1) if conf.threads > 1 and isinstance(length, int) and length > 1: value = [] @@ -504,6 +507,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None except KeyboardInterrupt: abortedFlag = True + finally: + setFormatterPrependFlag(False) if conf.verbose in (1, 2) or showEta: dataToStdout("\n")