Skip to content

Commit

Permalink
删除Volatile标记,防止clang优化爆炸,至于是为什么会爆炸,我也不知道,我也不想知道
Browse files Browse the repository at this point in the history
  • Loading branch information
KomiMoe committed Oct 6, 2024
1 parent 33e3bb9 commit 48375e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Obfuscation/IndirectBranch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ struct IndirectBranch : public FunctionPass {
Value *DecKey = EncKey;

if (GXorKey) {
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey, true);
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey);

if (opt.level() == 1) {
DecKey = IRB.CreateXor(EncKey1, XorKey);
Expand All @@ -274,7 +274,7 @@ struct IndirectBranch : public FunctionPass {
if (XorKeys) {
Value *XorKeysGEP = IRB.CreateGEP(XorKeys->getValueType(), XorKeys, {Zero, Idx});

Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP, true);
Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP);

XorKey = IRB.CreateNSWNeg(XorKey);
XorKey = IRB.CreateXor(XorKey, EncKey1);
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Obfuscation/IndirectCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ struct IndirectCall : public FunctionPass {
Value *DecKey = EncKey;

if (GXorKey) {
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey, true);
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey);

if (opt.level() == 1) {
DecKey = IRB.CreateXor(EncKey1, XorKey);
Expand All @@ -274,7 +274,7 @@ struct IndirectCall : public FunctionPass {
if (XorKeys) {
Value *XorKeysGEP = IRB.CreateGEP(XorKeys->getValueType(), XorKeys, {Zero, Idx});

Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP, true);
Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP);

XorKey = IRB.CreateNSWNeg(XorKey);
XorKey = IRB.CreateXor(XorKey, EncKey1);
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Transforms/Obfuscation/IndirectGlobalVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ struct IndirectGlobalVariable : public FunctionPass {

Value *DecKey = EncKey;
if (GXorKey) {
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey, true);
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey);

if (opt.level() == 1) {
DecKey = IRB.CreateXor(EncKey1, XorKey);
Expand All @@ -268,7 +268,7 @@ struct IndirectGlobalVariable : public FunctionPass {
if (XorKeys) {
Value *XorKeysGEP = IRB.CreateGEP(XorKeys->getValueType(), XorKeys, {Zero, Idx});

Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP, true);
Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP);

XorKey = IRB.CreateNSWNeg(XorKey);
XorKey = IRB.CreateXor(XorKey, EncKey1);
Expand Down Expand Up @@ -307,7 +307,7 @@ struct IndirectGlobalVariable : public FunctionPass {

Value *DecKey = EncKey;
if (GXorKey) {
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey, true);
LoadInst *XorKey = IRB.CreateLoad(GXorKey->getValueType(), GXorKey);

if (opt.level() == 1) {
DecKey = IRB.CreateXor(EncKey1, XorKey);
Expand All @@ -321,7 +321,7 @@ struct IndirectGlobalVariable : public FunctionPass {
if (XorKeys) {
Value *XorKeysGEP = IRB.CreateGEP(XorKeys->getValueType(), XorKeys, {Zero, Idx});

Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP, true);
Value *XorKey = IRB.CreateLoad(intType, XorKeysGEP);

XorKey = IRB.CreateNSWNeg(XorKey);
XorKey = IRB.CreateXor(XorKey, EncKey1);
Expand Down

0 comments on commit 48375e2

Please sign in to comment.