static AOP() { HandlersConditions = new Dictionary <string, Predicate <MemberInfo> >(); Handlers = new Dictionary <string, dHandlers>(); if (Description.SpecialVar) { GetRealBody = GetRealBody0; } else { GetRealBody = GetRealBody1; } Void = typeof(void); Z = new aopsL(); MyBody = typeof(AOP).GetMethod("Prepared", BindingFlags.NonPublic | BindingFlags.Instance).GetMethodBody().GetILAsByteArray(); TokenGetCurrentMethod = Addition.ToInt32(MyBody, 2); TokenGetCurrentMethodIE = Addition.ReadBytes(MyBody, 2, 4); ToBodyBegin = Addition.ReadBytes(MyBody, 1, 10); It2015 = MyBody[11] == 37;//dup if (It2015) { TokenInt32 = Addition.ToInt32(MyBody, 14); ToBodyAdd = Addition.ReadBytes(MyBody, 18, 5); ToBodyRunDo = Addition.ReadBytes(MyBody, 23, 5); } else { TokenInt32 = Addition.ToInt32(MyBody, 15); ToBodyAdd = Addition.ReadBytes(MyBody, 19, 5); ToBodyRunDo = Addition.ReadBytes(MyBody, 25, 5); } }
public static void InitAllCodeModificator(this aopsL Me) { if (!aopsL.IniAltDyn) { aopsL.IniAltDyn = true; AOP.HandlersConditions.ForEach(a => Assembly.GetExecutingAssembly().GetTypes().ForEach(x => x.GetMethods(Addition.ALL).Where(y => a.Value(y)).ForEach(z => Me.AddM(z)))); } }