From Fundamentals to Advanced Dynamic Instrumentation
Introduction
Chapter 1: The Art and Science of Reverse Engineering
- What Is Reverse Engineering
- Static Versus Dynamic Analysis
- The Threat Modeling Perspective
- Legal and Ethical Boundaries
- Prerequisites and Setup for This Book
Chapter 2: How Programs Execute - CPU Architectures and Assembly
- x86 and x86-64 Fundamentals
- ARM32 and ARM64 Essentials
- Registers, Flags and State
- Instruction Encoding and Execution
- Calling Conventions Across Platforms
Chapter 3: Executable Formats and Binary Layout
- ELF Format Deep Dive
- PE Format Deep Dive
- Mach-O Format Deep Dive
- Memory Mapping and Segmentation
- Symbols, Relocations and Export Tables
Chapter 4: Process Architecture and Virtual Memory
- Virtual Memory and Address Spaces
- The Stack, Heap and Data Segments
- Pointers, Addresses and Memory Layouts
- Threads and Concurrency
- System Calls and Kernel Boundaries
Chapter 5: Dynamic Linking and Shared Libraries
- The Dynamic Linker
- Shared Objects and DLL Loading
- Procedure Linkage Tables and Relocations
- Runtime Symbol Resolution
- Late Binding and Hooking Implications
Chapter 6: Application Runtimes and Managed Code
- The Java Virtual Machine Model
- Dalvik and ART on Android
- Objective-C Runtime and Method Dispatch
- Swift and Its Compatibility Layer
- .NET CLR and Managed-to-Native Boundaries
Chapter 7: Inside Frida - Architecture and Design
- The Frida Component Model
- Gum: The Instrumentation Engine
- GumJS and JavaScript Binding
- Message Passing and RPC
- Injection Mechanisms Across Platforms
Chapter 8: Installing and Configuring Frida
- Installing the Host Environment
- Setting Up Target Devices and Emulators
- Android Environment Configuration
- iOS and Jailbreak Setup
- Windows, Linux and macOS Deployment
Chapter 9: Scripting Foundations and the Frida API
- The Frida JavaScript Environment
- Process API and Memory API Basics
- Module Discovery and Symbol Resolution
- Debugging and Logging Patterns
- Common Scripting Anti-Patterns
Chapter 10: Interceptor - The Hooking Core
- How Inline Hooking Works
- Replacing and Tramping Functions
- Argument Inspection and Modification
- Return Value Manipulation
- Recursive Hooking and Performance
Chapter 11: Stalker - Instruction-Level Tracing
- Tracing Versus Hooking
- Configuring Stalker Transforms
- Building Custom Trace Outputs
- Call Stack Reconstruction
- Performance and Practical Limits
Chapter 12: Memory Instrumentation and Scanning
- Reading and Writing Memory Safely
- Pattern Scanning and Byte Searching
- String Detection and Extraction
- Allocating and Injecting Native Code
- Memory Protection and Page Permissions
Chapter 13: Native Function Calls and Pointer Manipulation
- NativeFunction and Function Signatures
- Constructing and Passing Structs
- Pointer Arithmetic and Offsets
- Callbacks and Function Pointers
- Handling Errors and Exceptions
Chapter 14: Reverse Engineering Android Applications
- Android Application Architecture
- Hooking Java Methods with Frida
- JNI Bridge Analysis and Instrumentation
- Native Library and So File Analysis
- Android-Specific Anti-Analysis Techniques
Chapter 15: Reverse Engineering iOS Applications
- iOS Application Architecture and Security
- Objective-C Runtime Instrumentation
- Dylib Loading and Symbol Resolution
- Swift Binary Analysis Considerations
- iOS Security Boundaries and Bypasses
Chapter 16: Windows Binary Analysis with Frida
- Windows Executable and DLL Architecture
- Win32 API Monitoring and Hooking
- PE File Analysis and Export Scanning
- Process Creation and Spawn Instrumentation
- Integration with Windows Debugging Tools
Chapter 17: Linux and macOS Binary Analysis
- Linux ELF Binary Instrumentation
- System Call and Library Hooking on Linux
- macOS Mach-O Analysis and DYLD Behavior
- Sandboxing and Security Extensions
- Cross-Platform Instrumentation Challenges
Chapter 18: Detecting and Evading Anti-Analysis
- Anti-Debugging Techniques
- Root and Jailbreak Detection
- Integrity Checks and Tamper Detection
- Frida-Specific Detection Methods
- Defense Evasion in Authorized Testing
Chapter 19: Cryptographic and Network Analysis
- Cryptographic API Monitoring
- Key and IV Extraction Techniques
- TLS Pinning and Certificate Analysis
- Network Traffic Inspection with Frida
- Protocol Reverse Engineering
Chapter 20: Advanced Scripting and Automation
- RPC Exports and Remote Procedure Calls
- Python and Node.js Controller Scripts
- Asynchronous and Event-Driven Instrumentation
- Building Reusable Instrumentation Libraries
- Performance Optimization Techniques
Chapter 21: Integration with Reverse Engineering Ecosystems
- Frida and Ghidra Integration
- IDA Pro Dynamic Analysis Bridge
- radare2 and r2frida Workflows
- JADX and Static-Dynamic Correlation
- Debugger Integration: LLDB and GDB
Chapter 22: Case Studies - Real-World Reverse Engineering
- Case Study: Android Application License Bypass Analysis
Find libnative.so in extracted/lib/arm64-v8a/
- Case Study: Malware Behavior Analysis
- Case Study: Proprietary Protocol Reverse Engineering
- Case Study: iOS Application Security Audit
- Case Study: Windows Application Vulnerability Research
Chapter 23: Professional Practice and Future Directions
- Documentation and Reporting Standards
- Team Workflows and Tool Standardization
- Continuous Instrumentation and CI Integration
- Emerging Platforms and Architectures
- The Future of Dynamic Instrumentation