Valhalla Legends Forums Archive | Battle.net Bot Development | omfg how do i catch 0x50

AuthorMessageTime
SubLiminaL_WolF
how do i fucking catch 0x50 it just breaks and does nuttin and stalls on the server
[code]
send(s, "\x1", 1, 0);
   packetbuf.insert((int)1);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert("Mr");
   packetbuf.insert("SubLiminL BoT ~ by 2xX-SlipKnoT/aka - SubLiminaL_WolF");
   packetbuf.sendpacket(s, 0x1e);

   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert("esc");
   packetbuf.insert("USA");
   packetbuf.insert("USA");
   packetbuf.insert("United States");
   packetbuf.sendpacket(s, 0x12);

   packetbuf.insert("68XI", 4); //platform
packetbuf.insert("PXES", 4); //product
packetbuf.insert((int)0xc7); //version byte
packetbuf.insert((int)0);
   packetbuf.sendpacket(s, 0x06);
   //packetbuf.sendpacket(s, 0x50);
   
   while(connected){
      packetbuf.sendpacket(s, 0x00);
      idletime += GetTickCount() - lasttick;
      lasttick = GetTickCount();
      TimeStamp(timestamp);
      DWORD waitresult = WaitForSingleObject(events[0], 10);
      if(waitresult == WAIT_TIMEOUT)
      {
         if(GetTickCount() >= floodtimer && lastreply){
            if(Queue.Count() > 0){
               packetbuf.insert(Queue.Get(0));
               packetbuf.sendpacket(s, 0x0e);
               char *tmpbuf = Queue.Get(0);
               if(tmpbuf[0] != '/'){
                  AppendText(IDC_CHATWND, WHITE, "%s", timestamp);
                  AppendText(IDC_CHATWND, LIGHTBLUE, "<%s> %s\n", unname, Queue.Get(0));
               }
               floodtimer = GetTickCount() + (strlen(Queue.Get(0)) * 10 + 1500);
               Queue.Remove(0);
               lastreply = false;
            }
         }
         if(GetTickCount() >= idletimer && idletimer != 0 && showidle == 1){
            if(idletype == IDLE_CUSTOM){
               char *p = new char[strlen(idle) + 1]; strcpy(p, idle);
               Queue.Add(p);
               packetbuf.insert((int)0x1b);
               packetbuf.insert((int)0);
               packetbuf.insert("icons.bni");
               packetbuf.sendpacket(s, 0x33);
            }
            if(idletype == IDLE_TIME){
               char tmpbuf[256] = "";
               SYSTEMTIME a = FormatDWORD(idletime);
               sprintf(tmpbuf, "[me=SubLiminaL_WolF]Idle: %d days, %d hours, %d minutes, %d seconds", a.wDay, a.wHour, a.wMinute, a.wSecond);[/me]
               char *p = new char[strlen(tmpbuf) + 1]; strcpy(p, tmpbuf);
               Queue.Add(p);
               packetbuf.insert((int)0x1b);
               packetbuf.insert((int)0);
               packetbuf.insert("icons.bni");
               packetbuf.sendpacket(s, 0x33);
            }
            if(idletype == IDLE_MP3){
               char song[200] = "";
               if(GetWindowText(Winamp, song, sizeof(song))){
                  for(int i = 0; i < (int)strlen(song); i++){
                     if(song[i] == ' ') break;
                  } i++;
                  memmove(song, song + i, strlen(song) - i);
                  char *p = strstr(song, " - Winamp");
                  if(p) *p = NULL;
               }
               char tmpbuf[256] = "";
               sprintf(tmpbuf, "[me=SubLiminaL_WolF]now playing: %s - SubLiminaL BoT *Private*", song);[/me]
               char *p = new char[strlen(tmpbuf) + 1]; strcpy(p, tmpbuf);
               Queue.Add(p);
               packetbuf.insert((int)0x1b);
               packetbuf.insert((int)0);
               packetbuf.insert("icons.bni");
               packetbuf.sendpacket(s, 0x33);
            }
            idletimer = GetTickCount() + 180000;
         }
      }
      if(waitresult == WAIT_OBJECT_0){
         int buflen = 0;
         int recvlen = recv(s, buffer + buflen, sizeof(buffer) - buflen, 0);
         if(!recvlen || recvlen == SOCKET_ERROR){
            Disconnect();
            return;
         }
         buflen += recvlen;
         while((int)buflen >= 4 && connected && (unsigned char)buffer[0] == 0xff){
            packetid = buffer[1];
            packetlen = *(unsigned short *)(buffer + 2);
            memcpy(packetdata, buffer, packetlen);
            //HexDump(packetlen, packetdata);
            switch(packetid){
            case 0x00:
               //Keep alive
               packetbuf.sendpacket(s, 0x0);
               break;
            case 0x06:
               //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;
[/code]
it stalls the server right after it displays version and cdkey...\n and its pissing me off cuz i think it has sumitn to do with the top part of the code that happenes right b4 connect
[code]
send(s, "\x1", 1, 0);
   packetbuf.insert((int)1);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert("Mr");
   packetbuf.insert("SubLiminL BoT ~ by 2xX-SlipKnoT/aka - SubLiminaL_WolF");
   packetbuf.sendpacket(s, 0x1e);

   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert((int)0);
   packetbuf.insert("esc");
   packetbuf.insert("USA");
   packetbuf.insert("USA");
   packetbuf.insert("United States");
   packetbuf.sendpacket(s, 0x12);

   packetbuf.insert("68XI", 4); //platform
packetbuf.insert("PXES", 4); //product
packetbuf.insert((int)0xc7); //version byte
packetbuf.insert((int)0);
   packetbuf.sendpacket(s, 0x06);
   //packetbuf.sendpacket(s, 0x50);
[/code] >:(
if i send the 0x50 i always get ipbanned so i have to reconnect to net
if im supposed to send sumtin after the display of version and cdkey in 0x06 i dunno what to send
May 6, 2003, 2:13 AM
Camel
packet logs
May 6, 2003, 3:06 AM
Kp
[quote author=SubLiminaL_WolF link=board=17;threadid=1239;start=0#msg9228 date=1052187212]
if i send the 0x50 i always get ipbanned so i have to reconnect to net
if im supposed to send sumtin after the display of version and cdkey in 0x06 i dunno what to send
[/quote]Two options: 1) study a pre-SID_AUTH client and find how it handles checking, or 2) use SID_AUTH messages, which is really more correct for BW anyway. Additionally, if you are being banned for sending 0x50, I recommend setting the program to hexdump the packetbuffer, then disconnect *without sending*. I used this technique extensively when I was adding new messages, and avoided several bans by doing a visual analysis of the packet before allowing it to be sent.

Finally, I do not see where you are assembling data for packet 0x50. I see your sendpacket calls for it, but not the associated insertions.
May 6, 2003, 4:06 AM

Search