Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Xorgen String Converter


    NeoIII
     Share

    Recommended Posts

    This is basically the same as: http://d4rc.net/d4/?cmd=xorgen

     

    just in c++

     

    the original xorgen.html is developed by gamedeception.net

    i extendet all Ascii control sequences to it.

     

    Creditz:

    gamedeception.net

    NeoIII

     

    Ico by Bigxxx

     

     

    for what you can use this?

    You can encrypt strings and hide them in c++ applications ( works only with xorgen.h, i will not host this file! )

     

    ChangeLog:

     

    You can now live view (500ms) the ClipBoard content.

    You can now activate HotKey Support mark some text in any application or textfile press CTRl+C to copy and it will be automatically converted to Xorgen you only have to press CTR+V to paste the encrypted string, if you have ( c++ like ) strings in form of "text" you can set the converter to autoremove the quotes on beginn and end of the string!

     

    its not fully bugfree there are still some bugs sometimes your paste content stay empty or the string failed @ encryption it will result in your original string or just nothing.

     

     

    Source:

    #include "stdafx.h"
    #include "Form1.h"
    #include <windows.h>
    #include "funcs.h"
    #include <string>
    #include <atlstr.h>
    #include <winuser.h>
    #include <sstream>
    using namespace std;
    using namespace XorStr;
    int APIENTRY _tWinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPTSTR    lpCmdLine,
                         int       nCmdShow)
    {
        System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
        Application::Run(new Form1());
        return 0;
    }
    HANDLE hKey = NULL;
    bool bARtags = false;
    char *GetClipboardText(void)
    {
        if(OpenClipboard(NULL))
        {
            HANDLE hData = GetClipboardData(CF_TEXT);
            if (!hData)
                return 0;
            char *buffer = (char*)GlobalLock(hData);
            GlobalUnlock(hData);
            CloseClipboard();
            return (buffer);
        }
        return 0;
    }
    void SetClipBoardText( char *text )
    {
        HGLOBAL hGlobalMemory = NULL;
        LPTSTR pcGlobalMemory = NULL;
        LPTSTR pcLocalText =(LPTSTR)text;
        int iTextLen = (int)strlen(pcLocalText);
        hGlobalMemory = GlobalAlloc(GHND |GMEM_SHARE, (iTextLen+1)*sizeof(TCHAR));  
        if(hGlobalMemory)
        {
            pcGlobalMemory = (LPTSTR) GlobalLock(hGlobalMemory);
            if(pcGlobalMemory)
            {
                for (int i = 0; i<iTextLen;i++)
                    *pcGlobalMemory++ = *pcLocalText++;  
                GlobalUnlock(hGlobalMemory);
                OpenClipboard (NULL);   
                EmptyClipboard();
                SetClipboardData(CF_TEXT, hGlobalMemory);
                CloseClipboard();
            }
        }
    }
    void RemoveFirstandLastQuote( char *str )
    {
        int iLen = (int)strlen(str);
        if(str[0]=='"')
        {
            for(int i = 0; i < (iLen-1); i++)
                str[i]=str[i+1];
            str[iLen-1] = '\0';
        }
        iLen = (int)strlen(str);
        if(str[iLen-1]=='"')
            str[iLen-1] = '\0';
    }
    void AddfText( char *szFile, char *szText, ... )
    {
        va_list va_alist;
        char logbuf[256];
        FILE * fp;
        va_start (va_alist, szText);
        _vsnprintf(logbuf, sizeof(logbuf), szText, va_alist);
        va_end (va_alist);
        if ( (fp = fopen ( szFile, "a")) != NULL )
        {
            fprintf ( fp, "%s\n", logbuf );
            fclose (fp);
        }
    }
    int strtoken( char *str, char *separator, char *token[] )
    {
        int i = 0;
        token[0] = strtok(str, separator);
        while(token[i]) {
            i++;
            token[i] = strtok(0, separator);
        }
        return i;
    }
    string gClipBoard;
    bool nowConverting = false;
    void ClipBoardStuff()
    {
        try
        {
            string clipboard = string( GetClipboardText( ) );
            Sleep(100);
            string xored = "";
            if( clipboard.compare( gClipBoard ) != 0 )
            {
                nowConverting = true;
                gClipBoard = clipboard;
                if(clipboard[0]=='/'&&clipboard[1]=='*')
                {
                    nowConverting = false;
                    return;
                }
                if(bARtags)
                {
        //            RemoveFirstandLastQuote(clipboard);
                    int i = 1;
                    if( clipboard[0] == '"' )
                        i = 0;
                    char *token[1000] = {0};
                    int iToken = strtoken( (char*)clipboard.c_str(), "\"", token );
                    for( int e=0; e<iToken; e++ )
                    {
                        if( e == i )
                        {
                            xored += Xorgen( token[e] );
                            i+=2;
                        } else {
                            xored += token[e];
                        }
                        
                    }
                    SetClipBoardText( (char*)xored.c_str() );
                    gClipBoard = string( GetClipboardText( ) );
                    nowConverting = false;
                    Beep(523, 300);
                    return;
                }
                SetClipBoardText( (char*)Xorgen(clipboard).c_str() );
                gClipBoard = string( GetClipboardText( ) );
                nowConverting = false;
                Beep(523, 300);
            }
        } catch(...){}
    }
    void HotKeyThread()
    {
        while(1)
        {
            //if(GetAsyncKeyState(VK_CONTROL) && GetAsyncKeyState(0x43)&1 )
            if( nowConverting == false )
                ClipBoardStuff();
            Sleep(300);
        }
    }
    void SwitchQuotes()
    {
        bARtags = !bARtags;
    }
    void SwitchThread()
    {
        if( hKey == NULL )
        {
            hKey = CreateThread(0,0,(LPTHREAD_START_ROUTINE)HotKeyThread,0,0,0);
        } else {
            TerminateThread(hKey,0);
            hKey = NULL;
        }
    }
    BYTE randByte()
    {
        Sleep((rand()%100)+10);
        srand(GetTickCount());
        return (rand()%512);
    }
    string hex( BYTE b ) {
        char buf[5];
        itoa(b, buf, 16);
        return buf;
    }
    string dec( BYTE b ) {
        char buf[5];
        itoa(b, buf, 10);
        return buf;
    }
    string Xorgen( string s1 )
    {
        string result = "";
        BYTE xvaluestart = randByte( );
        string xrefkill = "0x" + hex( randByte( ) ) + hex( randByte( ) ) + hex( randByte( ) ) + hex( randByte( ) );
        int finallen = s1.length( ) + 1;
        string hexsequence = "\"";
        BYTE xvalue = xvaluestart;
        for( int i = 0; i < (int)s1.length( ); i++ ) {
            BYTE ch = s1.substr( i, 1 ).c_str( )[0];
            BYTE chval;
            if( ch == '\\' ) {
                i++;
                ch = s1.substr( i, 1 ).c_str( )[0];
                if( ch == '0' ) {
                    chval = 0;
                }
                else if( ch == '\\' ) {
                    chval = '\\';
                }
                else if( ch == 'a' ) {
                    chval = 7;
                }
                else if( ch == 'b' ) {
                    chval = 8;
                }
                else if( ch == 't' ) {
                    chval = 9;
                }
                else if( ch == 'n' ) {
                    chval = 10;
                }
                else if( ch == 'v' ) {
                    chval = 11;
                }
                else if( ch == 'f' ) {
                    chval = 12;
                }
                else if( ch == 'r' ) {
                    chval = 13;
                }
                else {
                    result = string( "XorGen: invalid control sequence: \\" ) + ( char )ch;
                    return result;
                }
                --finallen;
            }
            else if( ch == '|' ) {
                chval = 0;
            }
            else {
                chval = ch;
                //if( !( chval >= 32 && chval <= 126 ) )
                //{
                //    result = string( "XorGen: invalid control sequence: \\" ) + ( char )ch;
                //    return result;
                //}
            }
            chval ^= xvalue;
            xvalue += 1;
            xvalue %= 256;
            hexsequence += "\\x" + hex( chval );
        }
        hexsequence += '"';
        stringstream sstream;
        sstream << "/*"+s1+"*/XorStr<0x" << hex( xvaluestart ) << "," << finallen << "," << xrefkill << ">(";
        string s2 = sstream.str( );
        s2 += hexsequence + "+" + xrefkill + ").s";
        result = s2;
        return result;
    }
    

    XorgenConverter.rar

    Edited by NeoIII
    • Upvote 1
    Link to comment
    Share on other sites

    • 2 weeks later...

    nice

    Link to comment
    Share on other sites

    • 2 years later...
    • 5 years later...
    • 1 month later...
    • 1 month later...

    Please dont bump up old theards, the first link still works and im sure you can find a converter for that in google.

    //Closed

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...