Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 17:08

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



How to Reverse Engineering NosTale?

Discussion on How to Reverse Engineering NosTale? within the Nostale forum part of the MMORPGs category.

Reply
 
Old 03/15/2019, 17:43   #16
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
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();
}
Koffy1 is offline  
Old 03/15/2019, 18:18   #17

 
FI0w's Avatar
 
elite*gold: 50
Join Date: Jul 2014
Posts: 1,699
Received Thanks: 1,165
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?
FI0w is offline  
Old 03/15/2019, 18:54   #18
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
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?
Koffy1 is offline  
Old 03/15/2019, 21:05   #19

 
FI0w's Avatar
 
elite*gold: 50
Join Date: Jul 2014
Posts: 1,699
Received Thanks: 1,165
Quote:
Originally Posted by Koffy1 View Post
How can I do it?
Learn how Winsocket works
FI0w is offline  
Old 03/16/2019, 17:37   #20
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
Quote:
Originally Posted by FI0w View Post
Learn how Winsocket works
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;
	}
Koffy1 is offline  
Old 03/16/2019, 18:13   #21
 
Pumba98's Avatar
 
elite*gold: 55
Join Date: Jan 2011
Posts: 1,240
Received Thanks: 1,187
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

Btw: you know that this is not what Walross talked about?
Pumba98 is offline  
Old 03/16/2019, 20:50   #22
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
Quote:
Originally Posted by Pumba98 View Post
example project

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



 
IceTrailer's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 2,070
Received Thanks: 821
Quote:
Originally Posted by Koffy1 View Post
Mmmm, what did Walross talked about Pumba? I'm bit 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.
IceTrailer is offline  
Old 03/16/2019, 23:57   #24
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
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
Koffy1 is offline  
Old 03/17/2019, 01:02   #25
 
Pumba98's Avatar
 
elite*gold: 55
Join Date: Jan 2011
Posts: 1,240
Received Thanks: 1,187
Quote:
Originally Posted by Koffy1 View Post
Mmmm, what did Walross talked about Pumba? I'm bit 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.
Pumba98 is offline  
Old 03/17/2019, 08:28   #26
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
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?
Koffy1 is offline  
Old 03/17/2019, 12:54   #27
 
Pumba98's Avatar
 
elite*gold: 55
Join Date: Jan 2011
Posts: 1,240
Received Thanks: 1,187
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
Pumba98 is offline  
Old 03/17/2019, 17:38   #28
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
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???
Koffy1 is offline  
Old 03/17/2019, 18:06   #29
 
Pumba98's Avatar
 
elite*gold: 55
Join Date: Jan 2011
Posts: 1,240
Received Thanks: 1,187
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
Pumba98 is offline  
Old 03/17/2019, 18:26   #30
 
elite*gold: 0
Join Date: Feb 2019
Posts: 29
Received Thanks: 0
Quote:
Originally Posted by Pumba98 View Post
Can't test at the moment, maybe look at this
SOLVED, TY PUMBA

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");
Koffy1 is offline  
Reply


Similar Threads Similar Threads
Nostale emulator state and reverse engineering ?
02/21/2015 - Nostale - 4 Replies
Hi, I'm new in Nostale emulation and I would like to know what is the current developpement state ? Like what is done. Do we know the basic packet structure and stuff ? Is there anyone who already worked on reverse engineering the client ? Thanks a lot, Sgt
Möchte reverse engineering lernen
10/02/2009 - General Coding - 2 Replies
Hey Leute Ich möchte Reverse engineering lernen, und wollte fragen ob ihr kompletten internet bücher kennt. oder auch ein kleines internet seminar . Hoffe ihr könnt mir da helfen
[c++]reverse engineering (Teil 1)
03/16/2009 - Coding Tutorials - 7 Replies
so, ich schreib hier jetzt mal mein erstes tut... WENN es euch weiterhilft, oder mehr haben wollt, schreib ich noch nen 2ten teil. in dem teil gehts darum, eigenen code in das spiel reinzubringen. was man braucht: - am besten grunderfahrung in c++, um den code besser zu verstehen. - eine c++ ide (meine is visual c++ 2008 express edition) - einen disassembler (IDA free) los gehts
Tools for reverse engineering?
09/27/2008 - Dekaron - 1 Replies
Would someone be kind enough to post what tools ppl use to reverse engineer the files?? (decompilers, debuggers, etc)
Reverse-Engineering talk
12/02/2005 - General Coding - 3 Replies
kennt sich jmd. mit der rechtlichen lage bezgl. reverse-engineering aus? die einen sagen das es illegal ist, die anderen wiederum meinen das re legal ist, was stimmt nun? ganz interessant ist auch http://de.wikipedia.org/wiki/Reverse_Engin...htlic he_Aspekte ich finde wir sollten das mal diskutieren um ein wenig klarheit zu schaffen. Die diskussion sollte speziell auf gamehacking gerichtet sein (nicht auf das cracken von programmen)



All times are GMT +1. The time now is 17:11.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.