introduces bap dependencies
command
#1294
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The command outputs program dependencies such as libraries and symbols. The information is collected recursively with various output options, including dependency graph, YAML, JSON, and SEXP.
The information includes the list of imported libraries as well as sets of imported and exported symbols. The information could be collected recursively when the
--recursive
option is specified. In a recursive mode, the list of paths where to search for libraries could be specified with the--library-path
option that accepts a list of paths. It is also possible to use the host ldconfig cache (or specify custom library config) via theldconfig
parameter. Information about each individual dependency is cached, so consecutive calls to bap will reuse the available information and terminate quickly.EXAMPLES
The default format is YAML, which suits best for human consumption. Additionally it possible to use JSON or SEXP, as well as Graphviz DOT format. The tool is designed to be used together with YAML and JSON query tools, such as yq and jq, e.g.,
Getting the list of imported libraries
Running recursively
Using
ldconfig
for getting the local (host) library cacheRunning in a rooted environment
Note, in the example above, all paths will be prefixed with the specified
root
,e.g.,
/bin/ls
will be taken from/mnt/image/bin/ls
and all paths from thecache (or paths stored in the binary itself, like rpaths or MachO full paths to libraries) will be prefixed as well with
/mnt/image
effectively creating a chrooted environment.Building the dependency graph
Getting the transitive closure of the dependency graph
Counting the number of imported symbols
Outputting all imported symbols