Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot "make" a clean version of avcleaner #23

Open
m-cetin opened this issue Aug 31, 2022 · 1 comment
Open

Cannot "make" a clean version of avcleaner #23

m-cetin opened this issue Aug 31, 2022 · 1 comment

Comments

@m-cetin
Copy link

m-cetin commented Aug 31, 2022

Hi,

I am using Kali Linux 5.10.0-kali9-amd64 and followed the steps through the installation step. I am getting a couple of error messages when building avcleaner.bin:

[ 33%] Building CXX object CMakeFiles/avcleaner.bin.dir/MatchHandler.cpp.o
[ 33%] Building CXX object CMakeFiles/avcleaner.bin.dir/main.cpp.o
/home/toto/MatchHandler.cpp: In member function ‘void MatchHandler::handleCallExpr(const clang::StringLiteral*, clang::ASTContext*, clang::DynTypedNode, std::string)’:
/home/toto/MatchHandler.cpp:196:18: warning: variable ‘Type’ set but not used [-Wunused-but-set-variable]
  196 |             auto Type = FunctionCall->getDirectCallee()->getParamDecl(i)->getType();
      |                  ^~~~
/home/toto/MatchHandler.cpp: In function ‘int nbUniqChars(const std::string&)’:
/home/toto/MatchHandler.cpp:391:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  391 |     for (auto i = 0; i < text.length(); i++) {
      |                      ~~^~~~~~~~~~~~~~~
/home/toto/MatchHandler.cpp: In static member function ‘static clang::SourceRange MatchHandler::findInjectionSpot(clang::ASTContext*, clang::DynTypedNode, const clang::StringLiteral&, bool, uint64_t)’:
/home/toto/MatchHandler.cpp:343:1: warning: control reaches end of non-void function [-Wreturn-type]
  343 | }
      | ^
[ 50%] Building CXX object CMakeFiles/avcleaner.bin.dir/Globals.cpp.o
[ 66%] Building CXX object CMakeFiles/avcleaner.bin.dir/ApiMatchHandler.cpp.o
[ 83%] Building CXX object CMakeFiles/avcleaner.bin.dir/Utils.cpp.o
/home/toto/ApiMatchHandler.cpp: In static member function ‘static clang::SourceRange ApiMatchHandler::findInjectionSpot(clang::ASTContext*, clang::DynTypedNode, const clang::CallExpr&, uint64_t)’:
/home/toto/ApiMatchHandler.cpp:130:1: warning: control reaches end of non-void function [-Wreturn-type]
  130 | }
      | ^
/home/toto/ApiMatchHandler.cpp: In member function ‘bool ApiMatchHandler::isInsideIfCondition(const clang::CallExpr*, clang::ASTContext*)’:
/home/toto/ApiMatchHandler.cpp:381:1: warning: control reaches end of non-void function [-Wreturn-type]
  381 | }
      | ^
[100%] Linking CXX executable avcleaner.bin
[100%] Built target avcleaner.bin

I cannot run avcleaner.bin successfully:

[toto@7600c3d5dab1 CMakeBuild]$ ./avcleaner.bin ../test/strings_test.c --strings=true --
Processing file /home/toto/CMakeBuild/../test/strings_test.c
/home/toto/CMakeBuild/../test/strings_test.c:1:10: fatal error: 'windows.h' file not found
#include <windows.h>
         ^~~~~~~~~~~
Running new consumer...                                                                                                                
[StringEncryption] Registering ASTMatcher...
** EndSourceFileAction for: /home/toto/CMakeBuild/../test/strings_test.c
File was not modified
1 error generated.
Error while processing /home/toto/CMakeBuild/../test/strings_test.c.

When including the headers, I get the error:

[toto@a6242ac6010f CMakeBuild]$ sudo ./avcleaner.bin ../test/strings_simplest.c -I ../include
avcleaner.bin: /usr/include/llvm/Support/Error.h:671: llvm::Expected<T>::storage_type* llvm::Expected<T>::getStorage() [with T = clang::tooling::CommonOptionsParser; storage_type = clang::tooling::CommonOptionsParser]: Assertion `!HasError && "Cannot get value when an error exists!"' failed.
Aborted

My clang version:

[toto@a6242ac6010f CMakeBuild]$ clang --version
clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/sbin

If you need further informations, let me know.

@plowsec
Copy link
Contributor

plowsec commented Jan 31, 2023

You fixed your first error correctly, but for your last problem, it's because some arguments are missing to avcleaner.bin. Try running it with --help and use the required arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants