Coder Social home page Coder Social logo

mariusmue / shannonbaseband Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grant-h/shannonbaseband

0.0 1.0 0.0 19.21 MB

Scripts, plugins, and information for working with Samsung's Shannon baseband.

Python 25.08% C 39.03% Java 35.44% Shell 0.45%

shannonbaseband's Introduction

Samsung's Shannon Baseband Tool Repository Build and test ShannonLoader

Scripts, tools, and information to help reverse engineer Samsung's EXYNOS cellular baseband platform, codenamed Shannon. These tools were released for the talk "Emulating Samsung's Shannon Baseband for Security Testing" at Black Hat USA'2020, August 5th.

Index

A Ghidra extension for loading modem.bin binaries from nearly all known modems to date. All firmware images from https://github.com/grant-h/ShannonFirmware are loaded during CI tests for the loader to ensure its compatibility.

Ghidra post-loading Python scripts that help annotate Shannon modem images. This includes recovering debug strings and auto-naming functions. Use after loading with ShannonLoader.

Raw modem.bin extraction script into sub parts and others as they are developed.

Scripts and info to parse Back Trace Log (BTL) files. These are included during modem crashes / dumps or via the "CP RAM Logging" functionality. These are compressed log files from the actual running modem.

Information on firmware acquistion and some extracted data dumps.

Getting started with Shannon Firmware

Here's a quick tutorial to start reversing this firmware with GHIDRA.

  1. Download the firmware binary of choice. Make sure you have extracted the CP partition from official Samsung firmware and have further extracted the modem.bin file. Make sure to unlz4 the binary if it is compressed.
  2. Install the ShannonLoader at the splash screen using File » Install Extensions.... Target the ShannonLoader.zip release that is in the latest release tag
  3. Now start a new GHIDRA project and add a new file. Select the modem.bin file. You should see that this file's loader is automatically selected as "Samsung Shannon Modem Binary". If you do not see this, make sure that you have loaded the right file and installed the extension properly. Open GHIDRA debug console (bottom right on splash screen) to double check if there are any errors.
  4. Import the file, let the loader finish and once again make sure there were no errors during loading.
  5. Double click on the imported file to open CodeBrowser and hit no to auto-analysis for now.
  6. Now run the ShannonTraceEntry.py python script from Script Manager under the "Shannon" category. Make sure to either place scripts into your user home directory at ~/ghidra_scripts (Linux) or add the path to them in the manager. This script will identify all trace debugging information before analysis and avoid diassembling data.
  7. Go to Analysis » Auto analyze..., and uncheck the "Non-returning Functions - Discovered" analyzer as this causes broken recovery of the log_printf function, leading to broken disassembly throughout the binary. If you do not uncheck this, you will need to restart your import from scratch.
  8. Hit analyze and let GHIDRA churn away until it settles.
  9. Next optionally run the auto-renamer script, ShannonRename.py. This will help you navigate the binary, but remember that the names are heuristically determined, so quality may vary. Functions with the same guessed name will have a numeric prefix appended.
  10. Start reversing!

If you want a quick look around, we exported a GHIDRA project for a 2017 modem image.

Related Resources

shannonbaseband's People

Contributors

fabianfreyer avatar grant-h avatar mariusmue avatar

Watchers

 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.