April 11, 2021, 02:54:55 PM

Author Topic: bot.h  (Read 456 times)

sit0

  • DarkBlizz
  • Resident
  • *****
  • Posts: 26
    • View Profile
bot.h
« on: January 09, 2011, 12:31:28 PM »
Code: [Select]
#include <stdio.h>

#include <stdlib.h>

#include <unistd.h> //close() socket

#include <string.h>

#include <ctype.h> //isprint()

#include <stdarg.h> //send va_ function

#include <stdint.h> //INT32 16 8...

//#include <sys/timeb.h> //gettickcount alternative

#include <time.h>



#ifdef _WIN32 //SOCKET

#include <winsock2.h>

#include <winsock.h>

#include <windows.h>

#else

#include <sys/socket.h>

#include <sys/types.h>

#include <netinet/in.h>

#include <netdb.h>

#include <arpa/inet.h> //inet_addr()

#endif



/*

PATH_MAX (defined in limits.h)

FILENAME_MAX (defined in stdio.h)

both of these are set to 4096 on my system (x86 Linux).



typedef unsigned char BYTE;

typedef unsigned long DWORD;

typedef long long LONGLONG;

typedef int LONG;

typedef unsigned short WORD;



typedef unsigned char* PBYTE;

typedef unsigned long* PDWORD;

typedef long long* PLONGLONG;

typedef int* PLONG;

typedef void* LPVOID;

typedef unsigned short* PWORD;

*/



extern int SB;



#ifndef BOT_H

#define BOT_H



#include "thread.h"



class Bot : public thread

{

public:

bool spingbb;



static char LDFile0[FILENAME_MAX];

static char D2File[4][FILENAME_MAX];

static char SCFile[4][FILENAME_MAX];

static char W2File[4][FILENAME_MAX];

static char W3File[4][FILENAME_MAX];

static char Language[11];

static char ACountry[11];

static char Country[31];

static int D2Byte;

static int SCByte;

static int W2Byte;

static int W3Byte;

static char BPlug[5];

static int SPing;

static bool Ping0;

static bool Ping1;

static bool Dump;

static bool Auto;

static char CMD[255];



static void getVAR(int num, char buf[]);



#ifdef _WIN32

WSADATA wsaData;

sockaddr_in h;

SOCKET sock;

#else

int sock;

#endif



char VFile[4][FILENAME_MAX];

char Username[255];

char Password[255];

char Server[255];

char Channel[255];

char CDKey[27];

char Client[9];



int VByte;

int Delay;



bool Connected;





char strname[255];



int ClientToken;

int ServerToken;

int place, PSB, CLIST;



char buff[2048];

unsigned int buflen;



Bot();



void SOCK_CON();

void SOCK_DISCON();

bool SOCK_CREATE();

void SOCK_HANDLER();





void run();

void readconsoleshit();

void getinput(char* blah);

void Login();

void hex_print(char* , int length);

void hexdump(char *pAddressIn, int le);

int Send(char *szFmt, ...);



void Mandate(char* a, char s[], bool d);

void Mandate2(int n, char* a, char* s, bool d);





void BVDispatch(char *user, char *txt, unsigned long VAR[]);

void CDispatch(char *);

void CVDispatch(char *pszEvent, int pnEventId, char *pszSpeaker, unsigned long puFlags, char *pszEventText);

void EID_HANDLER(char *pszEvent, int *pnEventId, char *pszSpeaker, unsigned  long *puFlags, char *pszEventText);

void EID_USER(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_JOIN(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_FLAG(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_LEFT(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_TALK(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_CHAN(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_PMSG(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_INFO(char *szSpeaker, unsigned long uFlags, char *szEventText);

void EID_NAME(char *szSpeaker, unsigned long uFlags, char *szEventText);





void RP_TEXT(unsigned char PID,char *szFmt, ...);

void RP_HANDLER(unsigned char PID, char *DATA, short DATALEN);

void RP_0x09(char *DATA, short DATALEN);

void RP_0x0A(char *data);

void RP_0x0B(char *data);

void RP_0x0F(char *data);

void RP_0x25(char *data);

void RP_0x3A(char *data);

void RP_0x3D(char *data);

void RP_0x46(char *data);

void RP_0x50(char *data);

void RP_0x51(char *data);

void SP_0x00();

void SP_0x09();

void SP_0x0A();

void SP_0x0B();

void SP_0x0C(int ss,char *data);

void SP_0x0E(char *data);

void SP_0x14();

void SP_0x25(char *data);

void SP_0x3A();

void SP_0x3D();

void SP_0x46();

void SP_0x50();

void SP_0x51(char *KeyHash, char *exeInfo, unsigned long exeVersion, unsigned long Checksum, unsigned long, unsigned long);





void ABYTE(unsigned char data);

void AWORD(unsigned short data);

void ADWORD(unsigned long data);

void ASTRING0(char* data);

void ASTRING(char* data);

void AVOID(void* data, unsigned int len);

void APACKET(unsigned char PacketID);

void APACKET0(char *lpszFmt, ...);

};



#endif