Tutorial How to use Riru-Il2CppDumper to dump Il2Cpp games (Magisk 23 and below)

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,757
301,056
1,213
Modding World
For Magisk 24 and above, please see new tutorial: How to use Zygisk-Il2CppDumper to dump Il2Cpp games (Magisk 24 and up) - Platinmods.com - Android & iOS MODs, Mobile Games & Apps

Riru-Il2CppDumper is a magisk module that hooks into the game, and dumps data while the game is running, even the game is protected and encrypted. Riru-Il2cppDumper can dump protected games that you can't with normal Il2cppDumper, even you used GG or LibDumper to dump .so and .dat file

This module requires root with magisk, if you don't have root, please use Auto-Il2CppDumper by BrianGIG: How to use Auto-Il2CppDumper to dump protected games (No magisk) - Platinmods.com - Android & iOS MODs, Mobile Games & Apps

This is not an 1-click dump, this is a DIY tutorial, you must do the following steps manually and compile the module by yourself. You just need to know how to use Android Studio and make some changes, no need programming skills. NEVER ask me to dump it for you

This will not work on some games with higher protections. Some games can detect tampered APK and detect hooking. It is always a matter of time the game developer will upgrade protection anytime!

Are you ready? let's go:

Requirements:
- Riru-Il2CppDumper (last version before Zygisk migration: 20 Nov 2021): GitHub - Perfare/Zygisk-Il2CppDumper at 1b9333373217d064ce1253eccb0e579bd8cfe20e
- Android Studio with SDK and NDK installed: Download Android Studio and SDK tools | Android Developers
- Magisk: Releases · topjohnwu/Magisk
- Riru magisk module (Can be downloaded via Magisk manager): Releases · RikkaApps/Riru

Steps:
Know the unity version: How to get unity version from any asset file - Platinmods.com - Android & iOS MODs, Mobile Games & Apps

1625591406820.png


Open the project in Android Studio. Wait for the Gradles to load

Open game.h. An example has been setup

1629306823718.png


Before you change version, read the Unity version compatible list in the game.h
and comment out or remove defines if one or more are below than that

For example my game is 2019.4.0f1, I changed version to 2019.3.7f1 game.h and commented out the following definitions

Code:
//#define VersionAbove2020dot2
//#define VersionAbove2021dot1
And know the game's package name. You can easly find out anywhere, from Playstore's URL, APKcombo's URL, etc

Image 1629306993.png


Compile the module

First do Build -> Make project

Then Build -> Make module

Image 1616754574.png


File comes out as riru-il2cppdumper-vX.X.X.debug.zip under out folder

1629307351476.png


Copy the file to your phone

Install Riru on Magisk if you haven't installed already, It's called Riru in the Modules list. Don't reboot yet

Screenshot_20210706-163750.png


Now Install the riru-il2cppdumper-vX.X.X.debug.zip module from your storage

Screenshot_20210706-191714.png


Screenshot_20210706-191738.png


Reboot after install

Check your module list again, see if Riru module is running. If it says Loaded 1 modules or more, you are good to go. If it says Loaded 0 modules, something is wrong with your setup

1631629402142.png


Open the game, it will generate dump.cs to /data/data/(Game package name)/files/ within a few sec. You may need to wait a few secs or wait for game data to be finished downloading, until it has been dumped

Screenshot_20210818-193251.png


Congratz, you have successfully dumped it!

Having issues? Try to dump unprotected game like Among US or Subway Sufers to see if it works, if not work, your device may not compatible or the Magisk or Riru module is not working
If it works, then the other game you had tried is protected against Riru dump

Report issues to github page Issues · Perfare/Riru-Il2CppDumper

Other ways to dump:
Auto-Il2CppDumper (No root): How to use Auto-Il2CppDumper to dump protected games (No root) - Platinmods.com - Android & iOS MODs, Mobile Games & Apps

LibDumper (Root only. Recommended if you use Emulator): How to Dump Protected libil2cpp & libUE4 game, metadata file and other non-unity games [NEW METHOD] - Platinmods.com - Android & iOS MODs, Mobile Games & Apps
 
Last edited:

WCJongkok

Solid & Active Platinian
May 11, 2020
60
1,775
183
29
Heaven
i got this error, any help?
Code:
> Task :module:externalNativeBuildDebug FAILED

Execution failed for task ':module:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process E:\MODAPK\TOOL\SDK\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C E:\MODAPK\TOOL\Riru-Il2CppDumper fixed\Riru-Il2CppDumper\module\.cxx\cmake\debug\armeabi-v7a android_example riru_il2cppdumper}
  ninja: Entering directory `E:\MODAPK\TOOL\Riru-Il2CppDumper fixed\Riru-Il2CppDumper\module\.cxx\cmake\debug\armeabi-v7a'
  [1/5] Building CXX object CMakeFiles/riru_il2cppdumper.dir/main.cpp.o
  FAILED: CMakeFiles/riru_il2cppdumper.dir/main.cpp.o
  E:\MODAPK\TOOL\SDK\ndk\22.1.7171670\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi23 --gcc-toolchain=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -DRIRU_MODULE -DRIRU_MODULE_API_VERSION=10 -DRIRU_MODULE_VERSION=1 -DRIRU_MODULE_VERSION_NAME=\"v1.1\" -Driru_il2cppdumper_EXPORTS -I"E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/Dobby/include" -isystem C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Werror=format -fdata-sections -ffunction-sections -O0 -O0 -fno-limit-debug-info  -fPIC   -std=gnu++11 -MD -MT CMakeFiles/riru_il2cppdumper.dir/main.cpp.o -MF CMakeFiles\riru_il2cppdumper.dir\main.cpp.o.d -o CMakeFiles/riru_il2cppdumper.dir/main.cpp.o -c "E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp"
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:78:1: error: unknown type name 'RiruApiV9'
  RiruApiV9 *riru_api_v9;
  ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:103:7: error: functions that differ only in their return type cannot be overloaded
  void *init(void *arg) {
  ~~~~~~^
  C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include\riru.h:91:38: note: previous declaration is here
  RIRU_EXPORT RiruVersionedModuleInfo *init(Riru *riru) ;
              ~~~~~~~~~~~~~~~~~~~~~~~~~^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:122:36: error: use of undeclared identifier 'RiruApiV9'
                      riru_api_v9 = (RiruApiV9 *) arg;
                                     ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:122:47: error: expected expression
                      riru_api_v9 = (RiruApiV9 *) arg;
                                                ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:124:36: error: use of undeclared identifier 'RiruModuleInfoV9'
                      auto module = (RiruModuleInfoV9 *) malloc(sizeof(RiruModuleInfoV9));
                                     ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:124:54: error: expected expression
                      auto module = (RiruModuleInfoV9 *) malloc(sizeof(RiruModuleInfoV9));
                                                       ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:125:46: error: unknown type name 'RiruModuleInfoV9'; did you mean 'RiruModuleInfo'?
                      memset(module, 0, sizeof(RiruModuleInfoV9));
                                               ^~~~~~~~~~~~~~~~
                                               RiruModuleInfo
  C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include\riru.h:63:3: note: 'RiruModuleInfo' declared here
  } RiruModuleInfo;
    ^
  7 errors generated.
  [2/5] Building CXX object CMakeFiles/riru_il2cppdumper.dir/hook.cpp.o
  [3/5] Linking CXX executable dobby\example\android_example
  [4/5] Building CXX object CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o
  FAILED: CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o
  E:\MODAPK\TOOL\SDK\ndk\22.1.7171670\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi23 --gcc-toolchain=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -DRIRU_MODULE -DRIRU_MODULE_API_VERSION=10 -DRIRU_MODULE_VERSION=1 -DRIRU_MODULE_VERSION_NAME=\"v1.1\" -Driru_il2cppdumper_EXPORTS -I"E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/Dobby/include" -isystem C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Werror=format -fdata-sections -ffunction-sections -O0 -O0 -fno-limit-debug-info  -fPIC   -std=gnu++11 -MD -MT CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o -MF CMakeFiles\riru_il2cppdumper.dir\il2cpp_dump.cpp.o.d -o CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o -c "E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp"
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp:345:27: error: use of undeclared identifier 'il2cpp_image_get_class_count'; did you mean 'il2cpp_image_get_entry_point'?
          auto classCount = il2cpp_image_get_class_count(image);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            il2cpp_image_get_entry_point
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cppapi/2017.2.1f1/il2cpp-api-functions.h:235:27: note: 'il2cpp_image_get_entry_point' declared here
  DO_API(const MethodInfo*, il2cpp_image_get_entry_point, (const Il2CppImage * image));
                            ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp:346:27: error: comparison between pointer and integer ('int' and 'const MethodInfo *')
          for (int j = 0; j < classCount; ++j) {
                          ~ ^ ~~~~~~~~~~
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp:347:26: error: use of undeclared identifier 'il2cpp_image_get_class'
              auto klass = il2cpp_image_get_class(image, j);
                           ^
  3 errors generated.
  ninja: build stopped: subcommand failed.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
 

TFive

Platinian
May 5, 2019
16
62
78
Thai
i got this error, any help?
Code:
> Task :module:externalNativeBuildDebug FAILED

Execution failed for task ':module:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process E:\MODAPK\TOOL\SDK\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C E:\MODAPK\TOOL\Riru-Il2CppDumper fixed\Riru-Il2CppDumper\module\.cxx\cmake\debug\armeabi-v7a android_example riru_il2cppdumper}
  ninja: Entering directory `E:\MODAPK\TOOL\Riru-Il2CppDumper fixed\Riru-Il2CppDumper\module\.cxx\cmake\debug\armeabi-v7a'
  [1/5] Building CXX object CMakeFiles/riru_il2cppdumper.dir/main.cpp.o
  FAILED: CMakeFiles/riru_il2cppdumper.dir/main.cpp.o
  E:\MODAPK\TOOL\SDK\ndk\22.1.7171670\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi23 --gcc-toolchain=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -DRIRU_MODULE -DRIRU_MODULE_API_VERSION=10 -DRIRU_MODULE_VERSION=1 -DRIRU_MODULE_VERSION_NAME=\"v1.1\" -Driru_il2cppdumper_EXPORTS -I"E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/Dobby/include" -isystem C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Werror=format -fdata-sections -ffunction-sections -O0 -O0 -fno-limit-debug-info  -fPIC   -std=gnu++11 -MD -MT CMakeFiles/riru_il2cppdumper.dir/main.cpp.o -MF CMakeFiles\riru_il2cppdumper.dir\main.cpp.o.d -o CMakeFiles/riru_il2cppdumper.dir/main.cpp.o -c "E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp"
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:78:1: error: unknown type name 'RiruApiV9'
  RiruApiV9 *riru_api_v9;
  ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:103:7: error: functions that differ only in their return type cannot be overloaded
  void *init(void *arg) {
  ~~~~~~^
  C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include\riru.h:91:38: note: previous declaration is here
  RIRU_EXPORT RiruVersionedModuleInfo *init(Riru *riru) ;
              ~~~~~~~~~~~~~~~~~~~~~~~~~^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:122:36: error: use of undeclared identifier 'RiruApiV9'
                      riru_api_v9 = (RiruApiV9 *) arg;
                                     ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:122:47: error: expected expression
                      riru_api_v9 = (RiruApiV9 *) arg;
                                                ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:124:36: error: use of undeclared identifier 'RiruModuleInfoV9'
                      auto module = (RiruModuleInfoV9 *) malloc(sizeof(RiruModuleInfoV9));
                                     ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:124:54: error: expected expression
                      auto module = (RiruModuleInfoV9 *) malloc(sizeof(RiruModuleInfoV9));
                                                       ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/main.cpp:125:46: error: unknown type name 'RiruModuleInfoV9'; did you mean 'RiruModuleInfo'?
                      memset(module, 0, sizeof(RiruModuleInfoV9));
                                               ^~~~~~~~~~~~~~~~
                                               RiruModuleInfo
  C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include\riru.h:63:3: note: 'RiruModuleInfo' declared here
  } RiruModuleInfo;
    ^
  7 errors generated.
  [2/5] Building CXX object CMakeFiles/riru_il2cppdumper.dir/hook.cpp.o
  [3/5] Linking CXX executable dobby\example\android_example
  [4/5] Building CXX object CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o
  FAILED: CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o
  E:\MODAPK\TOOL\SDK\ndk\22.1.7171670\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv7-none-linux-androideabi23 --gcc-toolchain=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=E:/MODAPK/TOOL/SDK/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -DRIRU_MODULE -DRIRU_MODULE_API_VERSION=10 -DRIRU_MODULE_VERSION=1 -DRIRU_MODULE_VERSION_NAME=\"v1.1\" -Driru_il2cppdumper_EXPORTS -I"E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/Dobby/include" -isystem C:/Users/Asus/.gradle/caches/transforms-2/files-2.1/587a97d280218e31b9b8b3a8a1dc1499/jetified-riru-25.0.1/prefab/modules/riru/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Werror=format -fdata-sections -ffunction-sections -O0 -O0 -fno-limit-debug-info  -fPIC   -std=gnu++11 -MD -MT CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o -MF CMakeFiles\riru_il2cppdumper.dir\il2cpp_dump.cpp.o.d -o CMakeFiles/riru_il2cppdumper.dir/il2cpp_dump.cpp.o -c "E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp"
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp:345:27: error: use of undeclared identifier 'il2cpp_image_get_class_count'; did you mean 'il2cpp_image_get_entry_point'?
          auto classCount = il2cpp_image_get_class_count(image);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            il2cpp_image_get_entry_point
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cppapi/2017.2.1f1/il2cpp-api-functions.h:235:27: note: 'il2cpp_image_get_entry_point' declared here
  DO_API(const MethodInfo*, il2cpp_image_get_entry_point, (const Il2CppImage * image));
                            ^
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp:346:27: error: comparison between pointer and integer ('int' and 'const MethodInfo *')
          for (int j = 0; j < classCount; ++j) {
                          ~ ^ ~~~~~~~~~~
  E:/MODAPK/TOOL/Riru-Il2CppDumper fixed/Riru-Il2CppDumper/module/src/main/cpp/il2cpp_dump.cpp:347:26: error: use of undeclared identifier 'il2cpp_image_get_class'
              auto klass = il2cpp_image_get_class(image, j);
                           ^
  3 errors generated.
  ninja: build stopped: subcommand failed.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Riru-Il2CppDumper fixed <- white space issue changed to something else
ex. Riru-Il2CppDumper-fixed
 

WCJongkok

Solid & Active Platinian
May 11, 2020
60
1,775
183
29
Heaven
fixed mine, actually i just need to disable "#define VersionAbove24" under "#define UnityVersion xxx" bcs my unity game using 2017.2.xx version