i have another problem,
i used a hex editor and i modified nostale ip in 5.7.162.152 (hamachi ip).
now, i have a problem with the login server.
how i receive nostale login packet that client send to server?
and buffer?
i used C++ language with WinSock2
This is correct?
HTML Code:
#pragma comment(lib,"ws2_32.lib") #include <WinSock2.h> #include <iostream> #include <stdio.h> #include <tchar.h> int _tmain(int argc, _TCHAR* argv[]) { WSAData wsa; WORD Version = MAKEWORD(2,1); WSAStartup(Version, &wsa); SOCKET Listen = socket(AF_INET, SOCK_STREAM, 0); SOCKET Connect = socket(AF_INET, SOCK_STREAM, 0); SOCKADDR_IN Server; char ip[12] = "5.7.162.152"; int port; port = 4003; Server.sin_addr.s_addr = inet_addr(ip); Server.sin_family = AF_INET; Server.sin_port = htons(port); bind(Listen, (SOCKADDR*)&Server, sizeof(Server)); listen(Listen, 1); int size = sizeof(Server); std::cout << "--------------------------------------------------------------------------------" << " Server connected." << std::endl << " Host: " << ip << " : " << port << std::endl << "--------------------------------------------------------------------------------" << std::endl; for(;;){ if(Connect = accept(Listen, (SOCKADDR*)&Server, &size)){ std::cout << "Connection accepted from: " << inet_ntoa(Server.sin_addr) << std::endl; char recvbuf[225]; recv(Connect,recvbuf,225,0); std::cout << recvbuf << std::endl; } } WSACleanup(); std::cin.get(); return 0; }
i receive:
Connection accepted from: 5.7.162.152
£╗ƒ☻♣♥♣‗♣*
♦♥
♦‗Â│┤│‗☺☻♠♣♦
♦
HELP ME PLEASE!!