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()); }
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()); }