Giter VIP home page Giter VIP logo

Comments (8)

mr-tz avatar mr-tz commented on June 12, 2024 1

thanks Ana for investigating!

from capa.

Ana06 avatar Ana06 commented on June 12, 2024

documenting offline discussion:

Instead of adding a new program scope, we want to add function scope to file scope. This is clearer than having a program and a file scope.

from capa.

williballenthin avatar williballenthin commented on June 12, 2024

turns out that right now we include subscope (function, basic block) matches to the file scope. this means file rules are already able to reason about matches across the entire file. is this sufficient?

alternatively, do we want to bubble up all of the function scope features to the file scope? this would be pretty trivial to add, but is it necessary?

pro: maybe could write more expressive rules (though i think we should demonstrate such a rule or two first)
con: increased memory usage/decreased performance at file scope (probably millions of entries in the ctx index)

from capa.

williballenthin avatar williballenthin commented on June 12, 2024

in any case, we should add a test or two that demonstrates the existing file-scope matching.

from capa.

Ana06 avatar Ana06 commented on June 12, 2024

The implementation to to bubble up all of the function scope features to the file scope: https://github.com/fireeye/capa/compare/ana-program-scope

from capa.

Ana06 avatar Ana06 commented on June 12, 2024

@williballenthin

con: increased memory usage/decreased performance at file scope (probably millions of entries in the ctx index)

I think the number of false positives will increase as well. Maybe we should focus on implementing child functions instead of modifying the current file scope.

in any case, we should add a test or two that demonstrates the existing file-scope matching.

We have the test_subscope_rules() and test_match_across_scopes_file_function tests already. Do we need more tests? I am not sure what kind of test would be the best for this.

from capa.

williballenthin avatar williballenthin commented on June 12, 2024

I think the number of false positives will increase as well.

good point. even if we add this feature, we should figure out how to avoid the temptation of using file scope when really we just don't support something (like child functions).

i like the idea of returning our attention towards child functions.

from capa.

williballenthin avatar williballenthin commented on June 12, 2024

suggesting to implement test_match_across_scopes_file_function was exactly what i had in mind. seems like we already have this feature 🤦.

i suggest we close out this issue.

from capa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.