[C++] Encrypting your strings with basic encryption (XOR) so noobs cant hex/rip it.

On martes, 7 de septiembre de 2010 0 comentarios


Ok, we all know noobs can easily hex your Tool and modify strings that say "Created by Mrk" to say "Created by randomnoob123".. Let's stop that ****. One basic step is to encrypt your strings.
Code:
char credits = "Tool created by Mrk";
Look there, how cute you have your credit in a char..
In a hex-editor any noob would find that straight away, so let's encrypt it..

+ Get xorgen.html & xorstr.h (link is at bottom of this post, and also pasted)
+ Launch xorgen.html in your favourite browser (Opera FTW)
+ Type in that string.. Tool created by Mrk
+ Press the button
+ SHA-BAM! You got a encrypted line back;
Code:
/*Tool created by Mrk*/XorStr<0x21,20,0x353401B2>("\x69\x43\x40\x4F\x05\x45\x55\x4D\x48\x5E\x4E\x48\x0D\x4C\x56\x10\x7C\x40\x58"+0x353401B2).s
Between the comment /* */ says the original text, you dont need that.
Code:
#include "xorstr.h" //dont forget to include it..

char credits = XorStr<0x21,20,0x353401B2>("\x69\x43\x40\x4F\x05\x45\x55\x4D\x48\x5E\x4E\x48\x0D\x4C\x56\x10\x7C\x40\x58"+0x353401B2).s;
..and now it's encrypted which makes it more difficult for noobs to change it.
What more you can do is ofcourse to use a packer/crypter such as PECompact, ASProtect, y0da crypt etc.




xorgen.html
Code:





 

    
  CONVERT TO XOR STRING   ******">
  


xorstr.h
Code:
#undef KEY
#undef BUFLEN
template
class XorStr
{
        private:
                XorStr();
        public:
               char s[BUFLEN];

                XorStr(const char* xs);
#ifndef DEBUG_OPTION
                ~XorStr(){ for(int i=0;i
#endif
};
template
XorStr::XorStr(const char* xs)
{
        int xvalue = XORSTART;
        int i = 0;
        for(;i<(BUFLEN-1);i++) {
               s[i] = xs[i-XREFKILLER]^xvalue;
               xvalue += 1;
               xvalue %= 256;
        }
        s[BUFLEN-1] = 0;
}
..and yeah, the xorgen wasn't written by me, if anyone could find the name of the author and proof, I'd put it as credited.

0 comentarios:

Publicar un comentario