From 26859306a2affd060fb4ebebed7525a5d88e967c Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sun, 11 Feb 2018 23:59:49 +0330 Subject: 2 major bug fixed for bruiser, a lot of little improvements and bug fixed here and there --- obfuscator/obfuscator.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'obfuscator/obfuscator.cpp') diff --git a/obfuscator/obfuscator.cpp b/obfuscator/obfuscator.cpp index 2cbbd73..f6df690 100644 --- a/obfuscator/obfuscator.cpp +++ b/obfuscator/obfuscator.cpp @@ -445,10 +445,12 @@ class BlankDiagConsumer : public clang::DiagnosticConsumer class MyASTConsumer : public ASTConsumer { public: MyASTConsumer(Rewriter &R) : funcDeclHandler(R), HandlerForVar(R), HandlerForClass(R), HandlerForCalledFunc(R), HandlerForCalledVar(R) { +#if 1 Matcher.addMatcher(functionDecl().bind("funcdecl"), &funcDeclHandler); Matcher.addMatcher(varDecl(anyOf(unless(hasDescendant(expr(anything()))), hasDescendant(expr(anything()).bind("expr")))).bind("vardecl"), &HandlerForVar); Matcher.addMatcher(recordDecl(isClass()).bind("classdecl"), &HandlerForClass); Matcher.addMatcher(declRefExpr().bind("calledvar"), &HandlerForCalledVar); +#endif } void HandleTranslationUnit(ASTContext &Context) override { @@ -471,6 +473,7 @@ public: delete BDCProto; delete tee; } + void EndSourceFileAction() override { std::error_code EC; std::string OutputFilename = TEMP_FILE; @@ -608,6 +611,7 @@ class WhitespaceWarper { /**********************************************************************************************************************/ /*Main*/ int main(int argc, const char **argv) { +#if 1 CommonOptionsParser op(argc, argv, ObfuscatorCat); const std::vector &SourcePathList = op.getSourcePathList(); ClangTool Tool(op.getCompilations(), op.getSourcePathList()); @@ -616,6 +620,7 @@ int main(int argc, const char **argv) { CW.run(); dumpHashFilenames(hashFilenames(SourcePathList)); dumpDirList(listDirs("./test")); +#endif #if 0 for (auto &iter : SourcePathList) { std::cout << "name: " << std::get<0>(getNameFromPath(iter)) << "\t" << "extension: " << std::get<1>(getNameFromPath(iter)) << "\tpath: " << std::get<2>(getNameFromPath(iter)) << "\n"; -- cgit v1.2.3