这里就使用了License, LicenseProvider, RegistryFileLicenseProvider。直接删除
public virtual bool IsLicensed()
{
if (this.License != null)
{
return true;
}
try
{
this.License = LicenseManager.Validate(base.GetType(), this);
return true;
}
catch
{
return false;
}
}
使他返回TRUE;
---1506
.method public hidebysig newslot virtual
instance bool IsLicensed() cil managed
{
// 代码大小 50 (0x32)
.maxstack 3
.locals init (bool V_0,
bool V_1)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: ldfld class [System]System.ComponentModel.License
ComponentArt.Web.UI.WebControl::License
IL_0007: ldnull
IL_0008: ceq
IL_000a: stloc.1
IL_000b: ldloc.1
IL_000c: brtrue.s IL_0012
IL_000e: ldc.i4.1
IL_000f: stloc.0
IL_0010: br.s IL_002f
.try
{
IL_0012: nop
IL_0013: ldarg.0
IL_0014: ldarg.0
IL_0015: call instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_001a: ldarg.0
IL_001b: call class [System]System.ComponentModel.License
[System]System.ComponentModel.LicenseManager::Validate(class [mscorlib]System.Type,
object)
IL_0020: stfld class [System]System.ComponentModel.License
ComponentArt.Web.UI.WebControl::License
IL_0025: ldc.i4.1
IL_0026: stloc.0
IL_0027: leave.s IL_002f
} // end .try
catch [mscorlib]System.Object
{
IL_0029: pop
IL_002a: nop
IL_002b: ldc.i4.0
IL_002c: stloc.0
IL_002d: leave.s IL_002f
} // end handler
IL_002f: nop
IL_0030: ldloc.0
IL_0031: ret
} // end of method WebControl::IsLicensed
--1553
换成:
.method public hidebysig newslot virtual instance bool IsLicensed() cil managed
{
.maxstack 1
.locals init (
[0] bool CS$1$0000)
L_0000: nop
L_0001: ldc.i4.1
L_0002: stloc.0
L_0003: br.s L_0005
L_0005: ldloc.0
L_0006: ret
}
删掉:
299637 --- 299739
.class public auto ansi beforefieldinit ComponentArt.Licensing.Providers.License
extends [System]System.ComponentModel.License
298904 -----299456
.class public auto ansi beforefieldinit ComponentArt.Licensing.Providers.LicenseProvider
extends [mscorlib]System.Object
298824 ---- 298902
.class public auto ansi beforefieldinit ComponentArt.Licensing.Providers.RegistryFileLicenseProvider
extends [System]System.ComponentModel.LicenseProvider
299148 --- 299366
.class private auto ansi beforefieldinit ComponentArt.Licensing.Providers.'ᜀ'
extends ComponentArt.Licensing.Providers.'ᜃ'
299150 ---
.class private auto ansi beforefieldinit ComponentArt.Licensing.Providers.'ᜁ'
extends ComponentArt.Licensing.Providers.'ᜃ'
.class private auto ansi beforefieldinit ComponentArt.Licensing.Providers.'ᜂ'
extends [mscorlib]System.Collections.ArrayList
.class private abstract auto ansi beforefieldinit ComponentArt.Licensing.Providers.'ᜃ'
extends [mscorlib]System.Object
IL_0001: ldarg.1
IL_0002: newobj instance void ComponentArt.Licensing.Providers.RegistryFileLicenseProvider::.ctor()
IL_0007: ldstr ""
IL_000c: newobj instance void ComponentArt.Licensing.Providers.License::.ctor(class
ComponentArt.Licensing.Providers.RegistryFileLicenseProvider,
string)
IL_0011: stfld class [System]System.ComponentModel.License
ComponentArt.Web.UI.WebControl::License
IL_0016: ldarg.1
删掉:
504 --514
.publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 // .$..............
00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 // .$..RSA1........
8F B8 4C 20 4D AD 24 D4 AC FF 94 0C 9C 74 AB F4 // ..L M.$......t..
E1 F7 7D 41 81 9F BB 3B 43 5C 4A 16 B6 9C C1 04 // ..}A...;C\J.....
AE 54 6C C0 7A FA A8 65 F0 D4 7B 89 AE 63 70 48 // .Tl.z..e..{..cpH
23 C7 67 35 BC 1C 00 A9 BC C1 B6 F0 CC F6 D9 90 // #.g5............
55 8E 30 3C 00 E1 6A AF E2 C4 2F A2 2E D4 0B BC // U.0<..j.../.....
A3 9A 71 40 FA 9F 95 D9 E6 F9 96 6F 01 9C 0B E3 // ..q@.......o....
4A 79 D9 00 57 85 A3 AA 70 5B 0F A1 48 B4 B1 07 // Jy..W...p[..H...
C9 3C 1C 11 10 7E 7F BB BF C5 50 09 E3 9E A6 B4 ) // .<...~....P.....
.hash algorithm 0x00008004
2. 删除VS2005对项目的权限检查。
一般就是依赖了LicenseProviderAttribute,打开IL,找到类似的代码,直接删除。20 多个!
.custom instance void [System]System.ComponentModel.LicenseProviderAttribute::.ctor(class
[mscorlib]System.Type) = ( 01 00 3C 43 6F 6D 70 6F 6E 65 6E 74 41 72 74 2E // ..<ComponentArt.
4C 69 63 65 6E 73
69 6E 67 2E 50 72 6F 76 69 64 // Licensing.Provid
65 72 73 2E 52 65
67 69 73 74 72 79 46 69 6C 65 // ers.RegistryFile
4C 69 63 65 6E 73
65 50 72 6F 76 69 64 65 72 00 // LicenseProvider.
00 )
命令:
c:
cd C:\Documents and Settings\itd0300166.PLSH166\桌面\123
ilasm /dll /resource=123.res /output:123.dll 123.il