mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-27 04:05:58 +00:00
more standard way to display hex encoded char (\xff instead of \ff) also compatible with python representation
This commit is contained in:
parent
05a0e1d3b0
commit
4d8a49a87c
2 changed files with 3 additions and 3 deletions
|
|
@ -153,7 +153,7 @@ def safecharencode(value):
|
|||
for char in SAFE_ENCODE_SLASH_REPLACEMENTS:
|
||||
retVal = retVal.replace(char, repr(char).strip('\''))
|
||||
|
||||
retVal = reduce(lambda x, y: x + (y if (y in string.printable or ord(y) > 255) else '\%02x' % ord(y)), retVal, unicode())
|
||||
retVal = reduce(lambda x, y: x + (y if (y in string.printable or ord(y) > 255) else '\\x%02x' % ord(y)), retVal, unicode())
|
||||
|
||||
elif isinstance(value, list):
|
||||
for i in xrange(len(value)):
|
||||
|
|
@ -173,7 +173,7 @@ def safechardecode(value):
|
|||
while True:
|
||||
match = regex.search(retVal)
|
||||
if match:
|
||||
retVal = retVal.replace(match.group("result"), binascii.unhexlify(match.group("result").lstrip('\\')))
|
||||
retVal = retVal.replace(match.group("result"), binascii.unhexlify(match.group("result").lstrip('\\x')))
|
||||
else:
|
||||
break
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue