Confuser.Core/Utils.cs
/// <summary>
/// This function decides if a ldci4 instruction can be obfuscated
/// </summary>
/// <param name="instructions">instructions of target method</param>
/// <param name="i">index of ldci4 instruction</param>
/// <returns></returns>
This function decides if a ldci4 instruction can be obfuscated
This function decides if a ldci4 instruction can be obfuscated
public static bool CanObfuscateLDCI4(IList<Instruction> instructions, int i)
        {
            if (instructions[i + 1].GetOperand() != null)
                if (instructions[i + 1].Operand.ToString().Contains("bool"))
                    return false;
            if (instructions[i + 1].OpCode == OpCodes.Newobj)
                return false;
            if (instructions[i].GetLdcI4Value() == 0 || instructions[i].GetLdcI4Value() == 1)
                return false;
            return true;
        }
public static bool CanObfuscateLDCI4 ( IList < Instruction > instructions , int i ) { if ( instructions [ i + 1 ] . GetOperand ( ) != null ) if ( instructions [ i + 1 ] . Operand . ToString ( ) . Contains ( " " ) ) return false ; if ( instructions [ i + 1 ] . OpCode == OpCodes . Newobj ) return false ; if ( instructions [ i ] . GetLdcI4Value ( ) == 0 || instructions [ i ] . GetLdcI4Value ( ) == 1 ) return false ; return true ; }
This function decides if a ldci4 instruction can be obfuscated
This function decides if a ldci4 instruction can be obfuscated
None
instructions
IList<Instruction>
instructions of target method
instructions of target method
i
int
index of ldci4 instruction
index of ldci4 instruction