lenmom

博客园 首页 新随笔 联系 订阅 管理

1. generate il with the target dll as input.

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\ildasm.exe“ /OUT=D:\workspace\ServiceHostCommand.dll.il /TEXT /NOBAR /RAWEH /QUOTEALLNAMES /UTF8 /FORWARD d:\workspace\ServiceHostCommand.dll

 

2. edit il file

for example ,we can change the internal class as public by change the private to public

 

 the original source code as follows:

 

 

3. reassembly the dll using the edited il as input

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe" /OUTPUT=d:\workspace\ServiceHostCommand.dll /nologo /quiet /dll /resource=d:\workspace\ServiceHostCommand.dll.res  D:\workspace\ServiceHostCommand.dll.il

after reassembly, the new generated dll shows as follows:

 

 

Note:

if we use .net 2.0 builded assembly file, we should use the corresponding tools:

  <property name="ILASM_v2.0.50727" value="C:\Windows\Microsoft.NET\Framework\v2.0.50727\ilasm.exe" />
  <property name="ILDASM_v2.0.50727" value="D:\workspace\source\Document\ildasm.net20.exe" />

 

posted on 2021-05-25 12:14  老董  阅读(65)  评论(0编辑  收藏  举报