DreamSoule / ollvm17

Obfuscation LLVM 17
337 stars 54 forks source link

-mllvm fla error fix #10

Open crazy-copy opened 12 months ago

crazy-copy commented 12 months ago

对比了一下别处的源码 发现有个小错误 导致不能使用 fla 选项

PreservedAnalyses FlatteningPass::run(Function& F, FunctionAnalysisManager& AM) {
    Function *tmp = &F; // 传入的Function
    // 判断是否需要开启控制流平坦化
    if (toObfuscate(flag, tmp, "fla")) {

      // Lower switch
      LowerSwitchPass lower;
      lower.run(F, AM);
      #这里没有返回值导致的错误
      if (flatten(F)) {
        ++Flattened;
      }
      return PreservedAnalyses::none();
    }
    return PreservedAnalyses::all();
}
bool FlatteningPass::flatten(Function &F){
     ...
    fixStack(F);
    return true;  #这里添加返回值 就可以使用fla了

}

{83C3333B-85C6-4c1e-B779-EA6187E6AFF9}

DreamSoule commented 12 months ago

感谢