# Logicmso

Analyze digital and analog captures from Saleae Logic MSO devices.

- Repository: https://github.com/BrownFineSecurity/iothackbot (879 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-06-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add BrownFineSecurity/iothackbot --skill logicmso -g -a claude-code -y`
Codex: `npx skills add BrownFineSecurity/iothackbot --skill logicmso -g -a codex -y`
Cursor: `npx skills add BrownFineSecurity/iothackbot --skill logicmso -g -a cursor -y`
Gemini CLI: `npx skills add BrownFineSecurity/iothackbot --skill logicmso -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add BrownFineSecurity/iothackbot`

## Description

Analyze digital and analog captures from Saleae Logic MSO devices. Decode protocols like UART, SPI, I2C from exported binary files. Use when analyzing logic analyzer captures for CTF challenges, hardware reverse engineering, or protocol decoding.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Saleae Logic MSO Analysis

This skill enables analysis of captured signals from Saleae Logic MSO devices using the `saleae-mso-api` Python library. It supports loading binary exports, analyzing signal transitions, and decoding common protocols.

## Prerequisites

- `saleae-mso-api` Python package, **Do NOT blindly pip install.** First check if it's already installed:
  ```bash
  python3 -c "from saleae.mso_api.binary_files import read_file; print('saleae-mso-api is available')"
  ```
  Only if that fails, install it: `pip install saleae-mso-api`
- Binary export files from Saleae Logic software (`.bin` format)

## Quick Reference

### Loading Binary Files

```python
from saleae.mso_api.binary_files import read_file
from pathlib import Path

file_path = Path("capture.bin")
saleae_file = read_file(file_path)

# Access metadata
print(f"Version: {saleae_file.version}")
print(f"Type: {saleae_file.type}")

# Access data
contents = saleae_file.contents
```

### Digital Capture Structure

Digital exports contain `DigitalExport_V1` with chunks:

```python
chunk = saleae_file.contents.chunks[0]

# Key attributes:
chunk.initial_state      # Starting logic level (0 or 1)
chunk.transition_times   # numpy array of transition timestamps (seconds)
chunk.sample_rate        # Capture rate in Hz
chunk.begin_time         # Capture start time
chunk.end_time           # Capture end time
```

### Calculating Pulse Durations

```python
import numpy as np

times = np.array(chunk.transition_times)
durations_ms = np.diff(times) * 1000  # Convert to milliseconds

# If initial_state is 0 (LOW):
#   - Even indices (0, 2, 4...) = HIGH pulse durations
#   - Odd indices (1, 3, 5...) = LOW gap durations
# If initial_state is 1 (HIGH):
#   - Even indices = LOW gap durations
#   - Odd indices = HIGH pulse durations
```

## Helper Scripts

This skill includes helper scripts for common analysis tasks:

### Protocol Analyzer

The rest: https://github.com/BrownFineSecurity/iothackbot/blob/HEAD/skills/logicmso/SKILL.md
