.net reactor - hardware ID matching

1,483 views
Skip to first unread message

keith

unread,
May 4, 2011, 9:59:22 AM5/4/11
to .Net Reactor Support
I have this code in my about box:

License.Status.HardwareID <> License.Status.License_HardwareID

They don't match but my program still runs. In the "license manager"
tab I have hardware locks on (all 4). The hardware ID that the HID.exe
created is in the right spot. I used the same master key for the
protection and the license so that's not the issue. If I delete the
license file, the program doesn't run so I know the license file is
working.

Why are these 2 values different (the first 12 characters match but
the last 8 do not)?

keith

unread,
May 7, 2011, 5:03:48 PM5/7/11
to .Net Reactor Support
Anyone have any ideas on this? I sent this question to support a week
ago and haven't heard anything on it.

When I run "If License.Status.Licensed Then" in order to test for a
valid license, it works as expected. But even if the above passes,
this line:

If (License.Status.HardwareID <> License.Status.License_HardwareID)
Then

is false. I don't get why the 2 values are different, especially if
License.Status.Licensed returns true. Maybe I'm misunderstanding
something.

Glen Harvy

unread,
May 7, 2011, 6:36:05 PM5/7/11
to net-react...@googlegroups.com
Hi Keith,

I've not used this function before but they are two different methods/functions.

License.Status.Licensed would indicate to me that the program is licesed. That is, there is a valid licence key file present in the path for that protected assemby.

From the chm Help file:
Check if a valid license file is available
    /*** Check if a valid license file is available. ***/
    public bool IsValidLicenseAvailable()
    {
        return License.Status.Licensed;
    }


So OK , the above test passes, it's now time to check the licence conditions:

Now "Licence.Status.HardwareID != Licence.Status.License_HardwareID" I guess is supposed to compare one string against another. Is that the case?

If so,

Then you would do something like:

if(Licence.Status.HardwareID != Licence.Status.License_HardwareID)
    Application.Exit.

Here's the appropriate tests from the chm help file:


Check the license status of Hardware Lock
    /*** Check the license status of Hardware Lock ***/
    public void CheckHardwareLock()
    {
        bool lock_enabled = License.Status.Hardware_Lock_Enabled;

        if (lock_enabled)
        {
            /* Get Hardware ID which is stored inside the license file */
            string lic_hardware_id  = License.Status.License_HardwareID;
        }
    }


Get Hardware ID of the current machine
    /*** Get Hardware ID of the current machine ***/
    public string GetHardwareID()
    {
        return License.Status.HardwareID;
    }


Compare current Hardware ID with Hardware ID stored in License File
    /*** Compare current Hardware ID with Hardware ID stored in License File ***/
    public bool CompareHardwareID()
    {
        if (License.Status.HardwareID == License.Status.License_HardwareID)
            return true;
        else
            return false;
    }
I think that explains it pretty well.

Glen.

keith

unread,
May 7, 2011, 9:05:58 PM5/7/11
to .Net Reactor Support
I'm not clear as to what you are telling me. You just kind of rewrote
the same thing I did but in a much longer way. I've read all the help
on this. And yes, it seems clear that if the license is valid then
Licence.Status.HardwareID should equal
Licence.Status.License_HardwareID. I used the same master key to
protect the file as I did to create the license file. I did this all
on my development machine. The hardware ID that is created by running
HID.exe does not match the one in Licence.Status.License_HardwareID.
That makes zero sense. How can you test if the hardware matches if
they are not equal. Now, to further complicate things, if I just
simply use the built in lock warnings of .netreactor then if I change
the hardware ID to some random value and create a license that's
really not for my machine, then the application won't run. .netreactor
prevents it from running. So something different seems to be going on
inside the .netreactor library than what happens when you test as I am
trying to do in my own test code. Create a tiny test app. Try it out.
I'd be curious to hear what your results are.

Okay, so are you ready for the answer? I figured it out. It's got to
do with the 4 optional hardware identifiers. By default, they don't
have "HDD" checked. I have been using that in my project and in my
license files. I just created a test project and tried it without
doing that. It works as expected. The 2 values match. But as soon as I
change things around to use the HDD as well (and yes, I'm setting it
in the HID.exe tool and the license generator), then things fall
apart. This seems to be a bug in .netreactor license.dll. Because just
running the test application with this works. It allows the program to
open successfully without any warnings. But because of this problem
I'm unable to compare them in my code and show the appropriate warning
to the end user in my splash screen. I'm assuming now that the
license.dll is hard coded to get the hardware ID based on CPU, Board
and Mac. I don't see any methods or properties for
License.Status.HardwareID that allow me to alter this functionality.

What's even odder and more frustrating is that when I create the
HID.exe tool using with HDD checked or unchecked, I get the same
hardwareID. It doesn't change. Leaving me to believe that therein lies
the flaw. HDD must be a useless setting. And with my experience with
RAID drives (which I'm not running right now), I'm guessing that HDD
setting would prove valueless as well in a system that is using
software RAID due to communications problems with HDD that RAID can
cause (such as not being able to read SMART data).



On May 7, 6:36 pm, Glen Harvy <glenha...@gmail.com> wrote:
> Hi Keith,
> I've not used this function before but they are two different methods/functions.
> License.Status.Licensed would indicate to me that the program is licesed. That is, there is a valid licence key file present in the path for that protected assemby.
> From the chm Help file:Check if a validlicensefile is available/*** Check if a validlicensefile is available. ***/publicboolIsValidLicenseAvailable(){returnLicense.Status.Licensed;}
> So OK , the above test passes, it's now time to check the licence conditions:
> Now "Licence.Status.HardwareID != Licence.Status.License_HardwareID" I guess is supposed to compare one string against another. Is that the case?
> If so,
> Then you would do something like:
> if(Licence.Status.HardwareID != Licence.Status.License_HardwareID)
>     Application.Exit.
> Here's the appropriate tests from the chm help file:Check the license status of Hardware Lock
>
> /*** Check the license status of Hardware Lock ***/publicvoidCheckHardwareLock(){boollock_enabled=License.Status.Hardware_Lock_Enabled;if(lock_enabled){/* Get Hardware ID which is stored inside the license file */stringlic_hardware_id=License.Status.License_HardwareID;}}Get Hardware ID of the current machine
>
> /*** Get Hardware ID of the current machine ***/publicstringGetHardwareID(){returnLicense.Status.HardwareID;}Compare current Hardware ID with Hardware ID stored in License File
>
> /*** Compare current Hardware ID with Hardware ID stored in License File***/publicboolCompareHardwareID(){if(License.Status.HardwareID==License.Status.License_HardwareID)return true;elsereturn false;}I think that explains it pretty well.

Glen Harvy

unread,
May 8, 2011, 2:30:10 AM5/8/11
to net-react...@googlegroups.com
On 8/05/2011 11:05 AM, keith wrote
. And yes, it seems clear that if the license is valid then
Licence.Status.HardwareID  should equal
Licence.Status.License_HardwareID.
Well, that isn't clear to me at all.

Function/Test 1: The copy of your program running on the computer is licenced. Test result = true/false. That doesn't mean that the HID comparison has been attempted yet, let alone passed the equality test.
Function/Test 2: The licence key contains a HID that dose not match the HID of the computer it is running on. Test result - true/false.

They are two different functions that may require up to 6 different actions to take.



 I used the same master key to
protect the file as I did to create the license file. I did this all
on my development machine. The hardware ID that is created by running
HID.exe does not match the one in Licence.Status.License_HardwareID.
That makes zero sense. How can you test if the hardware matches if
they are not equal.

Have you cast both values to their string values and compared them? If so, double check the settings in Licence Manager, run the ID Genertion program to create a new HID.exe and then run the HID.exe tool and compare them again after adding the new string in in your licence generator:

    /*** Create a License File ***/
    public void CreateLicenseFile(string project_filename)
    {
        LicenseGenerator licensegen = new LicenseGenerator(project_filename);
        licensegen.AdditonalLicenseInformation.Add("Name", "John Doe");
        licensegen.AdditonalLicenseInformation.Add("Company", "Acme");
        licensegen.HardwareLock_Enabled = true;
        licensegen.HardwareID = "1234-1234-1234-1234-1234";
        licensegen.CreateLicenseFile(@"C:\MyProject\newlicense.license");
    }
If they are the same string then there is either a bug or something else is wrong.

Glen.

keith

unread,
May 9, 2011, 9:02:32 AM5/9/11
to .Net Reactor Support
From the help:

/*** Check if a valid license file is available. ***/
public bool IsValidLicenseAvailable()
{
return License.Status.Licensed;
}

It seems that this just plain means that the license is valid. To be
fair, the help file is very much lacking in clarity. What exactly does
the above mean? There's no explanation that I can find that makes this
clear. I would expect that it checks whatever requirements there are
in my protected exe and the license file that's sitting there with it
to see if everything matches up okay. It's going to be sure a trial
hasn't expired, if the hardware ID's match, and so on. if all it does
is check for the existence of a license file, then that's kind of
silly. I can do that with just general vb.net methods. So logically,
if License.Status.Licensed = true then all the other requirements must
have been met as well and the program can be run.

In fact, i've proven this in my code. The first thing I run is the
above statement. If it's true, it runs other tests like how long is
left in the trial, etc. and I allow the user to continue. If it's
false, I check on why it's false (trial expired, hardware ID issue,
etc). The only problem I've run into so far is the HDD issue with
hardware locking. The help is not clear enough. It assumes we know
things that we cannot possibly know. I figured
License.Status.HardwareID was for the actual computer itself and
License.Status.License_HardwareID was for the ID inside the license
file. But I think I'm wrong about that. I'm completely unclear on
these two values now. It appears that the protected project contains
the hardware ID somewhere. That makes no sense. But test it. I
protected an exe with the hardware id of my computer. Then i chagned
the hardware id and created a license file. I ran my code and
displayed the 2 values. They were identical. I would have expected
them to be different. THen when I reprotected the exe (without
changing the hardware id - remember, it's the wrong one), it showed 2
different ID's in my code. That the hardware ID impacts the protected
file makes no sense.

To make matters worse, the countdown isn't working right. I set my
project up for 2 uses. The following code did what I expected:

max_uses = License.Status.Number_Of_Uses
current_uses =
License.Status.Number_Of_Uses_Current

MessageBox.Show("max: " & max_uses.ToString & ";
used: " & current_uses.ToString)

In the first use, it showed max: 2; used: 1
In the 2nd use it showed max: 2; used 2

But then on the third use, it showed this: max 2; used: 1.

It's as if the counter resets after it decides the license is expired.
But I want to show the user why it expired. I want to say "you've used
up all your uses". How can I do that if "used" resets to 1 after it's
all used up?

I've spent way to much time now trying to figure out how this thing
works (and doesn't work). Very frustrated. And 9 days now since my
first question was emailed to support with no answers at all.

Out of the box, I'm sure it does what it should but license.dll seems
like it doesn't behave properly at all and the help is far too terse.


On May 8, 2:30 am, Glen Harvy <glenha...@gmail.com> wrote:
> On 8/05/2011 11:05 AM, keith wrote. And yes, it seems clear that if the license is valid then Licence.Status.HardwareID should equal Licence.Status.License_HardwareID.Well, that isn't clear to me at all.
> Function/Test 1: The copy of your program running on the computer is licenced. Test result = true/false. That doesn't mean that the HID comparison has been attempted yet, let alone passed the equality test.
> Function/Test 2: The licence key contains a HID that dose not match the HID of the computer it is running on. Test result - true/false.
> They are two different functions that may require up to 6 different actions to take.I used the same master key to protect the file as I did to create the license file. I did this all on my development machine. The hardware ID that is created by running HID.exe does not match the one in Licence.Status.License_HardwareID. That makes zero sense. How can you test if the hardware matches if they are not equal.
> Have you cast both values to their string values and compared them? If so, double check the settings in Licence Manager, run the ID Genertion program to create a new HID.exe and then run the HID.exe tool and compare them again after adding the new string in in your licence generator:/*** Create a License File ***/publicvoidCreateLicenseFile(string project_filename){LicenseGenerator licensegen=newLicenseGenerator(project_filename);licensegen.AdditonalLicenseInformation.Add("Name","John Doe");licensegen.AdditonalLicenseInformation.Add("Company","Acme");licensegen.HardwareLock_Enabled=true;licensegen.HardwareID="1234-1234-1234-1234-1234";licensegen.CreateLicenseFile(@"C:\MyProject\newlicense.license");}If they are the same string then there is either a bug or something else is wrong.
> Glen.

Glen Harvy

unread,
May 9, 2011, 5:41:41 PM5/9/11
to net-react...@googlegroups.com
On 9/05/2011 11:02 PM, keith wrote:
>From the help:

    /*** Check if a valid license file is available. ***/
    public bool IsValidLicenseAvailable()
    {
        return License.Status.Licensed;
    }

It seems that this just plain means that the license is valid.

NO - it means that a licence file exists for your protected assembly.

It makes total sense to me because that's what it says it does.

A licence file does not need to exist for the conditions that you set for your protected assembly to be applied. If you set the number of days to 10, at the end of 10 days it won't run anymore. There is no need to use a licence file at all for that to happen. You don't have to distribute a licence file with your project.


 To be
fair, the help file is very much lacking in clarity.
I agree.

 What exactly does
the above mean? There's no explanation that I can find that makes this
clear. I would expect that it checks whatever requirements there are
in my protected exe and the license file that's sitting there with it
to see if everything matches up okay. 
What on earth gives you that idea.

It's going to be sure a trial
hasn't expired, if the hardware ID's match, and so on. if all it does
is check for the existence of a license file, then that's kind of
silly. I can do that with just general vb.net methods. 

No you can't. I bet you can't write any code that tells you whether there is a licence file available for your specific protected assembly.

HID is NOT included in the initial protection because it doesn't make sense to. You need to include that in a licence file if you are going to request even trial users to restrict their trial to a specific machine. Which of course doesn't make sense to by far the majority of free trial downloads that I've used. Granted, there are exceptions.


So logically,
if License.Status.Licensed = true then all the other requirements must
have been met as well and the program can be run.
NO NO NO

 It appears that the protected project contains
the hardware ID somewhere. That makes no sense. 
Agreed - makes no sense at all and I believe you are wrong in guessing the protected assembly contains a HID.

But test it. I protected an exe with the hardware id of my computer.
Do you mean - "I created a licence file that included the HID code generated by the HID generator tool"?

 Then i chagned
the hardware id 
I then changed the HID in the licence file from '12345678' to '23456789'.

and created a license file. I ran my code and
displayed the 2 values. They were identical.
I then ran my protected assembly without protecting it yet again and lo and behold, the two values were identical?

If that's the case then you have discovered a bug that many many people have not discovered before and you will need to wait for support to help you. Given the present situation that Support seems to have gone walkabout then you may have a long wait.


 I would have expected
them to be different. THen when I reprotected the exe (without
changing the hardware id - remember, it's the wrong one), it showed 2
different ID's in my code. That the hardware ID impacts the protected
file makes no sense.

To make matters worse, the countdown isn't working right. I set my
project up for 2 uses. The following code did what I expected:

                    max_uses = License.Status.Number_Of_Uses
                    current_uses =
License.Status.Number_Of_Uses_Current

                    MessageBox.Show("max: " & max_uses.ToString & ";
used: " & current_uses.ToString)

In the first use, it showed max: 2; used: 1
In the 2nd use it showed max: 2; used 2

But then on the third use, it showed this: max 2; used: 1.

It's as if the counter resets after it decides the license is expired.
But I want to show the user why it expired. I want to say "you've used
up all your uses". How can I do that if "used" resets to 1 after it's
all used up?

Dunno - never used that feature before.
I've spent way to much time now trying to figure out how this thing
works (and doesn't work). Very frustrated. And 9 days now since my
first question was emailed to support with no answers at all.

Out of the box, I'm sure it does what it should but license.dll seems
like it doesn't behave properly at all and the help is far too terse.

I think it may be time for you to accept that support is not up to the standard you require, the help file is not as good as it's supposed to be and what little help is available from others is just not helping you. Given this scenario are you going to go ahead and purchase the product?

I only have one suggestion to make. .Net Reactor works and works well. If you can't get it to work as you want it to then you must be trying to use it basing your logic on false assumptions.

Good luck and sincere best wishes,

Glen.

keith

unread,
May 14, 2011, 5:58:15 PM5/14/11
to .Net Reactor Support
>>> NO - it means that a license file exists for your protected assembly.
>>> What on earth gives you that idea.

Wrong. EVERY test I've run tells me that what I thought was true.
License.Status.Licensed does not just check for the existence of an
actual license file. It checks for the status of the license. If it's
expired, License.Status.Licensed returns FALSE. Simple test. Create a
project. Turn off ALL the locks in the settings tab. Enable "license
not found". Set "run without license" to False. Create a license with
any one (but just one) of the locks true and as having expired. Test
the value of License.Status.Licensed. It will be false. You have a
license file. It's an actual license file. But it's not valid since
it's expired. That's what I said before. License.Status.Licensed does
tests on the locks in the license file. It doesn't just check for one.

keith

unread,
May 14, 2011, 6:41:50 PM5/14/11
to .Net Reactor Support
And what's more is that after the locks have expired, and
License.Status.Licensed returns FALSE, you can't test for the reason.
I have all the locks in my settings turned off. I turned on a # of
uses lock in my license file settings. It's set to 2. The app runs 2
times. On the third time around, the app won't run which is expected.
But I can't test for the value of
License.Status.Number_Of_Uses_Current because
Number_Of_Uses_Lock_Enable returns false now even though it's set to
true in my license file and did return true until all the uses were
used up. Also, after both uses are used up,
License.Status.Number_Of_Uses_Current returns 1, not 2. Kind of
annoying.

Glen Harvy

unread,
May 15, 2011, 1:37:39 AM5/15/11
to net-react...@googlegroups.com
Good stuff - glad we've put that question to rest ...

Glen Harvy

unread,
May 15, 2011, 1:51:47 AM5/15/11
to net-react...@googlegroups.com
On 15/05/2011 8:41 AM, keith wrote:
> And what's more is that after the locks have expired, and
> License.Status.Licensed returns FALSE, you can't test for the reason.
This makes some sense to me in that once it has expired your program
won't even begin to execute. Ergo, you can't do anything programatically.

> I have all the locks in my settings turned off. I turned on a # of
> uses lock in my license file settings. It's set to 2. The app runs 2
> times. On the third time around, the app won't run which is expected.
> But I can't test for the value of
> License.Status.Number_Of_Uses_Current because
> Number_Of_Uses_Lock_Enable returns false now even though it's set to
> true in my license file and did return true until all the uses were
> used up. Also, after both uses are used up,
> License.Status.Number_Of_Uses_Current returns 1, not 2. Kind of
> annoying.
>

This also makes some sense to me as well, even if it is annoying to you.

By the way, how did you ascertain that
License_Status.Number_Of_Uses_Current returns 1 after both uses were
used up.

Reply all
Reply to author
Forward
0 new messages