Quote: "By issuing a key derived from some sort of hardware checksum that is submitted with the request for a key. My original question related to how I might obtain such a checksum, but it doesn't seem to be possible in DBPro."
Yes it is possible. Without going into the registry you can create a key using the users hardware. All Darkbasic programs require DirectX to run so you can bet that the computer running your program has DirectX so we can use DXDiag.exe to get some hardware stats.
The first lines of a file made with DXDiag.exe are like this (from my computer):
------------------
System Information
------------------
Time of this report: 3/1/2011, 12:56:37
Machine name: X-PC
Operating System: Windows Vista™ Home Premium (6.0, Build 6002) Service Pack 2 (6002.vistasp2_gdr.100608-0458)
Language: English (Regional Setting: English)
System Manufacturer: Acer
System Model: Aspire X1700
BIOS: Default System BIOS
Processor: Intel(R) Pentium(R) Dual CPU E2220 @ 2.40GHz (2 CPUs), ~2.4GHz
Memory: 4094MB RAM
Page File: 1877MB used, 6528MB available
Windows Dir: C:\Windows
DirectX Version: DirectX 11
DX Setup Parameters: Not found
DxDiag Version: 7.00.6002.18107 32bit Unicode
If you extract the machine name, system model, and processor that's enough to make a key that requires this machine to run. With the machine name added only this computer should produce the specific key even if a computer with exactly the same hardware is used it will not have exactly the same machine name. Using the code I posted in the other thread instead of getting the user name we use those instead.
This requires IanMs Matrix 1 Utilities Plugin:
` Dimensionalize an array to store the strings
dim Stat$(19)
` Pick a random seed
randomize 500
` Run Dxdiags output into a file
execute file "dxdiag.exe","/t !Stats.txt",get dir$()
` Open the file
open to read 1,"!Stats.txt"
` Only read the first 20 lines of !Stats.txt
for t=0 to 19
` Read the strings from !Stats.txt
read string 1,Stat$(t)
` Split the string
split string Stat$(t),":"
` Grab the important part of the string
Stat$(t)=get split word$(2)
next t
` Close the file
close file 1
` Delete the file
delete file "!Stats.txt"
` Show the array
for t=0 to 19
print "Stat$("+str$(t)+") = "+Stat$(t)
next t
` Add the PC Name, System Model, and Processor to one string
PCName$=Stat$(4)+Stat$(8)+Stat$(10)
` Remove all spaces
PCName$=remove all$(PCName$," ")
` Convert the name to ascii numbers
for t=1 to len(PCName$)
` Add the ascii number to Code$
Code$=Code$+str$(asc(mid$(PCName$,t)))+" "
next t
` Reduce the numbers by adding each set
for t=1 to len(Code$)
` Check if it's a space
if mid$(Code$,t)<>" "
` Add the numbers
Num=Num+val(mid$(Code$,t))
else
` Add Num to new string
Code2$=Code2$+str$(Num)
` Clear Num
Num=0
endif
next t
` Randomly pick the key from Code2$
for t=1 to 16
` Pick a number
a=rnd(len(Code2$)-1)+1
` Add the number to the key
Key$=Key$+mid$(Code2$,a)
` Count numbers
inc Num
` Add a - after 4 numbers
if Num=4 and t<16 then Key$=Key$+"-":Num=0
next t
` Show the results
print ""
print ""
print "PCName$ = "+PCName$
print "Code$ = "+Code$
print "Code2$ = "+Code2$
print "Key$ = "+Key$
wait key
Attached is what I get from running the above code.