English

On the difficulty of order constrained pattern matching with applications to feature matching based malware detection

Computational Complexity 2025-04-01 v1

Abstract

We formulate low-level malware detection using algorithms based on feature matching as Order-based Malware Detection with Critical Instructions (General-OMDCI): given a pattern in the form of a sequence MM of colored blocks, where each block contains a critical character (representing a unique sequence of critical instructions potentially associated with malware but without certainty), and a program AA, represented as a sequence of nn colored blocks with critical characters, the goal is to find two subsequences, MM' of MM and AA' of AA, with blocks matching in color and whose critical characters form a permutation of each other. When MM is a permutation in both colors and critical characters the problem is called OMDCI. If we additionally require M=MM'=M, then the problem is called OMDCI+; if in this case d=Md=|M| is used as a parameter, then the OMDCI+ problem is easily shown to be FPT. Our main (negative) results are on the cases when M|M| is arbitrary and are summarized as follows: OMDCI+ is NP-complete, which implies OMDCI is also NP-complete. For the special case of OMDCI, deciding if the optimal solution has length 00 (i.e., deciding if no part of MM appears in AA) is co-NP-hard. As a result, the OMDCI problem does not admit an FPT algorithm unless P=co-NP. In summary, our results imply that using algorithms based on feature matching to identify malware or determine the absence of malware in a given low-level program are both hard.

Keywords

Cite

@article{arxiv.2503.23176,
  title  = {On the difficulty of order constrained pattern matching with applications to feature matching based malware detection},
  author = {Adiesha Liyanage and Braeden Sopp and Binhai Zhu},
  journal= {arXiv preprint arXiv:2503.23176},
  year   = {2025}
}

Comments

23 pages, 2 figures

R2 v1 2026-06-28T22:39:08.149Z