• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Trunning

#1
Battle.net Bot Development / [C -> S] 0x51
May 07, 2010, 10:24 PM
From the Data Array from 0x01 BNLS_CDKEY, what am I suppose to use for 0x51?

DWORD - ClientToken - Tracking Value
DWORD - Exe Version - Got this from 0x1A
DWORD - Exe Hash - Got this from 0x1a
DWORD - Key Count - Simple
DWORD - Spawn - Only 1 ( True ) for STAR or W2BN

Per Key // using 1 key
DWORD - Key Length - 16, Ex: AAAABBBBCCCCDDDD
DWORD - Key Product - D2DV Maybe?
DWORD - Key Public Value - The actual key?
DWORD - Unknown - Always zero

DWORD - Hashed Key Data -
   1. Client Token - Tracking Value
   2. Server Token - Got this from 0x50
   3. Key Product (from decoded CD key) - Don't know
   4. Key Public (from decoded CD key) - Don't know
   5. (DWORD) 0 - Always zero
   6. Key Private (from decoded CD key) - Don't Know

String - Exe Info - Got this from 0x1A
String - Owner - Well this isn't obvious at all ;)
#2
Can I get a working download link for a Dll that contains the necessary functions for packet 0x51.

Thanks.
#3
Basically I'm stuck at receiving, I'm not sure if I have to put the pingval in a struct with the header, msgid and length. Or if I'm even receiving correctly, but if I'm doing anything wrong help is appreciated.

So if you can steer me in the right direction, I'd appreciated that.

#pragma comment(lib, "Ws2_32.lib")
#include <windows.h>
#include <winsock.h>
#include <string>
#include <iostream>
using namespace std;

int main(){
  WSADATA wsaData;

  WSAStartup(MAKEWORD(2,0), &wsaData);

  LPHOSTENT host;

  host = gethostbyname("asia.battle.net");

  if (!host)
  {
     MessageBox(NULL, "Host error", "", MB_OK);
     WSACleanup();
     return 0;
  }

  SOCKET theSocket;
  SOCKET theBnet;

  theSocket = socket(AF_INET,
                 SOCK_STREAM,
                 IPPROTO_TCP);

  theBnet = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

  if (theSocket == INVALID_SOCKET)
  {
     MessageBox(NULL, "theSocket bad...", "", MB_OK);
     WSACleanup();
     return 0;
  }

  if (theBnet == INVALID_SOCKET)
  {
  MessageBox(NULL, "Bnet socket bad...", "", MB_OK);
  WSACleanup();
  return 0;
  }

  SOCKADDR_IN info;

  info.sin_family = AF_INET;
  info.sin_addr = *((LPIN_ADDR)*host->h_addr_list);
  info.sin_port = htons(6112);

  int con;
  con = connect(theSocket, (LPSOCKADDR)&info, sizeof(info));

  if (con == SOCKET_ERROR)
  {
     MessageBox(NULL, (LPCSTR)WSAGetLastError(), "", MB_OK);
     WSACleanup();
     return 0;
  }

  struct SID_AUTH_INFO {
     BYTE   Header;
     BYTE   MsgID;
     WORD   wLen;
     DWORD   ProtocolID;
     DWORD   PlatformID;
     DWORD   ProductID;
     DWORD   VerByte;
     DWORD   ProductLang;
     DWORD   LocalIP;
     DWORD   TimeZone;
     DWORD   LocaleID;
     DWORD   LangID;
     char   CountryAbr[4];
     char   Country[10];
  } Packet;
 
  Packet.Header      = 0xFF;
  Packet.MsgID      = 0x50;
  Packet.wLen         = sizeof(SID_AUTH_INFO);
  Packet.ProtocolID   = 0x0;
  Packet.PlatformID   = '68XI';
  Packet.ProductID   = 'DV2D';
  Packet.VerByte      = 0x0D;
  Packet.ProductLang   = 0;
  Packet.LocalIP      = inet_addr("192.168.1.100");
  Packet.TimeZone      = 600;
  Packet.LocaleID      = 0;
  Packet.LangID      = (DWORD)GetUserDefaultLangID();
  strcpy(Packet.CountryAbr, "Aus");
  strcpy(Packet.Country, "Australia");

  DWORD PingVal;

  bind(theBnet, (LPSOCKADDR)&info, sizeof(info));

  cout << "Sending 0x50... " << send(theSocket, (const char*)&Packet, sizeof(SID_AUTH_INFO), NULL) << " bytes sent\n\n";

  recv(theBnet, (char *)&PingVal, sizeof(PingVal), NULL);

  cout << PingVal;

  // for testing purposes
  char n;
  cin >> n;
  closesocket(theBnet);
  closesocket(theSocket);
  return 0;
}