Guest User

Solución crackme C Yo-Mismo

a guest
Mar 16th, 2015
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int Longitudes(char *Name1,char *Name2)
  4. {
  5.     int Contador1=0;
  6.     while(Name1[Contador1]!='\0')
  7.     {
  8.         Contador1++;
  9.     }
  10.     int Contador2=0;
  11.     while(Name2[Contador2]!='\0')
  12.     {
  13.         Contador2++;
  14.     }
  15.     if(Contador1>6 && Contador2>6)
  16.     {
  17.         return 1;
  18.     } else {
  19.         return 0;
  20.     }
  21. }
  22.  
  23. int Funcion1(char *serialfalso)
  24. {
  25.     int Contador=0;
  26.     int Serie=0;
  27.     while(serialfalso[Contador]!='\0')
  28.     {
  29.         Contador++;
  30.         Serie+=(int)serialfalso[Contador];
  31.     }
  32.     while(Serie>100)
  33.     {
  34.         Serie=Serie^50;
  35.         Serie-=10;
  36.     }
  37.     return Serie;
  38. }
  39.  
  40. void main(int argc, char *argv)
  41. {
  42.     char Nombre[500];
  43.     char Serial[500];
  44.     char SerialFalso[500];
  45.     printf("Introduzca usuario: ");
  46.     scanf("%s",&Nombre);
  47.     printf("Introduzca serial: ");
  48.     scanf("%s",&SerialFalso);
  49.     if(Longitudes(Nombre, SerialFalso)==1)
  50.     {
  51.         int val1 = Funcion1(SerialFalso);
  52.         if((char)Nombre[0]==(char)val1)
  53.         {
  54.             printf("Correcto");
  55.         } else {
  56.             printf("Buen intento");
  57.         }
  58.     } else {
  59.         printf("Buen intento");
  60.     }
  61. }
Add Comment
Please, Sign In to add comment