Skip to content

Instantly share code, notes, and snippets.

@Silva97

Silva97/crackme00.c

Created Oct 30, 2019
Embed
What would you like to do?
/* 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