Skip to main content

Code Hierarchy Exploration Net (chen)

Project description

chen

Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.

Requirements

  • Java 17 - 20
  • Python > 3.8.1
  • Node.js > 16 (To run atom)
  • Minimum 16GB RAM

Installation

# Install atom
sudo npm install -g @appthreat/atom

# Install chen from pypi
pip install appthreat-chen

To download the chen distribution including the science pack.

chen --download

Once the download finishes, the command would display the download location along with the environment variables that needs to be set to invoke chennai console. Example output below:

[21:53:36] INFO     To run chennai console, add the following environment variables to your .zshrc or .bashrc:
export JAVA_OPTS="-Xmx16G"
export SCALAPY_PYTHON_LIBRARY=python3.10
export CHEN_HOME=/home/user/.local/share/chen
export PATH=$PATH:/home/user/.local/share/chen/platform:/home/user/.local/share/chen/platform/bin:

Running the console

Type chennai to launch the console.

chennai
 _                          _   _   _   _  __
/  |_   _  ._  ._   _. o   |_  / \ / \ / \  / |_|_
\_ | | (/_ | | | | (_| |   |_) \_/ \_/ \_/ /    |


Version: 0.0.7
Type `help` to begin


chennai>

Sample commmands

Help command

chennai> help
val res0: Helper = Welcome to the interactive help system. Below you find a table of all available
top-level commands. To get more detailed help on a specific command, just type

`help.<command>`.

Try `help.importCode` to begin with.
_______________________________________________________________________________________________________________________________________________________________
command          | description                                                               | example                                                       |
==============================================================================================================================================================|
annotations      | List annotations                                                          | annotations                                                   |
close            | Close project by name                                                     | close(projectName)                                            |
cpg              | CPG of the active project                                                 | cpg.method.l                                                  |
declarations     | List declarations                                                         | declarations                                                  |
delete           | Close and remove project from disk                                        | delete(projectName)                                           |
distance         | Show graph edit distance from the source method to the comparison methods | distance(source method iterator, comparison method iterators) |
exit             | Exit the REPL                                                             |                                                               |
files            | List files                                                                | files                                                         |
importAtom       | Create new project from existing atom                                     | importAtom("app.atom")                                        |
importCode       | Create new project from code                                              | importCode("example.jar")                                     |
importCpg        | Create new project from existing CPG                                      | importCpg("app.atom")                                         |
imports          | List imports                                                              | imports                                                       |
methods          | List methods                                                              | methods('Methods', includeCalls=true, tree=true)              |
open             | Open project by name                                                      | open("projectName")                                           |
openForInputPath | Open project for input path                                               |                                                               |
project          | Currently active project                                                  | project                                                       |
run              | Run analyzer on active CPG                                                | run.securityprofile                                           |
save             | Write all changes to disk                                                 | save                                                          |
sensitive        | List sensitive literals                                                   | sensitive                                                     |
showSimilar      | Show methods similar to the given method                                  | showSimilar(method full name)                                 |
summary          | Display summary information                                               | summary                                                       |
switchWorkspace  | Close current workspace and open a different one                          |                                                               |
workspace        | Access to the workspace directory                                         | workspace                                                     |

Refer to the documentation site to learn more about the commands.

Languages supported

  • C/C++ (Requires Java 17 or above)
  • H (C/C++ Header files alone)
  • Java (Requires compilation)
  • Jar
  • Android APK (Requires Android SDK. Set the environment variable ANDROID_HOME)
  • JavaScript
  • TypeScript
  • Python

Origin of chen

chen is a fork of the popular joern project. We deviate from the joern project in the following ways:

  • Make code analysis accessible by adding first-class integration with Python and frameworks such as NetworkX and PyTorch
  • Enable broader hierarchical analysis (Application + Dependency + Container + OS layer)
  • By creating a more welcoming community more appropriate for beginner users with great support

License

Apache-2.0

Enterprise support

Enterprise support including custom language development and integration services are available via AppThreat Ltd. Free community support is also available via discord.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

appthreat_chen-0.0.8.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

appthreat_chen-0.0.8-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file appthreat_chen-0.0.8.tar.gz.

File metadata

  • Download URL: appthreat_chen-0.0.8.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1011-azure

File hashes

Hashes for appthreat_chen-0.0.8.tar.gz
Algorithm Hash digest
SHA256 4d1460512fb5e865a2868053119488a4432df461b90cbbf224f2d8456b299263
MD5 ffca3ffecf45072470b2b0bb17ae6c53
BLAKE2b-256 71c5279c779072c6ca51d22bd9484b8d5df47e7361dfe76277af2edee7ea0709

See more details on using hashes here.

File details

Details for the file appthreat_chen-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: appthreat_chen-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1011-azure

File hashes

Hashes for appthreat_chen-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2fbb8535962f483f5b4448fad1216ce1a24434bca28e33e90184329e78c74a5e
MD5 14a81dd8bc779b329dea7771f35c774d
BLAKE2b-256 d7f8519343bc157ad0301f03d3d82f3719ff6a0b18a90cb144ad6bff4a517518

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page