PHP Code:
#include <Windows.h>
#include <iostream>
#include <time.h>
#include <vector>
#include <map>
#include <string>
#define MAX_VALUE_FOR_RANDOM 9734983
#define MAX_VALUE_FOR_TYPES 5
#define MAX_VALUE_FOR_VARNAME 15
enum Types
{
fl = 0,
integer = 1,
character = 2,
const_character = 3,
booleaN = 4,
};
std::string TypeToString( size_t typeValue )
{
if ( typeValue == Types::fl )
return "float ";
if ( typeValue == Types::integer )
return "int ";
if ( typeValue == Types::character )
return "char ";
if ( typeValue == Types::const_character )
return "const char* ";
if ( typeValue == Types::booleaN )
return "bool ";
}
void gen_random( char *s, const int len ) {
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
for ( int i = 0; i < len; ++i ) {
s[i] = alphanum[rand( ) % ( sizeof( alphanum ) - 1 )];
}
s[len] = 0;
}
int main( )
{
srand( time( NULL ) );
size_t randomType;
unsigned randomValue;
char* randomVarNamePrefix = "_var_";
char* randomVarNameSuffix = ( char* )malloc( MAX_VALUE_FOR_VARNAME );
char* finalVarName = ( char* )malloc( MAX_VALUE_FOR_VARNAME + 5 );
char* randomCharValue = ( char* )malloc( MAX_VALUE_FOR_VARNAME );
size_t randomVarNameSize;
char* randomChar = ( char* )malloc( 1 );
for ( auto i( 0 ); i < 10; ++i )
{
randomVarNameSize = rand( ) % MAX_VALUE_FOR_VARNAME + 5;
gen_random( randomVarNameSuffix, randomVarNameSize );
strcpy( finalVarName, randomVarNamePrefix );
strcat( finalVarName, randomVarNameSuffix );
randomType = rand( ) % MAX_VALUE_FOR_TYPES; // 0 to 4
randomValue = rand( ) % MAX_VALUE_FOR_RANDOM; // 0 to 9734982
if ( randomValue == 0 )
{
std::cout << TypeToString( randomType ) << finalVarName << ";\n";
continue;
}
if ( randomType == Types::character )
{
gen_random( randomChar, 1 );
std::cout << TypeToString( randomType ) << finalVarName << " = '" << randomChar << "';\n";
continue;
}
else if ( randomType == Types::const_character )
{
gen_random( randomCharValue, MAX_VALUE_FOR_VARNAME );
std::cout << TypeToString( randomType ) << finalVarName << " = \"" << randomCharValue << "\";\n";
continue;
}
std::cout << TypeToString( randomType ) << finalVarName << " = " << randomValue << ";\n";
}
std::cin.get( );
}
Code:
bool _var_tj1hr7hd = 20686; bool _var_gV2pkbHp8wlou = 21773; char _var_D2KfqxT9 = 'U'; bool _var_qmWAFw = 22076; const char* _var_4bkttBMw1mJl8j = "qdheM1MZuFv1TpO"; bool _var_U4iQahPq = 8714; float _var_ynSUGegSN = 18218; char _var_L75H34Ed2MN = 'X'; int _var_W4clpxnOR5jXhq7th = 24626; const char* _var_31kbmJwGRbMHPX = "ISQEoloh6ZmJzhi";
if you wanna use this(XD) you have to wrap the junk code around your 'real'
source code stuff whatever lol lmao.
just wrap this whole thing in a function and then do something like
"[JUNK PLEASE HERE]" string before your codenz .cpp / .txt / .hpp / .h file and
"[JUNK PLEASE END HERE]" string after your codenz you want to HIDE.
Search for that with std algorithms get the offset in file lines or stuff
and then place it there with the wrapper function.
here: search that shit set stream pos with
fseek and then write the crap out of it.
PS: don't forget to free the allocated memory