01-24-2015, 01:04 AM
Есть проблема прикручивал ргвард и фтгвард
проблема в dsetup.dll
с ним не конектит к логину, через ини все ок
что я делаю не так?
проблема в dsetup.dll
с ним не конектит к логину, через ини все ок
code
int __stdcall new_connect(SOCKET s, const struct sockaddr *name, int namelen)
{
struct sockaddr_in *name_in = (struct sockaddr_in*) name;
if (name_in->sin_port == htons(2106))
{
name_in->sin_port = htons(2107); пробовал 2106
name_in->sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
}
if (name_in->sin_port == htons(7777))
{
name_in->sin_port = htons(7778); пробовал 7777
name_in->sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
}
return true_connect(s, name, namelen);
}
void decodeKey(unsigned char *buf)
{
unsigned char bfkey[16] = {111, 63, 3, 26, -6, 28, 43, 63, 28, 45, 1, 21, 122, 16, -5, 82}; //STATIC KEY
unsigned char tmp[24];
Blowfish_CTX ctx;
memcpy(tmp, buf, 16);
Blowfish_Init(&ctx, bfkey, 16);
Blowfish_Decrypt(&ctx, tmp, 16);
memcpy(buf, tmp, 16);
}
int __fastcall new_AddNetworkQueue(unsigned int This, unsigned int EDX, TNetworkPacket *NetworkPacket)
{
if ((*(unsigned int*) (KiUserExceptDispADR + 10) + KiUserExceptDispADR < hNtDllStart) || (*(unsigned int*) (KiUserExceptDispADR + 10) + KiUserExceptDispADR > hNtDllEnd))
ErrorExit("Bot Program Detected #0!");
unsigned int retAddr = *((unsigned int*) &NetworkPacket - 1);
if ((retAddr < hEngineStart) || (retAddr > hEngineEnd))
ErrorExit("Bot Program Detected #1!");
if (NetworkPacket->subid == 0xFFFF)
{
switch (NetworkPacket->id)
{
case 0x2E:
decodeKey(NetworkPacket->data + 1);
break;
case 0xB0:
memset(&SpecialStrings[NetworkPacket->data[0]].FontDrawInfo, 0, sizeof(TFontDrawInfo));
SpecialStrings[NetworkPacket->data[0]].isDraw = (NetworkPacket->data[1] == 1) ? true : false;
SpecialStrings[NetworkPacket->data[0]].FontDrawInfo.font = (char) NetworkPacket->data[2];
SpecialStrings[NetworkPacket->data[0]].x = *(int*) (NetworkPacket->data + 3);
SpecialStrings[NetworkPacket->data[0]].y = *(int*) (NetworkPacket->data + 7);
SpecialStrings[NetworkPacket->data[0]].FontDrawInfo.color = *(unsigned int*) (NetworkPacket->data + 11);
wcscpy_s(SpecialStrings[NetworkPacket->data[0]].text, (wchar_t*) (NetworkPacket->data + 15));
if (NetworkPacket->data[0] == 14)
{
HANDLE hIcmpFile = IcmpCreateFile();
ICMP_ECHO_REPLY Reply;
if (hIcmpFile != 0)
{
if (IcmpSendEcho(hIcmpFile, inet_addr("127.0.0.1"), 0, 0, 0, &Reply, sizeof(ICMP_ECHO_REPLY), 500) != 0)
lastPing = Reply.RoundTripTime;
IcmpCloseHandle(hIcmpFile);
}
wsprintf(SpecialStrings[NetworkPacket->data[0]].text, L"%ls%d", (wchar_t*) (NetworkPacket->data + 15), lastPing);
}
break;
}
}
return true_AddNetworkQueue(This, EDX, NetworkPacket);
}