直接修改确实是麻烦,老是顾到了这里就顾不了那里,当然如果不加长的话还是直接修改来的方便快捷。本来还想看看tankaiha怎么手工修改的呢
直接反编译后再编译会报错,但是根据提示可以很轻松地搞定。
// Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50727.42
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v2.0.50727
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 2:0:0:0
}
.assembly extern System.Windows.Forms
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 2:0:0:0
}
.assembly joke2
{
// --- 下列自定义属性会自动添加,不要取消注释 -------
// .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public
{
// Offset: 0x00000000 Length: 0x0000000E
}
.module joke2.exe
// MVID: {394B36B5-9A54-4870-AE75-533D734AC4EB}
.imagebase 0x00400000
.file alignment 0x00001000
.stackreserve 0x00100000
.subsystem 0x0002 // WINDOWS_GUI
.corflags 0x00000001 // ILONLY
// Image base: 0x04960000
// =============== CLASS MEMBERS DECLARATION ===================
.class private auto ansi beforefieldinit tankaiha.joke2.Class1
extends [mscorlib]System.Object
{
.method public hidebysig static void Main() cil managed
{
.entrypoint
// 代码大小 12 (0xc)
.maxstack 8
IL_0000: ldstr
".net is cool!"
IL_0005: call valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string)
IL_000a: pop
IL_000b: ret
} // end of method Class1::Main
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// 代码大小 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method Class1::.ctor
} // end of class tankaiha.joke2.Class1
// =============================================================
// *********** 反汇编完成 ***********************
// 警告: 创建了 Win32 资源文件 H:\joke2\dump.res
将上面代码中蓝色的部分注释掉,并且根据要求将红色的部分改成".net is very cool!"后再重新编译即可