#include <sys/time.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <sys/ptrace.h> 
#include <sys/stat.h>


int main( int argc, char *argv[] )  {
              
	long result;
	
	char buffer[30];
	struct timeval tv;
	
	char name[100] ;
	
	char token[] = "Enhorabuena el token es YouAreABigPreLoAder" ;
	
	struct stat pathbuffer ;
	char *path = "/tmp/matrixhasyou";
	int statuscmd ;
	
	// Anti  Debug !
	
	
	if(close(3) != -1)
        {
                printf("Tecnica no valida [01]!!\n");
                _exit(-1);
        }

	
	 if(strcmp(argv[0], (char *)getenv("_")))
        {
                 printf("Tecnica no valida [02]!!\n");
                _exit(-1);
        }
	
	
	if(getsid(getpid()) != getppid())
        {
                 printf("Tecnica no valida [03]!!\n");
                _exit(-1);
        }
	
	
	if( ptrace(PTRACE_TRACEME, 0, 1, 0) < 0 )
        {
                 printf("Tecnica no valida [04]!!\n");
                 _exit(-1);
        }

	// Fin Anti Debug
	
	statuscmd = stat(path, &pathbuffer);

	if (statuscmd != 0) {

		printf("Esta no es mi casa :(\n");
		_exit(-1);
		
	}
	
	printf("Por favor, dime tu nombre: ") ;
	
	scanf("%100s", name);

	time_t curtime;

	gettimeofday(&tv, NULL); 
	curtime=tv.tv_sec;
	
	result = time(NULL);
	
	if (result < 1312934400) {
	
		printf ("Lo siento %s No te dare el token hasta el 10-08-2011\n", name) ;
	
		return(0);
		
	}
	
	else {
		
		printf("%s \n", token) ;
		
	}
}

