Sign in to follow this  
Followers 0
carlosale214

Securing something to a flash drive using DriveGEtSerial?

9 posts in this topic

I want to make a program that only runs on the flashdrive its assigned to and I do not feel like getting into registration keys and all of that so I began to think of another possible way this might work...this is what I came up with

if(DriveGetSerial("D:\")<>2883607200)Then
ProcessClose("runner.exe")
Exit
EndIf

Is it really this easy or would it not work? I assume every flash drive has its own serial and i checked this with a few of my own so cant you just check the serial of the flash drive and not run the file if they dont match?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I assume every flash drive has its own serial...

Only hard drives have an unique serial numbers, not a flash drives. The number that returns DriveGetSerial() will exist until the first format a drive.

Edited by Yashied

Share this post


Link to post
Share on other sites

May suggest this?

Provides a hardware id of a USB device rather than a partition serial number that is lost upon re-formatting.

Share this post


Link to post
Share on other sites

Thanks! that helped, appreciate it (:

Share this post


Link to post
Share on other sites

Only hard drives have an unique serial numbers, not a flash drives. The number that returns DriveGetSerial() will exist until the first format a drive.

My tests show that DriveGetSerial only obtains the Volume Serial (regardless of the media) not a hardware serial.

Share this post


Link to post
Share on other sites

May suggest this?

Provides a hardware id of a USB device rather than a partition serial number that is lost upon re-formatting.

One thing to bear in mind with this

I have encountered different pen drives with the same serial, mass produced ones etc

The way i got round it was to have a hidden ini file on the drive with a long serial encrypted on it

So the drive serial was only part of the equation

That way i could make it recognize my drive every time

Share this post


Link to post
Share on other sites

...I have encountered different pen drives with the same serial, mass produced ones etc

I can't deny this possibility, but I can imagine that you'd run into issues having two drives with the same PNPID plugged in at the same time.

Doesn't seem like it be an issue to me though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0