How to Reverse Engineering NosTale?

03/15/2019 17:43 Koffy1#16
How could I send a packet to various NosTale clients at the same time through sockets? I think this code is correct and I only need to include cryptography.h and cryptography.cpp of NosTale, but then, what should I do? I mean, It connects successfully to the game but now I don't know what to do.

Code:
#include <iostream>
#include <string>
#include <WS2tcpip.h>
#pragma comment(lib, "ws2_32.lib")

using namespace std;

void main()
{
	string ipAddress = "79.110.84.75";	// IP Address of the server
	int port = 4000;			// Listening port # on the server

	// Initialize WinSock
	WSAData data;
	WORD ver = MAKEWORD(2, 2);
	int wsResult = WSAStartup(ver, &data);
	if (wsResult != 0)
	{
		cerr << "Can't start Winsock, Err #" << wsResult << endl;
		return;
	}

	// Create socket
	SOCKET sock = socket(AF_INET, SOCK_STREAM, 0);
	if (sock == INVALID_SOCKET)
	{
		cerr << "Can't create socket, Err #" << WSAGetLastError() << endl;
		WSACleanup();
		return;
	}

	// Fill in a hint structure
	sockaddr_in hint;
	hint.sin_family = AF_INET;
	hint.sin_port = htons(port);
	inet_pton(AF_INET, ipAddress.c_str(), &hint.sin_addr);

	// Connect to server
	int connResult = connect(sock, (sockaddr*)&hint, sizeof(hint));
	if (connResult == SOCKET_ERROR)
	{
		cerr << "Can't connect to server, Err #" << WSAGetLastError() << endl;
		closesocket(sock);
		WSACleanup();
		return;
	}

	// Gracefully close down everything
	closesocket(sock);
	WSACleanup();
}
03/15/2019 18:18 FI0w#17
Quote:
Originally Posted by Koffy1 View Post
How could I send a packet to various NosTale clients at the same time through sockets? I think this code is correct and I only need to include cryptography.h and cryptography.cpp of NosTale, but then, what should I do? I mean, It connects successfully to the game but now I don't know what to do.

Code:
#include <iostream>
#include <string>
#include <WS2tcpip.h>
#pragma comment(lib, "ws2_32.lib")

using namespace std;

void main()
{
	string ipAddress = "79.110.84.75";	// IP Address of the server
	int port = 4000;			// Listening port # on the server

	// Initialize WinSock
	WSAData data;
	WORD ver = MAKEWORD(2, 2);
	int wsResult = WSAStartup(ver, &data);
	if (wsResult != 0)
	{
		cerr << "Can't start Winsock, Err #" << wsResult << endl;
		return;
	}

	// Create socket
	SOCKET sock = socket(AF_INET, SOCK_STREAM, 0);
	if (sock == INVALID_SOCKET)
	{
		cerr << "Can't create socket, Err #" << WSAGetLastError() << endl;
		WSACleanup();
		return;
	}

	// Fill in a hint structure
	sockaddr_in hint;
	hint.sin_family = AF_INET;
	hint.sin_port = htons(port);
	inet_pton(AF_INET, ipAddress.c_str(), &hint.sin_addr);

	// Connect to server
	int connResult = connect(sock, (sockaddr*)&hint, sizeof(hint));
	if (connResult == SOCKET_ERROR)
	{
		cerr << "Can't connect to server, Err #" << WSAGetLastError() << endl;
		closesocket(sock);
		WSACleanup();
		return;
	}

	// Gracefully close down everything
	closesocket(sock);
	WSACleanup();
}
How about Sending the Login Packet? but for what you need all this?
03/15/2019 18:54 Koffy1#18
Quote:
Originally Posted by FI0w View Post
How about Sending the Login Packet? but for what you need all this?
How can I do it?
03/15/2019 21:05 FI0w#19
Quote:
Originally Posted by Koffy1 View Post
How can I do it?
Learn how Winsocket works
[Only registered and activated users can see links. Click Here To Register...]
03/16/2019 17:37 Koffy1#20
Quote:
Originally Posted by FI0w View Post
Learn how Winsocket works
[Only registered and activated users can see links. Click Here To Register...]
How should I send the login packet? I tried this and I didn't get any error, so it's something like that, but I don't know how to use the cryptography to send packets, which parameters of the cryptography should I give to the function send?

Code:
wsResult = send(sock, sendbuf, (int)strlen(sendbuf), 0);
	if (wsResult == SOCKET_ERROR)
	{
		printf("send failed with error: %d\n", WSAGetLastError());
		closesocket(sock);
		WSACleanup();
		return;
	}
03/16/2019 18:13 Pumba98#21
Quote:
Originally Posted by Koffy1 View Post
How should I send the login packet? I tried this and I didn't get any error, so it's something like that, but I don't know how to use the cryptography to send packets, which parameters of the cryptography should I give to the function send?

Code:
wsResult = send(sock, sendbuf, (int)strlen(sendbuf), 0);
	if (wsResult == SOCKET_ERROR)
	{
		printf("send failed with error: %d\n", WSAGetLastError());
		closesocket(sock);
		WSACleanup();
		return;
	}
example project [Only registered and activated users can see links. Click Here To Register...]

Btw: you know that this is not what Walross talked about?
03/16/2019 20:50 Koffy1#22
Quote:
Originally Posted by Pumba98 View Post
example project [Only registered and activated users can see links. Click Here To Register...]

Btw: you know that this is not what Walross talked about?
Mmmm, what did Walross talked about Pumba? I'm bit confused :confused:
Where can I learn all this stuff? I don't find anything...
03/16/2019 22:15 IceTrailer#23
Quote:
Originally Posted by Koffy1 View Post
Mmmm, what did Walross talked about Pumba? I'm bit confused :confused:
Where can I learn all this stuff? I don't find anything...


The current cryptography is on epvp, you should search „sockets“ on google.
03/16/2019 23:57 Koffy1#24
Quote:
Originally Posted by IceTrailer View Post
The current cryptography is on epvp, you should search „sockets“ on google.
Ok, I think now my code is working but when I try to implement the cryptography in my visual studio project it appears an error.
The #include <md5.h> and <hex.h>. I tried to download CryptoPP, but I still get errors. Also I got a lot of errors when I try to compile CryptoPP project xd
PS: I'm using Cryless~ cryptography
03/17/2019 01:02 Pumba98#25
Quote:
Originally Posted by Koffy1 View Post
Mmmm, what did Walross talked about Pumba? I'm bit confused :confused:
Where can I learn all this stuff? I don't find anything...
I think we're mixing some things up here.
You started to talk about Reverse Engineering, so i guess you want to have multiple Game Clients?
Or do you want one Game Client and multiple "clientless" chars that follow?
If you want to use the Gameclient you don't need the Crypto and all these things.
Walross just talked about the Communication between the processes/clients to deliver the information where the char needs to walk to.
03/17/2019 08:28 Koffy1#26
Quote:
Originally Posted by Pumba98 View Post
I think we're mixing some things up here.
You started to talk about Reverse Engineering, so i guess you want to have multiple Game Clients?
Or do you want one Game Client and multiple "clientless" chars that follow?
If you want to use the Gameclient you don't need the Crypto and all these things.
Walross just talked about the Communication between the processes/clients to deliver the information where the char needs to walk to.
Hi Pumba, yes I think I had mixed some things xd
I want to do one game client and multiple "clientless" chars to follow me and do exactly the same as me. How could I do that?
03/17/2019 12:54 Pumba98#27
Quote:
Originally Posted by Koffy1 View Post
Hi Pumba, yes I think I had mixed some things xd
I want to do one game client and multiple "clientless" chars to follow me and do exactly the same as me. How could I do that?
Ok, then you we're on the right way.

Quote:
Originally Posted by Koffy1 View Post
Ok, I think now my code is working but when I try to implement the cryptography in my visual studio project it appears an error.
The #include <md5.h> and <hex.h>. I tried to download CryptoPP, but I still get errors. Also I got a lot of errors when I try to compile CryptoPP project xd
PS: I'm using Cryless~ cryptography
The headers are part of CryptoPP, did you include it in your project correctly?

When you're logged in successfully we talk again about the possibilities you have to imitate you're main character
03/17/2019 17:38 Koffy1#28
When I try to build the CryptoPP it appears one error: cannot open include file: 'stddefh.h': No such file or directory.
What directory I need to add, and where? Project -> Properties -> VC++ Directories -> Include Directories???
03/17/2019 18:06 Pumba98#29
Quote:
Originally Posted by Koffy1 View Post
When I try to build the CryptoPP it appears one error: cannot open include file: 'stddefh.h': No such file or directory.

What directory I need to add, and where? Project -> Properties -> VC++ Directories -> Include Directories???
Can't test at the moment, maybe look at this [Only registered and activated users can see links. Click Here To Register...]
03/17/2019 18:26 Koffy1#30
Quote:
Originally Posted by Pumba98 View Post
Can't test at the moment, maybe look at this [Only registered and activated users can see links. Click Here To Register...]
SOLVED, TY PUMBA :handsdown:

And now using the cryptography of Cryless~, what I am suposed to introduce as a parameter to this method? I want to put my username and password but it takes a string.
Code:
std::vector<unsigned char> encryptLoginPacket(const std::string& buf) const;
This is my code

Code:
Crypto client;
	std::string username = "test";
	std::string password = "1234";

	client.randomNumber(0, 1000);
	client.createLoginVersion();
	client.createLoginHash(username);
	client.encryptPasswordString(password);
	client.encryptLoginPacket("I don't know what to put here") // It takes a string as parameter

	int ret = send(ConnectSocket, "const char buf* of login packet?", "int len", "int flags");
        wprintf(L"Connected to server.\n");
Also is it correct this way of doing it?

Code:
Crypto client;
	std::string username = "test";
	std::string password = "1234";
	std::string packet = 
        client.createLoginHash(username)+client.encryptPasswordString(password);
	int packetLength = packet.length();
        client.randomNumber(0, 1000);
	client.createLoginVersion();
        client.encryptLoginPacket(packet);

        int ret = send(ConnectSocket, packet.c_str(), packetLength, 0);
	wprintf(L"Connected to server.\n");