Пример #1
0
 // Token: 0x06000085 RID: 133 RVA: 0x0000B88C File Offset: 0x00009A8C
 public static void ObfuscateNumbers(ModuleDef md)
 {
     foreach (TypeDef typeDef in md.Types)
     {
         foreach (MethodDef methodDef in typeDef.Methods)
         {
             bool flag = !methodDef.HasBody;
             if (!flag)
             {
                 for (int i = 0; i < methodDef.Body.Instructions.Count; i++)
                 {
                     bool flag2 = methodDef.Body.Instructions[i].IsLdcI4();
                     if (flag2)
                     {
                         int  ldcI4Value = methodDef.Body.Instructions[i].GetLdcI4Value();
                         bool flag3      = ldcI4Value <= 0;
                         if (!flag3)
                         {
                             methodDef.Body.Instructions[i].OpCode  = OpCodes.Ldstr;
                             methodDef.Body.Instructions[i].Operand = Constants__numbers_.Random(ldcI4Value);
                             methodDef.Body.Instructions.Insert(i + 1, OpCodes.Call.ToInstruction(md.Import(typeof(string).GetMethod("get_Length"))));
                         }
                     }
                 }
             }
         }
     }
 }
Пример #2
0
 // Token: 0x06000088 RID: 136 RVA: 0x0000BE5C File Offset: 0x0000A05C
 public static void Melting(ModuleDef md)
 {
     foreach (TypeDef typeDef in md.Types)
     {
         foreach (MethodDef methodDef in typeDef.Methods.ToArray <MethodDef>())
         {
             Constants__numbers_.StringOutliner(methodDef);
             Constants__numbers_.IntegerOutliner(methodDef);
         }
     }
 }
Пример #3
0
        // Token: 0x0600008C RID: 140 RVA: 0x0000C2C4 File Offset: 0x0000A4C4
        public static void Inject(ModuleDef module)
        {
            Constants__numbers_.Execute(module);
            int num = new Random().Next(0, int.MaxValue);

            Constants__numbers_.InjectClass(module);
            foreach (TypeDef typeDef in module.GetTypes())
            {
                bool isGlobalModuleType = typeDef.IsGlobalModuleType;
                if (!isGlobalModuleType)
                {
                    foreach (MethodDef methodDef in typeDef.Methods)
                    {
                        bool flag = !methodDef.HasBody;
                        if (!flag)
                        {
                            IList <Instruction> instructions = methodDef.Body.Instructions;
                            for (int i = 0; i < instructions.Count - 3; i++)
                            {
                                bool flag2 = instructions[i].OpCode == OpCodes.Ldc_I4;
                                if (flag2)
                                {
                                    int num2 = (int)instructions[i].Operand;
                                    int num3 = num2 * 69;
                                    num3 *= 2;
                                    instructions[i].Operand = num3;
                                    instructions.Insert(i + 1, Instruction.Create(OpCodes.Ldstr, "BlinkVM"));
                                    instructions.Insert(i + 2, Instruction.Create(OpCodes.Ldstr, "BlinkVM"));
                                    instructions.Insert(i + 3, Instruction.Create(OpCodes.Call, Constants__numbers_.init));
                                }
                                bool flag3 = instructions[i].OpCode == OpCodes.Ldc_R4;
                                if (flag3)
                                {
                                    float num4 = (float)instructions[i].Operand;
                                    float num5 = num4 * 69f;
                                    num5 *= 2f;
                                    instructions[i].Operand = num5;
                                    instructions.Insert(i + 1, Instruction.Create(OpCodes.Ldstr, "BlinkVM"));
                                    instructions.Insert(i + 2, Instruction.Create(OpCodes.Ldstr, "BlinkVM"));
                                    instructions.Insert(i + 3, Instruction.Create(OpCodes.Call, Constants__numbers_.init1));
                                }
                            }
                        }
                    }
                }
            }
            Constants__numbers_.Melting(module);
        }