Search:
Namespaces
Discussions
.NET v1.1
Feedback
Recursion issues
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.languages.vb
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
Nak
Hi there,
I was wondering what the normal procedure for making a license provider
require licensing was?
I have just created a licensing class library and I want to make it
require a license to be used, but I cannot protect the license provider with
itself as you just get a massive recursion issue taking place. Can I
protect my own "protector"? :-\
Nick.
Reply to this message...
One Handed Man \( OHM - Terry Burns \)
Ahem, well, cant you just instantiate a new one ?
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me
Time flies when you don't know what you're doing
"Nak" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Nak
What do you mean? My class needs to be licensed or any tom dick and harry
could use the class library to protect their applications. But I dont seem
to be able to protect anything within it! :-\
Nick.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Nak
I think I'll give a quick example, incase I'm missing something really
obvious here,
My licensing class library contains several classes for licensing
applications and controls, the main ones which the developer interacts with
are
myLicenseProvider
^ A license provider that does the main business
and
myLicenseAttribute
^ A custom attribute which is used to pass addition information to the
license provider upon initialization
Protecting anything becomes really easy with this, you basically do exactly
as you would with a
LicFileLicenseProvider
with the exception that you need
to include another attribute for each licensed class to set some extra
properties which are essential to getting a valid license.
For example,
<LicenseProvider(GetType(myLicenseProvider)), _
npLicenseAttribute(..parameters are passed here but are irrelivant...)> _
Public Class Class1
Private cLicLicence As npLicense
Public Sub New()
cLicLicence = CType(
LicenseManager
.Validate(GetType(Class1), Me),
npLicense)
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
If Not (cLicLicence Is Nothing) Then
cLicLicence.Dispose()
cLicLicence = Nothing
End If
End Sub
End Class
This is great and suits me down to the ground, *but* I want to use this same
method of licensing to protect "myLicenseProvider". Now in theory this is
impossible as the license provider would need to create a new license
provider to validate its license and the provider that it creates would have
to do likewise, hence forth an endless loop has occured.
The same goes for *any* other object used in myLicenseProvider that I have
created, I cannot license them as they will recurse themselves into a big
hole of muchness. The only thing that I can think of is to put code into
the class constructor of myLicenseProvider to call its internal routines and
validate its own license before it does anything else, but surely this is a
bit of a bodge isn't it? How would this normally be tackled, I'm trying not
to make things slack as I want to rely on this class library for all my
future projects.
Nick.
"Nak" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
One Handed Man \( OHM - Terry Burns \)
Perhaps, you could create a public property as an integer (0=non self >0
means self )called something like validatingSelf; this would be set to true
if the reference was to Me, each function would check this and execute if
this value was 0 or <2.
How about that ?
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me
Time flies when you don't know what you're doing
"Nak" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Nak
Hi OHM,
Thanks for the idea, I've managed to get something working, what I've
done is I've made a selfvalidation method inside of the licenseprovider
class, this is the first thing thats called when the licenseprovider is
called upon, if it returns false then a null referenced license is returned.
It seems to have the desired effect. I've kind of been thinking, surely I
only need to license this 1 class within the class library as this is the
only one that does the magic. I'm hoping anyway, that and panicing about
how easy it is for .NET reflector to disasembly my code to its orignal
source, which kind of destroys the good work Ive done in making a licensing
application if all you need to do is decompile 1 class library and remove a
couple of lines :-( Oh well, thanks for the idea :-) I hate recursion!
Nick.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Peter Huang (VIP)
Hi Nick,
If you wants to protecte your code from being disassembled, you may try to
use the obfuscation.
VS.NET IDE 2003 shipped with one community version of Obfuscation,
dotfuscator.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dotfuscator
/dotf6duz.asp
You may take a look and let me know if that helps you.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Reply to this message...
Nak
Hi Peter,
I dont have VS.NET 2003, I have VB.NET Standard 2002. I've tried a few
demos of commercial products but havent been massively impressed by the
results, especially considering the claims. One thing I wasnt aware of
until yesterday was that you can disable strong name checking on an
assembly! What is the point of using it if it can be disabled!! Half of me
thinks that the reason .NET code is so insecure is so that *anyone* can read
it, i.e. Microsoft!
Anyway, enough of my thoughts on that subject. I shall keep looking
around for an effective obfuscator, if you know of any *good* ones that
require very little interaction please let me know :-)
Nick.
""Peter Huang"" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Peter Huang (VIP)
Hi,
Here is two links you may take a look.
XenoCode is the powerful, flexible, and easy-to-use code protection and
optimization solution for .NET developers.
http://www.xenocode.com/en/Default.aspx
Obfuscating .NET: Protecting your code from prying eyes
http://www.desaware.com/products/books/net/obfuscating/index.aspx
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Reply to this message...
System.ComponentModel.LicenseManager
System.ComponentModel.LicenseProvider
System.ComponentModel.LicFileLicenseProvider
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com