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

PE rich signature improvements #1135

Merged
merged 3 commits into from
Sep 23, 2019

Conversation

marc-etienne
Copy link
Contributor

This pull request modifies the pe.rich_signature.toolid and pe.rich_signature.version functions to return the sum of "count values" in the Rich header for the given tool id and/or tool version.

Although it changes the behavior of the functions, it should be backward compatible with existing YARA rules. If there's a match the count should be more than 0, which will evaluates to true when converted to boolean. The only case where it wouldn't work is if the YARA rule compares the boolean return value with 1.

Test was added and doc was updated to reflect the change.

of the matching rich entries instead of a boolean

It remains backwards compatible thanks to non-null values being
considered as true and when not found it returns 0 (false).
to reflect changes of behavior: it now returns the sum of counts matching
to given `toolid` and `version`.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@marc-etienne
Copy link
Contributor Author

Note regarding CLA: I'm in the process of getting the corporate CLA signed, it should be done shortly.

@marc-etienne
Copy link
Contributor Author

@googlebot I signed it!

@plusvic plusvic merged commit e68eff9 into VirusTotal:master Sep 23, 2019
tarterp pushed a commit to mandiant/yara that referenced this pull request Mar 31, 2022
* rich_internal function now returns the sum of counts
of the matching rich entries instead of a boolean

It remains backwards compatible thanks to non-null values being
considered as true and when not found it returns 0 (false).

* Update documentation of the `toolid` and `version` in PE module
to reflect changes of behavior: it now returns the sum of counts matching
to given `toolid` and `version`.

* Added test for the updated rich_signature function
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 this pull request may close these issues.

4 participants