Can someone help me modify .dll files?

Users who are viewing this thread

I can see the files that I want to edit but I have no idea how to edit .dll files, only view them. I would like to mod Bannerlord but all the files I need to change are in .dll format
 
Solution
I'm not a real experienced programer. I really only know how to read and modify code and make my own programs and modify other peoples slightly. But I have little idea how to do as you described. Where would I be able to look to learn this?
There are several tutorials for the Visual Studio 2019 (it is free to use as a Community version). The clearest one that helped me a lot is a video tutorial series that goes through all the motions
I am modifying a dll... I used visual studio code with an extension for ilspy to decompile the dll… I did not have the proper references so get and set properties get turned into methods.... so I just made my own visual studio project using the tutorial, it will tell you the references you have to add for your project. The tutorial is here modding wiki. Once you have a class library open, copy all the code into the namespace. Then make a bunch of edits to get rid of all errors. Fix get_/set_ method calls and a few other things I forget. After you can just edit the code to do whatever.
 
Upvote 0
Use DNspy. It is straight forward. Open whatever DLL you want, load all the references from the bin folder, edit the code you want, compile, and extract it back as a dll.
 
Upvote 0
Use DNspy. It is straight forward. Open whatever DLL you want, load all the references from the bin folder, edit the code you want, compile, and extract it back as a dll.
This is not a mod though, it's a substitution of original DLL. Would work but would be a hassle to maintain through patches and keep compartible with other stuff.
A real mod would be there in the launcher so you can tick/untick it, and would use inherited classes in the completely new DLL to hook into original methods and override/modify them
 
Upvote 0
This is not a mod though, it's a substitution of original DLL. Would work but would be a hassle to maintain through patches and keep compartible with other stuff.
A real mod would be there in the launcher so you can tick/untick it, and would use inherited classes in the completely new DLL to hook into original methods and override/modify them
I'm not a real experienced programer. I really only know how to read and modify code and make my own programs and modify other peoples slightly. But I have little idea how to do as you described. Where would I be able to look to learn this?
 
Upvote 0
I'm not a real experienced programer. I really only know how to read and modify code and make my own programs and modify other peoples slightly. But I have little idea how to do as you described. Where would I be able to look to learn this?
There are several tutorials for the Visual Studio 2019 (it is free to use as a Community version). The clearest one that helped me a lot is a video tutorial series that goes through all the motions
 
Upvote 0
Solution
This is not a mod though, it's a substitution of original DLL. Would work but would be a hassle to maintain through patches and keep compartible with other stuff.
A real mod would be there in the launcher so you can tick/untick it, and would use inherited classes in the completely new DLL to hook into original methods and override/modify them
Well read the thread title pal, he was not asking how to make a mod, he was asking how to edit a DLL.
Needless to say, the method you mentioned can get you only so far because the modding api is not officially released and is severely limited. More advanced things like skill editing, AI editing, price editing, quest editing, whatever will require you to go through decompiled DLLs and edit them in one way or another.
Currently the best method I know is using the harmony library which creates detours at function prefixes or sufixes to your own code, during run time, which keeps the original code intact. But it still doesn't allow you to override an existing method in the game.
This is still hacking and not "official intended way" to make a mod. If you are looking for that, then wait for the API release and proper documentation.
 
Upvote 0
Back
Top Bottom