• Welcome to Valhalla Legends Archive.
 

Hey all need some help.

Started by Final, September 29, 2006, 06:15 PM

Previous topic - Next topic

Final

#15
Ok a friend of mine has been helping me out but we werent able to get a 0x51 in return can someone look over my 0x51 pakcet put together.


            case SID_AUTH_INFO:
           {
           addchat("[BNET]Recieved 0x50");
           
           servertoken= *(unsigned long *)(buffer + 8);
           char filename[256];//=buffer+24;
           char valuestring[256];// = buffer+39;
           strcpy(filename,buffer+24);
           strcpy(valuestring,buffer+39);
           clienttoken = GetTickCount();
           int checkrev;
           int checkmpq;
           unsigned long checkSum = 0;
           
           
                         checkmpq=extractMPQNumber(filename);
           if(checkmpq!=-1){
                            checkrev=checkRevisionFlat(valuestring,"C:\\STAR\\starcraft.exe","C:\\STAR\\storm.dll","C:\\STAR\\battle.snp",checkmpq,&checkSum);
           if(checkrev!=0){
                           unsigned long decoder=kd_create("2268812361134",13);
           if(decoder!=-1){
                           long hashLength=kd_calculateHash(decoder,clienttoken,servertoken);
           if(hashLength!=0){
                             char keyHash[hashLength];               
                             kd_getHash(decoder,keyHash);
           if(keyHash!=0){
                          int prod=kd_product(decoder);
           if(prod!=0){
                       int pub=kd_val1(decoder);
           if(pub!=0){
                      char exeInformation[300];
                      memset(exeInformation,0x0,300);
                      unsigned int Version;
                      int VerID = getExeInfo("C:\\STAR\\starcraft.exe", exeInformation, 300, &Version,0x1);
           if(VerID!=0){
                        InsertDWORD(clienttoken);
                        InsertDWORD(VerID);
                        InsertDWORD(checkSum);
                        InsertDWORD(1);
                        InsertDWORD(0);
                        InsertDWORD(13);
                        InsertDWORD(prod);
                        InsertDWORD(pub);
                        InsertDWORD(0);
                        InsertNonNTString(keyHash);
                        InsertNonNTString(exeInformation);
                        InsertNTString("Franky N.");
                        SendPacket(0x51);
                        addchat("[BNET]Sent 0x51");
           }else{
                 addchat("Public is Incorrect");     
           }
           }else{
                 addchat("Product is Incorrect");     
           }
           }else{
                 addchat("VerId is Incorrect");     
           }
           }else{
                 addchat("KeyHash is Incorrect");     
           }
           }else{
                 addchat("HashLength is Incorrect");     
           }
           }else{
                 addchat("Key Is Incorrect");     
           }
           }else{
                 addchat("Error CheckRevision");
           }
           }else{
                 addchat("Error Mpq File");
           }
           }
      break;

UserLoser

#16
It appears you commented out the function to send the packet, try uncommenting the line and try it again.

BTW, this is so bad...:

           char* filename=buffer+24;
           char* valuestring = buffer+39;


You can't do that...try using something like strcpy or similiar.  i.e. char filename[size]; strcpy(filename, buffer+24);  Should also have paths for files like "C:\\Starcraft\\Storm.dll", etc.  Not "C:/Starcraft/Storm.dll"

Also, use the tab key and whitespace please.  It's horrific seeing and reading code like that...

Final

#17
I commented it out for debuging purposes. I just do that so i can check everything else i have done it without commented out and it dont work.

I tried what you said and iit still aint working do you see anything else that might be wrong.

HERE ARE MY LOGS


1  Hide  Hide  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 52 41 54    ..P:.....68XIRAT
0010  53 CF 00 00 00 00 00 00 00 00 00 00 00 00 00 00    S...............
0020  00 00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69    .........USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                   ted States.

2  Hide  Hide  4  Send 
0000  FF 25 08 00                                        .%..

3  Hide  Hide  116  Send 
0000  FF 51 74 00 B9 92 31 21 27 00 00 00 7B 6A 94 81    .Qt...1!'...{j..
0010  01 00 00 00 00 00 00 00 0D 00 00 00 01 00 00 00    ................
0020  80 15 32 00 00 00 00 00 83 97 AC EF 6B C9 AF C3    ..2.........k...
0030  08 38 4E AF D0 2D C6 DD EA C1 E5 87 87 AE 4D F3    .8N..-........M.
0040  55 10 44 73 74 61 72 63 72 61 66 74 2E 65 78 65    U.Dstarcraft.exe
0050  20 30 39 2F 33 30 2F 30 36 20 30 35 3A 33 38 3A     09/30/06 05:38:
0060  32 34 20 31 32 31 36 35 31 32 46 72 61 6E 6B 79    24 1216512Franky
0070  20 4E 2E 00                                         N..


Yegg

#18
I'm curious, what happens when someone does this:

2  Hide  Hide  4  Send 
0000  FF 25 08 00                                        .%..


He didn't include the data for that packet.

In your 0x51 packet, you failed to include a 0x00 after the exe information string. You did include one after your cdkey owner name string. Is the owner name FrankyN. (yes, with the period)?

Other things can be wrong, but the Battle.net protocol is not something I know well or try to know well. I happened to know some about what your packets were missing.

Edit: It may be possible that your 0x51 packet has 2 extra, unnecessary DWORDs in there. According to

Quote(DWORD)       Client Token
(DWORD)       EXE Version
(DWORD)       EXE Hash
(DWORD)       Number of keys in this packet
(BOOLEAN)    Using Spawn (32-bit)

For Each Key:
(DWORD)       Key Length
(DWORD)       CD key's product value
(DWORD)       CD key's public value
(DWORD)       Unknown (0)
(DWORD[5])    Hashed Key Data

(STRING)     Exe Information
(STRING)     CD Key owner name

from BnetDocs, your packet's information does not match up size-wise.

Of your 14 DWORDs, they should equal exactly 56 bytes of space. Yours equals 63 bytes. So, it isn't really 2 extra DWORDs added. I'm not entirely sure what you did.

Edit: Something else looks wrong. Your exe version is 0x27?

l2k-Shadow

he's doing InsertDWORD(VerID) instead of InsertDWORD(Version)
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Final

#20
Wait so im suppose to put Version instead of VerID?
After CHanges/

1  Hide  Hide  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 52 41 54    ..P:.....68XIRAT
0010  53 CF 00 00 00 00 00 00 00 00 00 00 00 00 00 00    S...............
0020  00 00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69    .........USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                   ted States.

2  Hide  Hide  4  Send 
0000  FF 25 08 00                                        .%..

3  Hide  Hide  117  Send 
0000  FF 51 75 00 28 07 27 23 01 00 0E 01 5C 5E D9 15    .Qu.(.'#....\^..
0010  01 00 00 00 00 00 00 00 0D 00 00 00 01 00 00 00    ................
0020  80 15 32 00 00 00 00 00 61 F1 90 37 CC 50 76 94    ..2.....a..7.Pv.
0030  8A 78 63 D7 1C D0 1A 18 0C 1D 69 0E A2 CA F5 6A    .xc.......i....j
0040  9D 20 44 73 74 61 72 63 72 61 66 74 2E 65 78 65    . Dstarcraft.exe
0050  20 30 39 2F 33 30 2F 30 36 20 30 35 3A 33 38 3A     09/30/06 05:38:
0060  32 34 20 31 32 31 36 35 31 32 00 46 72 61 6E 6B    24 1216512.Frank
0070  79 20 4E 2E 00                                     y N..

what did i do wrong ?

UserLoser

Quote

2  Hide  Hide  4  Send
0000  FF 25 08 00                                        .%..


Set size to 8, there is not 8 bytes of data there.

Final

#22
dude thats the ping packet.

EDIT
OH DEAR GOD IT WAS THE FUCKING PING PACKET.

Bot Initialized Version 1.0.0
<-1:45:17>: [BNET]Connecting
<-1:45:17>: [BNET]Connected
<-1:45:17>: [BNET]Sent 0x50
<-1:45:17>: [BNET]Recieved 0x25
<-1:45:17>: [BNET]Sent 0x25
<-1:45:17>: [BNET]Recieved 0x50
<-1:45:17>: [BNET]Sent 0x51
<-1:45:17>: [BNET]Recieved 0x51
<-1:45:17>: [BNET]Passed challenge
<-1:45:17>: [BNET]Sent 0x29
<-1:45:17>: [BNET]Recieved 0x29
<-1:45:17>: [BNET]Login Was Successfull
<-1:45:17>: [BNET]You have Entered Chat

Hero


Final

#24
I got another problem though How do i join chat like were i talk and stuff.
Im here. ok I recieve 0x29 but I dont know what to do afterwards?


addchat("[BNET]Login Was Successfull");
        InsertNonNTString("tenb");
        SendPacket(0x14);

               InsertNTString("Unkownname");
               InsertNTString("");
               SendPacket(0x0A);

             InsertDWORD(productid);
             SendPacket(0x0B);

     InsertDWORD(0x01);
     InsertNTString("hello");
     SendPacket(0x0C);

addchat("Joining a channel"); 
connected=true;
addchat("[BNET]You have Entered Chat");

l2k-Shadow

0x0A -> 0x0C joins chat. Make sure that the name you are connecting with is "Unknownname" since that's what you're using for the string. 0x14 and 0x0B are optional packets and do not have to be sent. After you are in chat look into parsing 0x0F
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Final

NICE A friend was helping me out and i was able to connect and into a channel awsome.
I got another question

Lets say im chatting do i have to use packets to send like
/wisper
/join
/me
or do i just sent the chat packet?

l2k-Shadow

you send 0x0E for all chat messages, whether it's a "/join Channel" or "Hi".
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Final

#28
Thanks mate


MyndFyre

Quote from: l2k-Shadow on September 30, 2006, 04:53 PM
you send 0x0E for all chat messages, whether it's a "/join Channel" or "Hi".

/join <channelName> does not need to be a chat message, though.  You can parse the message and use 0x0c SID_JOINCHANNEL to join a channel as well.
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.

|