We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Strip掉LLVM的DebugIntrinsics。 因为都是void返回类型不需要处理Def-Use Chain所以直接删除指令即可 参见Hikari的实现:
vector<CallInst *> toRemove; vector<Constant*> DeadConstants; for (Instruction &I : *alteredBB) { if (CallInst *CI = dyn_cast<CallInst>(&I)) { if (CI->getCalledFunction() != nullptr && CI->getCalledFunction()->getName().startswith("llvm.dbg")) { toRemove.push_back(CI); } } } // Shamefully stolen from IPO/StripSymbols.cpp for (CallInst *CI : toRemove) { Value *Arg1 = CI->getArgOperand(0); Value *Arg2 = CI->getArgOperand(1); assert(CI->use_empty() && "llvm.dbg intrinsic should have void result"); CI->eraseFromParent(); if (Arg1->use_empty()) { if (Constant *C = dyn_cast<Constant>(Arg1)) { DeadConstants.push_back(C); } else { RecursivelyDeleteTriviallyDeadInstructions(Arg1); } } if (Arg2->use_empty()) { if (Constant *C = dyn_cast<Constant>(Arg2)) { DeadConstants.push_back(C); } } } while (!DeadConstants.empty()) { Constant *C = DeadConstants.back(); DeadConstants.pop_back(); if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) { if (GV->hasLocalLinkage()) RemoveDeadConstant(GV); } else RemoveDeadConstant(C); }
从CloneBB里搜索对llvb.dbg.*的调用并递归删除指令和指令的参数
llvb.dbg.*
The text was updated successfully, but these errors were encountered:
388页。 需要过滤Invoke的原因不是什么跳转。而是因为splitbb会把split之后第一个基本块的末尾修改成无条件跳转的br指令。 而原来的异常处理基本块开头的LandingPad应该被invoke引用而不是无条件的br。 这样生成的ir不合规
br
Ref: https://mayuyu.io/2017/12/27/BogusControlFlowBug/
Sorry, something went wrong.
389页。 C++ Include的问题是因为clone的llvm里没有libcxx libcxxabi compiler-rt等,全部带上即可
369页。通过增加load来加载LLVMObfuscation.dylib
不需要,可以把Obfuscation编译静态库然后修改opt来静态链接混淆
参考: https://github.com/HikariObfuscator/Hikari/blob/release_60/tools/opt/opt.cpp#L412
No branches or pull requests
Strip掉LLVM的DebugIntrinsics。 因为都是void返回类型不需要处理Def-Use Chain所以直接删除指令即可
参见Hikari的实现:
从CloneBB里搜索对
llvb.dbg.*
的调用并递归删除指令和指令的参数The text was updated successfully, but these errors were encountered: