• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Ruby [Ruby] Hex Converter 0.1

Status
Not open for further replies.

Doddy

Leech
User
Joined
Apr 1, 2012
Messages
169
Reputation
0
Reaction score
406
Points
63
Credits
0
‎13 Years of Service‎
57%
Un simple codigo para convertir texto a hex.

Code:
>
#!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 \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 ?
 
Status
Not open for further replies.
Back
Top