Git Product home page Git Product logo

s9-sboot-emu's Introduction

S9 S-Boot Emulator

Intro

This is a small device emulator tailored towards running Samsung’s S-BOOT and inspired by a QEMU version described here.

I hacked this together because static reversing felt time-consuming and difficult to correlate with the actual device behavior.

The code simulates enough of the devices to reach download mode (ODIN), and then processes odin commands received over stdio.

Some other interesting prior work is described here and here.

Dependencies

  • libcapstone
  • libunicorn

Building

The included Makefile should work on OpenBSD. Untested on linux or other BSDs.

make emulate

Running

The emulator assumes the base address of the second stage is 0x8f000000. You’ll need to obtain the firmware for the S9 and to extract the second-stage bootloader. The posts above describe well how to do this. After BL2 is extraced, you can run:

./emulate <sboot_bl2.bin>

You should see the emulated UART logging to stdout.

Notes

Based on a comparison of the emulator and device logs, there are a few significant deviations. Most notable is UFS: it is poorly implemented here and causes the emulator to pause as it encounters errors. Normally this would cause the device to drop into upload mode, but the emulator unprincipally redirects flow into download mode.

Even with these flaws, it can still be useful to observe the emulated behavior, changes in the heap state, and for fuzzing download mode.

s9-sboot-emu's People

Contributors

alex-segura avatar

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.