mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
Patch related to the #3453
This commit is contained in:
@@ -101,11 +101,29 @@ def filterNone(values): # Cross-referenced function
|
||||
def isListLike(value): # Cross-referenced function
|
||||
raise NotImplementedError
|
||||
|
||||
def shellExec(cmd): # Cross-referenced function
|
||||
raise NotImplementedError
|
||||
|
||||
def stdoutEncode(value):
|
||||
value = value or ""
|
||||
|
||||
if IS_WIN and kb.get("codePage", -1) is None:
|
||||
output = shellExec("chcp")
|
||||
match = re.search(r": (\d{3,})", output or "")
|
||||
|
||||
if match:
|
||||
try:
|
||||
candidate = "cp%s" % match.group(1)
|
||||
codecs.lookup(candidate)
|
||||
except LookupError:
|
||||
pass
|
||||
else:
|
||||
kb.codePage = candidate
|
||||
|
||||
kb.codePage = kb.codePage or ""
|
||||
|
||||
if isinstance(value, six.text_type) and PYVERSION < "3.6":
|
||||
encoding = sys.stdout.encoding or UNICODE_ENCODING
|
||||
encoding = kb.get("codePage") or sys.stdout.encoding or UNICODE_ENCODING
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user