Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

HabboEncoding C++ (new crypto)

Status
Not open for further replies.
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Don't know if they are already released, but here I release HabboEncoding for new crypto for C++.
It only contains the decoding functions as the encoding functions were useless.
This is my first time coding in C++.

HabboEncoding.h:
PHP:
#pragma once
ref class HabboEncoding
{
public:
	static int DecodeInteger(System::String^ v);
	static short DecodeShort(System::String^ v);
	static int DecodeInteger(System::Byte v[]);
	static short DecodeShort(System::Byte v[]);
};

HabboEncoding.cpp:
PHP:
#include "stdafx.h"
#include "HabboEncoding.h"


int HabboEncoding::DecodeInteger(System::String^ v)
{
	if ((((v[0] | v[1]) | v[2]) | v[3]) < 0)
		return -1;

	return ((((v[0] << 0x18) + (v[1] << 0x10)) + (v[2] << 8)) + v[3]);
}

short HabboEncoding::DecodeShort(System::String^ v)
{
	if ((v[0] | v[1]) < 0)
	{
		return -1;
	}

	return ((v[0] << 8) + v[1]);
}

int HabboEncoding::DecodeInteger(System::Byte v[])
{
	if ((((v[0] | v[1]) | v[2]) | v[3]) < 0)
		return -1;

	return ((((v[0] << 0x18) + (v[1] << 0x10)) + (v[2] << 8)) + v[3]);
}

short HabboEncoding::DecodeShort(System::Byte v[])
{
	if ((v[0] | v[1]) < 0)
	{
		return -1;
	}

	return ((v[0] << 8) + v[1]);
}

How to use it:

At the upper add:
PHP:
#include "HabboEncoding.h"

Where you want it do:
PHP:
int ID = HabboEncoding::DecodeInteger("");

Or:
PHP:
short ID = HabboEncoding::DecodeShort("");

DecodeInteger returns int (Int32) and DecodeShort returns short (Int16)

Proof it will work:

TuCN8 - HabboEncoding C++ (new crypto) - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Chasing 99 Red Balloons
Member
Joined
Jan 9, 2008
Messages
857
Reaction score
229
You've gone the wrong way about this by using strings
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Why would you even use .NET..? :(

It's easy.

We know Java is good, and I love Java, but the point is we have no C++ emulators (well maybe one or 2 but no flash)
Anyways, It would be lovely to see a C++ emulator working on new crypto.
And I wanted to make something in C++ so I decide to port some files in C++ (from C#)
 
Joined
May 23, 2011
Messages
1,607
Reaction score
588
It's easy.

We know Java is good, and I love Java, but the point is we have no C++ emulators (well maybe one or 2 but no flash)
Anyways, It would be lovely to see a C++ emulator working on new crypto.
And I wanted to make something in C++ so I decide to port some files in C++ (from C#)

C++ is more than capable of performing such tasks without using .NET. That restricts software to Windows; unless you hneed to use something windows-specific you shouldn't be using C++.NET (C++ has more than capable socket implementations which work across a variety of platforms) . It defeats the whole purpose of C/C++'s cross-platform abilities.
/rant
 
Master Summoner
Joined
Jan 20, 2011
Messages
512
Reaction score
163
C++ is more than capable of performing such tasks without using .NET. That restricts software to Windows; unless you hneed to use something windows-specific you shouldn't be using C++.NET (C++ has more than capable socket implementations which work across a variety of platforms) . It defeats the whole purpose of C/C++'s cross-platform abilities.
/rant

I agree if you use .net for c++ is just stupid

Nice release , i've been learning c++ for months now and this might come in handy some day
 
Banned
Banned
Joined
Feb 14, 2007
Messages
1,405
Reaction score
220
I assume that nobody have ever coded their emulator based off C++ But they are based off c# Or based on Java and so i suppose that you can give it a try but like others say: Just get along with .net if that makes you feel good furtherer good luck@!
 
Status
Not open for further replies.
Back
Top