-
-
Save hiromu/1446669 to your computer and use it in GitHub Desktop.
Sample of sys_brainfuck()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
#include <asm/unistd.h> | |
#include <sys/syscall.h> | |
#ifdef __i386__ | |
#define __NR_brainfuck 349 | |
#elif __x86_64__ | |
#define __NR_brainfuck 312 | |
#elif __arm__ | |
#define __NR_brainfuck 378 | |
#endif | |
#define LEN 3000 | |
int main (void) | |
{ | |
char source[LEN], input[LEN], output[LEN]; | |
printf("Source: "); | |
gets(source); | |
printf("Input: "); | |
gets(input); | |
syscall(__NR_brainfuck, source, input, output, strlen(source), strlen(input), LEN); | |
puts(output); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment