Coder Social home page Coder Social logo

sbaresearch / mbn-mcfg-tools Goto Github PK

View Code? Open in Web Editor NEW
20.0 6.0 2.0 122.6 MB

Tools for parsing/extracting/packing Qualcomm mbn MCFG (Modem Configuration) files

License: GNU General Public License v3.0

Nix 0.02% Python 99.98%
cellular-networks mbn qualcomm secure-boot volte mcfg

mbn-mcfg-tools's Introduction

MBN MCFG Tools

DISCLAIMER: This tool is still under development and started as a hastily written script because we needed something to parse MBN files, so please do not expect a polished tool.

This project provides a python library/application for parsing Qualcomm MBN configuration files and the contained configuration items.

Warning

The format assumed by the parsers results from reverse engineering and is partially copied from similar projects (see Related Repos below). We do NOT know how accurate the format is and how much the format changes between differing versions of configuration files. This uncertainty of whether we got the format right is especially true for the parsers for individual configuration items which were auto generated from here and whose results are often inaccurate.

MBN MCFG Files

MBN files are ELF files loadable by Qualcomm modems used not only to load executables but also to load configuration. When used for modem configuration, these ELF files contain a Qualcomm-specific segment โ€” the MCFG segment likely standing for modem configuration โ€” containing the configuration and a secure boot header. However, the modems we tested with only checked the hashes in the secure boot header and ignored wrong/missing signatures for MBN MCFG files.

The MBN modem configuration file format (or what we assume it to be) can be found here.

Installation

To install the mbn-tool:

python3 -m venv <venvname>
source <venvname>/bin/activate
pip install .

Usage

Our package provides a CLI tool to pack/unpack MBN files.

Note

When modifying an extracted MBN file, please note that currently, when changing a value of type "bytes", changes to its "ascii" property are ignored. Furthermore, only changes to the file meta and the files in the files directory are packed into an MBN file when using our tool to repack a file.

To extract the file row_common.mbn into the directory row_common_extracted:

mbn-tool -e row_common.mbn row_common_extracted

To pack the extracted configuration file row_common_extracted into the MBN file row_common_packed.mbn:

mbn-tool -p row_common_packed.mbn row_common_extracted

To check the hashes in the secure boot header for validity:

mbn-tool -c row_common.mbn

To extract all MBN files inside a sample folder (e.g. bash):

folder="mbn/Google_MBN/20231105/20231105_Google_Pixel_5_mbn_0A_Snapdragon_765G_5G_SM7250/mcfg_sw"; for i in $(find "$folder" | grep ".mbn$"); do mbn-tool -e "${i}" "${i}_extracted"; done

Related Repositories

mbn-mcfg-tools's People

Contributors

ggegenhuber avatar holzsec avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  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.