Skip to content

iscounter/IDA_PRO-Mobile

Repository files navigation

IDA Pro Mobile - Android Reverse Engineering Toolkit

A mobile reverse engineering toolkit inspired by IDA Pro, built with Jetpack Compose and C++ for binary analysis on Android devices.

Features

  • Binary File Support: Load and analyze various binary formats (ELF, PE, Mach-O)
  • Disassembly Viewer: Interactive disassembly with syntax highlighting for x86, x86-64, and ARM architectures
  • Hexadecimal Viewer: Raw binary data inspection with search capabilities
  • Function Detection: Automatic detection and listing of functions in binary files
  • Annotation System: Add comments and notes to assembly instructions
  • Material Design 3: Modern, professional UI following Material Design principles
  • Cross-Platform: Native C++ backend with Kotlin frontend for optimal performance

Architecture

Frontend (Kotlin + Jetpack Compose)

  • UI: Modern Material Design 3 interface
  • Navigation: Tab-based navigation between different analysis views
  • State Management: ViewModel pattern with StateFlow for reactive UI updates
  • Database: Room database for local data persistence

Backend (C++ + NDK)

  • Binary Analysis: Native C++ engine for binary parsing and analysis
  • Disassembly: Custom disassembly engine supporting multiple architectures
  • Function Detection: Pattern-based and symbol table-based function detection
  • JNI Bridge: Seamless integration between Kotlin and C++ components

Getting Started

Prerequisites

  • Android Studio Arctic Fox or later
  • Android NDK 25.1.8937393
  • JDK 17
  • Minimum Android API level 24 (Android 7.0)

Building the Project

  1. Clone the repository

    git clone https://github.com/your-username/ida-pro-mobile.git
    cd ida-pro-mobile
  2. Install NDK

    # Through Android Studio SDK Manager or command line
    sdkmanager "ndk;25.1.8937393"
  3. Build the project

    ./gradlew assembleDebug
  4. Run tests

    ./gradlew test
    ./gradlew connectedAndroidTest

Usage

Loading Binary Files

  1. Open the app and navigate to the "Files" tab
  2. Tap "Choose File" to select a binary file from your device
  3. The app will analyze the file and extract basic information
  4. Select the file from the list to begin analysis

Disassembly Analysis

  1. Switch to the "Disassembly" tab with a file selected
  2. View assembly instructions with syntax highlighting
  3. Tap on instructions to add comments and annotations
  4. Navigate through the code using the address view

Hex View

  1. Use the "Hex View" tab to inspect raw binary data
  2. Search for hex patterns or ASCII strings
  3. View both hex and ASCII representations side by side

Function Analysis

  1. The "Functions" tab shows all detected functions
  2. Filter functions by name, address, or type
  3. View function statistics and signatures
  4. Tap functions to navigate to their location in disassembly

Supported File Formats

  • ELF: Linux/Unix executables and shared libraries
  • PE: Windows executables (.exe, .dll)
  • Mach-O: macOS executables and dylibs
  • Raw Binary: Generic binary files

Supported Architectures

  • x86: 32-bit Intel architecture
  • x86-64: 64-bit Intel architecture
  • ARM: 32-bit ARM architecture
  • ARM64: 64-bit ARM architecture (basic support)

Development

Project Structure

ida-pro-mobile/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/com/idapro/mobile/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MainActivity.kt                    # Main activity with Compose setup
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IdaProMobileApplication.kt        # Application class with dependency injection
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ screens/                      # Main UI screens
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MainScreen.kt             # Tab navigation and main layout
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FileUploadScreen.kt       # Binary file upload interface
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DisassemblyScreen.kt      # Disassembly viewer with syntax highlighting
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ HexViewerScreen.kt        # Hex viewer with search capabilities
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── FunctionListScreen.kt     # Function detection and listing
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ components/                   # Reusable UI components
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ BinaryFileCard.kt         # File display card
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DisassemblyView.kt        # Assembly instruction rendering
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ HexGrid.kt                # Hex data grid component
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FunctionItem.kt           # Function list item
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── AnnotationDialog.kt       # Comment annotation dialog
β”‚   β”‚   β”‚   β”‚   β”‚   └── theme/                        # Material Design 3 theming
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Color.kt                  # Color palette
β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Theme.kt                  # Theme configuration
β”‚   β”‚   β”‚   β”‚   β”‚       └── Type.kt                   # Typography system
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ database/                     # Room database layer
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AppDatabase.kt            # Database configuration
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ entities/                 # Database entities
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ BinaryFileEntity.kt   # Binary file metadata
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── AnnotationEntity.kt   # User annotations
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── dao/                      # Data access objects
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ BinaryFileDao.kt      # File operations
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── AnnotationDao.kt      # Annotation operations
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ model/                        # Data models
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ BinaryFile.kt             # Binary file representation
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DisassemblyInstruction.kt # Assembly instruction model
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Function.kt               # Function metadata
β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── Annotation.kt             # User annotation model
β”‚   β”‚   β”‚   β”‚   β”‚   └── repository/                   # Repository pattern implementation
β”‚   β”‚   β”‚   β”‚   β”‚       └── BinaryAnalysisRepository.kt # Data management layer
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ viewmodel/                        # ViewModel layer
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MainViewModel.kt              # Main screen state management
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FileUploadViewModel.kt        # File upload logic
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DisassemblyViewModel.kt       # Disassembly state management
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ HexViewerViewModel.kt         # Hex viewer state
β”‚   β”‚   β”‚   β”‚   β”‚   └── FunctionListViewModel.kt      # Function list state
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ native/                           # JNI bridge layer
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NativeBinaryAnalyzer.kt       # JNI interface
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DisassemblyData.kt            # Data transfer objects
β”‚   β”‚   β”‚   β”‚   β”‚   └── FunctionData.kt               # Function data DTOs
β”‚   β”‚   β”‚   β”‚   └── utils/                            # Utility classes
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ BinaryUtils.kt                # Binary analysis utilities
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ FileUtils.kt                  # File handling utilities
β”‚   β”‚   β”‚   β”‚       └── Constants.kt                  # App constants
β”‚   β”‚   β”‚   β”œβ”€β”€ cpp/                                  # Native C++ backend
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ binary_analyzer.cpp               # Main binary analysis engine
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ disassembler.cpp                  # Disassembly engine
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ function_detector.cpp             # Function detection algorithms
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ jni_bridge.cpp                    # JNI integration layer
β”‚   β”‚   β”‚   β”‚   └── CMakeLists.txt                    # C++ build configuration
β”‚   β”‚   β”‚   └── res/                                  # Android resources
β”‚   β”‚   β”‚       β”œβ”€β”€ values/                           # Resource values
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ colors.xml                    # Color definitions
β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ strings.xml                   # String resources
β”‚   β”‚   β”‚       β”‚   └── themes.xml                    # XML theme definitions
β”‚   β”‚   β”‚       └── xml/
β”‚   β”‚   β”‚           └── file_paths.xml                # File provider configuration
β”‚   β”‚   β”œβ”€β”€ test/                                     # Unit tests
β”‚   β”‚   β”‚   └── java/com/idapro/mobile/
β”‚   β”‚   β”‚       β”œβ”€β”€ BinaryAnalysisTest.kt             # Binary analysis unit tests
β”‚   β”‚   β”‚       β”œβ”€β”€ viewmodel/                        # ViewModel tests
β”‚   β”‚   β”‚       └── utils/                            # Utility function tests
β”‚   β”‚   └── androidTest/                              # Instrumented tests
β”‚   β”‚       └── java/com/idapro/mobile/
β”‚   β”‚           β”œβ”€β”€ DatabaseTest.kt                   # Room database tests
β”‚   β”‚           β”œβ”€β”€ ui/                               # UI integration tests
β”‚   β”‚           └── native/                           # Native code tests
β”‚   β”œβ”€β”€ build.gradle.kts                             # App module build configuration
β”‚   └── proguard-rules.pro                           # ProGuard obfuscation rules
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── android.yml                              # GitHub Actions CI/CD pipeline
β”œβ”€β”€ gradle/
β”‚   └── wrapper/                                     # Gradle wrapper files
β”œβ”€β”€ build.gradle.kts                                 # Root project build configuration
β”œβ”€β”€ settings.gradle.kts                              # Gradle settings
β”œβ”€β”€ gradle.properties                                # Gradle properties and optimizations
└── README.md                                        # Project documentation

Key Technical Features

πŸ”§ Native C++ Backend

  • High-Performance Analysis: Custom C++ engine for binary parsing and disassembly
  • Multi-Architecture Support: x86, x86-64, ARM, and ARM64 instruction sets
  • Memory Efficient: Optimized algorithms for mobile devices with limited resources
  • JNI Integration: Seamless bridge between Java/Kotlin and native code

πŸ“± Modern Android Architecture

  • Jetpack Compose: Fully declarative UI with Material Design 3
  • MVVM Pattern: Clean separation of concerns with ViewModels and StateFlow
  • Room Database: Type-safe local storage with automatic schema management
  • Repository Pattern: Abstraction layer for data access and caching

πŸ” Advanced Analysis Capabilities

  • Binary Format Support: ELF, PE, Mach-O, and raw binary files
  • Intelligent Disassembly: Context-aware instruction decoding with syntax highlighting
  • Function Detection: Pattern-based and symbol table-based function identification
  • Interactive Annotations: User-generated comments and notes system

πŸ›‘οΈ Security & Performance

  • ProGuard Optimization: Code obfuscation and size reduction for release builds
  • NDK Integration: Native development kit for optimal performance
  • Memory Management: Efficient handling of large binary files
  • Secure Storage: Encrypted local database for sensitive analysis data

Testing Strategy

Unit Tests (app/src/test/)

  • BinaryAnalysisTest.kt: Tests for binary file analysis utilities including architecture detection, file type identification, hash calculation, and string extraction
  • ViewModel Tests: Comprehensive testing of all ViewModels with mock repositories
  • Utility Tests: Testing of binary utilities, file handling, and helper functions

Instrumented Tests (app/src/androidTest/)

  • DatabaseTest.kt: Room database integration tests including CRUD operations, foreign key constraints, and cascade deletions
  • UI Tests: Jetpack Compose UI component testing with user interaction simulation
  • Native Integration Tests: JNI bridge testing for C++ backend integration

Continuous Integration

The GitHub Actions workflow includes:

  • Automated Testing: Unit tests, instrumented tests, and lint checks
  • Code Quality: ktlint formatting and detekt static analysis
  • Security Scanning: Trivy vulnerability scanner integration
  • APK Building: Debug and release APK generation with signing

CI/CD Pipeline Features

Automated Workflows

  • Multi-stage Pipeline: Test β†’ Build β†’ Security Scan β†’ Quality Check
  • Parallel Execution: Independent jobs for faster feedback
  • Artifact Storage: APK files and test reports automatically uploaded
  • Environment Setup: Automatic NDK installation and caching

Code Quality Gates

  • Kotlin Code Style: Automated ktlint formatting verification
  • Static Analysis: detekt rules for code quality and best practices
  • Vulnerability Scanning: Trivy security scanner for dependency vulnerabilities
  • Test Coverage: Unit and integration test execution with reporting

Contributing

Development Setup

  1. Install Android Studio Arctic Fox or later
  2. Install Android NDK 25.1.8937393 through SDK Manager
  3. Clone repository and open in Android Studio
  4. Sync project to download dependencies

Code Style Guidelines

  • Follow Kotlin coding conventions
  • Use ktlint for automatic formatting
  • Maintain comprehensive test coverage
  • Document public APIs with KDoc
  • Follow Material Design 3 principles for UI

Pull Request Process

  1. Create feature branch from develop
  2. Implement changes with tests
  3. Run local tests: ./gradlew test lint
  4. Submit PR targeting develop branch
  5. Ensure CI pipeline passes
  6. Request code review from maintainers

Deployment

GitHub Release Process

  1. Tag Creation: Create version tag (e.g., v1.0.0)
  2. Automated Build: GitHub Actions builds and signs release APK
  3. Release Notes: Generate changelog from commit history
  4. Asset Upload: Signed APK attached to GitHub release

APK Signing Configuration

# Generate signing key
keytool -genkey -v -keystore release-key.keystore -alias ida-pro-mobile \
        -keyalg RSA -keysize 2048 -validity 10000

# Configure GitHub Secrets
SIGNING_KEY        # Base64 encoded keystore file
ALIAS              # Keystore alias name
KEY_STORE_PASSWORD # Keystore password
KEY_PASSWORD       # Key password

Distribution Options

  • GitHub Releases: Direct APK download from releases page
  • F-Droid: Open source app store distribution
  • Internal Testing: TestFlight-style internal distribution
  • Play Store: Google Play Store publication (with developer account)

Architecture Deep Dive

Data Flow Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   UI Layer      β”‚    β”‚  Domain Layer    β”‚    β”‚   Data Layer    β”‚
β”‚  (Compose)      │◄──►│  (ViewModels)    │◄──►│ (Repository)    β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ β€’ Screens       β”‚    β”‚ β€’ State Mgmt     β”‚    β”‚ β€’ Room DB       β”‚
β”‚ β€’ Components    β”‚    β”‚ β€’ Business Logic β”‚    β”‚ β€’ Native JNI    β”‚
β”‚ β€’ Navigation    β”‚    β”‚ β€’ Data Transform β”‚    β”‚ β€’ File System   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Native Integration Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Kotlin     β”‚    β”‚     JNI     β”‚    β”‚      C++         β”‚
β”‚   Frontend   │◄──►│   Bridge    │◄──►│    Backend       β”‚
β”‚              β”‚    β”‚             β”‚    β”‚                  β”‚
β”‚ β€’ File Load  β”‚    β”‚ β€’ Data      β”‚    β”‚ β€’ Binary Parser  β”‚
β”‚ β€’ UI Updates β”‚    β”‚   Transfer  β”‚    β”‚ β€’ Disassembler   β”‚
β”‚ β€’ User Input β”‚    β”‚ β€’ Error     β”‚    β”‚ β€’ Function       β”‚
β”‚              β”‚    β”‚   Handling  β”‚    β”‚   Detection      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security Considerations

Data Protection

  • Local Storage Encryption: SQLCipher integration for database encryption
  • Secure File Handling: Temporary file cleanup and secure deletion
  • Memory Protection: Sensitive data clearing after analysis
  • Permission Model: Minimal required permissions for file access

Binary Analysis Safety

  • Sandbox Execution: Isolated analysis environment
  • Resource Limits: Memory and CPU usage constraints
  • Input Validation: Comprehensive file format validation
  • Error Handling: Graceful handling of malformed binaries

Performance Optimizations

Mobile-Specific Optimizations

  • Lazy Loading: On-demand binary parsing and disassembly
  • Memory Management: Efficient handling of large files with pagination
  • Background Processing: Coroutines for non-blocking analysis
  • Caching Strategy: Intelligent caching of analysis results

Native Performance

  • SIMD Instructions: Vectorized operations for pattern matching
  • Multi-threading: Parallel analysis for multi-core devices
  • Memory Mapping: Efficient large file handling
  • Algorithmic Optimization: Custom algorithms optimized for mobile CPUs

License

MIT License - See LICENSE file for details.

Acknowledgments

  • Inspired by IDA Pro's powerful reverse engineering capabilities
  • Built with modern Android development best practices
  • Leverages the power of Jetpack Compose and Material Design 3
  • C++ backend designed for mobile performance constraints

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors