Created
October 30, 2019 23:39
-
-
Save Silva97/6634ca407123bcade852cd1e5ef6e910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Just a simple crackme. | |
* For compile this crackme, download the CCS tool from: | |
* https://github.com/Silva97/cli-tools | |
* | |
* And run: | |
* $ gcc `./ccs crackme00.c` -o crackme00 | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
void cputs(char *string, bool brk); | |
int cstrcmp(char *string, char *cipher); | |
int main(void) | |
{ | |
char password[65]; | |
cputs(_E("Don't patch it!"), true); | |
cputs(_E("Insert your password: "), false); | |
scanf("%64[^\n]", password); | |
if ( !cstrcmp(password, _E("ccs-passwd44")) ) | |
cputs(_E("Correct!"), true); | |
else | |
cputs(_E("Wrong!"), true); | |
return 0; | |
} | |
void cputs(char *string, bool brk) | |
{ | |
char buffer[256]; | |
strcpy(buffer, string); | |
cdec(buffer); | |
if (brk) | |
puts(buffer); | |
else | |
fputs(buffer, stdout); | |
} | |
int cstrcmp(char *string, char *cipher) | |
{ | |
int c = cchar(cipher); | |
while (*string && c && *string++ == c) { | |
c = cchar(NULL); | |
} | |
return !( !c && !*string ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment