Tool Il2CppInspector CLI by djkaty compiled for macOS and Linux

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,580
313,455
1,213
Modding World
1623851154617.png


Execute Il2CppInspector via command line on macOS or Linux

Note for macOS:
This also works on Apple M1/Silicon computers.
If you got permission denied, please run this command
chmod +x Il2CppInspector
Then you can execute Il2CppInspector

Usage:
Basic example
Code:
./Il2CppInspector -i (binary file) -m (metadata)
Code:
  -i, --bin                   (Default: libil2cpp.so) IL2CPP binary, APK, AAB, XAPK, IPA, Zip or Linux process map text input file(s) (single file or comma-separated list for split APKs)

  -m, --metadata              (Default: global-metadata.dat) IL2CPP metadata file input (ignored for APK/AAB/XAPK/IPA/Zip)

  --image-base                For ELF memory dumps, the image base address in hex (ignored for standard ELF files and other file formats)

  --select-outputs            Only generate outputs specified on the command line (use --cs-out, --py-out, --cpp-out, --json-out, --dll-out to select outputs). If not specified, all outputs are generated

  -c, --cs-out                (Default: types.cs) C# output file (when using single-file layout) or path (when using per namespace, assembly or class layout)

  -p, --py-out                (Default: il2cpp.py) Python script output file

  -h, --cpp-out               (Default: cpp) C++ scaffolding / DLL injection project output path

  -o, --json-out              (Default: metadata.json) JSON metadata output file

  -d, --dll-out               (Default: dll) .NET assembly shim DLLs output path

  --metadata-out              IL2CPP metadata file output (for extracted or decrypted metadata; ignored otherwise)

  --binary-out                IL2CPP binary file output (for extracted or decrypted binaries; ignored otherwise; suffixes will be appended for multiple files)

  -e, --exclude-namespaces    (Default: System Mono Microsoft.Reflection Microsoft.Win32 Internal.Runtime Unity UnityEditor UnityEngine UnityEngineInternal AOT JetBrains.Annotations) Comma-separated list of namespaces to suppress in C# output, or 'none' to include all namespaces

  -l, --layout                (Default: single) Partitioning of C# output ('single' = single file, 'namespace' = one file per namespace in folders, 'assembly' = one file per assembly, 'class' = one file per class in namespace folders, 'tree' = one file per class in assembly and
                              namespace folders)

  -s, --sort                  (Default: index) Sort order of type definitions in C# output ('index' = by type definition index, 'name' = by type name). No effect when using file-per-class or tree layout

  -f, --flatten               Flatten the namespace hierarchy into a single folder rather than using per-namespace subfolders. Only used when layout is per-namespace or per-class. Ignored for tree layout

  -n, --suppress-metadata     Diff tidying: suppress method pointers, field offsets and type indices from C# output. Useful for comparing two versions of a binary for changes with a diff tool

  --suppress-dll-metadata     Diff tidying: suppress method pointers, field offsets and type indices attributes from DLL output. Useful for comparing two versions of a binary for changes

  -k, --must-compile          Compilation tidying: try really hard to make code that compiles. Suppress generation of code for items with CompilerGenerated attribute. Comment out attributes without parameterless constructors or all-optional constructor arguments. Don't emit
                              add/remove/raise on events. Specify AttributeTargets.All on classes with AttributeUsage attribute. Force auto-properties to have get accessors. Force regular properties to have bodies. Suppress global::Locale classes. Generate dummy parameterless
                              base constructors and ref return fields.

  --separate-attributes       Place assembly-level attributes in their own AssemblyInfo.cs files. Only used when layout is per-assembly or tree

  -j, --project               Create a Visual Studio solution and projects. Implies --layout tree, --must-compile and --separate-attributes

  --cpp-compiler              (Default: BinaryFormat) Compiler to target for C++ output (MSVC or GCC); selects based on binary executable type by default

  -t, --script-target         (Default: IDA) Application to target for Python script output (IDA or Ghidra) - case-sensitive

  --unity-path                (Default: C:\Program Files\Unity\Hub\Editor\*) Path to Unity editor (when using --project). Wildcards select last matching folder in alphanumeric order

  --unity-assemblies          (Default: C:\Program Files\Unity\Hub\Editor\*\Editor\Data\Resources\PackageManager\ProjectTemplates\libcache\com.unity.template.3d-*\ScriptAssemblies) Path to Unity script assemblies (when using --project). Wildcards select last matching folder in
                              alphanumeric order

  --unity-version             Version of Unity used to create the input files, if known. Used to enhance Python, C++ and JSON output. If not specified, a close match will be inferred automatically.

  --unity-version-from-asset  A Unity asset file used to determine the exact Unity version. Overrides --unity-version.

  --plugins                   Specify options for plugins. Enclose each plugin's configuration in quotes as follows: --plugins "pluginone --option1 value1 --option2 value2" "plugintwo --option...". Use --plugins <name> to get help on a specific plugin

  --help                      Display this help screen.

  --version                   Display version information.
Download links:
View Folder - SBUpload - The next-gen File Hosting



Do not forget to extract plugins folder too!

README page:
djkaty/Il2CppInspector

How to build:
djkaty/Il2CppInspector

Credit:
djkaty
 

Attachments

Last edited:

Cato90

Rookie
Oct 24, 2023
3
0
1
33
Hi @AndnixSH, could you please advise how to run this in MacOS? As you said, I executed the "chmod +x Il2CppInspector" command so my "Il2CppInspector-cli" is now executable. However, when I run it I get "File libil2cpp.so does not exist" and nothing happens.

Do I need to put the "libil2cpp.so" and "global-metadata.dat" files somewhere specific? And what about all the other files that are part of an IL2CPP build, like "libmain.so"? Can these just be discarded? Many Thanks. (FYI my project is a Unity Android Project that I built using IL2CPP within Unity).
 

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,580
313,455
1,213
Modding World
Hi @AndnixSH, could you please advise how to run this in MacOS? As you said, I executed the "chmod +x Il2CppInspector" command so my "Il2CppInspector-cli" is now executable. However, when I run it I get "File libil2cpp.so does not exist" and nothing happens.

Do I need to put the "libil2cpp.so" and "global-metadata.dat" files somewhere specific? And what about all the other files that are part of an IL2CPP build, like "libmain.so"? Can these just be discarded? Many Thanks. (FYI my project is a Unity Android Project that I built using IL2CPP within Unity).
The question is did you read the usage I have mentioned in the thread?
 

Cato90

Rookie
Oct 24, 2023
3
0
1
33
The question is did you read the usage I have mentioned in the thread?
I absolutely did but unfortunately I do not understand it very well. This is my first attempt at doing any of this decompilation type stuff, and I'm also not very familiar with the terminal/command line (I'm using macOS).
 

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,580
313,455
1,213
Modding World
I absolutely did but unfortunately I do not understand it very well. This is my first attempt at doing any of this decompilation type stuff, and I'm also not very familiar with the terminal/command line (I'm using macOS).
That's the problem. You need to know basics of using terminal, and also know important tricks like drag and drop files into terminal to write the full path
 

Cato90

Rookie
Oct 24, 2023
3
0
1
33
That's the problem. You need to know basics of using terminal, and also know important tricks like drag and drop files into terminal to write the full path
Okay thanks for the advice, I'll dig around then and try to find some introductory tutorials on the stuff you mentioned. If you had any links that give a good overview on what you think is relevant, that would be really appreciated.