#!usr/bin/ruby
#Hex Converter 0.1
#Coded By Doddy H
def head()
print "\n -- == Hex Converter 0.1 == --\n"
end
def copyright()
print "\n\n(C) Doddy Hackman 2012\n\n"
exit(1)
end
def sintax()
print "\n\n[+] ruby hex.rb <text>\n"
end
def encodehex(texto)
return "0x"+(texto.unpack('H*')[0])
end
def hex(texto)
print "\n\n[+] Text : #{texto}\n"
print "[+] Result : "+encodehex(texto)+"\n\n"
end
texto = ARGV[0]
head()
if !texto
sintax()
else
hex(texto)
end
copyright()
# The End ?
Un simple codigo para convertir texto a hex.