def decode(self, encoded):
""" Takes the input from the text box and decodes it using the parameter
set in the combobox """
mode = self._encodings[self._decoder.currentIndex()]
if mode == 'raw':
return str(encoded)
try:
if mode == 'hex':
return encoded.decode('hex')
if mode == 'b64':
return b64decode(encoded)
if mode == 'py2':
return eval(encoded)
except:
log_alert("Failed to decode input")
return None
评论列表
文章目录