Developed and run in Visual Studio Code, this is a basic python program to obfuscate C/C++ files. Obfuscates all variables and functions, removes comments, and removes all whitespaces except after functions, variables, and imports.
You have been asked to write a C or C++ code obfuscator - you may use any language you want. Your job is to take existing C or C++ code and obfuscate all variable values and data structures.
-
Develop Phase [100]:
- Part one of the develop phase [50]:
For this part you should consider encoding strategies of the data. You may also want to embed validation in case someone is able to figure out your encoding (e.g. redundancy checks to detect tampering?). - Part two of the develop phase [50]:
Develop a mechanism that would obfuscate more complex data structures and possibly even logic structures. E.g. arrays, switch statements, etc.
- Part one of the develop phase [50]:
-
Attack Phase [50]:
Using any and all of the tools you have seen in this class, dissect code that you have obfuscated using your software. Identify everything you can. -
WriteUp/Submission [50]:
Document your development and design choices, include the dissection and reverse engineering of a sample program. Address the strengths and weaknesses of your software and how you would iterate and make your program more effective at obfuscation.
You must use version control, include me,and:
This python code is run in VS code, so if need be make sure python 3.7 is installed. In when you run it, give it the C/C++ file you like to obfuscate and it will genereate a obfuscated version of the original file. This was done so the user wishing to obfuscate can retain their orignal code and have an obfuscated version. The user can then rename the cpp file to whatever they wish.