Skip to content

Commit c543024

Browse files
feat(config): add runtime configuration system for dynamic DexDumper behavior
1 parent 9ed9beb commit c543024

File tree

9 files changed

+723
-55
lines changed

9 files changed

+723
-55
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DexDumper is an advanced Android library that performs runtime memory analysis t
1414
- **🛡️ Safe Memory Access** - Signal-handled memory reading prevents crashes
1515
- **📊 Duplicate Prevention** - SHA1 checksum and inode-based duplicate detection
1616
- **🧹 Exclusion Control** - SHA1-based exclusion list to skip unwanted DEX files
17+
- **⚙️ Runtime Configuration** - Dynamic configuration without recompiling via external config files
1718

1819
## 💡 Why Choose DexDumper?
1920

@@ -27,6 +28,14 @@ If this library is implemented in a sandbox or virtual machine, it can dump the
2728
- Clone and run the official/test apps inside the sandbox or virtual machine.
2829
- The dex files of the official/test apps will be dumped and saved.
2930

31+
**🔧 Dynamic Runtime Configuration**
32+
DexDumper features an advanced runtime configuration system that allows you to customize behavior without recompiling:
33+
34+
- Automatically detects and pairs configuration files with library names.
35+
- If no config exists, DexDumper creates a detailed, commented configuration file.
36+
37+
*How it works:* The library automatically extracts its own filename (e.g., `libdexdumper.so``dexdumper.conf`) and searches for matching configuration files. This ensures that even when you rename the library for stealth, the configuration system remains functional.
38+
3039
## 🛠️ Build & Installation
3140

3241
### Prerequisites
@@ -161,6 +170,22 @@ DexDumper will automatically try these directories in order. You can change the
161170
#define MAX_REGION_SIZE (200 * 1024 * 1024)
162171
```
163172
173+
### Runtime Configuration ([LIBRARY_NAME].conf)
174+
175+
DexDumper automatically creates and reads configuration files at runtime. No recompilation needed!
176+
177+
**Configuration File Locations:**
178+
- `/data/data/[PACKAGE]/files/[LIBRARY_NAME].conf`
179+
- `/data/user/0/[PACKAGE]/files/[LIBRARY_NAME].conf`
180+
- `/storage/emulated/0/Android/data/[PACKAGE]/files/[LIBRARY_NAME].conf`
181+
182+
**First Run Behavior:**
183+
- Automatically generates a detailed configuration file with explanations
184+
- Uses compile-time defaults until you customize the file
185+
- File includes comprehensive comments for every setting
186+
187+
**To customize:** Edit the generated `.conf` file, save, and restart the app. The library will use your new settings immediately.
188+
164189
## 📊 Performance Considerations
165190
166191
- **Memory Usage**: Minimal impact (typically < 10MB)

jni/Android.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ LOCAL_SRC_FILES := \
1717
../src/memory_scanner.c \
1818
../src/dex_detector.c \
1919
../src/stealth.c \
20-
../src/sha1.c
20+
../src/sha1.c \
21+
../src/config_manager.c
2122

2223
# Compiler flags
2324
LOCAL_CFLAGS := -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -O2

src/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include <stdint.h> // Fixed-width integer types
2828
#include <stddef.h> // Standard definitions
2929
#include <ctype.h> // Character type checking and conversion
30+
#include <dlfcn.h> // Dynamic linking operations
31+
#include <libgen.h> // Pathname manipulation
3032

3133
/**
3234
* @brief Represents a memory region from /proc/self/maps

0 commit comments

Comments
 (0)