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

feat: test framework #44

Merged
merged 6 commits into from
Oct 4, 2023
Merged

feat: test framework #44

merged 6 commits into from
Oct 4, 2023

Conversation

TommYDeeee
Copy link
Contributor

@TommYDeeee TommYDeeee commented Oct 3, 2023

Testing framework for modules. It will be part of a yara-x testing suite that loops over specific directories for modules. Those directories will contain multiple input and output files. Input files will be in intel hex format that represents binary file. Binary files can be converted to ihex representation with intelhex library and also objcopy linux utility. This is due to we don't want to store potentially malicious binary files on git.

This framework loads ihex representation using ihex library, passes it as an input into scanner and imports dummy rule that will be used just for files to be parsed for given module. Resulting protobuf is compared with expected text representation of protobuf structure - goldenfile is used to mitigate problems if something changes in protobuf structure and is outside our scope.

Adding a test will require just to add input and output files for given module.

This PR also adds small bugfix for macho module, where trailing \0 were not deleted in string representations in resulting protobuf structure.

@TommYDeeee TommYDeeee changed the title Test framework feat: test framework Oct 3, 2023
@TommYDeeee TommYDeeee marked this pull request as ready for review October 4, 2023 13:26
@plusvic plusvic enabled auto-merge (squash) October 4, 2023 18:22
@plusvic plusvic disabled auto-merge October 4, 2023 18:22
@plusvic plusvic merged commit ac45e5f into VirusTotal:main Oct 4, 2023
23 checks passed
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.

2 participants