There are multiple network adapters of the same model in the target computer. As below, they are all Intel I211.
PCI\VEN_8086&DEV_1539&SUBSYS_00008086&REV_03\0060E0FFFF6336A000
Name: Intel(R) I211 Gigabit Network Connection
Hardware IDs:
PCI\VEN_8086&DEV_1539&SUBSYS_00008086&REV_03
PCI\VEN_8086&DEV_1539&SUBSYS_00008086
PCI\VEN_8086&DEV_1539&CC_020000
PCI\VEN_8086&DEV_1539&CC_0200
Compatible IDs:
PCI\VEN_8086&DEV_1539&REV_03
PCI\VEN_8086&DEV_1539
PCI\VEN_8086&CC_020000
PCI\VEN_8086&CC_0200
PCI\VEN_8086
PCI\CC_020000&DT_0
PCI\CC_020000
PCI\CC_0200&DT_0
PCI\CC_0200
PCI\VEN_8086&DEV_1539&SUBSYS_00008086&REV_03\0060E0FFFF6336A100
Name: Intel(R) I211 Gigabit Network Connection #2
Hardware IDs:
PCI\VEN_8086&DEV_1539&SUBSYS_00008086&REV_03
PCI\VEN_8086&DEV_1539&SUBSYS_00008086
PCI\VEN_8086&DEV_1539&CC_020000
PCI\VEN_8086&DEV_1539&CC_0200
Compatible IDs:
PCI\VEN_8086&DEV_1539&REV_03
PCI\VEN_8086&DEV_1539
PCI\VEN_8086&CC_020000
PCI\VEN_8086&CC_0200
PCI\VEN_8086
PCI\CC_020000&DT_0
PCI\CC_020000
PCI\CC_0200&DT_0
PCI\CC_0200
How do I update driver for a specific one of these same model adapters by devcon, C++ or C#? For example, update by the unique device instance ID (ex: PCI\VEN_8086&DEV_1539&SUBSYS_00008086&REV_03\0060E0FFFF6336A100)
Thanks
EDIT:
I've searched APIs for this but they all use hardware ID to update the driver, which will update all of the same model adapters' drivers.
Ex: C++'s UpdateDriverForPlugAndPlayDevicesA and devcon's update command.
EDIT2:
The motivation of this issue is that we are using an RTOS (real-time OS, RTX64) and we want to establish a real-time network communication (EtherCAT connection) with other devices by the RTOS. We need to update one of the adapters' driver to the driver provided by RTX64, so that this adapter can be used by it.
The only workable solution for us to just update one of them is using Windows' "Device Manager". (There's no same model adapters in the below picture, it's just shows how to update by device manager manually)
We are asking our users to do this manual update after installing our software. It's not convenient for them. So we are trying to find an automatic way to do this.
Since Device Manager in Windows can do this, we suppose that there's an API can do this too.
Two workarounds. One minimizes manual customer interaction when updating the device driver, the other fully automates the process, but requires coding in a BASIC like language.
The first one consists on automatically showing the Hardware Update Wizard for that particular device instance, using the API function DiShowUpdateDevice as described in the previous link.
The second one is to use the free AutoIt automation software. With it you can automate basically everything in a Windows system, it's very powerful and I've used it in conjunction with web bots and automatic web testing (non-headless). I've also used it in double-click roll-outs of Windows systems and many sysadmin tasks.
As a remark, you could also mix both approaches. First, use DiShowUpdateDevice to show the wizard and then an AutoIt script can automatically perform UI interaction, the client won't have to do anything at all.
This is not really a average Programmer Problem.
Driver Programming - as a subset of Realtime Programming - is a highly specialized field. The average C# or C++ .NET Programmer will rarely have to deal with stuff like pointers and neer with assembler level code. But for those two, it is their daily bread and butter. I can not give you little more then general advice:
My first advice for you is to get somebody elses code to make that decision and installation. Usually drivers of one Manufacturer are distributed in packages. Wich do understand how to deal with idenitifcation of the hardware. Usually those installers also have a silent mode. So it comes down to calling them and intercepting the console output/looking for the return value.
My second advice, is to use their name as listed in the Device Manager. Optionally get them renamed manually. It is not that reliable as strings are quite patient and easily changed/missmatched, but it would get you somewhere to start from.
But as I understand it your problem is worse then just general driver updates. You have two instances of the same Hardware, and want to use different drivers for each. Wich is a order worse:
I am not even sure this is possible. Since the driver folder still uses the good old "only one file of each name" approach, it is propable that you can not use different drivers for different instances of the same hardware. Unless you define your own driver storage location.
I have no idea why you would do that. The average enduser programm does not need to worry about even selecting wich interface it will use. It just hands it's request off the to network stack and does not deal with layer 3 or below. Servers may have to pick a specific adapter to listen on, or just listen on both in paralell. But even those do not care for the driver version in use. They do not even care if it is a real, physical interface - after all missclassification like with early Bluetooth and Virtual Devices like for Virtual Machine Monitors/PDF printers are a thing.
So it honestly sounds like you got a XY Problem, with this idea being the (propably wrong) Y, to your real X.
Related
Today i come up with in situation where i need to implement system where i need to filter out few number when i call them. My requirement is i have Primary Rate Interface (Pri) network connected to 30 land line telephone sets. With my starting research i am able to find few solution's
Telephony Application Programming Interface (TAPI)
Microsoft Unified Communications Managed
Lync 2013
asterisk
I am able to achieve above motive by refereeing TAPI for single connection but still not have any idea about implementation on PRI lines. Asterisk is open source but to implement this we need to tools which are not free. As i am new with this, please give me directions to move on with.
The learning curve in this area can be wicked complicated, if you don't have T1/ISDN background you may be in for a long tough haul if you try to write PRI call control yourself in C#.
You should probably start by refining your requirements statement, keeping it as technology neutral as possible. You need to be prepared to explain the business problem you are trying to solve clearly. E.g. if you need PRI, is it for connecting to the telephone sets, to the telephone company, or both. What actions happen when you "filter out" telephone numbers? Focus first on a clear statement of what, rather than how.
As to how, there used to be several companies that produced this sort of hardware/software packages, but over the years one of them (Dialogics) seems to have bought out most of the others hardware vendors, so a lot of the software vendors partner with them. I'd recommend you start at http://www.dialogics.com and look into solutions partners to see if you can find a close match for your requirements.
Good luck!
Im building a small winforms app using: ayende rhino licensing. The licensing is working fine, I can create licences and distribute them as I choose.
The problem is, How do I make each license work on just one machine? I know there is a class in ayende's project called LicensingService which I believe does something like what I'm trying to do, but I just cant figure it out. I've done quite a bit of searching and couldnt really find any tutorials except this one.
Maybe someone has implemented this, or has some tips on how I could accomplish this? I do have access to a webserver, if that helps.
Any help is much appreciated, as always.
Depends how annoying you want to make it for your users to be honest. You could implement a HWID (see How to fast get Hardware-ID in C#? on how to generate them) which will be unique from system to system, then have your program check if the HWID matches the ID found to the place you store them on-line (usually by using a database).
Needless to say, this will make your application require internet connection in order to run which might be a bit frustrating for your users.
Or you can merge the HWID with the serial and have your application do the same to verify if they match, but that would be easily cracked by the average cracker.
In the end of the day, .net isn't the best as far as security goes since you can easily get the source code and modify the assemblies as needed to patch certain protections. Keep that in mind when deciding what route you want to take to protect your software.
I do not know what exactly is a rhino licensing. To tackle your need generally there are two approaches.
Either give some randomly generated password to the client machine, and maintain a pool of passwords in your server. Each time a password is entered to register the application in a local machine, check if it was already registered elsewhere by connecting to your server via internet.
Or, what we do is, generate a code unique to that machine (perhaps a hash of some unique machine id, say mac id) and get the client sent it to you. You would then rehash the code and send it back using some logic. Now when the client enters this code to his machine do the same thing: fetch the very machine id, do the same rehashing using the same some logicand check if it matches.
I cant think of anything else
For simple copy-protection purposes, I would like to generate a small string or int value to (somewhat) uniquely identify the current computer. Ideally this value won't change after simple hardware peripheral changes, or even hopefully after a complete re-installation of Windows.
Most of the answers found here and elsewhere are unsatisfactory for three main reasons:
The code presented isn't easily portable to C#.
The hardware values suggested are often unusable/empty (e.g. the processor ID or even the hard drive serial number) or unstable (e.g. the MAC address).
The code involved requires elevated admin privileges.
I have searched through several posts and found a helpful article (How To Get Hardware Information), but since #3 is an important consideration in my case, I'm not sure what hardware info I can retrieve with just normal user privileges.
Regarding #2, I imagine the best solution is to simply append a few different values together, but which ones? Any help is greatly appreciated, especially if it includes or points to C# code. :D
I think you're going to have a hard time meeting this criteria because uniquely identifying the machine may be a functionality that is only intended for administrators. If this isn't the case now I'd imagine it will be as time goes on due to rising privacy concerns.
I'm about to release my application which is built in C# VS2008 to my customer, and I want to prevent copy abuse post deployment, since it's easy to copy installation files to another machine and use the application. I want to limit usage to only one computer per installation.
See this question for some products that will help you do this...
https://stackoverflow.com/questions/118031/best-activation-key-software-for-net-application
My favorite for now is IntelliLock. Decent price, supports ASP.Net, and has been around for a while.
Locking to a machine ID is not a trivial thing to do manually. So I would us a license software package. Even if you're just trying to deter casual copying, you have to consider machine components change, and people get new computers.
But if you really want to do this manually see CPU serial number and http://www.vcskicks.com/hardware_id.php. But note even the CPU Serial is not a fool proof method as it quite often is disabled.
Use hashing to generate an unlock key. The idea is to gather some data which is fixed on the target machine but also unique. Examples are the name of the machine, id of network card, ... Generate a hash from these values and let the user send this data to you. Generated a new hash from this value and a secret key (only known by you) and send it back to the user. Now the user has to enter this key to unlock your software.
Use an "activation" scheme, like Microsoft does with Windows. Each installation must authenticate itself against a server somewhere using a key. If a key is used more than once, prompt the user to call and talk to a real person.
Just make a pre-screen to enter login\pwd
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Where do programs save their secret license or install related information? I notice that often times when you uninstall a program, clear out appdata references, check registries to make sure there is no residue of any relevant information.
If you reinstall the trial program again, it seems to know it was installed before. I'm not looking to find a way to crack trial programs but actually need to implement something similar and can't find any good information on how to do this.
Registry
online
file in folder Windows with system like name
I even seen apps that hacked unused OS variables to store custom data in registry.
But the simplest method is to register a handler for a custom unused file type like .sof (if that is there, it was installed before) Edit 1 You have to register the handle to open a known executable on the system, not to your app. Because cleaners will detect if points to a no longer existing app location. As for storing additional params like date of trial expiry you can include them in the path as a param, like: cmd.exe -o 2010-02-09
I have handled this in two ways. First, in windows apps, I put in an encrypted Registry entry which is not in a standard location so that it is not easily found. This is a good solution if you don't mind people who either a) reformat often which removes all registry entries or b) use your software on a virtual machine which can be quickly reverted to a pre-trial state (and thus your trail can be used again quickly).
The better alternative is to have an online registry component which catches the MAC address of the machine which the trial is loaded on. Whenever the trial is reloaded, the software checks against a web service to see if the MAC address has been seen before. The only way around this is again using a Virtual Machine with the ability to change the MAC address. However, if you have a user that goes to this extreme, they'll use your trial regardless.
Probably the most foolproof way of licensing (when done right) is through something the user physically has - some kind of hardware dongle.
very hard to copy/duplicate
not dependent on network access
tamper-resistant (compared to software)
user-friendly (when working correctly)
licence count enforcement (can't easily plug 1 dongle into 10 machines at once)
Of course, it has also numerous disadvantages:
expensive to produce
hard to repair/replace
actually requires you to communicate with the dongle in a cryptographically secure way - any kind of if(dongle_ok()) { do_stuff() } is an invitation for crackers to patch that over to if (1) { do_stuff() }...
...which will require special drivers...
...maybe even a special interface (I still have a LPT dongle, but no LPT ports; USB<->LPT sucks)
don't even think of hooking it up to a virtual machine (although peripheral support is better in VMs nowadays)
support hell (is it connected? is it not broken? is the driver not broken? are the signatures/keys right and unexpired?)
fragile, esp. if it sticks out of the computer and/or has destructive anti-tamper mechanisms
may break communication with other peripherals (esp. those "pass-through" things were notorious for this)
For most programs, the disadvantages far outweigh the advantages; however, if you're making expensive, complex software (think "production plant control"), your clients are rather cavalier about licensing (in other words, "would buy a single copy (crack it if necessary) and run it on 50 machines if they could get away with it"), and lawsuits are impractical (take too long, you don't have much evidence, uncertain outcome), this may be useful. (I didn't say simple, did I?)
They save it wherever they can, secret files, secret registry keys. There are commercial products that offer this kind of protection, like asprotect, armadillo, etc.
Some products will utilize ADS (Alternate Data Streams) and hide the data in various places.
Others will leave behind "rootkits" cough SONY.
Also some will create special registry entries that cannot be delete easily, such as entries with NULLs in the name.
It sometimes depends on how scrupulous the developer is.
Could also try making the file or folder hidden - most users don't know to reveal hidden files and folders. Then you can put it anywhere really. C:/WINDOWS is sometimes a good choice because of that silly window that shows up when you click it for the first time that says "DANGER! DO NOT EDIT ANYTHING IN THIS FOLDER OR YOUR OS WILL MESS UP!" This will hide most anything from the lay man, but let's face the facts, you're not hiding anything from anyone that is active on stack overflow. :)