AI-Assisted Analysis, Understanding, and Reconstruction of Software Systems
Introduction: The Discipline of Understanding Software
- The Undocumented System Problem
- Reverse Engineering as Evidence Collection
- What Claude Code Actually Does
- Authorization, Safety, and Scope
- How to Use This Book
Chapter 1: Foundations of Reverse Engineering
- What Is Reverse Engineering
- Legitimate Use Cases and Goals
- Legal Landscape and Compliance
- The Authorization Model
- The RE Methodology Cycle
- Evidence Types and Quality
Chapter 2: Claude Code from First Principles
- Installation and Configuration
- Project Context and Instruction Files
- Permission Models and Approvals
- Tool Use and Shell Interaction
- Context Management and Limits
- Security, Privacy, and Data Handling
- Model Limitations and Hallucination Risks
- Prompt Injection from Untrusted Artifacts
- Reproducibility and Auditable Analysis
Chapter 3: The AI-Assisted Reverse Engineering Workflow
- Phase One: Authorization and Scoping
- Phase Two: Preservation and Provenance
- Phase Three: Environment Isolation
- Phase Four: Inventory and Reconnaissance
- Phase Five: Architecture Reconstruction
- Phase Six: Hypothesis and Experimentation
- Phase Seven: Validation and Documentation
- The Evidence Ledger
Chapter 4: Source-Level Reverse Engineering
- Repository Mapping and Structure Analysis
- Build System Identification and Analysis
- Entry Point Discovery
- Dependency Graph Construction
- Module and Interface Inventory
- Configuration and Environment Analysis
- Initialization Sequences and Lifecycle
- Data Flow and Control Flow Tracing
- Undocumented Behavior Discovery
Chapter 5: Behavioral Reconstruction and Black-Box Analysis
- Black-Box Analysis Principles
- Systematic Input/Output Observation
- Boundary Value and Edge Case Testing
- State Modeling and Transition Discovery
- Differential Testing Methodology
- Golden-Master and Snapshot Testing
- Contract Extraction from Behavior
- Falsifying AI-Generated Hypotheses
Chapter 6: Binary Analysis Fundamentals
- Executable Formats and Structure
- Machine Code and Assembly Concepts
- Symbols, Debug Information, and Metadata
- Calling Conventions and Stack Behavior
- Functions, Control Flow, and Data References
- Linking, Imports, and Exports
- Compiler Artifacts and Optimization Effects
- Safe Analysis with Authorized Binaries
Chapter 7: Combining Claude Code with Established Tools
- The Tool Ecosystem Landscape
- Working with Disassemblers and Decompilers
- Debuggers and Runtime Inspection
- Tracing and Profiling Integration
- Dependency Analysis Tools
- Packet Analysis for Protocol Work
- Language-Specific Utilities
- Orchestrating Tool Output with Claude Code
Chapter 8: Program Comprehension at Depth
- Control Flow and Call Graphs
- Data Flow and State Tracking
- Invariants, Preconditions, and Postconditions
- Side Effects and Hidden Coupling
- Concurrency and Synchronization
- Resource Lifetimes and Memory Ownership
- Serialization and Persistence Patterns
- Configuration-Driven Behavior and Feature Toggles
- Focused Questioning for Testable Hypotheses
Chapter 9: Analyzing Compiled Applications Across Languages
- Native Binaries and Compiled Languages
- Managed Runtimes: JVM and .NET
- Bytecode-Based Applications
- Interpreted and Scripted Languages
- Bundled and Packaged Applications
- Minified and Obfuscated Code
- Generated Code and Build Artifacts
- Containerized Services and Images
Chapter 10: API, Protocol, and File-Format Reconstruction
- API Reconstruction Principles
- Request and Response Characterization
- Message Framing and Serialization
- State Transitions and Error Semantics
- Version Negotiation and Compatibility
- File Format Discovery and Schema Inference
- Checksums and Integrity Mechanisms
- Building Test Harnesses
Chapter 11: Legacy System Modernization
- Assessing the Legacy System
- Recovering Architectural Intent
- Dependency Audit and Risk Assessment
- Behavioral Characterization Before Change
- Regression Test Generation
- Interface Extraction and Documentation
- Database Schema Recovery
- Migration Planning and Execution
- Compatibility Layers and Incremental Rewrite
Chapter 12: Clean-Room Reimplementation
- Clean-Room Principles and Legal Basis
- Separating Observation from Implementation
- Defining Interface Contracts
- Spec Writer and Programmer Roles
- Independent Test Suite Construction
- Implementing Compatible Behavior Safely
- Evidence and Decision Records
- Provenance Documentation
Chapter 13: Documentation Recovery
- The Documentation Recovery Problem
- Architecture Decision Records
- Component Descriptions and Dependency Maps
- Interface Catalogs and Data Dictionaries
- Sequence Diagrams and State Diagrams
- Operational Runbooks and Deployment Guides
- Troubleshooting and Maintenance Documentation
- Validating Generated Documentation
Chapter 14: AI-Specific Risks and Defensive Practices
- Categories of AI Failure in RE
- Hallucinated Evidence and Imaginary Paths
- Prompt Injection from Analyzed Content
- Secret Disclosure and Data Leakage
- Destructive Command Risks
- Clean-Room Contamination
- Automation Bias and Overreliance
- Defensive Practices and Safety Gates
Chapter 15: Advanced Workflows, Testing, and Professional Practice
- Prompt and Context Engineering for RE
- Reusable Prompt Patterns and Templates
- Testing Reverse Engineering Conclusions
- Analysis Repository Structure
- Confidential Data Handling
- CI and Toolchain Integration
- Troubleshooting Methodology
- Evaluating AI-Assisted RE Quality
- When Traditional Approaches Are Better
Conclusion: The Future of AI-Assisted Understanding
Back Matter: Claude Code Reverse Engineering Playbook
- The Authorization-First Workflow Summary
- Phased Analysis Plan Template
- Reusable Project Structure
- Prompt and Context Templates
- Evidence Ledger Template
- Analysis Checklist
- Verification Checklist
- Troubleshooting Guide
- Clean-Room Checklist
- Security and Privacy Checklist
- Glossary
- References / Bibliography
