obfuscator-llvm / obfuscator

3.81k stars 1.16k forks source link

“AND” stand for what “&”or “&&” in Substitution.cpp #153

Open ChenforCode opened 4 years ago

ChenforCode commented 4 years ago

In Substitution.cpp have a code block like this:

case Instruction::And: (this->* funcAnd[llvm::cryptoutils->get_range(2)])(cast<BinaryOperator>(inst)); ++And; break; case Instruction::Or: (this->* funcOr[llvm::cryptoutils->get_range(2)])(cast<BinaryOperator>(inst)); ++Or; break; We know that this is used to handle the "and" instruction. I want to know whether the "and" here refers to the bitwise operator "&"or the logical operator "&&"。 // Implementation of a = b & c => a = (b^~c)& b void Substitution::andSubstitution(BinaryOperator *bo) // Implementation of a = a && b <=> !(!a | !b) && (r | !r) void Substitution::andSubstitutionRand(BinaryOperator *bo) funcAnd[0] = &Substitution::andSubstitution; funcAnd[1] = &Substitution::andSubstitutionRand; These two functions are "&"and "&&"processed separately. Why can you call them in "case AND"? Why don't you process "&"and&&"separately