-
-
Notifications
You must be signed in to change notification settings - Fork 336
Closed
Labels
enhancementNew feature or requestNew feature or request👑Sponsor👑Request from Sponsors!Request from Sponsors!
Description
⭐ Suggestion
I'd love to see the metadata allowing nested mappings, lists, etc., and not only strings.
💻 Use Cases
I use ast-grep to perform deobfuscation. As it's a more complex task than ast-grep can perform on its own, for most rules I define additional steps that are then handled by my scripts. I use metadata fields to keep those definitions close to the rule.
See for example: https://github.com/kam193/assemblyline-services/blob/main/ASTGrep/rules/extended/python/reverse-inline.yml
Currently, I use JSON strings that are later processed, e.g.:
...
metadata:
extended-obfuscation: yes
deobfuscate: |
{
"type": "fix-generate",
"steps": [
{"func": "reverse", "source": "DATA"},
{"func": "encode_list", "source": "DATA", "encoding": "int"},
{"func": "encode", "source": "DATA", "encoding": "bytes"},
{"func": "quote", "source": "DATA"}
]
}This works, but I have to manually write the JSON string, what is easy to make syntax issues and cannot be automatically formatted by IDE. It would be nice to be able to write the equivalent directly in YAML, e.g.:
...
metadata:
extended-obfuscation: yes
deobfuscate:
type: fix-generate
steps:
- func: reverse
source: DATA
- func: encode_list
source: DATA
encoding: int
- func: encode
source: DATA
encoding: bytes
- func: quote
source: DATAReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request👑Sponsor👑Request from Sponsors!Request from Sponsors!