Open AryazE opened 1 year ago
Also
foo
Another enhancement related to this issue would be to track objects of a specific type (or subclass of a particular class).
Also, if decorators such as the example you provided are to be used, it could be even better to call any arbitrary function as a hook as long as it has the decorator. This can help in writing cleaner analyzers, as the dispatch per object type should be handled manually in the hook right now.
For example:
@pre_call(functions=['open', 'close']
def file_handling_pre_call(...)
@pre_call(functions=['startswith', 'endswith'])
def string_handling_pre_call(...)
Although this would be a major breaking change.
@nimamg Do you mean to have hooks for specific object types? Like a hook that gets called every time there is a function call on a string type?
For some analyses it would be nice to only instrument and analyze specific functions. This can either be done by
pre_call
andpost_call
, e.g.pre_call_open
or@except(functions=['read', 'write']) def post_call(...)