反編譯DLL問題?

現有一個軟體, 裡面有個ABC.DLL庫, 寫得有問題。

因此對其進行更改。

1. 通過Reflector軟體 反編譯回去查看到部分源代碼。

2. 通過ILDasm軟體, 反編譯得到il文件, 對il文件進行了更改。更改的內容很簡單, 進入某個函數後什麼都不用做, 直接"ret"語句返回。很確定更改的內容無誤。

3. 通過ilasm再編譯il文件,生成更改後的dll文件。

上述步驟完畢後,運行軟體,調用此庫。但是會報錯。報錯內容是:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.BadImageFormatException: ?

File name: "ABC.vb.dll"

at XXXEdit.pEdit.TimerSplash_Tick(Object sender, EventArgs e)

at System.Windows.Forms.Timer.OnTick(EventArgs e)

at System.Windows.Forms.Timer.Callback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)

=== Pre-bind state information ===

LOG: DisplayName = ABC.vb, Version=1.0.5037.12408, Culture=neutral, PublicKeyToken=null

(Fully-specified)

LOG: Appbase = C:Program Files (x86)MyAppEDIT

LOG: Initial PrivatePath = NULL

Calling assembly : ABC, Version=3.1.0.5, Culture=neutral, PublicKeyToken=null.

===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).

LOG: Post-policy reference: ABC.vb, Version=1.0.5037.12408, Culture=neutral, PublicKeyToken=null

LOG: Attempting download of new URL file:///C:/Program Files (x86)/MyApp/Edit/ABC.vb.DLL.

....

************** JIT Debugging **************

To enable just in time (JIT) debugging, the config file for this

application or machine (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

&

&

&

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the machine

rather than being handled by this dialog.


應該是簽名了,你要重新簽。而且簽名的結果也是DLL名字的一部分,一定要做那種,修改完簽名恰好沒有變的(逃


如果是簽名的問題,可以用.net自帶的工具sn.exe. 用-Vr 參數加assembly路徑使那個dll跳過簽名驗證

破解Resharper時我就是這麼做的


推薦閱讀:

C++與C++/CLI的運行速度相比哪個快? C++/CLI和C#的運行速度一樣快?
Node.js和.Net 4.5下的await、async相比有什麼不同?
如何提升ASP.NET網站首次打開速度?
.NET 下的性能問題如何定位?
自學編程十年,依然沒有編寫出過什麼有用的東西,想知道下一步怎麼走?

TAG:NET | 反編譯 | 破解者Cracker |