mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-03 22:31:34 +00:00
More DREI updates
This commit is contained in:
parent
1241a025a2
commit
09aba3b5ce
16 changed files with 65 additions and 36 deletions
|
|
@ -11,6 +11,7 @@ except:
|
|||
import pickle
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
import codecs
|
||||
import json
|
||||
import re
|
||||
|
|
@ -160,7 +161,10 @@ def decodeHex(value, binary=True):
|
|||
if value.lower().startswith("0x"):
|
||||
value = value[2:]
|
||||
|
||||
retVal = codecs.decode(value, "hex")
|
||||
try:
|
||||
retVal = codecs.decode(value, "hex")
|
||||
except LookupError:
|
||||
retVal = binascii.unhexlify(value)
|
||||
|
||||
if not binary:
|
||||
retVal = getText(retVal)
|
||||
|
|
@ -180,7 +184,10 @@ def encodeHex(value, binary=True):
|
|||
if isinstance(value, six.text_type):
|
||||
value = value.encode(UNICODE_ENCODING)
|
||||
|
||||
retVal = codecs.encode(value, "hex")
|
||||
try:
|
||||
retVal = codecs.encode(value, "hex")
|
||||
except LookupError:
|
||||
retVal = binascii.hexlify(value)
|
||||
|
||||
if not binary:
|
||||
retVal = getText(retVal)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue