Jump to content
metin2dev
127.0.0.1

[How to] Hide xtea keys

Recommended Posts

My name is ramy, I'm a junior programmer with experience of about two years in (STL , boost .. and soo on ) I live Netherlands since 10 years, but i was born in USA :) Now I'll show you how you can protect your tea-keys against hackers. I love very much c ++ 11 / c ++ 17, so the codes will only work with Visual Studio 2013 or higher.

I saw someone selling it, so I thought to give you something better, I think.

I came to this forum because someone hired me to work on his server and he recommended me to come here if I need help, ever.

Firstly include those two STL headers  intro EterPack.h

#include <cstdint>
#include <array>

EterPack.h

struct TeaKey
{
// Date: 01 . 12 . 2016
// Author: Ramy overflow
	TeaKey(std::array<DWORD, 4>src): data_(src), copy(src) {}

	operator const std::uint8_t *()const
	{
		return reinterpret_cast<const std::uint8_t *>(data_.data());
	}

	operator const DWORD *()const
	{
		return data_.data();
	}

	operator DWORD *()const
	{
		return copy.data();
	}

private:
	std::array<DWORD, 4>data_;
	mutable std::array<DWORD, 4>copy;
};

 

EterPack.cpp

const TeaKey &s_adwEterPackKey()
{
// Date: 01 . 12 . 2016
// Author: Ramy overflow
	static const TeaKey key
	{
		std::array < DWORD, 4 > {{
				45129401UL,
				92367215UL,
				681285731UL,
				1710201UL,
			}
		}
	};
	return key;
}

const TeaKey &s_adwEterPackSecurityKey()
{
// Date: 01 . 12 . 2016
// Author: Ramy overflow
	static const TeaKey key
	{
		std::array < DWORD, 4 > {{
				78952482UL,
				527348324UL,
				1632942UL,
				486274726UL,
			}
		}
	};
	return key;
}

And now search for all  s_adwEterPackKey / s_adwEterPackSecurityKey and replace with  s_adwEterPackKey() / s_adwEterPackSecurityKey() so just add an ()  because it's a function :)

 

Sincerely , Ramy overfow :)

  • Like 3

Share this post


Link to post
Share on other sites

Great tutorial ! I use another method of obfuscation (more than one it's pretty complex) but I'll use this one completely or just some parts, great !

Share this post


Link to post
Share on other sites

So this basically just hide xteas and magic ?
So the scriptkiddie cant easily get them to decrypt right?
Thanks tho for the relase man, really appreciated.

 

Share this post


Link to post
Share on other sites
On 14.12.2016 at 5:22 AM, Fleon said:

So this basically just hide xteas and magic ?
So the scriptkiddie cant easily get them to decrypt right?
Thanks tho for the relase man, really appreciated.

 

Yes , just hide (Not encryption). 

Share this post


Link to post
Share on other sites
On 12/14/2016 at 3:25 AM, MORTE said:

 

On 12/13/2016 at 6:56 PM, 127.0.0.1 said:

My name is ramy, I'm a junior programmer with experience of about two years in (STL , boost .. and soo on ) I live Netherlands since 10 years, but i was born in USA :) Now I'll show you how you can protect your tea-keys against hackers. I love very much c ++ 11 / c ++ 17, so the codes will only work with Visual Studio 2013 or higher.

I saw someone selling it, so I thought to give you something better, I think.

I came to this forum because someone hired me to work on his server and he recommended me to come here if I need help, ever.

Firstly include those two STL headers  intro EterPack.h


#include <cstdint>
#include <array>

EterPack.h


struct TeaKey
{
// Date: 01 . 12 . 2016
// Author: Ramy overflow
	TeaKey(std::array<DWORD, 4>src): data_(src), copy(src) {}

	operator const std::uint8_t *()const
	{
		return reinterpret_cast<const std::uint8_t *>(data_.data());
	}

	operator const DWORD *()const
	{
		return data_.data();
	}

	operator DWORD *()const
	{
		return copy.data();
	}

private:
	std::array<DWORD, 4>data_;
	mutable std::array<DWORD, 4>copy;
};

 

EterPack.cpp


const TeaKey &s_adwEterPackKey()
{
// Date: 01 . 12 . 2016
// Author: Ramy overflow
	static const TeaKey key
	{
		std::array < DWORD, 4 > {{
				45129401UL,
				92367215UL,
				681285731UL,
				1710201UL,
			}
		}
	};
	return key;
}

const TeaKey &s_adwEterPackSecurityKey()
{
// Date: 01 . 12 . 2016
// Author: Ramy overflow
	static const TeaKey key
	{
		std::array < DWORD, 4 > {{
				78952482UL,
				527348324UL,
				1632942UL,
				486274726UL,
			}
		}
	};
	return key;
}

And now search for all  s_adwEterPackKey / s_adwEterPackSecurityKey and replace with  s_adwEterPackKey() / s_adwEterPackSecurityKey() so just add an ()  because it's a function :)

 

Sincerely , Ramy overfow :)

so which method is betteR ? or both are shit ? xD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×