HikariObfuscator / Hikari

LLVM Obfuscator
1.92k stars 549 forks source link

Linking errors #22

Closed ghost closed 6 years ago

ghost commented 6 years ago
[ 91%] Linking CXX executable ../../bin/llvm-dsymutil
../../lib/libLLVMObfuscation.a(AntiDebugging.cpp.o): In function `llvm::AntiDebugging::doInitialization(llvm::Module&)':
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiDebugging.cpp:70: undefined reference to `llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool)'
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiDebugging.cpp:72: undefined reference to `llvm::Linker::linkModules(llvm::Module&, std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, unsigned int, std::function<void (llvm::Module&, llvm::StringSet<llvm::MallocAllocator> const&)>)'
../../lib/libLLVMObfuscation.a(AntiHooking.cpp.o): In function `llvm::AntiHook::doInitialization(llvm::Module&)':
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiHooking.cpp:73: undefined reference to `llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool)'
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiHooking.cpp:74: undefined reference to `llvm::Linker::linkModules(llvm::Module&, std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, unsigned int, std::function<void (llvm::Module&, llvm::StringSet<llvm::MallocAllocator> const&)>)'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
Naville commented 6 years ago

Hmm strange, it works here on macOS. Try edit lib/Transforms/Obfuscation/CMakeLists.txt and add IRReader below interpreter.

ghost commented 6 years ago

Doesn't seems to work?

Naville commented 6 years ago

strange. which version of linux are you using? I only have Windows and macOS installation here and they both seem to link correctly. Temporary workaround would be make clang and just use the clang directly

ghost commented 6 years ago

I'm using archlinux. Kernel version: 4.14.7-1 make clang just gave me this:

make: *** No rule to make target 'clang'.  Stop.
Naville commented 6 years ago

If even clang isn't available, I'm pretty sure among many otherthings , you didn't setup the source base correctly

ghost commented 6 years ago

Mmh. Is that wrong?

$ mkdir obf
$ cd obf
$ git clone ...
$ cmake .../
$ make
Naville commented 6 years ago

First the wiki stated you need to checkout clang and many other stuff separately. The linker error is probably on my side. Will take a look into it in around 8hours

Naville commented 6 years ago

Pushed a fix which should hopefully fix building on Linux. Let me know if it still doesn't

ghost commented 6 years ago
[ 91%] Linking CXX executable ../../bin/llvm-dsymutil
../../lib/libLLVMObfuscation.a(AntiDebugging.cpp.o): In function `llvm::AntiDebugging::doInitialization(llvm::Module&)':
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiDebugging.cpp:70: undefined reference to `llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool)'
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiDebugging.cpp:72: undefined reference to `llvm::Linker::linkModules(llvm::Module&, std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, unsigned int, std::function<void (llvm::Module&, llvm::StringSet<llvm::MallocAllocator> const&)>)'
../../lib/libLLVMObfuscation.a(AntiHooking.cpp.o): In function `llvm::AntiHook::doInitialization(llvm::Module&)':
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiHooking.cpp:73: undefined reference to `llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool)'
/home/yoooo/git/Hikari/lib/Transforms/Obfuscation/AntiHooking.cpp:74: undefined reference to `llvm::Linker::linkModules(llvm::Module&, std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >, unsigned int, std::function<void (llvm::Module&, llvm::StringSet<llvm::MallocAllocator> const&)>)'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tools/dsymutil/CMakeFiles/llvm-dsymutil.dir/build.make:396: bin/llvm-dsymutil] Error 1
make[1]: *** [CMakeFiles/Makefile2:20521: tools/dsymutil/CMakeFiles/llvm-dsymutil.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

It still doesn't work again :c

Naville commented 6 years ago

I suspect an extra line of required_libraries = IRReader Linker is needed at the bottom of lib/Transforms/Obfuscation/LLVMBuild.txt. Building LLVM in a virtual machine is ridiculously slow and to be honest I couldn't care less about building on other platforms

Naville commented 6 years ago

No idea how the LLVM cmake system works though, but my gut feeling tell me by explicitly introducing dependency like this should hopefully point out the right way to the linkers and stuff

Naville commented 6 years ago

Closing due to inactivity