datLeak is a lightweight C interpreter/virtual machine. It runs C code without compiling it natively.
make
Run a file: ./datleak myfile.c
Interactive mode: ./datleak (write your code and press Ctrl+D when done)
- printf with %d, %s, %c, %%, \n, \t
- int, char, long, short, unsigned variables
- Basic arithmetic: + - * /
- Operator precedence: * / before + -
- Unary negation: -x
- Parenthesized expressions: (x + y) * z
- Variable assignment: x = expr;
- return statement
- Single-line comments: //
- Block comments: /* */
- Preprocessor directives ignored: #include, #define
#include <stdio.h> int main() { int x = 10; int y = 5; printf("x = %d\n", x); printf("x * y = %d\n", x * y); return 0; }
MIT License - see LICENSE file. Check LICENSE before using this as a base.