Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
1–10 of 25 posts
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#2Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#3I've hacked and modded a few in the past, but they were all using Mono, so dnSpy could easily decompile them back into source code.
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#4Do many desktop Unity games use IL2Cpp nowadays? I've hacked and modded a few in the past, but they were all using Mono, so dnSpy could easily decompile them back into source code.
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#5reminds me of my GameShark, maybe it's time to add Moon Jump to a few Unity games?
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#6I've noticed that a lot of basic hacks are based on replacing some method implementation to return a fixed value, or do nothing, or writing to some memory position to change the normal game behavior to your advantage. So maybe something like that could be done for Among us.
First I learnt that it was a Unity il2cpp based game and found Il2CppDumper, a great tool for getting class names and method/field offsets in the game. That was great for understanding what I needed to modify. But then I didn't know how to modify it.
So I read a lot of great tutorials here and there and noticed that there were a lot of beginner hackers (like me) struggling with this part. There is quite a bit of low level programming stuff like assembly for function hooking, pointer arithmetics and that sort of thing.
After kinda figuring it out, I've managed to make a simple mod that allowed you to change the speed of the little guy you control by hooking some functions and changing some fields in the player object.
Then it hit me: the process to write the code to perform that sort of mods in any il2cpp based game would be exactly the same. Get your Il2CppDumper output => hook functions => do your modded stuff. So as a personal fun weekend challenge, I decided to make a tool that would be simple to use and would allow anyone to make basic mods without programming at all. And thus, il2cpp-modder was born.
Given the output from Il2CppDumper and some rules telling il2cpp-modder what you'd like to mod, it will generate C++ code to perform DLL injection in your game and run your mods. There are 4 built in mod types: - Make a function return a fixed value (eg, always return true, false, 0, 1, 99999, etc) - Set an object field to any value you want (eg, keep your player health at 100) - Replace a function call arguments (eg, always call your coins setter with 99999) - Replace a function implementation (eg, just rewrite the whole thing. Programming required!)
Maybe this can encourage less experienced hackers to try and make their first successful mods! I really hope this project can help someone. I had a lot of fun building it and I've learned a lot for doing it.
If you have a chance to try it, let me know if you found it useful! Or if you had any trouble I'll try my best to help you.
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#7Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#8Do many desktop Unity games use IL2Cpp nowadays? I've hacked and modded a few in the past, but they were all using Mono, so dnSpy could easily decompile them back into source code.
Mono runtime will load your assembly and bind it with all the pinvoke stuff and JIT.
IL2cpp will take the IL code from your assemblies and convert it to C++ when making the binary, AOT.
IL2cpp is the preferred way to make sure your game supports the most platforms.
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#9Would this work for Unity games which are running in WebGL?
Re: Show HN: Il2cpp-modder – Generate DLL injection projects for hacking Unity games
#10Do many desktop Unity games use IL2Cpp nowadays? I've hacked and modded a few in the past, but they were all using Mono, so dnSpy could easily decompile them back into source code.
> When building a project using IL2CPP, Unity converts IL code from scripts and assemblies to C++, before creating a native binary file (.exe, apk, .xap, for example) for your chosen platform. Some of the uses for IL2CPP include increasing the performance, security, and platform compatibility of your Unity projects. Mono runtime will load your assembly and bind it with all the pinvoke stuff and JIT. IL2cpp will take…
Yup, using Mono for iterating due to better build times is pretty common while using il2cpp for production releases.
ARM 64 bit can't even be targeted by Mono so unless you're keen to exhaust the address space il2cpp is the way to go.