| name | binary-analysis |
| description | Binary analysis: strings, binwalk, hexdump, xxd, file, objdump. Use when identifying unknown files, extracting strings, hunting credentials, or entropy analysis. |
| user-invocable | false |
| allowed-tools | Bash(file *), Bash(xxd *), Bash(hexdump *), Bash(strings *), Bash(objdump *), Bash(readelf *), Bash(nm *), Read, Grep, Glob |
| created | "2025-12-27T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-04-25T00:00:00.000Z" |
Binary Analysis
Tools for exploring and reverse engineering binary files, firmware, and unknown data.
When to Use This Skill
| Use this skill when... | Use rg-code-search instead when... |
|---|
Identifying unknown or non-text file types (file, xxd) | Searching tracked source files for a regex |
| Extracting strings or symbols from compiled binaries / firmware | Auditing a repo's text-encoded files for hardcoded patterns |
Inspecting raw hex layout of an ELF, Mach-O, or .bin blob | The input is human-readable code or markdown |
| Use this skill when... | Use jq-json-processing instead when... |
|---|
| Reverse-engineering an opaque binary format | The data is already structured JSON awaiting transformation |
Hunting embedded files with binwalk -e | A field needs extraction from a parsed JSON payload |
Quick Reference
| Tool | Purpose | Install |
|---|
strings | Extract printable text from binaries | Built-in (binutils) |
binwalk | Firmware analysis, file extraction | pip install binwalk or cargo install binwalk |
hexdump | Hex/ASCII dump | Built-in |
xxd | Hex dump with reverse capability | Built-in (vim) |
file | Identify file type | Built-in |
strings - Extract Text from Binaries
Find human-readable strings embedded in binary files.
strings binary_file
strings -n 10 binary_file
strings -t x binary_file
strings -t d binary_file
strings binary_file | grep -i password
strings binary_file | grep -E 'https?://'
strings binary_file | grep -i api_key
strings -e l binary_file
strings -e b binary_file
strings -e L binary_file
strings -a binary_file
Common discoveries with strings:
- Hardcoded credentials, API keys
- URLs and endpoints
- Error messages (hints at functionality)
- Library versions
- Debug symbols and function names
- Configuration paths
binwalk - Firmware Analysis
Identify and extract embedded files, analyze entropy, find hidden data.
binwalk firmware.bin
binwalk -e firmware.bin
binwalk --extract firmware.bin
binwalk -Me firmware.bin
binwalk -E firmware.bin
binwalk --entropy firmware.bin
binwalk -A firmware.bin
binwalk --opcodes firmware.bin
binwalk --dd='type:extension' firmware.bin
binwalk --signature firmware.bin
binwalk --raw='\\x1f\\x8b' firmware.bin
binwalk output interpretation:
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 TRX firmware header
28 0x1C LZMA compressed data
1835008 0x1C0000 Squashfs filesystem, little endian
hexdump / xxd - Raw Hex Analysis
hexdump -C binary_file
xxd binary_file
xxd -s 0x100 -l 256 binary_file
hexdump -v -e '/1 "%02x "' binary_file
xxd binary_file > hex.txt
xxd -r hex.txt > reconstructed_binary
xxd binary_file | grep "504b"
file - Identify File Types
file unknown_file
file -i unknown_file
file *
file -L symlink
Common Analysis Workflows
Unknown Binary Exploration
file mystery_file
binwalk mystery_file
strings -n 8 mystery_file | head -100
xxd mystery_file | head -20
binwalk -E mystery_file
Firmware Analysis
binwalk firmware.bin
binwalk -Me firmware.bin
find _firmware.bin.extracted -type f -name "*.conf"
find _firmware.bin.extracted -type f -name "passwd"
grep -r "password" _firmware.bin.extracted/
strings -n 10 firmware.bin | grep -i -E "(pass|key|secret|token)"
Finding Hidden Data
binwalk -E file.jpg
binwalk file.jpg | grep -E "(Zip|RAR|7z|gzip)"
dd if=file.jpg of=hidden.zip bs=1 skip=12345
File Signatures (Magic Bytes)
| Signature | Hex | File Type |
|---|
PK | 50 4B 03 04 | ZIP archive |
Rar! | 52 61 72 21 | RAR archive |
7z | 37 7A BC AF | 7-Zip |
ELF | 7F 45 4C 46 | Linux executable |
MZ | 4D 5A | Windows executable |
PNG | 89 50 4E 47 | PNG image |
JFIF | FF D8 FF E0 | JPEG image |
sqsh | 73 71 73 68 | SquashFS |
hsqs | 68 73 71 73 | SquashFS (LE) |
Tips
- Start with entropy: High entropy = compressed or encrypted
- Look for strings first: Often reveals purpose quickly
- Check file headers: First 16 bytes often identify format
- Use recursive extraction: Firmware often has nested archives
- Save offsets: Note interesting locations for targeted extraction