Giter Site home page Giter Site logo

fwtools's Introduction

Firmware Tools

Detects and extracts ROM regions for a variety of ROM protocols:

  • IFD
  • ME
  • FIT
  • UEFI
  • FMAP
  • CBFS

Protocol TODO:

  • ME/MFS
  • Boot Guard Structures

Feature TODO:

  • Artifact Tree -> ROM file (unextract)

  • Artifact Tree -> Protocol-Specific Config

Infer a basic build structure / system and allow modifications to contents in each protocol, i.e. IFD should be represented as a JSON struct not a RAW region. Always fallback to RAW handling for unkonwn protocol regions.

  • Dependency Management Graph

Handle DAG of locations: bootblock -> CBFS header / FIT, FIT -> microcode, etc.

Install / Run

go get -u github.com/flammit/fwtools
export PATH=$PATH:$(go env GOPATH)/bin
fwcli extract firmware.bin output/

Output

summary.json contains a hierarchy of ROM regions and the output directory will contain directories containing each leaf region.

Non-empty regions of the ROM that do not belong to the supported region formats are saved as "unknown_0xNNNNNNNN" to allow for byte-for-byte reconstructions.

{
  "Type": "container",
  "Name": "full",
  "Offset": 0,
  "Size": 16777216,
  "Children": [
    {
      "Type": "raw",
      "Name": "ifd",
      "Offset": 0,
      "Size": 4096
    },
    {
      "Type": "container",
      "Name": "me",
      "Offset": 4096,
      "Size": 2093056,
      "Children": [
        {
          "Type": "raw",
          "Name": "me/FPT",
          "Offset": 4096,
          "Size": 3584
        },
        {
          "Type": "raw",
          "Name": "me/FTPR",
          "Offset": 8192,
          "Size": 684032
        },
        {
          "Type": "raw",
          "Name": "me/MFS",
          "Offset": 692224,
          "Size": 409600
        }
      ]
    },
    {
      "Type": "container",
      "Name": "fmap",
      "Offset": 2097152,
      "Size": 14680064,
      "Children": [
        {
          "Type": "container",
          "Name": "fmap/BIOS",
          "Offset": 2097152,
          "Size": 14680064,
          "Children": [
            {
              "Type": "raw",
              "Name": "fmap/FMAP",
              "Offset": 2097152,
              "Size": 512
            },
            {
              "Type": "raw",
              "Name": "fmap/RW_MRC_CACHE",
              "Offset": 2162688,
              "Size": 65536
            },
            {
              "Type": "container",
              "Name": "fmap/COREBOOT",
              "Offset": 2228224,
              "Size": 14548992,
              "Children": [
                {
                  "Type": "raw",
                  "Name": "fmap/COREBOOT/cbfs master header/header",
                  "Offset": 2228224,
                  "Size": 56
                },
                {
                  "Type": "raw",
                  "Name": "fmap/COREBOOT/cbfs master header/data",
                  "Offset": 2228280,
                  "Size": 72
                },
                ...
              ]
            }
          ]
        }
      ]
    }
  ]
}

fwtools's People

Contributors

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