All Projects → axt → Cfg Explorer

axt / Cfg Explorer

Licence: bsd-2-clause
CFG explorer for binaries

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Cfg Explorer

Replica
Ghidra Analysis Enhancer 🐉
Stars: ✭ 194 (+487.88%)
Mutual labels:  analysis, binary
Qiling
Qiling Advanced Binary Emulation Framework
Stars: ✭ 2,816 (+8433.33%)
Mutual labels:  analysis, binary
Angr Utils
Handy utilities for the angr binary analysis framework, most notably CFG visualization
Stars: ✭ 169 (+412.12%)
Mutual labels:  analysis, binary
Binee
Binee: binary emulation environment
Stars: ✭ 408 (+1136.36%)
Mutual labels:  analysis, binary
xbpch
xarray interface for bpch files
Stars: ✭ 17 (-48.48%)
Mutual labels:  analysis, binary
Reverse Engineering Tutorials
Some Reverse Engineering Tutorials for Beginners
Stars: ✭ 217 (+557.58%)
Mutual labels:  analysis, binary
Gtirb
Intermediate Representation for Binary analysis and transformation
Stars: ✭ 190 (+475.76%)
Mutual labels:  analysis, binary
vulnscan
A static binary vulnerability scanner
Stars: ✭ 47 (+42.42%)
Mutual labels:  analysis, binary
Ddisasm
A fast and accurate disassembler
Stars: ✭ 325 (+884.85%)
Mutual labels:  analysis, binary
Angr
A powerful and user-friendly binary analysis platform!
Stars: ✭ 5,542 (+16693.94%)
Mutual labels:  analysis, binary
Pysoar
Gliding competition analysis
Stars: ✭ 8 (-75.76%)
Mutual labels:  analysis
Android Classyshark
Android and Java bytecode viewer
Stars: ✭ 6,930 (+20900%)
Mutual labels:  analysis
Dotnet Assembly Grapher
Reverse engineering and software quality assurance tool for .NET assemblies
Stars: ✭ 21 (-36.36%)
Mutual labels:  analysis
Camoco
Camoco is a fully-fledged software package for building co-expression networks and analyzing the overlap interactions among genes.
Stars: ✭ 29 (-12.12%)
Mutual labels:  analysis
Php Bitmap
Bitmap representation with bitwise operations
Stars: ✭ 7 (-78.79%)
Mutual labels:  binary
Third Party Web
Data on third party entities and their impact on the web.
Stars: ✭ 911 (+2660.61%)
Mutual labels:  analysis
Pyintelowl
Robust Python SDK and Command Line Client for interacting with IntelOwl's API.
Stars: ✭ 26 (-21.21%)
Mutual labels:  analysis
Frosty
serialize native Nim types to strings, streams, or sockets ⛄
Stars: ✭ 25 (-24.24%)
Mutual labels:  binary
Revelt
Analysis of a project using React and Svelte technologies
Stars: ✭ 20 (-39.39%)
Mutual labels:  analysis
Hamming
Hamming distance and bit counting primitives in Go (golang)
Stars: ✭ 30 (-9.09%)
Mutual labels:  binary

cfg-explorer

license platform pyversion version download

CFG explorer is a simple utility which can be used to explore control flow graphs of binary programs.

It uses angr binary analysis framework, for CFG recovery, and renders the CFG to SVGs, with the help of bingraphvis.

The generated SVGs can be navigated by clicking on the function or the callsite nodes.

Besides, now it can also export multiple formats of static CFG files to your local machine, including:

  • .canon
  • .cmap
  • .cmapx
  • .cmapx_np
  • .dot
  • .fig
  • .gd
  • .gd2
  • .gif
  • .imap
  • .imap_np
  • .ismap
  • .jpe
  • .jpeg
  • .jpg
  • .mp
  • .pdf
  • .plain
  • .plain-ext
  • .png
  • .ps
  • .ps2
  • .svg
  • .svgz
  • .vml
  • .vmlz
  • .vrml
  • .wbmp
  • .xdot
  • .raw

CFGs starting from multiple start addresses or for multiple functions can also be automatically exported to multiple files at once with different suffixes in their filenames.

Note

This project is in its very early stage!

Install

$ pip install cfg-explorer

Usage

CLI

After installation, cfg_explorer can be easily called in command lines as:

$ cfgexplorer --help

usage: cfgexplorer [-h] [-v] [-s [STARTS [STARTS ...]]] [-P PORT] [-p] [-l]
                   [-o OUTFILE]
                   binary

positional arguments:
  binary                the binary to explore

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         increase output verbosity
  -s [STARTS [STARTS ...]], --start [STARTS [STARTS ...]]
                        start addresses
  -P PORT, --port PORT  server port
  -p, --pie             is position independent
  -l, --launch          launch browser
  -o OUTFILE, --output OUTFILE
                        output file path, only support for ['canon', 'cmap',
                        'cmapx', 'cmapx_np', 'dot', 'fig', 'gd', 'gd2', 'gif',
                        'imap', 'imap_np', 'ismap', 'jpe', 'jpeg', 'jpg',
                        'mp', 'pdf', 'plain', 'plain-ext', 'png', 'ps', 'ps2',
                        'svg', 'svgz', 'vml', 'vmlz', 'vrml', 'wbmp', 'xdot',
                        'raw']

For example:

$ cfgexplorer /your/binary -l

The command above will build the CFG, spawn a web server, and open it in your browser.

Module

You can also utilize cfg_explore function in it as other common modules in Python:

from cfgexplorer import cfg_explore

cfg_explore(binary=r'/your/binary', launch=True)

The codes will do what the cfgexplorer does in the previous example. If you want to shut down the app, you need to interrupt your Python interpreter as well. So the function is more often used by specifying output to generate output files in a Python program like:

cfg_explore(binary=r'/your/binary', output='./cfg_output.svg')

The code above exports CFG as svg format to file path ./cfg_output.svg

The function is defined as follow:

cfg_explore(binary, starts=[], port=5000, pie=False, launch=False, output='')
  • binary(str): the path of the binary file to analysis
  • starts(list): the start points (address) in CFGs, if none, the CFG will start with main func entry address
  • port(int): server port to host the web app. make sure the port is idle now.
  • pie(bool): whether the analysis position-independent
  • launch(bool): Whether launch a browser to view CFG immediately
  • output(str): the output file path. only support certain formats. If you leave it an empty string, no output will be generated and the interactive web app will start. Otherwise, no app will be launched and the CFGs will be exported to specified files.

Detailed usages of this function are available in examples/demo.ipynb.

Annotation Style

Edges:

Edge class Color Style
Conditional True Green
Conditional False Red
Unconditional Blue
Next Blue Dashed
Call Black
Return Gray
Fake Return Gray Dotted
Unknown Orange

Limitations

  • works on Linux only
  • at the moment, the result is simply an SVG file, i plan to add a small frontend around it

Screenshots

Function graph mode (/function/0x123456)

fgraph

CFG mode (/cfg/0x123456)

cfg

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].