An analyst needs a byte pattern with a wildcard nibble in the middle of a file header. Which YARA string form fits, as opposed to a plain text string?
Select an answer to reveal the explanation.
Short Explanation
You’re looking for a hex string, where one nibble can vary while the rest of the header bytes stay fixed. A plain text string, a meta field, and a filename-limited regular expression don’t match a wildcard nibble in header bytes.
Full Explanation
YARA hex strings are designed to match raw bytes, and a single question mark in a hex string acts as a nibble wildcard. A hex string with that wildcard among the header bytes lets the nibble vary while the surrounding bytes stay fixed. A plain text string searches for ordinary readable characters, so it does not express a wildcard nibble in a binary header; quotation marks do not turn a character string into a byte wildcard. A meta field can store or document the wildcard, but it does not participate in byte matching and is not evaluated as a pattern. A regular expression limited to the sample filename does not inspect header bytes. Even a content regular expression is the wrong tool when you need a nibble wildcard inside header bytes, which a hex string expresses directly. Exam caveat: ?? represents a full-byte wildcard, while A? or ?B represents one unknown nibble; the question-mark syntax differs by nibble position. Practical check: compile a small rule with one nibble wildcard in the header and confirm that it matches both expected header variants while missing a text-only copy of the same letters.