Reverse Engineeringi2chardwarebuseepromlinuxsmbus

i2c-tools

Heterogeneous set of I2C tools for Linux including bus probing, chip dumping, register access, and EEPROM decoding. Provides userspace access to I2C devices and related protocols.

Description

i2c-tools is a package containing various utilities for interacting with I2C buses on Linux systems. It includes tools for detecting chips, dumping registers, reading and writing data, and decoding EEPROM contents from memory modules or specific hardware like Sony Vaio laptops. These tools are essential for hardware debugging, firmware analysis, and low-level device communication.

Use cases include probing I2C buses to identify connected devices, examining register contents for reverse engineering, and extracting configuration data from EEPROMs. The package also offers development libraries for custom I2C programming and Python bindings for SMBus access, enabling scripted interactions without kernel driver dependencies.

Related components like libi2c-dev and python3-smbus extend functionality for compiling user-space I2C applications and integrating with Python scripts on hosts with I2C kernel support.

How It Works

The tools operate through the Linux I2C /dev interface, leveraging kernel I2C support, device interfaces, and bus adapter drivers. Utilities like i2cdetect probe buses for chip addresses, i2cdump reads registers in modes such as byte, word, or block with optional SMBus PEC. i2cget/i2cset handle read/write operations on registers, while i2ctransfer sends custom message sequences. Decoding scripts parse hex dumps from EEPROMs, accounting for endianness issues in formats like hexdump -C. Userspace libraries bypass kernel drivers for direct adapter access.

Installation

bash
sudo apt install i2c-tools

Flags

-fforce access even if address is marked used (i2cdump, i2cget, i2cset)
-ydisable interactive mode (i2cdetect, i2cdump, i2cget, i2cset)
-aallow scanning full address range or even reserved addresses (i2cdetect, i2cdump, i2cget, i2cset, i2ctransfer)
-r first-lastlimit probing or dump range (i2cdetect, i2cdump)
-cprint nice html output (decode-dimms)
--formatprint nice html output (decode-dimms)
-b, --bodyonlydon't print html header (decode-dimms)
-vverbose mode (i2ctransfer)

Examples

Show usage and flags for decoding memory module SPD EEPROMs
decode-dimms -h
Show usage for decoding Sony Vaio laptop identification EEPROMs
decode-vaio -h
Show usage for feeding i2c-stub with dump files
i2c-stub-from-dump -h
Show usage for detecting I2C chips on a bus
i2cdetect -h
Show usage for examining I2C registers
i2cdump -h
Show usage for reading from I2C/SMBus chip registers
i2cget -h
Show usage for setting I2C registers
i2cset -h
Read 8 bytes at offset 0x64 from EEPROM at 0x50 on bus 0
i2ctransfer 0 w1@0x50 0x64 r8
Updated 2026-04-16kali.org ↗