Skip to main content

An emulation stack tracking library

Project description

SmallWorld

commit-style-image code-style-image license-image

Easier harnessing of code for analysis!

Description

SmallWorld is an environment for streamlined harnessing of binary code for the purpose of dynamic analysis. If you have code that you got from somewhere and you'd like to run it and analyze those runs to understand what that code does or if it has bugs, then you should try SmallWorld!!

There are two fundamental tenets behind SmallWorld

  • Harnessing should be easier
  • Analysis can accelerate harnessing

The first of these tenets we hope to support with good software APIs. As a very simple example, consider the harnessing script stack.py, composed using SmallWorld, in which registers are initialized and a stack is arranged for running the code in stack.s. For a more sophisticated example of SmallWorld's harnessing facitilites, consider the code snippet struct.s, which assumes a stack and input pointers to a linked list with very specific format. The harnessing script in this case is more complicated, including specifying type information for the linked list element structures as well as use of a simple allocator abstraction provided by SmallWorld to instantiate nodes and link them together appropriately: struct.py.

The second tenet we address with purpose-built analyses which leverage a (possibly incomplete) harness script and that use techniques such as Micro Execution and Symbolic Execution to provide hints that can guide improving a harness.

This harness is the final output of SmallWorld and might be used in fuzzing or dynamic reverse engineering. Note that these are not applications which SmallWorld directly supports yet.

Installation

To install SmallWorld from this repo, run:

pip install .

Usage

Print basic usage and help:

smallworld --help

Contributing

Pull requests and issues more than welcome.

Development

To set up a development environment from this repo, install SmallWorld in editable mode with extras for development and testing. Use the include constraints to install frozen versions and ensure a consistent development environment.

pip install -e .[development] -c constraints.txt

Code Style

Pre-commit hooks are available for automatic code formatting, linting, and type checking via pre-commit. To enable them (after installing development dependencies), run:

pre-commit install

Documentation

To build the full SmallWorld documentation, after installing SmallWorld with development extras enabled, from the docs/ directory, run:

make html

Or other supported Sphinx output formats.

Testing

Prerequisites

Building the test binaries requires some dependencies which can be installed with:

apt-get install `cat tests/dependencies/apt.txt`

You can then build the tests by running:

make -C tests

Running Tests

Once the test files have been built and SmallWorld has been installed, you can run unit and integration tests:

python3 tests/unit.py
python3 tests/integration.py

Distribution

DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited.

This material is based upon work supported by the Under Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Under Secretary of Defense for Research and Engineering.

Delivered to the U.S. Government with Unlimited Rights, as defined in DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright notice, U.S. Government rights in this work are defined by DFARS 252.227-7013 or DFARS 252.227-7014 as detailed above. Use of this work other than as specifically authorized by the U.S. Government may violate any copyrights that exist in this work.

MIT License

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

smallworld_re-1.0.0.tar.gz (174.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smallworld_re-1.0.0-py3-none-any.whl (227.0 kB view details)

Uploaded Python 3

File details

Details for the file smallworld_re-1.0.0.tar.gz.

File metadata

  • Download URL: smallworld_re-1.0.0.tar.gz
  • Upload date:
  • Size: 174.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for smallworld_re-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ff0ab52e5ddb6e613d46dbf00ba96ae88faa427cc12a1531dcef3e1a372503d6
MD5 09fe3bf211667e55be9f3b7d8fe1f4a2
BLAKE2b-256 0e66fe2a6b91236eb045d99dbeb79946fe6d36374907e2666eac4c0ad55e2095

See more details on using hashes here.

File details

Details for the file smallworld_re-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: smallworld_re-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 227.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for smallworld_re-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cba98cd15b67cf751a76eaf3ef60061e3cda191bdc4ab2a232b1d339724d7dc
MD5 dc08147984ea9e765112f02f7ccaf8db
BLAKE2b-256 f757b169ea86d36b9401cff4298ef19d10788fb75bec6c02f56541ae551e8181

See more details on using hashes here.

Supported by

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