News:

Help! We're trapped in the computer, and the computer is trapped in 2008! Someone call the time police!

Main Menu

Logging to BNet in c/c++

Started by KrzaQ, April 13, 2007, 12:19:06 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Sidoh


KrzaQ

#16
Quote from: Sidoh on April 21, 2007, 02:33:55 PM
http://en.wikipedia.org/wiki/Endianness
I have already checked Wiki, but I don't know how will it change file

- I don't know the "element size")


I guess the question about A B and C order in 0x50 packet is more significant :/


BREAKING NEWS!
I got Check revision to work properly, probably when i make source more clear I'll post it here.

Hdx

#17
Just read the file fount to end IIRC.
As for The order of A/B/C
Doesn't matter. Just do it in the order they send you.
        for(int x = 0; x<3; x++){
          String seed = tok.nextToken();
          if(seed.toLowerCase().startsWith("a=") == true) a = Long.parseLong(seed.substring(2));
          if(seed.toLowerCase().startsWith("b=") == true) b = Long.parseLong(seed.substring(2));
          if(seed.toLowerCase().startsWith("c=") == true) c = Long.parseLong(seed.substring(2));
        }

Just do something like that.
~Hdx
http://img140.exs.cx/img140/6720/hdxnew6lb.gif
09/08/05 - Clan SBs @ USEast
[19:59:04.000] <DeadHelp> We don't like customers.
[19:59:05.922] <DeadHelp> They're assholes
[19:59:08.094] <DeadHelp> And they're never right.

KrzaQ

Quote from: HdxBmx27 on April 21, 2007, 11:14:11 PM
Just read the file fount to end IIRC.
As for The order of A/B/C
Doesn't matter. Just do it in the order they send you.
        for(int x = 0; x<3; x++){
          String seed = tok.nextToken();
          if(seed.toLowerCase().startsWith("a=") == true) a = Long.parseLong(seed.substring(2));
          if(seed.toLowerCase().startsWith("b=") == true) b = Long.parseLong(seed.substring(2));
          if(seed.toLowerCase().startsWith("c=") == true) c = Long.parseLong(seed.substring(2));
        }

Just do something like that.
~Hdx

Thank you, I have already managed to get check revision to work.

What I need now is to understand cdkey encoding, I hope this is right source to start.

Hdx

http://jbls.org/Downloads/JBLS.jar
Open that up, it has all the spiffy functions that you need.
For something like thats your only choices are to look at other's sources or reverse it yourself :P
~Hdx
http://img140.exs.cx/img140/6720/hdxnew6lb.gif
09/08/05 - Clan SBs @ USEast
[19:59:04.000] <DeadHelp> We don't like customers.
[19:59:05.922] <DeadHelp> They're assholes
[19:59:08.094] <DeadHelp> And they're never right.

iago

Quote from: KrzaQ on April 22, 2007, 12:30:02 PM
What I need now is to understand cdkey encoding, I hope this is right source to start.
It's typically called "Decoding" for some reason. And that's one for Starcraft, but if you want to do D2 look for one called AlphaKeyDecode or something similar.


KrzaQ

I meant AlphaKeyDecode, just pasted link from wrong tab in browser.

I guess I should hash each key with algorithm used there, but again I can't understand whats returned. hash() doesn't get any variables, and returns none.

iago

It uses and sets class variables. Just look at what it uses, everything should be fairly common sense. For example, "cdkey" is the cdkey.

KrzaQ

#23
Funny example ;)

I guess it should return keyarray, so I tried to port it to c and make it return keyarray.

For now I would need some confirmation again.
For cdkey 8VP8H276GG6ZNTTJ keyarray i receive is 06419C125496D5A0
Is it proper?

PS: the cdkey is banned.

Edit:
I guess its proper, since all decoded cdkeys start with 06 for me.

Edit 2:
    public int[] getKeyHash(int clientToken, int serverToken)

    {

       

        Buffer hashData = new Buffer();

       

        hashData.addDWord(clientToken);

        hashData.addDWord(serverToken);

        hashData.addDWord(getProduct());

        hashData.addDWord(getVal1());

        hashData.addDWord(0);

        hashData.addDWord(getVal2());

       

        return BrokenSHA1.calcHashBuffer(hashData.getBuffer());

    }


This function sends 6 DWords to calcHashBuffer, but it only needs 5. Or am I wrong?