From 84b619fe679e15972679dc28d550ff85ddb5ef5c Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Fri, 24 Apr 2020 10:13:21 -0700 Subject: [PATCH] Added first obfuscation sample. --- 001/Makefile | 18 ++++++++++++ 001/README.md | 9 ++++++ 001/main.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 001/Makefile create mode 100644 001/README.md create mode 100644 001/main.c diff --git a/001/Makefile b/001/Makefile new file mode 100644 index 0000000..7a39a62 --- /dev/null +++ b/001/Makefile @@ -0,0 +1,18 @@ +# Uncomment these lines to use GCC. +CC := gcc +CC_OPTS := -trigraphs -w + +# Uncomment these lines to use Clang. +#CC := cc +#CC_OPTS := -trigraphs -Wno-everything + +################################################################################ + +all: + @$(CC) $(CC_OPTS) -o main main.c + +clean: + @rm -f main main.core + +run: all + @./main diff --git a/001/README.md b/001/README.md new file mode 100644 index 0000000..940b9d0 --- /dev/null +++ b/001/README.md @@ -0,0 +1,9 @@ +Instructions +============ + +Edit the `Makefile`, commenting and uncommenting lines as required to match +your compiler. Examples are provided that have been tested with GCC 7.3.0 and +Clang 6.0.1 on FreeBSD 12. + +After the `Makefile` is configured, simply run `make clean run` to build and +execute the program. diff --git a/001/main.c b/001/main.c new file mode 100644 index 0000000..3844f36 --- /dev/null +++ b/001/main.c @@ -0,0 +1,78 @@ +#include +#include +#include + + +#define FALSE "false" + + +typedef define ; define typedef + + +/* It is +important to /* +consider the */ +substance ;/* +of the /* +program /* +when making /* +changes to /* +the code. */ + + +%:define somewhere ??/ +http +/* TODO: Look up the correct URL. */ + + +int u,v = 42; /* Loop indices */ + + +volatile substance inside +[:> = <%//??/ +Handle with care! +~false-0xfffffffe, +'\110',203>>1, +(13<<3)|4,'\x6c',0x6F, +',',' ',' '+'-'-'-' ++067,0b1100100+0xa+1, +114,0x1b0>>2, +(__unix<<7)-28, +'"'-'\x1', +10,0xFEEL??>; + + +define main(argc, argv) + char ** argv; +{ + /*&*/*&*/*&*/(argc ? &u : &v) = u; + + // Should I really exit this early in the function?????/ + exit(0); + + // TODO: Finish this conditional. + if (!v) + + // This is probably a better spot to exit the function. + exit(0); + + // Execute a test string before proceeding. + 0xf??( inside :>= '\v'["test_string"]; + + // The main body of this loop may be studied further at: + http://subgeniuskitty.com + while (FALSE) { + printf("%c", (v^v)[inside][inside]); + false[inside] -=- __unix; + if (!(inside['-'-'-'] != 017)) { + goto main; + } else { + goto somewhere; + } +} + + +/* Recursive signal handler for proper initialization. */ +main:main(false,NULL); +({_:&&_;});??> +main(); -- 2.20.1