Valhalla Legends Forums Archive | Battle.net Bot Development | 0x25

AuthorMessageTime
ReaSoN
I'm playing around with actual ping spoofing (Like setting your ping to the value you want) My bot is storing all the pings from a session and finding an average, then delaying sending 0x25 based on the formula

(custom ping - average ping)

I use a timer to do the delays instead of Sleep(), and i noticed that whenever i log in i always get -1ms because bnet thinks im not sending 0x25.
because i'm sending it some .125 seconds later, and then whenever i rejoin a channel or something my ping doesn't change. My question is, why does BNET keep sending 0x25 if it doesnt update the ping? And how can i "improve" my method to make it work?
September 13, 2009, 9:54 PM
Sixen
It doesn't change when you change the channel because the ping is taken at login (the initial ping response).
September 13, 2009, 10:50 PM
ReaSoN
But BNET keeps sending 0x25, even after they send it the first time, so why do they keep sending it?
September 14, 2009, 12:20 AM
MyStiCaL
It does change during game play, just not in channels (EVER). you could ping the server your connected to randomly and get your inital ping responce from that to keep a somewhat like real time PING
September 14, 2009, 9:55 PM
BreW
[quote author=ReaSoN link=topic=18061.msg183358#msg183358 date=1252878861]
why does BNET keep sending 0x25 if it doesnt update the ping?
[/quote]
Good question. I think it's like a typical "are you still there bro?" kind of ping to test if the connection is still active and ok at the application level, whereas the one way SID_NULL keepalive is to keep the connection active and ping at a level below the application layer.


[quote author=ReaSoN link=topic=18061.msg183358#msg183358 date=1252878861]
And how can i "improve" my method to make it work?
[/quote]
By delaying the sending of all other packets until your 0x25 is sent. What I like to do is break my program off into another GetMessage/TranslateMessage/DispatchMessage loop so it could service the GUI messages and the packets from other connections while it waits for the spoofing period to be over like so:

[code]
void __stdcall PingSpoofProc(int index) {
  char asdf[64];
  AddChatf(vbYellow, bot[index]->hWnd_rtfChat, asdf, "Sleep()ing for %dms...", bot[index]->spoofedping);
  Sleep(bot[index]->spoofedping);
  AddChat(vbGreen, "Wakey wakey!", bot[index]->hWnd_rtfChat);
  InsertDWORD(0);
  SendPacket(0x25, index);
  PostMessage(hWnd_main, WM_WAKEUP, 0, index);
}

void WaitForPingSpoof(int index) {
  MSG msg;
  HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)PingSpoofProc, (void *)index, 0, NULL);
  while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
      if (msg.message == WM_WAKEUP && msg.lParam == index && msg.hwnd == hWnd_main)
        break;
      if (!TranslateMDISysAccel(hWnd_Client, &msg)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
      }
  }
  CloseHandle(hThread);
}
[/code]
September 14, 2009, 11:53 PM

Search