SamboyCoding / Cpp2IL

Work-in-progress tool to reverse unity's IL2CPP toolchain.
MIT License
1.68k stars 197 forks source link

Increase analysis success rate #270

Closed Balthazariy closed 8 months ago

Balthazariy commented 8 months ago

Hi!

Have a issue when i try to decompile with next arguments - [_Cpp2IL.exe --just-give-me-dlls-asap-dammit --game-path=_] i have no more then 90% of success rate. And few methods, variables and other is empty or writed - [throw new Cpp2IlInjected.AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");]. Sometimes in methods i got - { //IL_0018: Expected I8, but got I4 //IL_001f: Expected I4, but got I8 //IL_002c: Expected I8, but got I4 //IL_0035: Expected I8, but got I4 //IL_007a: Expected F4, but got I4}

How i can increase success rate and get all 100% of code? With out - [--just-give-me-dlls-asap-dammit] attribute succes rate is ~40%

Here is all output from cmd runned with administrator: C:\Diss>Cpp2IL.exe --just-give-me-dlls-asap-dammit --game-path=C:\Diss\Balls.apk ===Cpp2IL by Samboy063=== A Tool to Reverse Unity's "il2cpp" Build Process.

[Info] [Program] Running on Win32NT [Info] [APK] Attempting to extract required files from APK C:\Diss\Balls.apk [Info] [APK] Extracting APK/lib/arm64-v8a/libil2cpp.so to C:\Users\chebu\AppData\Local\Temp\tmpE7EB.tmp [Info] [APK] Extracting APK/assets/bin/Data/Managed/Metadata/global-metadata.dat to C:\Users\chebu\AppData\Local\Temp\tmpE7EC.tmp [Info] [APK] Reading globalgamemanagers to determine unity version... [Info] [APK] Determined game's unity version to be 2022.1.23 [Warn] [Program] !!!!!!!!!!You have enabled IL-To-ASM. If this breaks, it breaks.!!!!!!!!!! [Fail] [Program] !!!!!!!!!!Throwing safety out the window, as you requested! Forget "If this breaks, it breaks", this probably WILL break!!!!!!!!!! [Info] [Library] Initializing Metadata... [Info] [Library] Using actual IL2CPP Metadata version 29,1 [Info] [Library] Initialized Metadata in 327ms [Info] [Library] Searching Binary for Required Data... [Info] [Library] Got Binary codereg: 0x18F8DD8, metareg: 0x1974AF8 in 1111ms. [Info] [Library] Initializing Binary... [Info] [Library] Initialized Binary in 164ms [Info] [Library] Mapping pointers to Il2CppMethodDefinitions...Processed 35334 OK (40ms) [Info] [Program] Building assemblies...This may take some time. [Info] [Program] Finished Building Assemblies in 585ms [Info] [Program] Fixing up explicit overrides. Any warnings you see here aren't errors - they usually indicate improperly stripped or obfuscated types, but this is not a big deal. This should only take a second... [Info] [Program] Fixup complete (60ms) [Info] [Program] Running Scan for Known Functions... [Info] [Program] Running entire .text section through Arm64 disassembler, this might take up to several minutes for large games, and may fail on large games if you have <16GB ram... [Info] [Program] Applying type, method, and field attributes for 42 assemblies...This may take a couple of seconds [Info] [Program] Finished Applying Attributes in 412ms [Info] [Program] Populating Concrete Implementation Table... [Info] [Harmony] Patching Cecil for better error messages... [Info] [Program] Saving 42 assemblies to C:\Diss\cpp2il_out... [Info] [Program] Running Analysis for Assembly-CSharp.dll... [Info] [Program] This assembly contains 75 types. Assuming an average rate of 20 types per second, this will take approximately 3 seconds, or 0,1 minutes, to process. [Info] [Analyze] 10% (8 classes in 0 sec, ~112 classes / sec, 67 classes remaining, approx 6 sec remaining) [Info] [Analyze] 20% (16 classes in 1 sec, ~14 classes / sec, 59 classes remaining, approx 9 sec remaining) [Info] [Analyze] 30% (23 classes in 24 sec, ~1 classes / sec, 52 classes remaining, approx 59 sec remaining) [Info] [Analyze] 40% (31 classes in 25 sec, ~1 classes / sec, 44 classes remaining, approx 40 sec remaining) [Info] [Analyze] 50% (38 classes in 25 sec, ~2 classes / sec, 37 classes remaining, approx 30 sec remaining) [Info] [Analyze] 60% (46 classes in 25 sec, ~2 classes / sec, 29 classes remaining, approx 21 sec remaining) [Info] [Analyze] 70% (53 classes in 28 sec, ~2 classes / sec, 22 classes remaining, approx 17 sec remaining) [Info] [Analyze] 80% (61 classes in 30 sec, ~2 classes / sec, 14 classes remaining, approx 12 sec remaining) [Info] [Analyze] 90% (68 classes in 31 sec, ~2 classes / sec, 7 classes remaining, approx 8 sec remaining) [Info] [Analyze] Finished processing 491 methods in 308091407 ticks (about 30,8 seconds), at an overall rate of about 2 types/sec, 16 methods/sec [Info] [Program] Overall analysis success rate: 90% (442) of 491 methods. [Info] [Program] Saving 1 assembly to C:\Diss\cpp2il_out... [Info] [Program] Cleaning up C:\Users\chebu\AppData\Local\Temp\tmpE7EB.tmp... [Info] [Program] Cleaning up C:\Users\chebu\AppData\Local\Temp\tmpE7EC.tmp... [Info] [Program] Done.

.Net istalled 6 and 7. Win10 Pro x64.

Balthazariy commented 8 months ago

Open discord and find info :)