-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rework internal Scanner/Evaluator API #81
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is useful to setup the data of a module, as the get_dynamic_values method will now be called multiple times per scan.
Prepare for when it will be called multiple times.
ScanContext will be used when calling get_module_values, and will contain a byte slice, as it will be recreated for every memory region. EvalContext will be used when evaluating functions, and will contain the Memory object.
Split how modules are handled with a ScanData and a ModulesData. The first one needs to be built by scanning every region, and the second one contains the immutable data that is needed to evaluate rules.
Add a ScanContext different from the one used during evaluation. Additionally, internalize the parameters. This makes the ac_scan module no longer dependent on types from the evaluation phase.
This is not used in the evaluator module, so remove it.
Move this outside of the ScanData object.
This ends the simplification by removing a lot of converting code.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lots of changes that impact the internal API without any effect on the public API.
Those changes are made to prepare the scan of process memory.
The objects used between the scanner module and the evaluator module were kind of a mess.
This MR makes it cleaner, although not as clean as I would like. I think there is still
quite a room for improvement, but the new version at least will work relatively well
with the addition of another kind of "memory" to scan: a fragmented one, used to represent
the process memory.