Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser Error with Anonymous Strings #237

Open
idiom opened this issue Feb 23, 2023 · 0 comments
Open

Parser Error with Anonymous Strings #237

idiom opened this issue Feb 23, 2023 · 0 comments

Comments

@idiom
Copy link

idiom commented Feb 23, 2023

I'm seeing a parser error when processing a rule that uses anonymous strings within the condition. I believe this is caused by the use of the anonymous identifier $ within the of clause.

The following example raised a yaramod.ParserError -> Reference to undefined string '$'

Example Rule:

rule example_rule
{
	strings:
        $ = "12345" nocase wide ascii
        $ = "67890" nocase wide ascii                
        $ = {00 01 02 03 04 05}
	condition:
		any of ($)
}

If I modify the rule to use them it is processed as expected.

Example:

rule example_rule
{
	strings:
        $ = "12345" nocase wide ascii
        $ = "67890" nocase wide ascii                
        $ = {00 01 02 03 04 05}
	condition:
		any of them
}

Also using indexes for the strings, the rule is processed without error.

rule example_rule
{
	strings:
        $s1 = "12345" nocase wide ascii
        $s2 = "67890" nocase wide ascii                
        $s3 = {00 01 02 03 04 05}
	condition:
		any of ($s*)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants