Git Product home page Git Product logo

tsmok's Introduction


TSMOK (pronounce [(t)smok]) is a tool to emulate firmware for testing and research purpose. TSMOK is based on Unicorn engine.


  • Modular structure.
  • Supports OPTEE OS, OPTEE TA, Trusty OS, and Pigweed ARM ELF binaries.
  • Fake ATF, OPTEE, and HW components implementations.
  • Python OPTEE instance has a simple implementation of RPMB storage.
  • FF-A support
  • MMU support
  • TSMOK tracks:
    • execution flow (instruction, function, and syscalls)
    • memory access
    • syscall access
    • Mem/Reg control and examination
  • Coverage support (gcov, lcov) base on disasm and ELF DWARF
  • AFL support for fuzzing(AFL has instrumentation for Unicorn engine).
  • OPTEE TA fuzzing support
  • Extensibility: easy to add new fake HW component support or new tracking/analyzing features.

Area of usage

  • Testing: tests(unit/functional) with about any complexity can be written.
  • Security research
  • Fuzzing


Install custom UnicornAFL

git clone -b tee-dev

cd unicornafl/bindings/python

sudo python3 install

Install dependencies

pip3 install -r requirements.txt

Install TSMOK

python3 install


AFLPlusPlus is requeired for fuzzing. AFLPlusPlus installation instruction can be found on its page.


Pigweed binary run

python3 -m tsmok.example.pw_app -b <path/to/binary> -v

Trusty OS binary run

python3 -m tsmok.examples.trusty.tee_app -f images/examp les/trusty/trusty-os.elf -v

OPTEE TA binary run

python -m tsmok.examples.optee.ta_arm64_app -t images/examples/optee/8aaaf200-2450-11e4-abe2-0002a5d5c51b.elf -v

OPTEE TA binary fuzzing

afl-fuzz -U -m none -i images/examples/optee/ta-fuzz-samples/ -o <path/to/result> -M fuzzer01 -- python3 -m tsmok.examples.optee.ta_arm64_fuzz_app images/examples/optee/8aaaf200-2450-11e4-abe2-0002a5d5c51b-with-crash.elf @@

Run local unittests

python3 -m tests.test_rpmb_simple


Dmitry Yatsushkevich [email protected]


This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.

tsmok's People


dmitryya avatar


 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar


 avatar  avatar



tsmok's Issues

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

Artifacts Found

  • images/examples/optee/8aaaf200-2450-11e4-abe2-0002a5d5c51b-with-crash.elf
  • images/examples/optee/8aaaf200-2450-11e4-abe2-0002a5d5c51b.elf
  • images/examples/trusty/trusty-os.elf

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.

Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See for more information. For questions specific to the repository, please contact the owner or maintainer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.