Register for your free account! | Forgot your password?

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

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

Advertisement



Session Encrypter C++

Discussion on Session Encrypter C++ within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 154
Received Thanks: 166
Session Encrypter C++

Hi community, today i release the session encrypter in C++ !

Code:
// return an array with encrypted bytes
std::vector<std::string> encryptedBytes(int num)
{
	std::vector<std::string> temp;
	std::stringstream ss;
	for (int i = 0, j = 0; i <= num; i++)
	{
		if (i % 10 == 0 && i != 0)
		{
			ss << std::uppercase << std::hex << 83 + j + 6;
			j += 7;
		}
		else
		{
			ss << std::uppercase << std::hex << 83 + j;
			j++;
		}
		temp.push_back(ss.str());
		ss.str("");
	}
	return temp;
}

// encrypt session packet < identifier > < session >
std::string sessionEncrypt(std::string identifier, std::string session)
{
	std::vector<std::string> table = encryptedBytes(99);

	std::string str_enc;
	str_enc += 0x9A;

	std::stringstream ss;
	ss << identifier[0] << identifier[1];
	str_enc += toString(table[atoi(ss.str().c_str())]);
	ss.str("");
	ss << identifier[2] << identifier[3];
	str_enc += toString(table[atoi(ss.str().c_str())]);
	ss.str("");
	ss << identifier[4];
	
	switch (atoi(ss.str().c_str()))
	{
	case 0:
		str_enc += 0x50;
		break;
	case 1:
		str_enc += 0x60;
		break;
	case 2:
		str_enc += 0x70;
		break;
	case 3:
		str_enc += 0x80;
		break;
	case 4:
		str_enc += 0x90;
		break;
	case 5:
		str_enc += 0xA0;
		break;
	case 6:
		str_enc += 0xB0;
		break;
	case 7:
		str_enc += 0xC0;
		break;
	case 8:
		str_enc += 0xD0;
		break;
	case 9:
		str_enc += 0xE0;
		break;
	}

	ss.str("");
	ss << session[0] << session[1];
	str_enc += toString(table[atoi(ss.str().c_str())]);
	ss.str("");
	ss << session[2] << session[3];
	str_enc += toString(table[atoi(ss.str().c_str())]);
	ss.str("");
	ss << session[4];

	switch (atoi(ss.str().c_str()))
	{
	case 0:
		str_enc += 0x4F;
		break;
	case 1:
		str_enc += 0x5F;
		break;
	case 2:
		str_enc += 0x6F;
		break;
	case 3:
		str_enc += 0x7F;
		break;
	case 4:
		str_enc += 0x8F;
		break;
	case 5:
		str_enc += 0x9F;
		break;
	case 6:
		str_enc += 0xAF;
		break;
	case 7:
		str_enc += 0xBF;
		break;
	case 8:
		str_enc += 0xCF;
		break;
	case 9:
		str_enc += 0xDF;
		break;
	}

	ss.str("");

	return str_enc += 0x0E;
}
for who haven't toHex & toString functions

Code:
std::string toHex(std::string str)
{
	std::stringstream ss;
	for (unsigned int i = 0; i < str.size(); i++)
		ss << std::uppercase << std::hex << std::setw(2) << std::setfill('0') << (int)(unsigned char)str[i] << " ";
	return ss.str();
}

std::string toString(const std::string &input)
{
	static const char* const lut = "0123456789ABCDEF";
	size_t len = input.length();
	if (len & 1) throw std::invalid_argument("odd length");
	std::string output;
	output.reserve(len / 2);
	for (size_t i = 0; i < len; i += 2)
	{
		char a = input[i];
		const char* p = std::lower_bound(lut, lut + 16, a);
		if (*p != a) throw std::invalid_argument("not a hex digit");
		char b = input[i + 1];
		const char* q = std::lower_bound(lut, lut + 16, b);
		if (*q != b) throw std::invalid_argument("not a hex digit");
		output.push_back(((p - lut) << 4) | (q - lut));
	}
	return output;
}
example

Code:
sessionEncrypt("53061", "26705")
it's work for me, good luck !

PS. Session encrypter isn't complete 100% but only a fast function, work with an identifier of 5 characters and session of 5 character, no + no -
Sm•ke is offline  
Thanks
2 Users
Old 10/12/2013, 07:23   #2
 
LostSoul8817's Avatar
 
elite*gold: 0
Join Date: Oct 2013
Posts: 14
Received Thanks: 0
Hi Smoked must put this code in visual basic 2013? as for the other who can decrypt the files. NOS?
LostSoul8817 is offline  
Old 10/12/2013, 12:41   #3
 
elite*gold: 0
Join Date: Aug 2013
Posts: 154
Received Thanks: 166
Quote:
Originally Posted by LostSoul8817 View Post
Hi Smoked must put this code in visual basic 2013? as for the other who can decrypt the files. NOS?
this isn't for .nos files
if u are a programmer u can convert it in visual basic, if u aren't u can't use :P
Sm•ke is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Buying] [S] einen der meinen Char mit MEINER HB Session bottet [B] Gebrauch von 1 HB Session
07/07/2013 - World of Warcraft Trading - 1 Replies
Also nochmal: Ich stelle die Honorbuddy Session zur Verfügung und möchte das mein Char bzw mehrere Chars gebottet werden, sei es Leveln oder Pvp. Als Gegenleistung könnt ihr 1 Session nach belieben verwenden! :) Würde vielleicht auch dafür zahlen, dass jemand den Char hochbottet!:rolleyes: Greeetz!
[B] 4 Honorbuddy Lizenzen (2x 1 Session und 2x 3 session) (extrem billig) [S] Paypal
07/31/2012 - World of Warcraft Trading - 4 Replies
#closed Alle Keys verkauft ^^
Encrypter/Decrypter
06/16/2009 - Conquer Online 2 - 3 Replies
Anyone know of a good program that can decrypt/encrypt DAT files like Monster, Itemtype, etc... in the conquer folder? ty <3
Encrypter/Decrypter
06/15/2009 - CO2 Private Server - 5 Replies
Anyone know of a good program that can decrypt/encrypt DAT files like Monster, Itemtype, etc... in the conquer folder? :) ty <3
RFO INI De-Encrypter
09/24/2005 - General Gaming Discussion - 5 Replies
kann mir plz jemand helfen einen zu finden??



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


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.