Skip to content

Commit

Permalink
Make MBAObfuscation faster by reduce the coefficients z3 needs to cal…
Browse files Browse the repository at this point in the history
…culate from 10 to 5
  • Loading branch information
bluesadi committed Jan 3, 2024
1 parent 290583b commit 7f65b41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Obfuscation/MBAObfuscation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace std;
using namespace llvm;
using namespace MBAUtils;

#define NUM_COEFFS 10
#define NUM_COEFFS 5

PreservedAnalyses Pluto::MbaObfuscation::run(Function &F, FunctionAnalysisManager &AM) {
for (BasicBlock &BB : F) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Obfuscation/MBAUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int8_t truthTables[15][4] = {
int64_t *MBAUtils::generateLinearMBA(int numExprs) {
#ifdef USE_CACHE
static std::queue<int64_t *> cached_coeffs;
if (cached_coeffs.size() >= 50) {
if (cached_coeffs.size() >= 100) {
int64_t *coeffs = cached_coeffs.front();
cached_coeffs.pop();
int64_t *coeffs_copy = new int64_t[15];
Expand Down

0 comments on commit 7f65b41

Please sign in to comment.