make string length configurable and consistent across backends
should we make this configurable and consistent across backends?
Originally posted by @williballenthin in https://github.com/mandiant/capa/pull/1298#discussion_r1091841019
Hi, I would like to work on this issue.
Go for it :)
Hi, I would like to work on this issue.
Sure, feel welcomed to open a PR with the changes.
Sorry for the delay but I have made some initial changes. I have not tested it yet, but I will continue to update it.
Hi, I made the following changes in my PR and could use some advice:
- I added an additional argument in main.py (-l, –len) to allow users to configure the string length. (args.len)
- I changed the following extractors to take an additional argument (len) and pass it to their string extracting functions:
- capa/features/extractors/dnfile/extractor.py: DnfileFeatureExtractor
- capa/features/extractors/ida/extractor.py : IdaFeatureExtractor
- capa/features/extractors/pefile.py: PefileFeatureExtractor
- capa/features/extractors/viv/extractor.py: VivisectFeatureExtractor
- capa/features/extractors/elffile.py: ElfFeatureExtractor
- capa/features/extractors/dotnetfile.py: DotnetFileFeatureExtractor
- I changed the tests to use len=DEFAULT_STRING_LENGTH, which is defined in capa/features/extractors/strings.py as 4. Currently, I’m not sure how to allow users to pass in the len argument to IdaFeatureExtractor. I would appreciate any pointers, thanks!
I would like to work on this issue should i just open a PR ?
we have an existing PR open in #1421 that needs a bit more work. i'd suggest picking a different issue to focus on, if possible.
This issue can be tackled from scratch again. See comments/work in #1421 for reference.