• Welcome to Valhalla Legends Archive.
 

`whoami`=> "bigmac\n"

Started by i8igmac, September 15, 2011, 11:12 AM

Previous topic - Next topic

i8igmac

i have been working with ruby for a little while now and its alot of fun... i have script a few proxys and other tools for automating task's...

i have been searching your forum for ruby document but i only see a few examples of pack and unpack...

my first question would be, is it possible to establish a connection to the battlenet servers with ruby? i have been trying and all my attempts fail...

MysT_DooM

Anything is possible.  Have you read up on Ruby Socket Programming?  I googled a bit and theres a lot of info out there for it. 

Also check out bnetdocs.org once you get a good foundation on ruby socket programming.


vb6, something about that combination of numbers and letters is sexy

Alendar

Welcome to the forums! Looking forward to seeing any possible productions you may make. =)
- Joseph W
http://josephw.net


i8igmac

i have made some clients and proxys, mosty http, some ftp and ssh but these are all simple...

i have never done anything with headers


require 'socket'
bnet_server=TCPSocket.open('useast.battle.net','6112')
bnet_server.puts("") # 01
bnet_server.recv
bnet_server.puts"�P:?????68XI3RAW???SUne��k�?? ?? ??USA?United States?"
bnet_server.recv


this was my first attempt to establish a connection, i never receive a response, im sure once i get past this part things will start to make sense...

i will start reading more into tcp connections.

rabbit

I'm going to go out on a limb and assume that Ruby behaves like other languages and has a state change callback somewhere.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

MyndFyre

@iBigmac: You'll be far, far better off not treating the connection data as a string.  I'm sure Ruby has a way to manipulate a byte stream; you'll be far happier using that.  (Most people here would call that a databuffer or packet buffer). 
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

i8igmac

thanks for your help guys I figured it out.

I've pulled the hex value from wireshark and used [hexdata].pack("H")

I have received response and things now makes sense !