Giter Site home page Giter Site logo

yara-json's People

Contributors

jeromehadorn avatar

Stargazers

 avatar

Watchers

 avatar

yara-json's Issues

key_exists doesnt work for keys which contain a dot when trying to check for a nested key

Hi :)

First of all, very big thanks for this! This already helps tons!

After trying it, I wanted to work with a json like this:

{
  "body": "Hello Alice!",
  "format": "org.matrix.custom.html",
  "formatted_body": "Hello \u003ca href='https://matrix.to/#/@alice:example.org'\u003eAlice\u003c/a\u003e!",
  "m.mentions": {
    "user_ids": [
      "@alice:example.org",
      "@alice:example.org",
      "@alice:example.org",
      "@alice:example.org"
    ]
  },
  "msgtype": "m.text"
}

The specification of matrix.org which defines this json uses lots of java like namespacing in their keys. However, when I tried to write a yara condition it can't match since there are dots in the keys and the module is using that to split it:

For example: json.key_exists("m.mentions.user_ids") won't work since it searches for user_ids in mentions in m.

The code at

// Split key into possible subcomponents - separated by '.'
probably needs some kind of escape sequence support. Would it be possible to add that? I am sadly not good at all in C hence I am asking rather than making a PR :)

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.