symdis
A CLI tool for disassembling functions from crash reports. Given a module identifier and either a function name or an offset, symdis fetches the binary and symbol information from public servers, disassembles the target function, and annotates it with source lines, call targets, and inline frames.
Supports Windows (PE), Linux (ELF), macOS (Mach-O), and Android modules. Not limited to Mozilla — works with any module from a crash report, including Microsoft system DLLs, Windows kernel drivers, GPU drivers, Linux system libraries, and macOS frameworks. The tool itself runs on Windows, Linux, and macOS.
Designed primarily for use by AI agents analyzing Socorro/Crash Stats crash reports, but also useful for manual crash triage and reverse engineering.
Features
- Fetch symbols and binaries from Mozilla's Tecken symbol server, Microsoft/Intel/AMD/NVIDIA symbol servers, debuginfod servers, the Snap Store (Ubuntu snaps), APT repositories (Debian/Ubuntu), pacman repositories (Arch Linux), and Mozilla's FTP archive — with automatic CAB decompression,
.tar.xzextraction,.pkg(XAR/cpio) extraction,.debextraction,.pkg.tar.zstextraction, and.apk(ZIP) extraction - Not limited to Mozilla modules: works with any module from a crash report. On Windows: system DLLs (ntdll, kernel32, kernelbase), kernel drivers (win32kfull.sys, tcpip.sys), GPU drivers — PDB fetched automatically when
.symis unavailable. On Linux: system libraries via debuginfod, Snap Store, APT, or pacman. On macOS: framework binaries from FTP archives - PDB support (automatic): PDB is fetched and parsed automatically when
.symis unavailable for Windows modules. PDB fetch chain: Tecken → Microsoft → Intel → AMD → NVIDIA. Includes inline frames, srcsrv VCS paths, MSVC-demangled function signatures, and C++ type information forfield-layout. Use--pdbto skip the.symattempt when you know it's unavailable (saves one round-trip) - C++ type information: the
field-layoutcommand extracts class/struct/union field layouts from PDB type data (TPI stream) — identify which field is at a given byte offset in a crash. Works with Mozilla PDBs (535K+ types) and some Microsoft public PDBs (ntdll.pdb has hundreds of types including_RTL_CRITICAL_SECTION,_PEB,_TEB) - Cross-platform module analysis: PE/Windows (via section table), ELF/Linux (via PT_LOAD segments), Mach-O/macOS (including fat/universal binaries), and Android (Fenix + Focus via APK extraction). symdis itself runs on Windows, Linux, and macOS — it analyzes crash dumps from any platform regardless of where it runs
- Find functions by exact name, substring match (
--fuzzy), or by RVA/offset; searches FUNC records, PUBLIC symbols (with demangling), and binary exports - Disassemble x86, x86-64, ARM32, and AArch64 code via Capstone; ARM32 Thumb-2 mode auto-detected from ELF symbol metadata
- Annotate instructions with source file/line, resolved call targets (FUNC/PUBLIC/IAT/PLT/GOT/dylib imports), and inline function boundaries
- Resolve indirect calls: IAT imports on x86/x86-64, PLT stubs on ARM/AArch64 ELF,
__stubsentries on Mach-O, GOT slots on Linux ELF, and AArch64 ADRP+LDR+BLR/BR sequences across all platforms - Demangle C++ (Itanium ABI), Rust, and MSVC (
?Name@...) symbol names automatically (--no-demangleto disable) - Highlight a specific offset (e.g., a crash address) in the output
- Graceful degradation: binary+sym gives full annotated disassembly; binary-only gives raw disassembly; sym-only gives function metadata
- Text and JSON output formats (
--format text|json) - Socorro crash report integration (
--socorro-json): pass a full Socorro crash report JSON and all module IDs, offsets, product, version, channel, distro, and backend flags are extracted automatically — frame mode disassembles the crash frame, module mode targets any loaded module - Configurable via TOML config file, environment variables, and CLI flags with layered precedence
- Local cache with WinDbg-compatible layout, atomic writes, negative-cache markers, and
_NT_SYMBOL_PATHintegration
Installation
Pre-built binaries (fastest, includes LZO support for snap packages):
Pre-built binaries are available for:
x86_64-pc-windows-msvcandaarch64-pc-windows-msvc(Windows)x86_64-unknown-linux-gnuandaarch64-unknown-linux-gnu(Linux glibc)x86_64-unknown-linux-musl(Linux static)x86_64-apple-darwinandaarch64-apple-darwin(macOS)
From source (no LZO support for snap packages — see below):
Or clone and build:
LZO support for snap packages
Some Ubuntu snap packages use LZO-compressed squashfs images. The upstream backhand crate's lzo feature depends on a GPL-licensed library, which is incompatible with symdis's MPL-2.0 license, so cargo install symdis builds without LZO support.
Pre-built release binaries from GitHub Releases include LZO support — they are built against a fork of backhand that uses the MIT-licensed lzokay instead. cargo binstall symdis downloads these pre-built binaries (but note that binstall falls back to cargo install from crates.io if no binary is available for your platform, which would build without LZO).
To build from source with LZO support:
Both the [features] and [patch.crates-io] sections are required. The lzokay feature activates backhand's lzo feature, and the patch redirects backhand to the lzokay fork so that it pulls in MIT-licensed lzokay instead of GPL rust-lzo. The feature is deliberately named lzokay (not lzo) to make it clear this requires the fork.
Many of the GNOME runtime snaps that symdis encounters (e.g. gnome-42-2204-sdk, core22) use LZO compression, so LZO support is important for Ubuntu snap crash reports. If you hit an LZO-compressed snap without LZO support, symdis will print a clear error message with instructions.
Quick Start
# Easiest: pass a Socorro crash report JSON — all IDs, offsets, and flags are
# extracted automatically. Disassembles the crash frame by default.
# Same, but pipe from socorro-cli (use "-" for stdin):
|
# Disassemble a specific function in a different loaded module from the report:
# Manual mode: specify all IDs explicitly
# Fuzzy name search
# Linux module with FTP archive fallback
# macOS module (fat/universal binary from PKG archive)
# JSON output
Example Output
Text (default)
Output is abbreviated — the tool prints all instructions in the function.
; Module: xul.dll (xul.pdb / EE20BD9ABD8D048B4C4C44205044422E1)
; Function: IPC::Channel::ChannelImpl::ProcessIncomingMessages(...) (RVA: 0x144c490, size: 0xa57)
; Source: hg:hg.mozilla.org/releases/mozilla-esr140:ipc/chromium/src/chrome/common/ipc_channel_win.cc:0b8c...
; Architecture: x86
; Data sources: binary+sym
;
; .../ipc_channel_win.cc:...:264
0x0144c490: push ebp
0x0144c491: mov ebp, esp
0x0144c493: push ebx
0x0144c494: push edi
0x0144c495: push esi
0x0144c496: and esp, 0xfffffff8
0x0144c499: sub esp, 0xf8
; .../ipc_channel_win.cc:...:269
0x0144c4b8: test cl, cl
...
; [inline] mozilla::UniquePtr<...>::get() const (.../ipc_channel_win.cc:...:305)
; .../mfbt/UniquePtr.h:...:399
0x0144c4d5: mov ebx, dword ptr [edi + 0x8c]
; [end inline] mozilla::UniquePtr<...>::get() const
...
0x0144c801: call 0x1463290 ; IPC::Channel::ChannelImpl::AcceptHandles(IPC::Message&)
...
==> 0x0144c8cd: call dword ptr [0x173b5260] ; [indirect]
0x0144c8d3: add esp, 4
JSON
Commands
| Command | Description |
|---|---|
disasm |
Disassemble a function from a module |
lookup |
Resolve an offset to a symbol, or a name to an address |
info |
Show module metadata and PDB type info availability |
fetch |
Pre-fetch symbols and binary for a module |
field-layout |
Show C++ class/struct field layout from PDB type info |
cache |
Manage the local cache (path, size, clear, list) |
Run symdis <command> --help for full documentation, crash report field mappings, and more examples.
disasm
The primary command. See the Quick Start section above for common examples. Additional examples:
# Socorro crash report JSON — frame mode (disassembles the crash frame):
# Socorro JSON — module mode (disassemble a function in any loaded module):
# Non-Mozilla module (Windows system DLL):
# Windows kernel driver (PDB auto-fallback, .pdata function bounds):
# Ubuntu system library (APT backend, auto-detected source package):
# Fenix (Firefox for Android) — MUST use --product fenix:
# Skip .sym lookup, go straight to PDB (saves one round-trip):
The --socorro-json flag accepts a file path or "-" for stdin. In frame mode (default, no --debug-file), it disassembles the function at the selected frame (default: frame 0, the crash frame) with offset and highlight auto-set. In module mode (--debug-file + --function/--offset), it disassembles a specific function in any loaded module, with IDs resolved from the crash report's module list. In both modes, product, version, channel, build-id, distro, and backend flags (APT/pacman/snap) are auto-extracted from the crash report.
lookup
Resolves offsets to symbols or symbols to addresses using the .sym file only (no binary needed). Searches both FUNC and PUBLIC symbols.
# Resolve an offset to a symbol name:
# Find a function's address by name (substring match):
info
Shows module metadata: OS, architecture, function count, sym/binary availability, and PDB type info availability. Use --pdb to fetch the PDB and check if field-layout will work.
# Check module metadata and sym/binary availability:
# Check a non-Mozilla module and probe PDB type info:
fetch
Pre-fetches sym and binary into the local cache so subsequent disasm calls are instant.
# Pre-fetch a Windows module:
# Pre-fetch a Linux module with FTP archive fallback:
# Pre-fetch PDB + binary (skips .sym, also checks type info for field-layout):
field-layout
Extracts C++ class/struct/union field layouts from PDB type information (TPI stream). Use --offset to identify which field is at a given byte offset in a crash.
# Show layout of a Mozilla type:
# Find which field is at offset 0x4c:
# Windows system type from ntdll.pdb:
cache
Manage the local cache.
Global Options
| Option | Default | Description |
|---|---|---|
--cache-dir <PATH> |
auto-detected | Cache directory path |
--format <FMT> |
text |
Output format: text or json |
--no-demangle |
off | Disable C++/Rust symbol demangling |
-v / -vv |
off | Verbose output (info / debug) |
--offline |
off | Skip network requests; use only cached data |
Configuration
Settings are resolved with layered precedence: defaults < config file < environment variables < CLI flags.
Config File
Location (checked in order):
SYMDIS_CONFIGenvironment variable- Platform default:
%APPDATA%\symdis\config.toml(Windows) or~/.config/symdis/config.toml(Linux/macOS)
[]
= "D:\\SymbolCache\\symdis"
= 48
[]
= [
"https://symbols.mozilla.org/",
"https://msdl.microsoft.com/download/symbols",
]
= ["https://debuginfod.elfutils.org/"]
[]
= "intel" # "intel" or "att"
= 2000
[]
= "text" # "text" or "json"
[]
= 30
= "symdis/0.4.1"
= false
Environment Variables
| Variable | Description |
|---|---|
SYMDIS_CONFIG |
Override config file path |
SYMDIS_CACHE_DIR |
Override cache directory |
SYMDIS_SYMBOL_SERVERS |
Comma-separated symbol server URLs |
DEBUGINFOD_URLS |
Space-separated debuginfod server URLs |
_NT_SYMBOL_PATH |
Windows symbol path (used for cache directory resolution) |
Update Check
On each run, symdis checks crates.io in the background for a newer version. If one is found, a notice is printed to stderr after the command completes. The check is cached for 24 hours and can be disabled by setting MOZTOOLS_UPDATE_CHECK=0.
Cache
Downloaded symbol files and binaries are cached locally. The cache directory is resolved in this order:
--cache-dirCLI flagSYMDIS_CACHE_DIRenvironment variable- Config file
[cache] dirsetting _NT_SYMBOL_PATH(Windows) -- uses the cache path fromSRV*<cache>*<server>entries- Platform default (
%LOCALAPPDATA%\symdis\cache,~/.cache/symdis, or~/Library/Caches/symdis)
The cache uses WinDbg-compatible flat layout (<file>/<id>/<file>) so it can be shared with other symbol tools.
Data and Privacy
symdis processes only publicly available data:
- Inputs: Module identifiers (debug file, debug ID, code file, code ID), function names, and offsets — all from the public portions of crash reports on Crash Stats.
- Downloads: Symbol files and binaries from public symbol servers (Mozilla Tecken, Microsoft, Intel, AMD, NVIDIA, debuginfod) and public archives (Mozilla FTP, Snap Store, APT, pacman).
- Does NOT process: Minidumps, memory contents, crash annotations, user comments, URLs, email addresses, or any other protected data.
When using symdis — whether manually or through an AI agent — only provide data from publicly accessible crash report fields (stack traces, module lists, release information). Do not pass protected crash report data (such as user comments, email addresses, or URLs from crash annotations) to symdis or to AI tools analyzing crash reports.
For Mozilla's policies on using AI tools in development, see AI and Coding. For contribution guidelines, see CONTRIBUTING.md.
License
This project is licensed under the Mozilla Public License 2.0.