Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.