How perfare/zygisk-il2cppdumper works
Based on our analysis of the file tree and README, this project is a specialized Android module called “Zygisk-Il2CppDumper.” Its purpose is to hook into game processes at runtime—via Magisk’s Zygisk framework—to dump Il2Cpp data (even when that data is protected, encrypted, or obfuscated). The project is built using Gradle (with both Android-specific and C++ native code components) and packages a Magisk module (using the provided template) for installation on rooted Android devices.
Main Components
• Android Environment & Magisk Framework: Represent the target device environment where Magisk (v24 or later) and Zygisk are enabled.
• Zygisk Injection Module: This is the Magisk module built from the provided module sources, which integrates with the game process at runtime.
• Native Code Layer (C++): Under module/src/main/cpp, the dumper logic is implemented (including files like hack.cpp, il2cpp_dump.cpp, and the xdl utility functions). This section covers the interaction with the native Android runtime via C/C++.
• Build & Deployment Infrastructure: Show the Gradle build system, including build scripts (build.gradle, module.gradle), CMake files, and the gradle wrapper. Also include the GitHub Actions workflow which provides automated builds.
• Magisk Module Template: (Located in template/magisk_module) defines the schema and metadata (module.prop, updater-script, update-binary) required by Magisk to recognize and install the module.
• Game Process & Dump Output: The final target, where the module interferes with or hooks the game process to dump the il2cpp data (e.g., generating dump.cs in the game’s data directory).
Relationships and Interactions
• The Android Environment loads Magisk with the enabled Zygisk feature.
• Upon starting the game, Magisk (via Zygisk) loads the injected module.
• The module’s native code (compiled via C++ build defined by CMakeLists.txt and Gradle tasks) hooks into the game’s process and accesses the Il2Cpp data.
• The extracted runtime data flows from the game process to the module’s dumping logic, eventually generating the dump file (dump.cs) in the game’s file directory.
• The build/deployment pipeline (GitHub Actions or Android Studio) packages the module correctly (using the provided Magisk module template) before deployment.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly differentiate between build configuration (Gradle scripts), UI/Android-level configuration (AndroidManifest.xml), and performance-critical native code (C++ sources).
• Modular Design: The integration of a Magisk module template along with separate “module” source code emphasizes reusability and compartmentalization.
• Hooking/Injection Mechanism: The Zygisk integration leverages dynamic loading/injection, which is pivotal in understanding the data flow – from game process to dump output.
Relevant Technologies and Frameworks
• Android Studio/Gradle for build and project management.
• C/C++ for the native code, managed using CMake.
• Magisk and Zygisk for runtime injection/hooking on Android.
• GitHub Actions for Continuous Integration (CI) and building the module package.
• Magisk Module Template components (update-binary, updater-script, etc.) that facilitate module deployment.
Elements
• Each major component (Android Environment, Magisk Framework, Zygisk Module, Native Layer, Build Pipeline, and Game Process) should be clearly labeled.
Final Advice
• Be very detailed – segregate the project into as many clear components as feasible. For instance, you might separate the Gradle build configuration, native code, and Magisk module packaging sections.
• Verify that the data flow from the game process to the file generation (dump.cs) is clearly represented.