Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.OverflowException: Arithmetic operation resulted in an overflow. #234

Open
PickleOnAString opened this issue Aug 29, 2023 · 3 comments
Labels
area:libcpp2il bug Something isn't working

Comments

@PickleOnAString
Copy link

===Cpp2IL by Samboy063===
A Tool to Reverse Unity's "il2cpp" Build Process.

[Info] [Program] Running on Win32NT
[Info] [Program] Determined game's unity version to be 2022.1.0
[Info] [Library] Initializing Metadata...
[Info] [Library]        Using actual IL2CPP Metadata version 29.1
[Info] [Library] Initialized Metadata in 491ms
[Info] [Library] Searching Binary for Required Data...
[Info] [Library] Got Binary codereg: 0x18252C310, metareg: 0x18298A470 in 176ms.
[Info] [Library] Initializing Binary...
[Fail] [Program]

Cpp2IL.Core.Exceptions.LibCpp2ILInitializationException: Fatal Exception initializing LibCpp2IL!
 ---> System.OverflowException: Arithmetic operation resulted in an overflow.
   at LibCpp2IL.ClassReadingBinaryReader.ReadClassArrayAtRawAddr[T](Int64 offset, Int64 count)
   at LibCpp2IL.Il2CppBinary.Init(UInt64 pCodeRegistration, UInt64 pMetadataRegistration)
   at LibCpp2IL.LibCpp2IlMain.Initialize(Byte[] binaryBytes, Byte[] metadataBytes, Int32[] unityVersion)
   at LibCpp2IL.LibCpp2IlMain.LoadFromFile(String pePath, String metadataPath, Int32[] unityVersion)
   at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, Int32[] unityVersion, Boolean allowUserToInputAddresses)
   --- End of inner exception stack trace ---
   at Cpp2IL.Core.Cpp2IlApi.InitializeLibCpp2Il(String assemblyPath, String metadataPath, Int32[] unityVersion, Boolean allowUserToInputAddresses)
   at Cpp2IL.Program.MainWithArgs(Cpp2IlRuntimeArgs runtimeArgs)
   at Cpp2IL.Program.Main(String[] args)

Waiting for you to press enter - feel free to copy the error...

the game is slime rancher 2

@SamboyCoding
Copy link
Owner

This might be due to the Unity version SR2 uses. There's a couple of 2021.2 subversions that have their exe files incorrectly labelled as 2022.1, which triggers CPP2IL to try to read the metadata as V29.1 instead of V29. With that said, I believe you mentioned in discord that this doesn't happen in the development branch (the pre-releases) and I don't think the code has changed.

You can try using the --force- options (use --help to list them) and manually specify the correct unity version, and see if this helps?

@SamboyCoding SamboyCoding added bug Something isn't working area:libcpp2il labels Aug 30, 2023
@KomiksPL
Copy link

On nightly it works

@PickleOnAString
Copy link
Author

yeah it works on nightly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:libcpp2il bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants