nishihatapalmer / byteseek

A Java library for byte pattern matching and searching
BSD 3-Clause "New" or "Revised" License
40 stars 11 forks source link

Search and match variable length wildcards #27

Open nishihatapalmer opened 3 years ago

nishihatapalmer commented 3 years ago

There is a middle ground between fixed length sequences that byteseek currently supports, and full regular expressions (which needs a lot more dev and test). We can support wildcards between sequence elements.

. wildcards: A sequence like 01 02 . 03 04 can be matched easily (01 02, then search for 03 04).
.{1,4} variable length wildcards. A sequence like 01 02 03 .{1,4} 04 05 can be matched as 01 02 03, then search for 04 05.

Also need to support backtracking (optionally).

nishihatapalmer commented 3 years ago

To support all of the matching performed by the DROID application, it would also have to support alternative sequences ('one' | 'two' | 'three'). This would be a bit more complex than just having variable length wildcards, but probably not a lot more. It would require at least some of the multi-pattern matching currently at incubator stage to be promoted to fully tested and supported.