secret
Created

Binary Level

  • Download Gist
binary-100.cpp
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<ctime>
using namespace std ;
 
int check( char* ) ;
char* md5_custom( char* ) ;
main( int argv , char **argc )
{
if(argv >3){
srand(time(NULL));
int *size , *select ;
int size = argv<<3 , select = rand() % ( argv-1 ) +1 ;
char password[size] ;
char *size_pass = password ;
char *check_pass = size_pass + sizeof(password) ;
*check_pass = '0';
strcpy( password , argc[select] );
if ( check( md5_custom( password ) ) ) *check_pass = '1' ;
if( *check_pass == '1' ) cout<<" #################### is the password ! . Good Job ! "<<endl;
else cout<<"Md5-custom Trolls ! Collide the 3 millionth one ! "<<endl;
}
else{
cout<<" I Want More Passwords !!!"<<endl ;
}
}
 
 
 
 
char* md5_custom( char* password ){
// Here comes a large code that calculates ' md5( password ) '
// return the hash ;
}
 
 
int check( char* hash ){
for( int i = 0 ; i < 32 ; i++ ){
if( hash[i] != "f2332291a6e1e6154f3cf4ad8b7504d8"[i] )return 0 ;
}
return 1 ;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.