Skip to content

dayanuyim/shdep

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Shdep

License

Shdep is an analysis tool to trace the shell script dependency.

Installation

  1. Prerequisite

    Shdep leverages shfmt/v2.0 to parse the script syntax tree. A copy can be found in tools folder. Put it in one of your path in $PATH.

  2. Build Gradle Task

     ./gradlew shdep
    

Run Shdep

  1. Security Concerns

    Some commands in scripts could be run for anlaysis. For security concerns, it is recommanded to run the tool in a docker container or a vitual machine.

  2. Execute JAR

     java -jar build/libs/shdep.jar sample/cramfs-root  # To unpack the sample file first.
    
  3. Output

    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/readbits
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/eraseflash
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/echo
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/cp
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/set_led -> /bin/statusled
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/set_led -> /var/run/statusled
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/set_led -> /bin/networkled
    /sbin/rc.init -> /sbin/rc.factorydefault -> /bin/set_led -> /bin/powerled
    ...
    ...
    ...
    

About

Shdep is an analysis tool to trace the shell script dependency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages