Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Written by Reno Robert
- Difficulty: Easy */
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- void success() {
- char *arg[] = {"/bin/sh", 0};
- printf("\nSuccess! Right code\n");
- execve("/bin/sh", arg, 0);
- }
- void fail() {
- printf("Wrong Code!\n");
- }
- int main() {
- int code;
- char buf[64];
- printf("Working! Please Wait...\n");
- sleep(3);
- srand(time(0));
- code = rand();
- memset(buf, 0, sizeof(buf));
- printf("Enter code to get ur message: ");
- fgets(buf, sizeof(buf), stdin);
- if(code == atoi(buf))
- success();
- else
- fail();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement