Giter VIP home page Giter VIP logo

Comments (3)

williballenthin avatar williballenthin commented on June 3, 2024

plan:

{
  $rule-name: {
    "meta": {...copy of rule.meta...},
    "matches": {
      0x401000: { ...TODO: details of logic match...},
      ...
    }
  },
  ...
}

from capa.

williballenthin avatar williballenthin commented on June 3, 2024

d0345fc

example output:

{
    "calculate module 256 via x86 assembly": {...},
    "read file via mapping": {
        "matches": {
            "4198560": {
                "children": [
                    {
                        "children": [],
                        "locations": [
                            4198630
                        ],
                        "node": {
                            "feature": {
                                "api": "kernel32.MapViewOfFile",
                                "type": "api"
                            },
                            "type": "feature"
                        },
                        "success": true
                    },
                    {
                        "children": [],
                        "locations": [
                            4198599,
                            4198661
                        ],
                        "node": {
                            "feature": {
                                "number": 4,
                                "type": "number"
                            },
                            "type": "feature"
                        },
                        "success": true
                    },
                    {
                        "children": [
                            {
                                "children": [],
                                "locations": [
                                    4198843
                                ],
                                "node": {
                                    "feature": {
                                        "api": "kernel32.UnmapViewOfFile",
                                        "type": "api"
                                    },
                                    "type": "feature"
                                },
                                "success": true
                            },
                            {
                                "children": [
                                    {
                                        "children": [],
                                        "node": {
                                            "feature": {
                                                "match": "get file size",
                                                "type": "match"
                                            },
                                            "type": "feature"
                                        },
                                        "success": false
                                    },
                                    {
                                        "children": [],
                                        "locations": [
                                            4198608
                                        ],
                                        "node": {
                                            "feature": {
                                                "api": "kernel32.CreateFileMapping",
                                                "type": "api"
                                            },
                                            "type": "feature"
                                        },
                                        "success": true
                                    },
                                    {
                                        "children": [],
                                        "locations": [
                                            4198803
                                        ],
                                        "node": {
                                            "feature": {
                                                "number": 2,
                                                "type": "number"
                                            },
                                            "type": "feature"
                                        },
                                        "success": true
                                    }
                                ],
                                "node": {
                                    "statement": {
                                        "type": "and"
                                    },
                                    "type": "statement"
                                },
                                "success": false
                            }
                        ],
                        "node": {
                            "statement": {
                                "type": "optional"
                            },
                            "type": "statement"
                        },
                        "success": true
                    }
                ],
                "node": {
                    "statement": {
                        "type": "and"
                    },
                    "type": "statement"
                },
                "success": true
            },
            "4199488": {
                "children": [
                    {
                        "children": [],
                        "locations": [
                            4199636,
                            4199717
                        ],
                        "node": {
                            "feature": {
                                "api": "kernel32.MapViewOfFile",
                                "type": "api"
                            },
                            "type": "feature"
                        },
                        "success": true
                    },
                    {
                        "children": [],
                        "locations": [
                            4199633,
                            4199687,
                            4199903,
                            4200316,
                            4200346,
                            4200382
                        ],
                        "node": {
                            "feature": {
                                "number": 4,
                                "type": "number"
                            },
                            "type": "feature"
                        },
                        "success": true
                    },
                    {
                        "children": [
                            {
                                "children": [],
                                "node": {
                                    "feature": {
                                        "api": "kernel32.UnmapViewOfFile",
                                        "type": "api"
                                    },
                                    "type": "feature"
                                },
                                "success": false
                            },
                            {
                                "children": [
                                    {
                                        "children": [],
                                        "node": {
                                            "feature": {
                                                "match": "get file size",
                                                "type": "match"
                                            },
                                            "type": "feature"
                                        },
                                        "success": false
                                    },
                                    {
                                        "children": [],
                                        "locations": [
                                            4199619,
                                            4199692
                                        ],
                                        "node": {
                                            "feature": {
                                                "api": "kernel32.CreateFileMapping",
                                                "type": "api"
                                            },
                                            "type": "feature"
                                        },
                                        "success": true
                                    },
                                    {
                                        "children": [],
                                        "locations": [
                                            4199495,
                                            4199546,
                                            4199549,
                                            4199610,
                                            4199869,
                                            4200156,
                                            4200264,
                                            4200313,
                                            4200335
                                        ],
                                        "node": {
                                            "feature": {
                                                "number": 2,
                                                "type": "number"
                                            },
                                            "type": "feature"
                                        },
                                        "success": true
                                    }
                                ],
                                "node": {
                                    "statement": {
                                        "type": "and"
                                    },
                                    "type": "statement"
                                },
                                "success": false
                            }
                        ],
                        "node": {
                            "statement": {
                                "type": "optional"
                            },
                            "type": "statement"
                        },
                        "success": true
                    }
                ],
                "node": {
                    "statement": {
                        "type": "and"
                    },
                    "type": "statement"
                },
                "success": true
            }
        },
        "meta": {
            "author": "[email protected]",
            "capa/nursery": true,
            "capa/path": "/home/user/code/capa-pub/capa/../rules/nursery/read-file-via-mapping.yml",
            "name": "read file via mapping",
            "namespace": "host-interaction/file-system/read",
            "scope": "function"
        }
    }
}

from capa.

williballenthin avatar williballenthin commented on June 3, 2024

added in #34

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.