473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Recursion issues

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.
Nov 21 '05 #1
9 1182
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" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
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.

Nov 21 '05 #2
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:es**************@TK2MSFTNGP11.phx.gbl...
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" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
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.


Nov 21 '05 #3
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" <a@a.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
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:es**************@TK2MSFTNGP11.phx.gbl...
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" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
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.



Nov 21 '05 #4
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" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
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" <a@a.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
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:es**************@TK2MSFTNGP11.phx.gbl...
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" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
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.



Nov 21 '05 #5
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:Ob**************@TK2MSFTNGP09.phx.gbl...
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" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
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" <a@a.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
> 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:es**************@TK2MSFTNGP11.phx.gbl...
>> 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" <a@a.com> wrote in message
>> news:er**************@TK2MSFTNGP15.phx.gbl...
>>> 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.
>>>
>>>
>>
>>
>
>



Nov 21 '05 #6
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/de...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.

Nov 21 '05 #7
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"" <v-******@online.microsoft.com> wrote in message
news:7B**************@cpmsftngxa10.phx.gbl...
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/de...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.

Nov 21 '05 #8
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/boo...ing/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.

Nov 21 '05 #9
Hi Nick,

If you still have any concern, please feel free to post here.

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.

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Peri | last post by:
I'm trying to create Python parser/interpreter using ANTLR. Reading grammar from language refference I found: or_expr::= xor_expr | or_expr "|" xor_expr For me it looks like infinite recursion....
12
by: da Vinci | last post by:
Greetings. I want to get everyone's opinion on the use of recursion. We covered it in class tonight and I want a good solid answer from people in the "know" on how well recursion is accepted...
0
by: Roz Lee | last post by:
I am trying to access a satellite assembly for a custom culture using Resource Manager. When I use the .getstring method I get the following error message: System.ArgumentException: I can't...
43
by: Lorenzo Villari | last post by:
I've tried to transform this into a not recursive version but without luck... #include <stdio.h> void countdown(int p) { int x;
18
by: MTD | last post by:
Hello all, I've been messing about for fun creating a trial division factorizing function and I'm naturally interested in optimising it as much as possible. I've been told that iteration in...
13
by: Mumia W. | last post by:
Hello all. I have a C++ program that can count the YOYOs that are in a grid of Y's and O's. For example, this Y O Y O O Y O Y O Y O O Y O Y Y O Y O Y O O Y O O Y Y O Y O
1
by: John | last post by:
Does anybody know if there are any compilers that warn of infinite recursion ( a very simple case ) like void foo( int a ) { return foo( a ); }
20
by: athar.mirchi | last post by:
..plz define it.
35
by: Muzammil | last post by:
int harmonic(int n) { if (n=1) { return 1; } else { return harmonic(n-1)+1/n; } } can any help me ??
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.