Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FPD25- C loader and copy protection
Message
 
To
18/09/2002 04:07:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00701158
Message ID:
00709693
Views:
35
Hi Cetin

How was your DevCon? Looks like everybody is happy with VFP8.

Sorry to be troubling you again but I seem to have run into a problem with serial.bin I will be glad if you can help me with it. The problem goes:

I have tried this on a standalone manner and it is very well. But on a LAN environment where I have mapped the server C drive as say for eg. E: the following failed from the node:

E:
CD\app
FOXR readsrno.prg (which in turn call serial.bin)

here serial.bin returns a blank instead of 4 characters.

But if I shift to the server and...
C:
CD\app
FOXR readsrno.prg

here serial.bin returns the right value.

On the same machine but between drive partitions like C: and D: on the same machine is working well.

Please help.

>>The usual, the Disk Serial no. My main aim for the copy protection is casual copy protection. Serious hackers will break any if they want to.
>>
>>
>
>You don't need a C routine to check disk format serial number. If C routine is correct it still works under w2K, XP. In FPD2.x you can load and call binary routines.
>
>
>*SerialBinTest.prg
>parameters driveletter
>set talk off
>clear
>mp = chr(asc(upper(driveletter))-ASC("A")+1)+chr(0)+;
>	space(22) && 24 bytes total
>load serial
>call serial with mp   && execute binary code
>? substr(mp,2+1) && First two bytes are always chr(0)
>cSerial1 = substr(mp,1+2,1)
>cSerial2 = substr(mp,2+2,1)
>cSerial3 = substr(mp,3+2,1)
>cSerial4 = substr(mp,4+2,1)
>
>? asc(cSerial4)  && Disk serial number
>? asc(cSerial3)  && is a doubleword
>? asc(cSerial2)  && So read in reverse order
>? asc(cSerial1)  && as shown in dir
>* Now print in hex format just like dir
>? "Disk serial number is "
>?? padl(dec2hex(asc(cSerial4)),2,"0")
>?? padl(dec2hex(asc(cSerial3)),2,"0")
>?? ":"
>?? padl(dec2hex(asc(cSerial2)),2,"0")
>?? padl(dec2hex(asc(cSerial1)),2,"0")
>?
>
>function Dec2Hex
>parameters nDecimal
>n=0
>do while floor(nDecimal/16^n) > 15
> n = n+1
>enddo
>cHEX = ""
>for ix=n to 0 step -1
> cHEX = cHex + DecDigit2HexDigit(floor(nDecimal/16^ix))
> nDecimal = nDecimal % 16
>endfor
>return cHex
>
>function DecDigit2HexDigit
>parameters nDecimal
>return iif(ndecimal>9,chr(asc("A")+nDecimal%10),str(nDecimal,1))
>
>
>
*Create bin - run once
>handle=fcreate('Serial.Bin')
>=FWRITE(handle,CHR(83)+CHR(184)+;
>  CHR(0)+CHR(105)+CHR(139)+CHR(211)+;
>  CHR(139)+CHR(31)+CHR(205)+CHR(33)+;
>  CHR(91)+CHR(203))
>=fclose(handle)
>
Cetin
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform