thank you ;D
Native C++ FTW!! ;D
Waves ~
This is a discussion on VL64 and B64 encoding functions ~ C++ within the Habbo Releases forums, part of the Habbo Hotel category; This probably won't be of use to those of you who've moved onto the new crypto, but oh well. Pretty ...

This probably won't be of use to those of you who've moved onto the new crypto, but oh well.
Pretty self explanatory, it's a stable port of the VL64 and B64 encoding functions written by Jeax (I believe) and Jordan (his Java port provided the basis for this).
VL64 function
B64 functionPHP Code:static string Encode_VL64(int i){
string s = "";
char res[6]; //assign the var res to a a char array - len6
int p = 0;
int sP = 0;
int bytes = 1;
int negativeMask = i >= 0 ? 0 : 4; //? : = if else clause
i = abs(i);
res[p++] = (char)(64 +(i & 3));
for (i >>= 2; i != 0; i >>= 6){
bytes++;
res[p++] = (char)(64 + (i & 0x3f));
}
int null = 0;
res[sP] = (char)(res[sP] | bytes << 3 | negativeMask);
string tmp = string(res);
tmp.erase(2,22); //clever little method to cut the string.
//If this was not done, the output would have extremely weird chars.
return tmp;
}
Usage:PHP Code:static string Encode_B64(int i){
string s = "";
for (int x = 1; x <= 2; x++){
s += (char)((char)(64 + (i >> 6 * (2 - x) & 0x3f)));
}
return s;
}
Compiled binary, VS solution and source code:PHP Code:#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
int value;
cout << "Enter your value\n";
cin >> value;
cout << //either: Encode_B64(value) or Encode_VL64(value);
cin.get()
return 0;
}
http://jokercode.net/utils/packetscout++.zip
Pictures of it functioning:
Notes:
Don't go off releasing this under your name.
Option 3 will output "coming soon", due to native C++ not having certain classes and functions built-in.
Report any bugs here. (If you enter a string for menu selection, prepare for errors).
~Adil
thank you ;D
Native C++ FTW!! ;D
Waves ~
Thank you, I forgot this part to add to mines :
Also thanks for this :)Code:tmp.erase(2,22); //clever little method to cut the string. //If this was not done, the output would have extremely weird chars.
Great release Adil, saw some screenies on DB.
Has anyone tested it out?
What are your thoughts?
I converted them a few days ago into C++, but forgot some things like erase etc.
My opinion: Works great lol'd
Notes:
Updated build. Latest can be found at the same directory, http://jokercode.net/utils/packetscout++.zip
Updates:
-RC4 has been implemented. If you wish to encrypt something with RC4, please change:
to:Code:rc4.Encrypt(key, "NV6VVFPoC7FLDlzDUri3qcOAg9cRoFOmsYR9ffDGy5P8HfF6eekX40SFSVfJ1mDb3lcpYRqdg28sp61eHkPukKbqTu1JsVEKiRavi04YtSzUsLXaYSa5BEGwg5G2OF");
The key variable is user input.Code:rc4.Encrypt(key, "your special key here");
Problems:
-Dom has told me that my encryption is static, whereas the habbo rc4 encryption wasn't. You can use this for static RC4 encryption if you wish.
Images:
Credits:
Jerry Jiang for his RC4.h file :D
~Adil
Thanks, this will come in handy!
Better nog make strings of them, bytes are better i guess.
Char arrays can't be initialized as empty in C++ (I think). If I use a char* pointer, the stack becomes overflowed :p
EDIT:
Writing to file:
Sorry for the double post, but this is a note to any who used this.
I overlooked something. Some were complaining of a DLL error, which was caused due to them not having MS' C runtime library installed. The updated build should fix this. Link is the same as always:
http://jokercode.net/utils/packetscout++.zip
Read the readme contained inside /dll
Last edited by Caustik; 29-12-11 at 01:11 PM.
Ehm I don't know anything about Emulators, what's this?