• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - OldMcDonald

#1
Battle.net Bot Development / Re: Java debuffer
April 23, 2010, 08:45 PM
mmk thanks for explaining that lol. I'll see how it goes and ill ask more questions here.
#2
Battle.net Bot Development / Re: Java debuffer
April 23, 2010, 07:08 PM
yea i know that but im saying does the input stream grab the whole entire packet? Or just the data + the bnet header?
#3
Battle.net Bot Development / Re: Java debuffer
April 23, 2010, 06:56 PM
so the read() takes out header info huh... which header we talking about? the ff 50 and length? Does it read it only or does it remove as well?

Also what wud be best to do with the info...
Should i place everything into an byte array and pass it on to buffer?

#4
Battle.net Bot Development / Java debuffer
April 23, 2010, 04:58 PM
I got the response from bnet as an inputstream. I wanna debuff the input stream which means I would have to break it down, assign it to a byte array and send it to iagos buffer class.

I know there is an easier way to do it so I'm looking for other ways. If anyone has sample source codes I can look or suggest something other than input please do so.
#5
alright i successfully received packets 25 and 50 =D. Thanks a lot... lol I oversaw the methods that returned the length and buffer
#6
okay im using this now:   myOutput.write(buff.size() + 3);

also the only way to cut off the nulls at the end is if i go into the buffer class and change maxLength = maxLength * 2; to maxLength = maxLength + 1 in the verifyLength method.

Should I make that tweak in the buffer? Or will it interfere somehow.
#7
Battle.net Bot Development / Java sending 0x50
April 19, 2010, 06:44 PM
I'm sending everything successfully but I get no ping response back.

Here is my code:


import java.net.*;
import java.io.*;


public class bnetConnection{

    String host = "211.233.0.54";
    Socket skt = new Socket(host, 6112);
    String received;
    int id;

    BufferedReader myInput = new BufferedReader(new InputStreamReader(skt.getInputStream()));
    PrintStream myOutput = new PrintStream(skt.getOutputStream());
    buffer buff = new buffer();
   
 
   
    bnetConnection() throws Exception {
     
             myOutput.write(0x01);

    }
   
    public void send50() throws Exception{
       
        System.out.println("Connected to " + host);
        System.out.println("Sending Authorization");

        int verb = 0x0D;

         
        buff.addDWord(0);
        buff.addString("68XI");
        buff.addString("VD2D");
        buff.addDWord(verb);
        buff.addDWord(0);
        buff.addDWord(0);
        buff.addDWord(0);
        buff.addDWord(0);
        buff.addDWord(0);
        buff.addNTString("USA");
        buff.addNTString("United States");
        sendpack(0x50);
        System.out.println("Authorization Sent...");
        id = myInput.read();
        System.out.println("Received " + id);
       
       
    }
   
    public void Parseping() throws Exception{
       
        System.out.println("Got the ping");
    }

     public void Parsesend50() throws Exception{

         System.out.println("Got the packet 50 response");
    }


  /////////////////////////////////////////////////////////////////////////////

    public void sendpack(int p_id) throws Exception{

         



           
           myOutput.write(0xFF);
           myOutput.write(p_id);
           myOutput.write(buff.buffer.length + 3);
            //I'm only adding 3 because when I packet log it with 4 it is one bigger
            //than the actual packet


           myOutput.write(buff.buffer);
         
           
   }
}



I'm using iagos buffer class with this which can be located here:
http://www.google.com/codesearch/p?hl=en#LCtTldHliGI/trunk/BNUBot/src/org/jbls/util/Buffer.java&q=buffer%20package:http://bnubot\.googlecode\.com&sa=N&cd=1&ct=rc


When i packet log this is what i send:



0000  00 1a 70 d9 6e 5a 00 1b  fc 69 78 a4 08 00 45 00   ..p.nZ.. .ix...E.
0010  00 29 06 9e 40 00 80 06  27 ae c0 a8 01 64 3f f0   .)..@... '....d?.
0020  ca 86 ec 73 17 e0 c5 3f  90 11 82 a2 44 c7 50 18   ...s...? ....D.P.
0030  fa f0 c6 48 00 00 01                               ...H...       

0000  00 1a 70 d9 6e 5a 00 1b  fc 69 78 a4 08 00 45 00   ..p.nZ.. .ix...E.
0010  00 7b 06 9f 40 00 80 06  27 5b c0 a8 01 64 3f f0   .{..@... '[...d?.
0020  ca 86 ec 73 17 e0 c5 3f  90 12 82 a2 44 c7 50 18   ...s...? ....D.P.
0030  fa f0 b5 49 00 00 ff 50  53 00 00 00 00 36 38 58   ...I...P S....68X
0040  49 56 44 32 44 0d 00 00  00 00 00 00 00 00 00 00   IVD2D... ........
0050  00 00 00 00 00 00 00 00  00 00 00 00 00 55 53 41   ........ .....USA
0060  00 55 6e 69 74 65 64 20  53 74 61 74 65 73 00 00   .United  States..
0070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0080  00 00 00 00 00 00 00 00  00                        ........ . 



Then i receive this:


0000  00 1b fc 69 78 a4 00 1a  70 d9 6e 5a 08 00 45 00   ...ix... p.nZ..E.
0010  00 24 6f 73 00 00 6d 11  11 d3 3f f0 ca 86 c0 a8   .$os..m. ..?.....
0020  01 64 17 e0 17 e0 00 10  1b c3 05 00 00 00 74 65   .d...... ......te
0030  6e 62 00 00 00 00 00 00  00 00 00 00               nb...... ....   




And after send this out:

0000  00 1a 70 d9 6e 5a 00 1b  fc 69 78 a4 08 00 45 00   ..p.nZ.. .ix...E.
0010  00 40 06 a0 00 00 80 01  67 9a c0 a8 01 64 3f f0   .@...... g....d?.
0020  ca 86 03 03 c9 a1 00 00  00 00 45 00 00 24 6f 72   ........ ..E..$or
0030  00 00 6d 11 11 d4 3f f0  ca 86 c0 a8 01 64 17 e0   ..m...?. .....d..
0040  17 e0 00 10 1b c3 05 00  00 00 74 65 6e 62         ........ ..tenb 


Finally I get the last reponse bnet gives me:

0000  00 1b fc 69 78 a4 00 1a  70 d9 6e 5a 08 00 45 00   ...ix... p.nZ..E.
0010  00 24 6f 73 00 00 6d 11  11 d3 3f f0 ca 86 c0 a8   .$os..m. ..?.....
0020  01 64 17 e0 17 e0 00 10  1b c3 05 00 00 00 74 65   .d...... ......te
0030  6e 62 00 00 00 00 00 00  00 00 00 00               nb...... ....