Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: SubLiminaL_WolF on May 07, 2003, 10:26 PM

Title: Yes finally!! (0x50)
Post by: SubLiminaL_WolF on May 07, 2003, 10:26 PM
ok i get it finally

on connect
packetbuf.insert((int)0);
               packetbuf.insert("68XI", 4); //platform
               packetbuf.insert("PXES", 4); //product
               packetbuf.insert((int)0xc7); //version byte
               packetbuf.insert((int)0);
               packetbuf.insert((int)0);
               packetbuf.insert((int)0);
               packetbuf.insert((int)0);
               packetbuf.insert((int)0);
               packetbuf.insert("USA"); //country abbreviation
               packetbuf.insert("United States"); //country name
packetnuf.sendpacket(s, 0x50);

i think thats right then

while connected if 0x50 i dunno what to put inside the packet when it is sent do i put the 0x51 info and send 0x51?

tell me if im wrong anywhere in here
Title: Re:Yes finally!! (0x50)
Post by: SubLiminaL_WolF on May 07, 2003, 10:54 PM
ok now i get a checkversion() failed! i think i dunno whgat it is cuz i have the new hash

tick = GetTickCount();
   send(s, "\x1", 1, 0);
   packetbuf.insert((int)0);
   packetbuf.insert("68XI", 4); //platform
   packetbuf.insert("PXES", 4); //product
   packetbuf.insert((int)0xc7); //version byte
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert("USA"); //country abbreviation
   packetbuf.insert("United States"); //country name
   packetbuf.sendpacket(s, 0x50);



then  if connected


case 0x50:
               //Mpq name & hash command
               strcpy(mpqname, buffer + 12);
               strcpy(hashcmd, buffer + 25);
               if(!CheckRevision("star\\starcraft.exe", "star\\storm.dll", "star\\battle.snp", hashcmd, &version, &checksum, exeinfo, mpqname)){
                  AppendText(IDC_CHATWND, WHITE, "%s", timestamp);
                  AppendText(IDC_CHATWND, RED, "CheckRevision() failed!\n");
                  Disconnect();
                  return;
               }
               AppendText(IDC_CHATWND, WHITE, "%s", timestamp);
               AppendText(IDC_CHATWND, WHITE, "Checking version & Cdkey...\n");
               break;
            case 0x51:
               //Version check result
               if(buffer[4] != 0x00){
                  AppendText(IDC_CHATWND, WHITE, "%s", timestamp);
                  AppendText(IDC_CHATWND, RED, "Version & Cdkey check failed!\n");
                  Disconnect();
                  return;
               }
               /*packetbuf.sendpacket(s, 0x14);
               packetbuf.sendpacket(s, 0x2d);
               packetbuf.insert((int)0x1b);
               packetbuf.insert((int)0);
               packetbuf.insert("bnserver.ini");
               packetbuf.sendpacket(s, 0x33);*/
               packetbuf.sendpacket(s, 0x25);
               packetbuf.sendpacket(s, 0x3a);
               break;

i get the check revision() fail what do you think it is?
Title: Re:Yes finally!! (0x50)
Post by: tA-Kane on May 08, 2003, 03:32 AM
Breakpoint CheckRevision() and follow it until it returns false, silly.
Title: Re:Yes finally!! (0x50)
Post by: SubLiminaL_WolF on May 08, 2003, 04:14 AM
how would i breakpoint it i can follow it with visually with appendtext(blach blah "Test1...\n");
Title: Re:Yes finally!! (0x50)
Post by: SubLiminaL_WolF on May 08, 2003, 11:22 AM
nvm
i think there is something wrong with

//Mpq name & hash command
              strcpy(mpqname, buffer + 12);
              strcpy(hashcmd, buffer + 25);

Title: Re:Yes finally!! (0x50)
Post by: Camel on May 08, 2003, 07:13 PM
make sure all of the vars you are passing to checkrevision() are correct (breakpoint it)
if they are, try using fully qualified paths for the files
it's also a good idea to add code to check if the files exist before even attempting to call checkrevision
Title: Addition to Camel's comments
Post by: Kp on May 08, 2003, 11:35 PM
Quote from: Camel on May 08, 2003, 07:13 PM
make sure all of the vars you are passing to checkrevision() are correct (breakpoint it)
if they are, try using fully qualified paths for the files
it's also a good idea to add code to check if the files exist before even attempting to call checkrevision
It'd be an even better idea to use a version which returns a result code. :)  For example, zero = success, one = bad MPQ name, two = bad hash command, three = missing file, etc.
Title: Re:Addition to Camel's comments
Post by: tA-Kane on May 09, 2003, 01:10 AM
Quote from: Camel on May 09, 2003, 01:05 AMThere is no "magick pixie dust". There is, however, IBM.  ;)
Title: Re:Yes finally!! (0x50)
Post by: Banana fanna fo fanna on May 10, 2003, 10:01 PM
lol