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

STRING_ESCAPE_CHARS should contain 'r' #123

Open
immanuelAtTQ opened this issue Apr 6, 2023 · 3 comments · May be fixed by #125
Open

STRING_ESCAPE_CHARS should contain 'r' #123

immanuelAtTQ opened this issue Apr 6, 2023 · 3 comments · May be fixed by #125

Comments

@immanuelAtTQ
Copy link

see https://yara.readthedocs.io/en/stable/writingrules.html#text-strings

'r' is missing from STRING_ESCAPE_CHARS

@immanuelAtTQ
Copy link
Author

I was able to fix this in my implementation by doing the following:

    # Ensure '\r' is supported: https://yara.readthedocs.io/en/stable/writingrules.html#text-strings
    parser.STRING_ESCAPE_CHARS.add('r')  # HACK adds to predefined {'"', '\\', 't', 'n', 'x'}
    parsed_rules = `parser.parse_string(value)```

@Derekt2
Copy link

Derekt2 commented May 9, 2023

Also saw this issue, and confirmed your workaround worked!

@Derekt2 Derekt2 linked a pull request May 9, 2023 that will close this issue
@neiltyagi
Copy link

Yes due to this issue plyara throws error when parsing a rule where string part contains \r.

Kindly fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants