<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# API Reference — Performing Mobile Binary Analysis

## readelf (ELF / Android .so)
```bash
readelf -h binary.so                     # ELF header
readelf -s binary.so                     # Symbol table
readelf -l binary.so                     # Program headers (segments)
readelf -d binary.so                     # Dynamic section
readelf -S binary.so                     # Section headers
```

## otool (Mach-O / iOS)
```bash
otool -h AppBinary                       # Mach-O header
otool -l AppBinary                       # Load commands
otool -tV AppBinary                      # Disassembly
otool -L AppBinary                       # Shared libraries
```

## radare2
```bash
r2 -A binary                             # Open with analysis
aaa                                       # Full analysis
afl                                       # List functions
pdf @sym.func                            # Disassemble function
iz                                        # Data section strings
izz                                       # All strings
/x HEXPATTERN                            # Search hex bytes
axt @addr                                # Cross-references
VV @func                                 # Visual graph
```

## Ghidra (headless)
```bash
analyzeHeadless PROJECT_DIR PROJECT_NAME \
  -import binary.so \
  -postScript ExportDecompilation.java \
  -scriptPath /scripts/
```

## checksec
```bash
checksec --file=binary                    # All protections
checksec --file=binary --format=json      # JSON output
# Checks: RELRO, Stack Canary, NX, PIE, RPATH, RUNPATH, Fortify
```

## class-dump (iOS)
```bash
class-dump AppBinary > classes.h          # Dump ObjC headers
class-dump -H AppBinary -o headers/       # To directory
```

## nm
```bash
nm binary                                 # List symbols
nm -D binary                              # Dynamic symbols only
nm -g binary                              # External symbols only
nm binary | grep -i encrypt               # Filter
```
