Code:
int main(void)
{
WORD sockVersion;
WSADATA wsaData;
int nret;
sockVersion = MAKEWORD(1, 1);
WSAStartup(sockVersion, &wsaData);
LPHOSTENT hostEntry;
hostEntry = gethostbyname("192.168.2.101");
if (!hostEntry) {
nret = WSAGetLastError();
printf("gethostbyname()");
WSACleanup();
return NETWORK_ERROR;
}
SOCKET theSocket;
theSocket = socket(AF_INET,
SOCK_STREAM,
IPPROTO_TCP);
if (theSocket == INVALID_SOCKET) {
nret = WSAGetLastError();
printf("socket()");
WSACleanup();
return NETWORK_ERROR;
}
SOCKADDR_IN serverInfo;
serverInfo.sin_family = AF_INET;
serverInfo.sin_addr = *((LPIN_ADDR)*hostEntry->h_addr_list);
serverInfo.sin_port = htons(80);
nret = bind(theSocket,
(LPSOCKADDR)&serverInfo,
sizeof(struct sockaddr));
if (nret == SOCKET_ERROR) {
nret = WSAGetLastError();
printf("bind()");
WSACleanup();
return NETWORK_ERROR;
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////RECV////////////////////////////////////////
char *buffer = new char[256];
nret = recv(theSocket,buffer,256,0);
if (nret == SOCKET_ERROR)
{
printf("recv()");
WSACleanup();
return NETWORK_ERROR;
}
else
{
delete [] buffer;
}
////////////////////////////////////////////////////////////////////////////
/////////////////////////////////RECV///////////////////////////////////////
closesocket(theSocket);
WSACleanup();
return 0;
}
This is what I got so far... Basically I want to recieve packets in a buffer pointer and then display them on the console screen.. Then after that I would like to feed this information into a ASM dll that has a function built into it that will decrypt the packets... You need a pointer to a buffer containing the packets in order for the function in the dll to work.
This kinda stuff
Code:
0000 47 45 54 20 2F 73 65 61 72 63 68 3F 63 6C 69 65
0010 6E 74 3D 6E 61 76 63 6C 69 65 6E 74 2D 61 75 74
0020 6F 26 67 6F 6F 67 6C 65 69 70 3D 4F 3B 32 31 36
0030 2E 32 33 39 2E 33 39 2E 39 39 3B 32 36 36 26
0040 66 72 65 73 68 6E 65 73 73 5F 63 68 65 63 6B 3D
0050 34 63 51 64 35 44 63 49 6B 55 75 65 2D 6B 46 55
0060 30 49 49 37 66 26 69 71 72 6E 3D 30 53 36 42 26
Any help would be awesome...
THANKS