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 Code:
#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 Code:
#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 Code:
#include "HabboEncoding.h"
Where you want it do:
PHP Code:
int ID = HabboEncoding::DecodeInteger("");
Or:
PHP Code:
short ID = HabboEncoding::DecodeShort("");
DecodeInteger returns int (Int32) and DecodeShort returns short (Int16)
Proof it will work: