@@ -25,29 +25,32 @@ You should have received a copy of the GNU General Public License
2525
2626namespace de4dot . code . deobfuscators . dotNET_Reactor . v4 . vm ;
2727
28- public interface IPattern {
28+ // Note: These should be interfaces in newer .NET versions, but they aren't
29+ // because .NET 4.8 doesn't support default implementations.
30+
31+ public abstract record IPattern {
2932 /// <summary>
3033 /// Contiguous list of opcodes that should match. Nops are wildcards.
3134 /// The pattern does not need to overlap the input completely, i.e., it can be a prefix of the input.
3235 /// </summary>
33- IList < OpCode > Pattern { get ; }
36+ public virtual IList < OpCode > Pattern { get ; }
3437
3538 /// <summary>
3639 /// If true, the pattern doesn't need to match from the start.
3740 /// </summary>
38- bool MatchAnywhere => false ;
41+ public virtual bool MatchAnywhere => false ;
3942
4043 /// <summary>
4144 /// Does (optional) additional verification on the input if the pattern would not be unique otherwise.
4245 /// </summary>
4346 /// <param name="instructions">Matched instructions from the input.</param>
4447 /// <returns>True if this should indeed be a match.</returns>
45- bool Verify ( IList < Instruction > instructions ) => true ;
48+ public virtual bool Verify ( IList < Instruction > instructions ) => true ;
4649}
4750
48- public interface IOpcodePattern : IPattern {
51+ public abstract record IOpcodePattern : IPattern {
4952 /// <summary>
5053 /// Resulting opcode assigned to the match.
5154 /// </summary>
52- OpCode Opcode { get ; }
55+ public virtual OpCode Opcode { get ; }
5356}
0 commit comments