Jump to content

Securing something to a flash drive using DriveGEtSerial?


Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Link to comment
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.
Link to comment
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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...