Solved

How can i make my app. run only if it is on a certain USB Flash Disk?

Posted on 2004-08-29
12
252 Views
Last Modified: 2010-04-05
Hard disk drives have manufacturer serial numbers and i can determine and use them to make my exe run on a certain harddisk only. This provides enough copy protection for me. But now i have to make my exe to run on a USB Flash Disk so that end-user can take it anywhere he wants and run on any computer but it should not run if it is copied to a harddrive, to another flash disk etc. Is there a way to do this? I'm using Delphi 7. Thanks to everyone answering.
0
Comment
Question by:blackcat67
  • 3
  • 3
  • 2
  • +3
12 Comments
 
LVL 7

Expert Comment

by:DavidBirch2dotCom
ID: 11925491
There was a similar thread to this a while ago... unforunatly i cant find it :(  the end result as i remember was that there was no simple way of doing this.  I dont think USB sticks have a unique code....

DAvid
0
 
LVL 7

Accepted Solution

by:
DavidBirch2dotCom earned 200 total points
ID: 11925512
there you go found it :)

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21076454.html

Very long thread but lots of info there all related to the same thing, some of it might be useful

David
0
 
LVL 5

Expert Comment

by:Gwena
ID: 11926794
Why not check the physical size of the drive the exe is on...

If it is larger than the size of a USB drive then halt the exe. :-)

Not too many old 10mb to 1gb hard disks out there any more so this should
work ok...

Also...are not USB drives MUCH slower than the average HD?
do a simple drive access speed test for a couple of seconds
and act accordingly..

Combine both ideas and I bet it would weed out pretty much all HD's
0
 

Expert Comment

by:RomanianKid
ID: 11929197
Checking the S/N of the flash disk, a size check, drive letter (different than A,B,C), file system. This should be almost full-proof. Gonna give code later... Maybe in a few hours.
0
 

Expert Comment

by:RomanianKid
ID: 11929207
Speed Test should be skipped. It takes too long and the values can be very different, because of the load of the computer in that moment.
0
 

Author Comment

by:blackcat67
ID: 11932156
Thanks to DavidBirch2dotcom. I've carefully read all comments at the link you've given. Now I understand that I would not be able to find exactly what i want but some other solutions may work. I'm planning to use a combination of volume serial info and vendor id (or similar info that Windows normally identifies for installation of necessary driver) of the usb disk. But now i should know that how can i determine if my exe runs from a usb disk, or from a hard disk, or even from a cd-rom? And also how can i retrieve the vendor and model info of the usb disk (Such as 3SYSTEM USB FLASHDISK, or  TinyDisk)?

also thanks to romaniankid for comments and i'm waiting for his code.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Assisted Solution

by:DavidBirch2dotCom
DavidBirch2dotCom earned 200 total points
ID: 11933002
well, to find out where its running then just get the filename and directory of the exe, i am not sure which letter windows uses for a USB pen... but I think it aught to be something you could pick up on

As for Disk info have a look at

http://delphi.about.com/library/weekly/aa070699.htm - lots of info about getting disk infomation
http://www.swissdelphicenter.ch/torry/showcode.php?id=238  - get disk free space

Also alot of very good information and components for this kind of task on this site
http://www.efg2.com/Lab/Library/Delphi/IO/DisksDrives.htm 

and
http://www.ordergenuine.com/Development/Components-Libraries/delphi-component-free.php - bottom of the page

Hope that one of those links proves useful,

David

0
 
LVL 45

Expert Comment

by:aikimark
ID: 11937591
Can we at least assume you are the person copying your software on the USB device?  If so, you create a strongly encrypted key file that indicates the serial number of the USB device and include that either as a separate binary file on the USB or as a resource file or hard-coded in your program.

As you use new devices, you change the associated serial number check/comparison.

=================
If you want to get really slick, you can copy the files in a specific sequence to the USB device in such a way that the starting sector of the serial number file(s) are in specific locations.  You can use Windows file system API calls to determine the starting location as a valid indicator.

=================
If you are looking for a more secure solution, look to vendors that offer strongly encrypted dongles and associated security software.  Your application can then be installed on the hard drive and require the presence of the data on the strongly encrypted USB dongle in order to execute.
0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 11939144
> Comment from DavidBirch2dotCom
>Date: 08/29/2004 03:08PM CEST
>      Comment       

>there you go found it :)
>http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21076454.html
>Very long thread but lots of info there all related to the same thing, some of it might be useful
>David


i followed this this thread and there you can find the followin post:

>Comment from alikoank
>Date: 08/02/2004 10:08AM CEST
>      Comment       

>Ordinary memory sticks do not have an unique ID. They have some sort of hardwareID but it is not unique, and is used to identify usb hardware to host computer.
>There are some memory sticks with unique id feature but they also require installation of drivers to host system.

the whole problem condenses to one simple problem:
is one usb stick different from another one?
that means can you determine within a program that the actual one is not the original one?
its the same problem the cd disc copy protections have.
as blank cds dont have a serial number they developed different means of protections.

in the other thread no one knew something about a unique serial number for usb sticks

regards
0
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 50 total points
ID: 11942364
0
 
LVL 45

Expert Comment

by:aikimark
ID: 11953060
blackcat67,

I'm glad we could help you solve your problem (thanks for the points).
However, a 'C' grade indicates some dissatisfaction with the comments
or solution.  This discussion thread had only been open for a couple of
days, so I'm surprised that it is now closed.  Perhaps if we had discussed
this further, you would have been more satisfied with your solution.

Since the accepted answer refers to a currently open EE discussion thread,
and to better help me answer future questions, what is the 'solution' to
your question/problem?
0
 

Author Comment

by:blackcat67
ID: 11989523
since there is no hardware serial for usb sticks there is no exact solution for my question but there may be some solution for copy protection. I decided to write harmless few identifying bytes to boot sector of usb stick and so prevent copying to some degree but this method of course has many disadvantages that I do not have time to mention here. Again thanks to everyone trying to help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now