-
Notifications
You must be signed in to change notification settings - Fork 565
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
New feature: Instruction #767
Comments
I would love to see this implemented. I'd prefer the subscope route as it would allow user's to easily specify environment specifics like the architecture. - instruction:
- arch: i386
- mnemonic: cmp
- operand1: eax
- operand2: ecx |
This does sound useful. I think this will negatively affect performance; however, this is not a good reason to reduce the expressivity of capa. It just lends further support to #602 to investigate better matching algorithms. |
the grap tool has a mini-language for declaring patterns of instructions like this. if it makes sense we could try to reuse terms from that project. note, i'm not aware of a large corpus of grap rules, so there's probably not a huge overlap/reuse argument to be made here. |
can we build out some examples of rules we'd want this feature/scope for? lets list them in this thread. why? i'm having a little trouble thinking about which features we need/don't need. e.g., do we need to name the registers? can we get by with the existing features (mnemonic, number, offset, arch)? |
Just some examples from existing rules where this would be helpful.
We should think of additional useful feature (combinations) we may not be able to express currently with our rules. Initially, I like the idea of using the existing features. |
piggy back on syntax discussion in #921 |
Summary
Often we want to check for specific instructions and use the basic block scope for this.
Example from
check for software breakpoints
I'm not sure if we need complete flexibility, but a way to provide variable operand values would be neat.
Examples:
Key
Instruction
fields:Or as a "subscope"?
We could then continue to support the
mnemonic
feature as an alias for the newinstruction
feature.Motivation
An instruction scope would allow for more expressive and concise rules.
Downsides
More complexity for extractors and potential performance hits.
The text was updated successfully, but these errors were encountered: