Perfare / Il2CppDumper

Unity il2cpp reverse engineer
MIT License
6.94k stars 1.37k forks source link

Return non-zero value on failure, and add config option for automation #357

Closed bbepis closed 3 years ago

bbepis commented 4 years ago

I'm using this project in a Unity modding framework to allow for IL2CPP support, and it is currently a bit difficult to use this tool in an automated fashion.

Currently the process returns 0 on both success and failure; it would be useful to have it return 1 or some other value on failure so that it's easy to detect if a failure occurs.

There are also problematic places like this: https://github.com/Perfare/Il2CppDumper/blob/master/Il2CppDumper/Program.cs#L213-L215 The user will not be able to input these values, so it would be good if there was a way to disable user input in the config, and have it just fail instead.

bbepis commented 3 years ago

This issue was fixed in these commits in another fork: https://github.com/BepInEx/Il2CppDumper/commit/6810a8d9084b66b145b42773c2a5b00fdf4915f7 https://github.com/BepInEx/Il2CppDumper/commit/585cc5209955a776e0e583c56b85bcfb4f0833e6

Turns out invoking a process to perform this task was horrible as it did not allow for easy propagation of errors and logging output. Instead Il2CppDumper was converted to a class library and the console aspect converted into an API to be used by other applications.

There were some issues with Il2CppDumper not disposing objects and releasing file handles correctly, which were also fixed.