Since starting using DOTNET to do a website, I will develop a technical forum in my own website. If there is anything else, just want to check your own level of the DOTNET. The posts of the entire forum are bound to the web tree control. The tree control is used by Microsoft's Microsoft.Web.ui.WebControls component, because Microsoft.Web.ui.WebControls is pointing to the home directory of IIS, When the service provider did not load Microsoft.Web.ui.WebControls components, this tree became a bunch of dry wood, helplessly downloaded Microsoft.Web.ui.WebControls source code, pointing resources to it. The virtual directory of the site is compiled into its own version. The forum finally built it in the local area network, I gave him a name called "Good Big Tree Forum". My friend gave me a free space to let me test. I used the 56K old cat to raise the water. Of course it is normal, but the speed is really unsatisfactory. Although the flashing problem can be avoided by closing the return, but This is at the expense of the real-time and other important functions of the sacrifice forum. Use the broadband and try again, the effect is much better, but my forum is called "good tree forum DOTNET broadband version". Since the lightweight web tree control is not found, this big tree has been locked in the deep.
In the past few days, I saw that everyone was in a big way to Microsoft TreeView, and he tried to raise r.a.d.treeview, which once again evolved my idea to change the "tree species" for that forum. Looking at the http://www.telerik.com of R.a.d.TreeView, I saw a new version version 2.5. After loading this machine, its presentation screen is as follows:
Since it is a 30-day free trial version, I adjusted the date of the computer for a year, and the resulting expiration prompt appeared.
Since two days ago, I just explored the authorization method of DotNetTextBox 1.3 (also wrote a crackler, but unfortunately published here), use Reflector to open RADTreeView.dll, and go straight to the rendering method render with the rendering of the control. ).
It is the following code:
The IL assembly code corresponding to the VB code protected overrides sub render (Byval Output as HtmlTextWriter)
Me.LicenseMessage = string.empty
IF
NOT
ME
.
LicenseMessage is string.empty) THEN
Output.write (Me.LicenseMessage)
Else
Me.page.verifyrenderingInServerform (me)
DIM text1 as string = string.format ("", me.uniqueid, "trigger")
DIM objarray1 as object () = new object () {string.concat (me.uniqueid, "_expanded"), string.concat (me.uniqueid, "_expanded"), me.uniqueid, "trigger"}
DIM text2 as string = string.format ("", objarray1)
Objarray1 = new Object () {string.concat (me.uniqueid, "_checked"), string.concat (me.uniqueid, "_checked"), me.uniqueid, "trigger"} Dim text3 as string = string.format ", objarray1)
Objarray1 = new object () {string.concat (me.uniqueid, "_selected"), string.concat (me.uniqueid, "_selected"), me.uniqueid, "trigger"}
DIM text4 as string = string.format ("", objarray1)
Output.write (Text1)
Output.write (Text2)
Output.write (Text3)
Output.write (Text4)
END IF
End Sub .method family virtual instance void Render ([System.Web] System.Web.UI.HtmlTextWriter output) cil managed {// Code Size: 344 byte (s) .maxstack 5 .locals (string text1, string text2, string text3, string text4, object [] objArray1) L_0000: ldarg.0 L_0001: ldsfld string [mscorlib] System.String :: Empty L_0006: stfld string WebControlLibrary1.WebCustomControl1 :: licenseMessage L_000b: ldarg.0 L_000c: ldfld string WebControlLibrary1.WebCustomControl1 :: licensemessage l_0011: ldsfld string [mscorlib] system.String :: Empty L_0016: beq.s l_0029 l_0018: ldarg.1 l_0019: ldarg.0 ... middle independent code slightly
L_0150: ldarg.1 l_0151: ldloc.3 l_0152: Callvirt instance void [system.web] system.web.ui.htmlTextwriter :: Write (string) L_0157: Ret}
A comparison of the anti-assembly code of the RENDER method of RADTREEVIEW.DLL, and the following correspondence is obtained in WebControllibrary1
IL VB corresponding assembly code Me.licenseMessage = String.Empty L_0000: ldarg.0 L_0001: ldsfld string [mscorlib] System.String :: Empty L_0006: stfld string Telerik.WebControls.RadTreeView :: licenseMessage
Now you can add IL code. Open Visual Studio .NET 2003 Command Tips Type ILDASM to open RADTreeView.dll
Then dump the IL disassembly code, save the RADTreeView.il, the affiliate files also appear in the folder
Use Notepad to open the RADTREEVIEW.IL file, and the strong name is now verified. Look at the file header to delete it:
.publicKey = (00 24 00 00 04 80 00 00 00 00 00 00 00 00 00 //. $ ..............
00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 //. $ .. rsA1 ........
CD 62 12 05 0E 7C CD 6F 51 AF 2C 41 FD CC 65 44 // .b ... | .OQ., A..ED
AC E3 CF 79 6A 19 49 C5 80 C3 FF 52 7C AC 91 1D // ... Yj.i .... r | ...
9b E0 5F AD 28 47 CE F4 E7 E5 EC 87 9F C9 4B E4 // .._. (G ...... k.
9E 31 C7 97 C2 B8 39 25 C4 ED F6 AA 83 FA 78 A3 /// .1 .... 9% ... X.
5A 47 C0 F4 7B 44 A8 F9 3F D1 44 A9 B7 96 BF 74 // Zg .. {d ..?. D .... T
9E 8D FC B3 99 82 11 52 A9 5C 7A 37 EB A3 82 B6 // ....... r./z7 ....
9D A5 8B 7A 1C 87 DA 5C ED 0B 7A 72 BA B1 3F 12 // ... z ... / .. Zr ..?.
52 C6 2F 50 DD 35 44 06 E6 F3 B0 4B AF F4 19 BD) // R./p.5d .... k ....
Find a render method, see the pieces of the code as follows:
Family Hidebysig Virtual Instance Void
Render (class [system.Web] system.web.ui.htmltextwriter output) CIL Managed
{
// Code size 313 (0x139)
.MAXSTACK 4
.locals init (Class Telerik.WebControls.RadtreeViewHtmlrenderer V_0,
String v_1,
String v_2,
String v_3,
String v_4)
IL_0000: ldarg.0
IL_0001: ldfld string telerik.WebControls.RadtreeView :: licenseMessage
IL_0006: ldsfld string [mscorlib] system.string :: EMPTY
IL_000B: Call Bool [mscorlib] system.string :: op_equality (string,
String)
IL_0010: brfalse.s il_001f
... Middle independent code slightly
IL_0124: Callvirt Instance Void [Mscorlib] System.io.TextWriter :: Write (String)
IL_0129: ldarg.1
IL_012A: LDLOC.3
IL_012B: Callvirt Instance Void [mscorlib] System.io.TextWriter :: Write (String)
IL_0130: ldarg.1il_0131: ldloc.s v_4
IL_0133: Callvirt Instance Void [Mscorlib] System.io.TextWriter :: Write (String)
IL_0138: RET
} // end of method RadtreeView :: RENDER
Insert "Simulation" IL code into the front of the render method, see the following bold code.
Family Hidebysig Virtual Instance Void
Render (class [system.Web] system.web.ui.htmltextwriter output) CIL Managed
{
// Code size 313 (0x139)
.MAXSTACK 4
.locals init (Class Telerik.WebControls.RadtreeViewHtmlrenderer V_0,
String v_1,
String v_2,
String v_3,
String v_4)
L_0000: ldarg.0
L_0001: ldsfld string [mscorlib] system.string :: Empty
L_0006: stfld string telerik.WebControls.radtreeView :: licenseMessage
IL_0000: ldarg.0
IL_0001: ldfld string telerik.WebControls.RadtreeView :: licenseMessage
IL_0006: ldsfld string [mscorlib] system.string :: EMPTY
IL_000B: Call Bool [mscorlib] system.string :: op_equality (string,
String)
IL_0010: brfalse.s il_001f
... Middle independent code slightly
IL_0133: Callvirt Instance Void [Mscorlib] System.io.TextWriter :: Write (String)
IL_0138: RET
} // end of method RadtreeView :: RENDER
Save RadtreeView.il Prepare to recompile using ILASM, to respond to compilation, and use Notepad to make a batch file Myasm.bat Save in the same directory, the content is as follows:
ILASM / DLL / RESOURCE: RADTREEVIEW.RES / OUTPUT: RADTREEVIEW.DLL RADTREEVIEW.IL
The Visual Studio .NET 2003 command prompts to run myasm, after a few seconds, the new RADTreeView.dll appears.
To check the correctness of the added IL instruction, use the reflector to open the ruled RadtreeView.dll, the anti-compile render method is VB code, unfortunately, Me.LicenseMessage = String.empty
The command accurately appears in our predetermined location, it can be seen that the "simulation" IL code is correct. See below:
Enter Microsoft Visual .NET development environment, add new RADTREEVIEW.DLL to the toolbox. Improve the sample code to establish a test page WebForm1.aspx, and the resource TreeViewImages directory required for RADTREEVIEW is examined in the virtual directory of the test site.
<% @ Register TagPrefix = "radt" Namespace = "Telerik.WebControls" Assembly = "RadTreeView"%> <% @ Page Language = "vb" AutoEventWireup = "false" Codebehind = "WebForm1.aspx.vb" Inherits = "WebTest .Webform1 "%>
After the necessary settings, compile the test project, in the local browser, use localhost mode to detect, you can see the web tree on the page, and all nodes are exhibited, and no expiration warnings will appear. The screenshot is as follows:
Using a domain name or IP address on this unit and other machines, it is found that although there is no longer a warning, the Web tree will no longer respond to the mouse click. The browser status has the page there is an error, lacks a warning of an object. It seems that the crack is not finally completed.
Check out the RADTreeView help documentation and discover that the control is bundled with the domain name and IP address. When using domain names and IP address access, if the expiration warning is displayed, the control script is not sent to the client. The previous work only shields expired warnings, but does not resolve the relevant scripting problem.
It seems that you must find a method or function that detects the license, or uses the Reflector, there is a checklicenseKeys function on the TELERIK.WebControls RadtreeView node. From its function name, it is basically what we are looking for, as shown below:
The code that is reversible to copy checklicenseKeys () is as follows
Private Function CheckLicenseKeys () As String Dim text1 As String = String.Empty Dim num1 As Integer = -1 Dim text2 As String = "" Dim text3 As String = Me.Page.Request.ServerVariables.Get ( "SERVER_NAME"). ToLower DIM text4 as string = me.page.request.servervariables.get ("local_addr") IF ((me.Company is string.empty) Andalso (Me.LicenseKey is string.empty)) Andalso
NOT
ME
.
LicenseFile Is String.Empty)) Then Dim text5 As String = Me.Page.Request.MapPath (Me.LicenseFile.Replace ( "~ /", Me.applicationPath)) Dim document1 As XmlDocument = New XmlDocument Try document1.Load (text5 ) Dim reader1 As XmlTextReader = New XmlTextReader (Assembly.GetExecutingAssembly.GetManifestResourceStream ( "Telerik.WebControls.TreeViewResources.SchemaLicense.xsd")) If Class2.Function4 (document1, reader1) Then Dim node1 As XmlNode For Each node1 In document1.SelectNodes ( "// license [@control = 'TreeView']") DIM Num2 as INTEGER = Class2.Function2 (Node1.attributes.Itemof ("Company"). Value, Node1.attributes.Itemof ("licenseKey"). Value, Text3 , TEXT4) IF (Num2> Num1) THEN Num1 = Num2 end if ifness (Num1 = 1) THEN goto Label_016A End If Next End If Label_016A: reader1.Close Catch exception1 As XmlException End Try Else num1 = Class2.Function2 (Me.Company, Me.LicenseKey, text3, text4) End If If ((num1 <= 0) AndAlso (( Text3 is "localhost") orelse (Text4 IS "127.0.0.1"))) ")) Then Num1 = 1 TEXT2 ="
Copyright © Telerik 2003. To Remove this Message, please, Obtain a href = "" http://www.telerik.com/clientnet "> 30-day trial key." End ififf (Num1> 0) THEN IF (Text2.Length <= 0) THEN RETURN TEXT1 End IF Dim Time1 AS DateTime = DateTime.Now Dim Random1 As Random = New Random (Time1.MilliseCond) DIM NUM3 AS INTEGER = Random1.next (19) IF (NUM3 < > 7) Then Return text1 End If Return text2 End If Me.Controls.Clear If (num1 <0) Then Return "radtreeview v.2.1. you have not provided valid license key or company, or you are trying to access the control By Domain Name, IP, or Server Name. please, use http: // localhost instead or obtain a 30-day trial key. "Endiff" RADTREEVIEW V.2.1. Your Trial Key Has Expired. To Extend Your Key Contact Sales@telerik.com. "End Function Opens RADTreeView.il in Notepad and search ChecklicenseKeys, discovers the entire control The ChecklicenseKeys function is called only in the onprender method, and the VB code of the onprender method is:
IL assembly code corresponding to VB code Protected Overrides Sub onprender (Byval E as Eventargs)
Mybase.onprender (e)
Me.LicenseMessage = me.checklicenseKeys
IF (Me.LicenseMessage Is String.empty) THEN
IF (me.isempty andalso
NOT
ME
.
ContentFile is string.empty)).
Me.LoadContentFile (me.contentfile)
END IF
IF (me.contextmenus.count = 0) Andalso
NOT
ME
.
ContextMenuContentfile is string.empty)).
DIM Document1 as xmldocument = new xmldocument
Document1.Load (me.context.server.mappath (me.contextMenuContentFile.Replace ("~ /", me.ApplicationPath))))
Me.LoadContextMenusxmlstring (Document1.outerxml) endiff
IF not me.isempty life
Me.page.registeraRrayDeclaration ("TLRKTreeViews", Me.ID)
Me.page.getPostBackeventreference (ME, "Dummy")
IF
NOT
ME
.
CSSFILE IS STRING.EMPTY) THEN
Me.page.registerClientScriptblock (String. Concat (Me.ID, "CSS"), String.Concat ("
Me.cssfile.replace ("~ /", me.applicationpath), ">"))
END IF
Me.RegisterStyLesASCSSSSSCSS
IF not me.page.isclientscriptblockregistered ("RadtreeViewjavascript") THEN
IF
NOT
ME
.
Pathtojavascript is string.empty) THEN
Me.PathTojavascript = me.pathtojavascript.replace ("~ /", me.applicationpath)
Me.Page.RegisterClientScriptBlock ( "RadTreeViewJavaScript", String.Concat ( "