Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
REinject committed Jun 28, 2024
1 parent d9b1fb7 commit 5c31b5e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
10 changes: 9 additions & 1 deletion ollvm-pass/obfuscation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_library(LLVMObfuscationx MODULE
add_library(LLVMObfuscationx SHARED
CryptoUtils.cpp
Utils.cpp
ObfuscationPassManager.cpp
Expand All @@ -12,7 +12,15 @@ add_library(LLVMObfuscationx MODULE
obfuscation.def
)

target_include_directories(LLVMObfuscationx PRIVATE ${CMAKE_SOURCE_DIR}/obfuscation)

add_dependencies(LLVMObfuscationx intrinsics_gen LLVMLinker)

llvm_map_components_to_libnames(llvm_libs support core irreader linker)
target_link_libraries(LLVMObfuscationx PRIVATE ${llvm_libs})

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set_target_properties(LLVMObfuscationx PROPERTIES
LINK_FLAGS "-static -static-libgcc -Wl,-Bstatic,--whole-archive -lwinpthread -lstdc++ -Wl,--no-whole-archive -Wl,-Bdynamic"
)
endif()
2 changes: 1 addition & 1 deletion ollvm-pass/obfuscation/Flattening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "include/Flattening.h"
#include "include/LegacyLowerSwitch.h"
#include "include/Utils.h"
#include "llvm/CryptoUtils.h"
#include "include/CryptoUtils.h"
#include "llvm/ADT/Statistic.h"

#define DEBUG_TYPE "flattening"
Expand Down
2 changes: 1 addition & 1 deletion ollvm-pass/obfuscation/IndirectBranch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "include/IndirectBranch.h"
#include "include/ObfuscationOptions.h"
#include "include/Utils.h"
#include "llvm/CryptoUtils.h"
#include "include/CryptoUtils.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"

Expand Down
8 changes: 4 additions & 4 deletions ollvm-pass/obfuscation/IndirectCall.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/Transforms/Obfuscation/IndirectCall.h"
#include "llvm/Transforms/Obfuscation/ObfuscationOptions.h"
#include "llvm/Transforms/Obfuscation/Utils.h"
#include "llvm/CryptoUtils.h"
#include "include/IndirectCall.h"
#include "include/ObfuscationOptions.h"
#include "include/Utils.h"
#include "include/CryptoUtils.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"

Expand Down
2 changes: 1 addition & 1 deletion ollvm-pass/obfuscation/IndirectGlobalVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "include/IndirectGlobalVariable.h"
#include "include/ObfuscationOptions.h"
#include "include/Utils.h"
#include "llvm/CryptoUtils.h"
#include "include/CryptoUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"

#define DEBUG_TYPE "indgv"
Expand Down
4 changes: 2 additions & 2 deletions ollvm-pass/obfuscation/ObfuscationPassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ INITIALIZE_PASS_END(ObfuscationPassManager, "irobf", "Enable IR Obfuscation",
//-----------------------------------------------------------------------------
// New PM Registration
//-----------------------------------------------------------------------------
llvm::PassPluginLibraryInfo getHelloWorldPluginInfo() {
llvm::PassPluginLibraryInfo getObfPassPluginInfo() {
return {LLVM_PLUGIN_API_VERSION, "Obfuscation", LLVM_VERSION_STRING,
[](PassBuilder &PB) {
PB.registerPipelineParsingCallback(
Expand Down Expand Up @@ -188,5 +188,5 @@ llvm::PassPluginLibraryInfo getHelloWorldPluginInfo() {
// command line, i.e. via '-passes=hello-world'
extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo
llvmGetPassPluginInfo() {
return getHelloWorldPluginInfo();
return getObfPassPluginInfo();
}
2 changes: 1 addition & 1 deletion ollvm-pass/obfuscation/StringEncryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/CryptoUtils.h"
#include "include/CryptoUtils.h"
#include <map>
#include <set>
#include <iostream>
Expand Down

0 comments on commit 5c31b5e

Please sign in to comment.