예제 #1
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var matcher = new CodeMatcher(instructions);
            int start   = matcher.MatchForward(false,
                                               new CodeMatch(OpCodes.Ldstr, "CannotEquip")
                                               ).Pos;
            int end = matcher.MatchForward(false,
                                           new CodeMatch(OpCodes.Br)
                                           ).Pos;

            return(matcher.RemoveInstructionsInRange(start, end).Instructions());
        }
예제 #2
0
        static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
        {
            var matcher = new CodeMatcher(instructions);
            int start   = matcher.MatchForward(false,
                                               new CodeMatch(OpCodes.Ldstr, "MessageCantEquipIncapableOfViolence")
                                               ).Pos;
            int end = matcher.MatchForward(false,
                                           new CodeMatch(OpCodes.Ret)
                                           ).Pos;

            return(matcher.RemoveInstructionsInRange(start, end).Instructions());
        }