[NosTale]Packets

09/18/2012 19:48 szymek111#1
Hi i have a problem i got a good source code :) but i don't receive login packets.What i have to add?


This is a code on c++
Code:
#include "TwojeImie2.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[14] = "127.0.0.1";
int port = 1337;
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;
}
09/18/2012 20:10 Engel1621997#2
[Only registered and activated users can see links. Click Here To Register...]

This ?

And Port of LoginServer is 4001 :D
09/18/2012 20:46 Rorc#3
#moved
09/20/2012 20:25 Kingrap#4
no..
4001 = old client
4003 = new client..

you try whit 4001 and 4003.. :)
09/20/2012 20:41 ernilos#5
Quote:
Originally Posted by Kingrap View Post
no..
4001 = old client
4003 = new client..

you try whit 4001 and 4003.. :)
Lool, for that dont work my client ._.
09/21/2012 14:43 Kingrap#6
now worked?
10/07/2012 17:26 szymek111#7
No It's not work ;/


I have a question how is port of polish nostale ?? No Italian,German
10/07/2012 23:47 ernilos#8
Quote:
Originally Posted by szymek111 View Post
No It's not work ;/


I have a question how is port of polish nostale ?? No Italian,German
Get it with sniffer(Wpe pro) ^^
10/12/2012 17:41 szymek111#9
#include "TwojeImie.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[14] = "86.63.112.65";
int 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;

}

std::string DecryptLoginPacket(std::string str, int plength)
{
std::string decrypted_string;

for (int i = 0; i < plength; i++) { decrypted_string += str[i] - 0xF ^ 0xC3; }

return decrypted_string;


I hex in nostalex.dat file for my ip and port and its dont receive and send login packet I not know what is wrong