]> git.siccegge.de Git - frida/frida.git/commitdiff
Add some simple samples for screenshots and similar stuff
authorChristoph Egger <christoph@christoph-egger.org>
Sat, 3 Jan 2015 10:43:34 +0000 (11:43 +0100)
committerChristoph Egger <christoph@christoph-egger.org>
Sat, 3 Jan 2015 10:43:34 +0000 (11:43 +0100)
samples/crypt/main.c [new file with mode: 0644]
samples/simple/main.c [new file with mode: 0644]

diff --git a/samples/crypt/main.c b/samples/crypt/main.c
new file mode 100644 (file)
index 0000000..773f0ea
--- /dev/null
@@ -0,0 +1,21 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+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 (file)
index 0000000..0664bf0
--- /dev/null
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char ** argv) {
+       int count = atoi(argv[1]);
+
+       while (count --> 0) {
+               printf(argv[2]);
+       }
+}