From 453ccbcb228b7f39adf087bfe955c770e4640f64 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sat, 16 Dec 2017 17:01:54 +0330 Subject: obfuscator should handle macro expansions just fine now, also there was no rewriter for macro expansion so added one and added a test folder for obfuscator, also added a new method for getting the spellingloc to aux methods --- obfuscator/test/compile_commands.json | 7 +++ .../test/dir1/dir12/dir122/dir1221/header.hpp | 0 obfuscator/test/dir1/dir12/dir122/header.h | 0 obfuscator/test/dir1/dir12/source.cpp | 0 obfuscator/test/dir1/dir12/source.cxx | 0 obfuscator/test/dir1/source.cc | 0 obfuscator/test/makefile | 24 ++++++++ obfuscator/test/obfuscator-tee | 68 ++++++++++++++++++++++ obfuscator/test/test.cpp | 68 ++++++++++++++++++++++ 9 files changed, 167 insertions(+) create mode 100644 obfuscator/test/compile_commands.json create mode 100644 obfuscator/test/dir1/dir12/dir122/dir1221/header.hpp create mode 100644 obfuscator/test/dir1/dir12/dir122/header.h create mode 100644 obfuscator/test/dir1/dir12/source.cpp create mode 100644 obfuscator/test/dir1/dir12/source.cxx create mode 100644 obfuscator/test/dir1/source.cc create mode 100644 obfuscator/test/makefile create mode 100644 obfuscator/test/obfuscator-tee create mode 100644 obfuscator/test/test.cpp (limited to 'obfuscator/test') diff --git a/obfuscator/test/compile_commands.json b/obfuscator/test/compile_commands.json new file mode 100644 index 0000000..ea76446 --- /dev/null +++ b/obfuscator/test/compile_commands.json @@ -0,0 +1,7 @@ +[ + { + "command": "c++ -c -I/usr/lib/gcc/x86_64-redhat-linux/6.3.1/include -o test.o test.cpp", + "directory": "/home/bloodstalker/devi/hell2/obfuscator/test", + "file": "/home/bloodstalker/devi/hell2/obfuscator/test/test.cpp" + } +] \ No newline at end of file diff --git a/obfuscator/test/dir1/dir12/dir122/dir1221/header.hpp b/obfuscator/test/dir1/dir12/dir122/dir1221/header.hpp new file mode 100644 index 0000000..e69de29 diff --git a/obfuscator/test/dir1/dir12/dir122/header.h b/obfuscator/test/dir1/dir12/dir122/header.h new file mode 100644 index 0000000..e69de29 diff --git a/obfuscator/test/dir1/dir12/source.cpp b/obfuscator/test/dir1/dir12/source.cpp new file mode 100644 index 0000000..e69de29 diff --git a/obfuscator/test/dir1/dir12/source.cxx b/obfuscator/test/dir1/dir12/source.cxx new file mode 100644 index 0000000..e69de29 diff --git a/obfuscator/test/dir1/source.cc b/obfuscator/test/dir1/source.cc new file mode 100644 index 0000000..e69de29 diff --git a/obfuscator/test/makefile b/obfuscator/test/makefile new file mode 100644 index 0000000..1b0859b --- /dev/null +++ b/obfuscator/test/makefile @@ -0,0 +1,24 @@ +BRUISER_TEST=test +CXX?=clang++ +# you should change the include path to one that is right for you +CXX_FLAGS=-I/usr/lib/gcc/x86_64-redhat-linux/6.3.1/include + +.DEFAULT:all clean + +.PHONY:all clean $(BRUISER_TEST) help + +all:$(BRUISER_TEST) + +.cpp.o: + $(CXX) $(CXX_FLAGS) -c $< -o $@ + +$(BRUISER_TEST): test.o + $(CXX) $^ $(LD_FLAGS) -o $@ + +clean: + rm -f *.o *~ $(BRUISER_TEST) + +help: + @echo "the makfile for the bruiser test file." + @echo "there is the taget itself, all and clean." + diff --git a/obfuscator/test/obfuscator-tee b/obfuscator/test/obfuscator-tee new file mode 100644 index 0000000..7fc775f --- /dev/null +++ b/obfuscator/test/obfuscator-tee @@ -0,0 +1,68 @@ + +#if 0 +#include +#include +#endif + +int ID7143433513913994171(void) { + return 123; +} + +int ID806107362239807644(int ID6414370376350317282, int ID5596922551969966689) { + return ID6414370376350317282 + ID5596922551969966689; +} + +#define ID17270913437327947952 1 +#define ID3990433166784345791 int + +#define ID13091842907427809651 3.14 + +#define ID8553886278371731254 int ID6457201339852078238 +#define ID5893689362230717210 int ID17001300751847036766 + +namespace devi +{ + class ID3351929323710182842 + { + public: + ID3351929323710182842 () {} + + void ID5560374959326430988 (void) + { + int ID4993892634952068459 = 1; + int ID10838281452030117757 = 2; + int ID10959529184379665549 = 3; + } + }; +} + +int main(int ID3701972582333163920, const char **ID14643508047410943861) +{ + /***hya**/ + /* + * + * */ + // /**/ + int ID17697423301731741216; // this one + int ID3227026850925696272; /* + * + */ + /* "//" \\ \\\\ // */ + //std::cout << "//" << "/**/" << "\n"; + int/***/ ID5827489293749552374; +#if 0 + std::ofstream myfile; + myfile.open("./touch"); + myfile << "line one.\n"; + myfile.close(); +#endif + int ID468926534229516570 = 100; + int ID1567269223287109631 = 28; + + ID8553886278371731254; + ID5893689362230717210; + ID806107362239807644(ID6457201339852078238, ID17001300751847036766); + return ID806107362239807644(ID468926534229516570, ID1567269223287109631); + + //return return123(); +} diff --git a/obfuscator/test/test.cpp b/obfuscator/test/test.cpp new file mode 100644 index 0000000..23c3f23 --- /dev/null +++ b/obfuscator/test/test.cpp @@ -0,0 +1,68 @@ + +#if 0 +#include +#include +#endif + +int return123(void) { + return 123; +} + +int retret(int s, int w) { + return s + w; +} + +#define loco 1 +#define puta int + +#define PI 3.14 + +#define INTMAC1 int mac1 +#define INTMAC2 int mac2 + +namespace devi +{ + class LOCO + { + public: + LOCO () {} + + void lupo (void) + { + int a = 1; + int b = 2; + int c = 3; + } + }; +} + +int main(int argc, const char **argv) +{ + /***hya**/ + /* + * + * */ + // /**/ + int bubba; // this one + int hubba; /* + * + */ + /* "//" \\ \\\\ // */ + //std::cout << "//" << "/**/" << "\n"; + int/***/ cucu; +#if 0 + std::ofstream myfile; + myfile.open("./touch"); + myfile << "line one.\n"; + myfile.close(); +#endif + int aa = 100; + int bb = 28; + + INTMAC1; + INTMAC2; + retret(mac1, mac2); + return retret(aa, bb); + + //return return123(); +} -- cgit v1.2.3