feat: ignore FLOSS artifact strings
@@ -172,6 +172,7 @@ def hex(i):
# libary detection appears to fail, called via __amsg_exit or __abort
# also see issue #296 for another possible solution
FP_STRINGS = (
+ "R6002",
"R6016",
"R6030",
"Program: ",
@@ -188,7 +189,17 @@ FP_STRINGS = (
"- not enough space for thread data",
# all printable ASCII chars
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
+)
+
+# ignore FLOSS artifacts, like strings created during emulation
+FP_FLOSS_ARTIFACTS = (
MOD_NAME,
+ # hard-coded observed FP substrings
+ MOD_NAME[1:],
+ MOD_NAME[2:],
+ MOD_NAME[:-1],
+ MOD_NAME[1:-1],
+ MOD_NAME[2:-1],
)
@@ -203,6 +214,10 @@ def extract_strings(buffer: bytes, min_length: int, exclude: Set[str] = None) ->
if s.string in FP_STRINGS:
continue
+ if s.string in FP_FLOSS_ARTIFACTS:
+ logger.trace("filtered FLOSS artifact: %s", s.string)
+ continue
+
decoded_string = strip_string(s.string)
if len(decoded_string) < min_length:
