Help on number mother card

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Julien Morel.

Hello

Could somebody help me?
I want to protect my application. For that I want to use a key starting from the number of the mother card.

Can how be recovered the job number of a mother card ?
Even question for the hard disk. But I believe that for the hard disk, with each formatting the number changes!

Afflicted for my English, who should not be good:cry:, but I am French

Thank you for your assistance :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by alizta.

there is a hard disk id which does not change on a reformat since it is stored in a flash-chip, but can be changed by certain tools (wich are not very widespread).
i don't think there is something like a motherboard id.
you could also use the hardware id of a network card (if installed) called the MAC-Address, but though it should be unique there are tools to change that either. the only way to have a completely save and unchangeable id is to use the cpu id, which will only work for Pentium3 processors. maybe for pentium 4 as well, but i don't know about that. AMDs don't have identifieres as far as i know.
imho, the best target is the hard disk id.

---when all you have is a hammer, everything starts to look like a nail... ---
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Help on number mother card

Post by BackupUser »

Code updated for 5.20+

Restored from previous forum. Originally posted by ricardo.

Hi,

This snippet gives you the ID of the HD.

Code: Select all

appdir$=Space(255) : GetCurrentDirectory_(255,@appdir$)
DIR$ = Mid(appdir$,1,3)
lpRootPathName.s=DIR$
pVolumeNameBuffer.s=Space(256)
nVolumeNameSize=256
lpVolumeSerialNumber.i
lpMaximumComponentLength.i
lpFileSystemFlags.i
lpFileSystemNameBuffer.s=Space(256)
nFileSystemNameSize=256
Result=GetVolumeInformation_(lpRootPathName,pVolumeNameBuffer,256,@lpVolumeSerialNumber,@lpMaximumComponentLength,@lpFileSystemFlags,lpFileSystemNameBuffer,256)

ID$ = Hex(lpVolumeSerialNumber);Here is the ID of the HD
Debug ID$
(Dont told Franco that i already correct the error :))

Of course you need to 'hide' that you are using the ID of the HD and do something more to the ID, otherwise anyone can make a keygenerator for your application easy.




Best Regards

Ricardo

Dont cry for me Argentina...
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Change the first line from

Code: Select all

appdir=Space(255) : GetCurrentDirectory_(255,@appdir)
to

Code: Select all

appdir.s=Space(255) : GetCurrentDirectory_(255,@appdir)
and it will work without error messages.

Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ricardo.

Morel,

What kind of application did you develop? Im asking because all your questions... i dont get which kind of app are you developing :)


Best Regards

Ricardo

Dont cry for me Argentina...
Post Reply