function call arguments syntax #921
Replies: 11 comments 11 replies
-
extend the existing API feature to optionally expect a block that specifies arguments: - api: CreateFileA
- ...: "bad.exe" pros:
cons:
|
Beta Was this translation helpful? Give feedback.
-
Let users refer to arguments by their declared name, such as those displayed by MSDN: - api: CreateFileA
args:
- lpFileName: "bad.exe"
pros:
cons:
|
Beta Was this translation helpful? Give feedback.
-
Specify arguments in array-like manner - api: CreateFileA
args[0]: "bad.exe" |
Beta Was this translation helpful? Give feedback.
-
Introduce a new block for call scope, like: - call:
- name: CreateFileA
- args[0]: "bad.exe" this would enable logic around the function name, maybe like: - call:
- or:
- name: CreateFileA
- name: DeleteFile
- args[0]: "bad.exe" pro:
cons:
|
Beta Was this translation helpful? Give feedback.
-
Specify arguments by keywords - api: CreateFileA
- arg0: "bad.exe" |
Beta Was this translation helpful? Give feedback.
-
Enable rules to specify logic for the values of arguments, like: - api: CreateFileA
args:
- or:
- dwCreationDisposition: 2 = CREATE_ALWAYS
- dwCreationDisposition: 1 = CREATE_NEW pro:
con:
|
Beta Was this translation helpful? Give feedback.
-
Enable rules to specify regular expression for the string value of arguments, like: - api: CreateFileA
args:
- lpFileName: /.exe$/ pro:
con:
|
Beta Was this translation helpful? Give feedback.
-
Enable rules to specify a description related to argument features, like: - api: CreateFileA
args:
- lpFileName: "bad.exe"
description: the name of some malware pro:
con:
|
Beta Was this translation helpful? Give feedback.
-
Make the argument specification literally an array. - api: CreateFileA
args:
- *
- GENERIC_READ pro:
con:
|
Beta Was this translation helpful? Give feedback.
-
Consider making the top level node an - api: CreateFileA
lpFilePath: "bad.exe"
dwCreationDisposition: 1 = CREATE_NEW - call:
- and:
- api: CreateFileA
- lpFilePath: "bad.exe"
- dwCreationDisposition: 1 = CREATE_NEW pros:
cons:
|
Beta Was this translation helpful? Give feedback.
-
One concern with the specified arguments (args[] index or specific name) is the reliability of the analysis engines to recognize these. Should we maybe explore this first before betting on it to work in most cases? For the most rules we currently have, the specific argument offset is nice to have, but not needed, because we look for API + constant mostly there. I would favor the more detailed feature extraction and rule syntax, however, don't have much experience on how vivisect (or SMDA) perform here. |
Beta Was this translation helpful? Give feedback.
-
In #771 we describe a potential new rule feature that lets authors describe the parameters passed to functions. While the exact behavior is not yet specified, let's discuss here how rules should look that use this feature.
Some things to consider when proposing a syntax:
Beta Was this translation helpful? Give feedback.
All reactions