Closed i30817 closed 6 years ago
Not the author, but take a look at dnspy, it allows you to edit an assembly in c#. And yeah, rimworld loads mod dlls by itself. As far as I know, harmony doesn't have an injection loader by itself.
Author is currently in Africa and doesn't have internet for most of this month.
Actually, this project looks promising: https://github.com/HearthSim/UnityHook
It apparently has a class dedicated exclusively to direct the library to the games assemblies on various platform specific locations. Unfortunately it only runs code after function returns apparently while i pretty much need to run it on arguments (replace a argument to be specific). Could be a source of ideas for a injection framework.
You could use that to insert a call that loads yours and harmony's dlls very early.
Harmony works with Unity on Linux and Windows (tested with .Net subset 3.5, I dont know if it will work with 4.6 too)
The purpose of Harmony is to patch code. I leave injecting the initial code into applications to someone else.
I'm looking to mod shadowrun returns on a 'semi-portable' way. I did the hack i wanted before by injecting IL code into the assembly (with a tool i forget), but then changed version of the game from windows to linux (and it updated) and it all got lost, and i was tired of editing those methods one at a time in a that awful language.
As far as i can tell this is almost ideal... except it doesn't have a example of how to hook into a commercial unity game dll that is not prepared part of your project already, afaict (that's the vibe i get from the Rimworld examples, might be wrong).
Is there some general crossplatform injection loader i'm missing?