我正在寻找一种方法来制作C#DLL文件的可分发补丁.虽然我能够找到像dnSpy这样的东西,它允许打开和编辑DLL,但我正在寻找一种将我的编辑分发给其他人的方法,而不是分发整个修改后的DLL.有什么工具可以做到这一点吗?
我正在寻找一种方法来制作C#DLL文件的可分发补丁.虽然我能够找到像dnSpy这样的东西,它允许打开和编辑DLL,但我正在寻找一种将我的编辑分发给其他人的方法,而不是分发整个修改后的DLL.有什么工具可以做到这一点吗?
这就是你要找的机器人:
https://github.com/0xd4d/dnlib个
您可以直接在C#补丁程序可执行文件中进行所有类型的编辑,例如:
// Load the original assembly
ModuleDefMD module = ModuleDefMD.Load(originalExe);
//Iterate through all types to find the class inheriting from MyClass
TypeDef targetClass = FindClassInheritingFrom(module, "MyClass");
//edit the constructor
var ctor = targetClass.Methods.First(x => x.IsConstructor);
//replace some line with nop
ctor.Body.Instructions[5] = OpCodes.Nop.ToInstruction();
ctor.Body.UpdateInstructionOffsets();
// Save the modified assembly with a different name
module.Write(newName);