Skip to content

Instantly share code, notes, and snippets.

@Silva97
Created October 30, 2019 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Silva97/6634ca407123bcade852cd1e5ef6e910 to your computer and use it in GitHub Desktop.
Save Silva97/6634ca407123bcade852cd1e5ef6e910 to your computer and use it in GitHub Desktop.
/* 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