From: Christoph Egger Date: Sat, 3 Jan 2015 10:43:34 +0000 (+0100) Subject: Add some simple samples for screenshots and similar stuff X-Git-Tag: v0.1~148 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=379a273ffec1fefe8b6f9af3a959ae85eba17857;p=frida%2Ffrida.git Add some simple samples for screenshots and similar stuff --- diff --git a/samples/crypt/main.c b/samples/crypt/main.c new file mode 100644 index 0000000..773f0ea --- /dev/null +++ b/samples/crypt/main.c @@ -0,0 +1,21 @@ +#define _GNU_SOURCE +#include +#include +#include + +int check(char * str) { + /* Ich bin der größte! */ + static const char * correct = "TOgP5hrln1SAE"; + printf("%s\n", crypt(str, "TOPSECRET")); + return ! strcmp(correct, crypt(str, "TOPSECRET")); +} + +int main() { + char password[255]; + printf("Password: "); + scanf("%s", password); + if (check(password)) + printf("Success!\n"); + else + printf("Failure!\n"); +} diff --git a/samples/simple/main.c b/samples/simple/main.c new file mode 100644 index 0000000..0664bf0 --- /dev/null +++ b/samples/simple/main.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char ** argv) { + int count = atoi(argv[1]); + + while (count --> 0) { + printf(argv[2]); + } +}