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.3.tar.gz (174.9 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.3-py3-none-any.whl (227.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smallworld_re-1.0.3.tar.gz
  • Upload date:
  • Size: 174.9 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.3.tar.gz
Algorithm Hash digest
SHA256 62113d56222e904b65d8aa4f334018332291434a5cd00310c856fbe38ac82b4e
MD5 7a2e483cc4885344474c9c0572b80659
BLAKE2b-256 602852030276a5df104a0c60173a8826155c42e02e7797ecf0816153689047f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smallworld_re-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 227.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f33cb83b49d232c709945e75d954dd57b477e930ef0db3dec44d5c08207fd20e
MD5 abf92c3f37a382c3e3819433878f2fd6
BLAKE2b-256 cf0cc581b62f311b880f247f7542cc286b2fc312c850aba45ea874d91abd6575

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