NosTale Q&A

06/12/2019 14:40 Kolzy16#16
Quote:
Originally Posted by IceTrailer View Post
Where do you have the packet from?
Make sure to use your GUID and to generate the hash automatically (so you don‘t have to change it everytime the client gets an update)
The packet is from the packetlooger, I just copy paste it.
06/12/2019 14:40 IceTrailer#17
Quote:
Originally Posted by Kolzy16 View Post
The packet is from the packetlooger, I just copy paste it.


Then generate it?
06/12/2019 14:42 Kolzy16#18
Quote:
Originally Posted by IceTrailer View Post
Then generate it?
But why it doesn't work, it is supossed to work no? It's the same packet.
06/12/2019 14:43 IceTrailer#19
Quote:
Originally Posted by Kolzy16 View Post
But why it doesn't work, it is supossed to work no? It's the same packet.


Note that the right packet depends on: client version, client exe files, account data and your hardware (or pc)
06/12/2019 15:02 FI0w#20
Quote:
Originally Posted by IceTrailer View Post
Where do you have the packet from?
Make sure to use your GUID and to generate the hash automatically (so you don‘t have to change it everytime the client gets an update)
the GUID dont care so much for me i generate it for each login new and it works. But i think the 0x0B can be maybe the problem.
06/12/2019 22:11 Kolzy16#21
I found the error. Yey
06/14/2019 09:52 Cryless~#22
There is a lot of confusion here.

You should use a std::string to store the packet and encrypt/decrypt it. Finally you should cast it to const char* using .c_str() method and pass it to send() function with .length(). It does not care \0 since send() function is using the length you pass it as parameter.

NostaleString is an alternative to AnsiString for packet injection. It is not related to clientless.

Quote:
Originally Posted by IceTrailer View Post
No and no.

When you have decrypted bytes you should never use a string due to the null byte.
Use a std::vector.
And no, C/C++ terminates strings on the first found \0 byte. You cannot change that.
What you said is a bullshit.
In fact, std::string is not caring \0 at all. :facepalm:
06/14/2019 14:05 IceTrailer#23
Quote:
Originally Posted by Cryless~ View Post
What you said is a bullshit.
In fact, std::string is not caring \0 at all. :facepalm:
It is not bullshit since it's about printing a encrypted text packet which contains \0. He might use a vector from the beginning which makes it easier than with a std::string.
06/14/2019 19:16 Cryless~#24
Quote:
Originally Posted by IceTrailer View Post
It is not bullshit since it's about printing a encrypted text packet which contains \0. He might use a vector from the beginning which makes it easier than with a std::string.
Illuminate me. How is std::vector easier than std::string? The std::vector<char> .data() method returns a const char* which is exactly the same as std::string .c_str(). A std::string is not using \0 or any delimiter at all. You can operate on std::string the same way you operate on std::vector with the benefit of not having to convert from const char* to std::vector to convert it back again to const char* or std::string. You also have access to very useful methods which you may need. What you are saying is senseless and you should stop spreading disinformation out there.

Quote:
Originally Posted by Kolzy16 View Post
Couldn't I work with strings instead of vectors? And, is there a possible way to try avoiding the "\0" while you convert string to const char*?
Yes, you should. No. Print the string directly.

Code:
int main()
{
	std::string packet = "NoS0575 7031428 Test 3213852420455EE02E4F9FB7E1263751BA49DC01278E8D8AC6B094C2AD555ABE3512267B6A2D9528A2234E6A90E295E95E12"
		"4AE0AB2E54C406C49B533293B3CF c594947f-d4a9-4462-b545-ad7ddbfd71a2 006EC080\x0B0.9.3.3104 0 2F65F4A00E723E4281EFE51CACE4039D";
		
	// print plaintext packet
	
	std::cout << packet << std::endl;
	
	// encrypt
	
	for (std::size_t i = 0; i < packet.length(); i++)
	{
		packet[i] ^= 0xC3;
		packet[i] += 0x0F;
	}
	
	// print encrypted packet
	
	std::cout << packet << std::endl;
	
	// ws2_32.send()
	
	send(socket, packet.c_str(), packet.length(), NULL);
	
	return 0;
}
06/19/2019 10:10 Kolzy16#25
Someone could help me to compile curl library for windows? I want to use it but I don't know how to compile this damn library.
06/19/2019 10:58 Pumba98#26
Quote:
Originally Posted by Kolzy16 View Post
Someone could help me to compile curl library for windows? I want to use it but I don't know how to compile this damn library.
[Only registered and activated users can see links. Click Here To Register...]

You can find compiled binaries too
06/19/2019 17:04 Kolzy16#27
Quote:
Originally Posted by Pumba98 View Post
[Only registered and activated users can see links. Click Here To Register...]

You can find compiled binaries too
Do you know why I get this error? Did I linked bad the libraries?

[Only registered and activated users can see links. Click Here To Register...]

Code:
#include <iostream>
#include <string>
#include "curl.h"

static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp)
{
	((std::string*)userp)->append((char*)contents, size * nmemb);
	return size * nmemb;
}

int main(void)
{
	CURL* curl;
	CURLcode res;
	std::string readBuffer;

	curl = curl_easy_init();
	if (curl) {
		curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");
		curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
		curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
		res = curl_easy_perform(curl);
		curl_easy_cleanup(curl);

		std::cout << readBuffer << std::endl;
	}
	return 0;
}
06/19/2019 17:21 Cryless~#28
Quote:
Originally Posted by Kolzy16 View Post
Do you know why I get this error? Did I linked bad the libraries?

[Only registered and activated users can see links. Click Here To Register...]

Code:
#include <iostream>
#include <string>
#include "curl.h"

static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp)
{
	((std::string*)userp)->append((char*)contents, size * nmemb);
	return size * nmemb;
}

int main(void)
{
	CURL* curl;
	CURLcode res;
	std::string readBuffer;

	curl = curl_easy_init();
	if (curl) {
		curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");
		curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
		curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
		res = curl_easy_perform(curl);
		curl_easy_cleanup(curl);

		std::cout << readBuffer << std::endl;
	}
	return 0;
}
I thought you wanted help for C++ code.
Why I see you only posting C code in 2 pages?
It is horrible to read.

You probably want to use Boost.Beast instead of curl: [Only registered and activated users can see links. Click Here To Register...]

To solve your error you have to link curl .lib(s)
06/19/2019 17:46 Kolzy16#29
Quote:
Originally Posted by Cryless~ View Post
I thought you wanted help for C++ code.
Why I see you only posting C code in 2 pages?
It is horrible to read.

You probably want to use Boost.Beast instead of curl: [Only registered and activated users can see links. Click Here To Register...]

To solve your error you have to link curl .lib(s)
My idea is to do it in C++ but I took this example code for a random page.
06/19/2019 19:50 Cryless~#30
Quote:
Originally Posted by Kolzy16 View Post
My idea is to do it in C++ but I took this example code for a random page.
I see. The hardest part of learning programming is that most of code you can find online is done wrong. Feel free contacting me in private for any question. I will be glad to help you.