Code Monkey home page Code Monkey logo

alainiamburg / sniffrom Goto Github PK

View Code? Open in Web Editor NEW
275.0 20.0 34.0 20.02 MB

A tool for passive data capture and reconnaissance of serial flash chips. It is used in conjunction with a Saleae logic analyzer to reconstruct flash memory contents and extract contextual information about device operations.

License: GNU General Public License v3.0

Python 100.00%
reverse-engineering hardware-hacking logic-analyzer flash-memory python i2c spi saleae-logic saleae sniffer

sniffrom's Introduction

NOTE: Saleae Logic version 2 breaks the built-in SPI analyzer export feature, meaning sniffROM currently only works with data exported from Logic version 1.x

As of 12/6/2023 it is unknown when this will be fixed.

sniffROM

A tool for passive data capture and reconnaissance of serial flash chips. It is used with a Saleae logic analyzer to reconstruct flash memory contents and extract contextual information about device operations.

  • Supports SPI and I²C flash chips.
  • Preserves the actual memory addresses of captured data.
  • Generates a visual map of the reconstructed binary image.
  • Generates a timing plot of reads/writes to memory addresses.
  • Recognizes 100+ (and currently parses 12) SPI flash commands from the following manufacturers:
    • Atmel
    • Eon
    • Fidelix
    • GigaDevice
    • Macronix
    • Numonyx
    • Spansion
    • SST
    • Winbond

See the Wiki for documentation

usage: sniffROM_new.py [-h] [--addrlen [{2,3,4}]] [--endian [{msb,lsb}]]
                       [--filter [{r,w}]] [-o [O]] [--summary] [--data-map]
                       [--timing-plot] [-v]
                       input_file

sniffROM - Reconstructs flash memory contents and extracts other data from
passively sniffed commands in a Saleae logic analyzer capture file. Currently
supports SPI and I2C flash chips.

positional arguments:
  input_file            Saleae Logic SPI or I2C Analyzer Export File (.csv)

optional arguments:
  -h, --help            show this help message and exit
  --addrlen [{2,3,4}]   set length of SPI memory address in bytes (default: 3)
  --endian [{msb,lsb}]  set endianness of SPI memory bytes (default: msb)
  --filter [{r,w}]      analyze only Read or Write commands (default: both)
  -o [O]                flash image output file name (default: output.bin)
  --summary             print summary of sniffed commands and metadata
  --data-map            show visual data map
  --timing-plot         show timing analysis
  -v                    increase verbosity (up to -vvv)

sniffrom's People

Contributors

alainiamburg avatar alexhude avatar ampotos avatar

Stargazers

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

sniffrom's Issues

ZeroDivisionError: float division by zero

Python 2.7.18
Ubuntu 21.10.
SPI format: Time [s],Packet ID,MOSI,MISO
Logic 2 version 2.3.55
BIOS: MX25L6473F, 3V, 64Mb, v1.3

$python sniffROM.py test.csv -o spiflash_out.bin --summary
Parsing SPI data...

Traceback (most recent call last):
File "sniffROM.py", line 666, in
highest_byte+1, args.o, bytes_sniffed, ((bytes_sniffed / float(highest_byte)) * 100.0), bytes_sniffed_written)
ZeroDivisionError: float division by zero

Features TODO

  • Warning when a memory address is accessed more than once
  • Variable address lengths
  • Filter by command
  • Parse more commands
  • Support I2C flash chips
  • Auto lookup JEDEC ID to Mfg/Device
  • Parse Status Registers and Security Registers
  • Add visual output of rebuilt image vs captured data
  • Support additional export file formats from other logic analyzers
  • Support parsing traffic from multiple I2C slaves in a single capture file
  • Add new colors to the binary graph: for addresses with multiple read or write accesses
  • Derive clock frequency from packet timestamps

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.