RTH Text Converter
Bueno, os traigo esta herramienta que he programado.
Funciones:
Código [Seleccionar]
-ASCII
-Hexadecimal
-Base64
-MD5 (lo crackea a partir de una web online, que por cierto es mala (las buenas tienen captcha xDD))
-URL encode
Espero que os guste, más bien, que os sea de utilidad xDD
A mi por lo menos me es útil para algunas cosas.. bueno, aquí el código:
Código (python) [Seleccionar]
#!/usr/bin/env python
#RTH Text Converter - by xassiz
import wx,base64,md5,urllib,sys,binascii
class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, title='RTH Text Converter - by xassiz', pos=wx.DefaultPosition,
size=wx.Size(450, 450), style=wx.DEFAULT_FRAME_STYLE^(wx.RESIZE_BORDER|wx. MAXIMIZE_BOX))
self.panel = wx.Panel(self, id=1, pos=(0, 0), size=(300, 520))
wx.StaticText(self.panel, label='Texto:', pos=wx.Point(8,18), size=wx.Size(33,13), style=0)
wx.StaticText(self.panel, label='Salida:', pos=wx.Point(8,152), size=wx.Size(33,13), style=0)
ascii = wx.Button(self.panel, label='ASCII', pos=wx.Point(50,288), size=wx.Size(75,23), style=0)
hexa = wx.Button(self.panel, label='HEX', pos=wx.Point(125,288), size=wx.Size(75,23), style=0)
base_64 = wx.Button(self.panel, label='Base64', pos=wx.Point(200,288), size=wx.Size(75,23), style=0)
md5_ = wx.Button(self.panel, label='MD5', pos=wx.Point(275,288), size=wx.Size(75,23), style=0)
url_encode = wx.Button(self.panel, label='URL', pos=wx.Point(350,288), size=wx.Size(75,23), style=0)
borrar = wx.Button(self.panel, label='Borrar', pos=wx.Point(265,345), size=wx.Size(80,46), style=0)
about = wx.Button(self.panel, label='About', pos=wx.Point(345,345), size=wx.Size(80,46), style=0)
self.cifrar = wx.RadioButton(self.panel, label='cifrar', pos=wx.Point(50,345), size=wx.Size(80,23), style=0)
self.descifrar = wx.RadioButton(self.panel, label='descifrar', pos=wx.Point(50,370), size=wx.Size(80,23), style=0)
self.accion = "enc"
self.txtNormal = wx.TextCtrl(self.panel, pos=wx.Point(48,18), size=wx.Size(375, 120), style=0, value='')
self.txtConvertido = wx.TextCtrl(self.panel, pos=wx.Point(48,152), size=wx.Size(375,120), style=0, value='')
self.Bind(wx.EVT_BUTTON, self.ascii, ascii)
self.Bind(wx.EVT_BUTTON, self.hexa, hexa)
self.Bind(wx.EVT_BUTTON, self.base_64, base_64)
self.Bind(wx.EVT_BUTTON, self.md5_, md5_)
self.Bind(wx.EVT_BUTTON, self.url_encode, url_encode)
self.Bind(wx.EVT_BUTTON, self.borrar, borrar)
self.Bind(wx.EVT_BUTTON, self.about, about)
self.Bind(wx.EVT_RADIOBUTTON, self.accion_enc, self.cifrar)
self.Bind(wx.EVT_RADIOBUTTON, self.accion_des, self.descifrar)
def ascii(self, event):
textoNormal = self.txtNormal.GetValue()
if self.accion == "enc":
ascii = ''
for x in textoNormal:
ascii = ascii + str(ord(x)) + ","
ascii = ascii[:-1]
self.txtConvertido.SetValue(ascii)
elif self.accion == "des":
normal = ''
textoNormal = textoNormal.replace(","," ")
textoNormal = textoNormal.replace("."," ")
for x in textoNormal.split():
normal = normal + chr(int(x))
self.txtConvertido.SetValue(normal)
def hexa(self, event):
textoNormal = self.txtNormal.GetValue()
if self.accion == "enc":
hexa = ''
for x in textoNormal:
hexa = hexa + hex(ord(x))
hexa = "0x%s" % hexa.replace("0x","")
self.txtConvertido.SetValue(hexa)
elif self.accion == "des":
normal = textoNormal.replace('0x','')
normal = binascii.unhexlify(normal)
self.txtConvertido.SetValue(normal.replace("'",""))
def base_64(self, event):
textNormal = self.txtNormal.GetValue()
if self.accion == "enc":
self.txtConvertido.SetValue(base64.encodestring(textNormal))
else:
self.txtConvertido.SetValue(base64.decodestring(textNormal))
def md5_(self, event):
textNormal = self.txtNormal.GetValue()
if self.accion == "enc":
textConvertido = md5.new()
textConvertido.update(textNormal)
textConvertido = repr(textConvertido.hexdigest())
self.txtConvertido.SetValue(textConvertido.replace("'",""))
elif self.accion == "des":
x=urllib.urlopen("http://www.md5-lookup.com/livesearch.php?q=%s"%textNormal).read()
if 'No results found' in x:
self.txtConvertido.SetValue("No se encontraron resultados")
elif len(textNormal) != 32:
self.txtConvertido.SetValue("No es un MD5")
else:
x=x.split("\n")
x=x[16].replace(' <td width="250">','')
self.txtConvertido.SetValue(x.replace('</td>',''))
def url_encode(self, event):
textNormal = self.txtNormal.GetValue()
if self.accion == "enc":
textConvertido = urllib.urlencode({'xassiz':textNormal})
self.txtConvertido.SetValue(textConvertido.replace("xassiz=",""))
elif self.accion == "des":
self.txtConvertido.SetValue(urllib.unquote_plus(textNormal))
def borrar(self, event):
self.txtNormal.SetValue('')
self.txtConvertido.SetValue('')
def about(self, event):
wx.MessageBox("Autor: xassiz","RTH Text Converter")
wx.MessageBox("Dedicado a http://foro.rthacker.NET","RTH Text Converter")
def accion_enc(self, event):
self.accion = "enc"
def accion_des(self, event):
self.accion = "des"
class App(wx.App):
def OnInit(self):
frame = Frame()
frame.Show()
self.SetTopWindow(frame)
return True
if __name__ == '__main__':
app = App()
app.MainLoop()
Saludos