Author Topic: [java] Sample w2bn login sequence  (Read 17791 times)

0 Members and 1 Guest are viewing this topic.

Offline chuck

  • Full Member
  • ***
  • Posts: 335
  • Canadian Biathlete
    • View Profile
    • Chucks Blog
Re: [java] Sample w2bn login sequence
« Reply #30 on: September 21, 2006, 02:56:30 pm »
Does anyone know a way to get a profile correctly? I tryed:
Code: [Select]
            BNetBuffer buf = new BNetBuffer((byte) 0x26);
           
            buf.addDWord(1);
            buf.addDWord(4);
           
            buf.addNTString(account);
           
            buf.addNTString("profile\\sex");
            buf.addNTString("profile\\age");
            buf.addNTString("profile\\location");
            buf.addNTString("profile\\description");
           
            sendNow(buf);

Which my packet sniffer shows as:
T 192.168.2.135:49708 -> 63.240.202.129:6112 [AP]
  .&P.........FoeBot.profile\sex.profile\age.profile\location.profile\descriptio
  n.     

And my code to receive the packet look like:
Code: [Select]
case 0x26:
data.removeDWord(); // Num. accounts
int numKeys = data.removeDWord(); // Num. of keys
data.removeDWord(); // Request ID
                               
                               
String[] keys = new String[numKeys];
for (int z=0; z < numKeys; z++) {
keys[z] = data.removeNTString();
print(keys[z]);
}
Which always prints nothing. The packet bnet sends me back looks like:

T 63.240.202.129:6112 -> 192.168.2.135:49708 [AP]
  .&..........FoeB....                                                                                                           

I just cannot figure out how to send a String[] through a socket properly. Can anyone help me w/ this? Without flaming me?
Chucks Blog
JavaOp2 Plugins

Quote
Error, keyboard not connected. Press F1 to continue.

Offline chuck

  • Full Member
  • ***
  • Posts: 335
  • Canadian Biathlete
    • View Profile
    • Chucks Blog
Re: [java] Sample w2bn login sequence
« Reply #31 on: September 21, 2006, 03:51:07 pm »
NVM, found this document: http://www.valhallalegends.com/docs/ProfileRequest.htm

The code for other people (Sending profile request is the only one i changed for it to work)
Code: [Select]
    public void sendProfileRequest(String account) {
        try {
            BNetBuffer buf = new BNetBuffer((byte) 0x26);
           
            buf.addDWord(1);
            buf.addDWord(4);
           
            buf.addDWord(156); // some random number :)
           
            buf.addNTString(account);
           
            buf.addNTString("profile\\sex");
            buf.addNTString("profile\\age");
            buf.addNTString("profile\\location");
            buf.addNTString("profile\\description");
           
            sendNow(buf);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

EDIT:
SS
« Last Edit: September 21, 2006, 04:43:25 pm by chuck »
Chucks Blog
JavaOp2 Plugins

Quote
Error, keyboard not connected. Press F1 to continue.

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: [java] Sample w2bn login sequence
« Reply #32 on: September 21, 2006, 06:54:07 pm »
Do you understand the difference between your code and the working code?

Shear luck is the only reason you were even getting a response with your code instead of being timebanned :)

Offline chuck

  • Full Member
  • ***
  • Posts: 335
  • Canadian Biathlete
    • View Profile
    • Chucks Blog
Re: [java] Sample w2bn login sequence
« Reply #33 on: September 21, 2006, 07:12:56 pm »
Do you understand the difference between your code and the working code?

Shear luck is the only reason you were even getting a response with your code instead of being timebanned :)
I understand the difference.

I was timebanned over 10 times while trying to get that to work
« Last Edit: September 21, 2006, 07:17:20 pm by chuck »
Chucks Blog
JavaOp2 Plugins

Quote
Error, keyboard not connected. Press F1 to continue.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: [java] Sample w2bn login sequence
« Reply #34 on: September 25, 2006, 09:54:01 am »
Incidentally, the following keys all work (insomuch that you don't get banned for requesting them):
profile\sex
profile\age
profile\location
profile\description
system\account created
system\last logon
system\last logoff
system\time logged

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [java] Sample w2bn login sequence
« Reply #35 on: September 25, 2006, 10:26:54 pm »
Leave it to Ron to come up with sex first in the list of all those. ^_^.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: [java] Sample w2bn login sequence
« Reply #36 on: September 26, 2006, 12:11:55 pm »
Yeah, who'd think I'd do it in the same order the Blizzard did, and who'd think that they'd do it in the order of the fields in the profile?

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [java] Sample w2bn login sequence
« Reply #37 on: September 26, 2006, 12:17:22 pm »
Leave it to Ron to come up with sex first in the list of all those. ^_^.

::)

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [java] Sample w2bn login sequence
« Reply #38 on: September 26, 2006, 01:16:44 pm »
Yeah, who'd think I'd do it in the same order the Blizzard did, and who'd think that they'd do it in the order of the fields in the profile?
Likely excuse.
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [java] Sample w2bn login sequence
« Reply #39 on: September 27, 2006, 05:19:24 pm »
Leave it to Blizzard to come up with sex first in the list of all those. ^_^.

Fixed.
I'd personally do as Joe suggests

You might be right about that, Joe.