VL64 and B64 encoding functions ~ C++

Results 1 to 13 of 13
  1. #1
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

    VL64 and B64 encoding functions ~ C++

    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
    PHP 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 >= 4//? : = if else clause
     
    abs(i);
     
    res[p++] = (char)(64 +(3));
     for (
    >>= 2!= 0>>= 6){
         
    bytes++;
         
    res[p++] = (char)(64 + (0x3f));
     }
     
    int null 0;
     
    res[sP] = (char)(res[sP] | bytes << 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;


    B64 function
    PHP Code:
    static string Encode_B64(int i){
    string s "";
     for (
    int x 1<= 2x++){
                    
    += (char)((char)(64 + (>> * (x) & 0x3f)));
    }
     return 
    s;

    Usage:
    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;

    Compiled binary, VS solution and source code:
    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


  2. #2
    C# | C++ Emerica is offline
    MemberRank
    Oct 2010 Join Date
    GermanyLocation
    437Posts

    Re: VL64 and B64 encoding functions ~ C++

    thank you ;D
    Native C++ FTW!! ;D

    Waves ~

  3. #3
    Valued Member BetterWay is offline
    MemberRank
    Dec 2011 Join Date
    The NetherlandsLocation
    146Posts

    Re: VL64 and B64 encoding functions ~ C++

    Thank you, I forgot this part to add to mines :
    Code:
    tmp.erase(2,22); //clever little method to cut the string. 
    //If this was not done, the output would have extremely weird chars.
    Also thanks for this :)

  4. #4
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: VL64 and B64 encoding functions ~ C++

    Great release Adil, saw some screenies on DB.

  5. #5
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

    Re: VL64 and B64 encoding functions ~ C++

    Has anyone tested it out?
    What are your thoughts?

  6. #6
    Valued Member BetterWay is offline
    MemberRank
    Dec 2011 Join Date
    The NetherlandsLocation
    146Posts

    Re: VL64 and B64 encoding functions ~ C++

    I converted them a few days ago into C++, but forgot some things like erase etc.
    My opinion: Works great lol'd

  7. #7
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

    Re: VL64 and B64 encoding functions ~ C++

    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:
    Code:
    rc4.Encrypt(key, "NV6VVFPoC7FLDlzDUri3qcOAg9cRoFOmsYR9ffDGy5P8HfF6eekX40SFSVfJ1mDb3lcpYRqdg28sp61eHkPukKbqTu1JsVEKiRavi04YtSzUsLXaYSa5BEGwg5G2OF");
    to:
    Code:
    rc4.Encrypt(key, "your special key here");
    The key variable is user input.

    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

  8. #8
    The Omega Superfun is offline
    MemberRank
    Dec 2006 Join Date
    The NetherlandsLocation
    5,223Posts

    Re: VL64 and B64 encoding functions ~ C++

    Thanks, this will come in handy!

  9. #9
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts
    Quote Originally Posted by Superfun View Post
    Thanks, this will come in handy!
    Thanks ^^

    I updated the build with decoding function. Instead of using a long winded char pointer to substitute for a char array, I've used strings.
    http://jokercode.net/utils/packetscout++.zip
    Posted via Mobile Device

  10. #10
    Proficient Member Squard is offline
    MemberRank
    Dec 2011 Join Date
    155Posts

    Re: VL64 and B64 encoding functions ~ C++

    Better nog make strings of them, bytes are better i guess.

  11. #11
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts
    Quote Originally Posted by Squard View Post
    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 02:11 PM.

  12. #12
    I don't even know azaidi is offline
    MemberRank
    Apr 2010 Join Date
    the NetherlandsLocation
    2,065Posts

    Re: VL64 and B64 encoding functions ~ C++

    Ehm I don't know anything about Emulators, what's this?

  13. #13
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

    Re: VL64 and B64 encoding functions ~ C++

    Quote Originally Posted by azaidi View Post
    Ehm I don't know anything about Emulators, what's this?
    It's an encoder/decoder written in C++



Advertisement