
hadanka c.4 - najdi heslo
tak a znova ma hackli. chcel som byt poriadny geek a urobil som si autentifikaciu v jazyku C. myslel som, ze som zvolil celkom dobre heslo:
if (strcmp(buffer, "123") == 0)
, ale asi moc dobre nebolo. 


#include <string.h>
#include <stdio.h>
char testuj_udaje(char* heslo)
{
// char* hash="_y66v!**";
char je_heslo_OK = 'N';
char buffer[15];
strcpy(buffer, heslo);
if (strcmp(buffer, "*******************") == 0)
je_heslo_OK = 'A';
return je_heslo_OK;
}
int main(int argc, char* argv[])
{
if (argc<2) {
printf("musis zadat heslo, sklerotik!\n");
return 1;
}
if (testuj_udaje(argv[1]) == 'A')
printf("OK, vstup pane\n");
else
printf("koho chces hackovat, loser?\n");
return 0;
}
otestovat heslo si mozte tu: http://test.w3tech.sk/hadanky/4/level4.phpa binarka na testovanie je tu: http://test.w3tech.sk/hadanky/4/heslo.zip
hall of fame je tu: http://test.w3tech.sk/hadanky/4/halloffame.php