Click to See Complete Forum and Search --> : Expire The Project After 15 Days
shakti5385
Aug 4th, 2006, 04:08 AM
Hi all :wave:
There is a big problem to uninstall the software after some days… :confused: There are many method but
I think that this is the simplest and secure method
So all u please check it and tell….
How it is :thumb:
Private str As String
Private str1 As String
Private str2 As String
Private initialDate As Date
Private expDate As Date
Private usedDate As Date
Private Expire As Boolean
Sub Main()
Call Expire_Project
End Sum
Public Sub Expire_Project()
str = GetSetting("Project Name", "Expiry", "Initial Date")
'First Get the Value from the Registry
If Len(Trim(str)) < 1 Then
'If the Registry Value is not set then Set the Value
SaveSetting "Project Name", "Expiry", "Initial Date", Date
expDate = DateAdd("d", 15, Date)
'Add 15 days to the Current Date
SaveSetting "Project Name", "Expiry", "Expiry Date", expDate
'Here I have Given 15 days for expiration of the Software You can Give 'n' no of days as you like
Else
str1 = GetSetting("Project Name", "Expiry", "Used Date")
'If this Registry Value is not Set then
If Len(Trim(str1)) < 1 Then
str = GetSetting("Project Name", "Expiry", "Initial Date")
'Get the Previously set Initial Value from the Registry
initialDate = CDate(str)
str2 = GetSetting("Project Name", "Expiry", "Expiry Date")
'Get the Expiry Value from the Registry
expDate = CDate(str2)
If Date > expDate Or Date < initialDate Then
'Compare Registry Values with the Date, if they are bound with in the Initial Value of the Software and Expiry Value of the SOftware then only the Program will run
SaveSetting "Project Name", "Expiry", "Used Date", "True" 'Now set the Used Date value to True
MsgBox "Software Has Been Expired; You cannot run the Software by Setting the Date Backwards", vbExclamation, "Software Expired"
Expire = True
Exit Sub
End If
Else
MsgBox "Software Has Been Expired; You cannot run the Software by Setting the Date Backwards", vbExclamation, "Software Expired"
Expire = True
Exit Sub
End If
End If
End Sub
check It Out....
Shakti Singh Dulawat :thumb:
thanks.. ;)
shukla
Aug 4th, 2006, 05:04 AM
i have tried this code.
But user who know registry path and can edit registry values can break this code.
shakti5385
Aug 4th, 2006, 05:33 AM
have tried this code.
But user who know registry path and can edit registry values can break this code.
if any one able to change in the registry then he can do any thing.....
but tell me one thing that how the client know that this software saving the date in the registry....
this is u know and i know
check and change tha date see what happen....
It is working perfectlly here......
d00by
Aug 4th, 2006, 06:24 PM
would be cool if there was some sort of way to hardcode the varible into the project using php or something, so that like when user clicks download, the page actually sets the date in the script, then compiles the program for you, then gives the user the download link to the newly compiled project :)
shakti5385
Aug 5th, 2006, 02:37 AM
but i thinks my code send the date of first open project... and when user run it second time it compare that time.....
and in the middle if u are changing the date then it autolatically expird....
run the code and try to change the date...
Immortal Knight
Aug 5th, 2006, 05:07 AM
nice code.. but it would be better if you encoded the date before writing it to the registry. you may just use a simple array or ptu an encode/decode key in a txt file to use as a base.. then when program opens it will decode and look at the date. safe and easy...(ok maby not that easy but not more than a few hours of work for you) in the and its just a date composed of 8 characters.
so that although the user knows how to edit registry, he wouldnt understand from a date like "aa jkfdsa hhe".
shakti5385
Aug 5th, 2006, 05:39 AM
in my code i show the line that adding the registry number.... so programmer can use it......
we are not showing the user that it is adding the programme in to the registry
bushmobile
Aug 6th, 2006, 04:52 PM
in my code i show the line that adding the registry number.... so programmer can use it......
we are not showing the user that it is adding the programme in to the registrybut the first thing that someone attempting to bypass this would do is check under the registry for any Keys belonging to your app.
Anyone with any knowledge of the registry could get round it.
d00by
Aug 6th, 2006, 09:15 PM
you could do a dual action approach. Store one date in the registry, and one date in an ini file. If they dont match, then delete the ini file, and if there is no ini file, then program doesnt worik.
shakti5385
Aug 6th, 2006, 09:26 PM
you could do a dual action approach. Store one date in the registry, and one date in an ini file. If they dont match, then delete the ini file, and if there is no ini file, then program doesnt worik.
if u have an idea then modify code and post here....
then i will check.... i haven't idea about the ini file....
shakti5385
Aug 7th, 2006, 01:28 AM
Steps Involved
1) Make a table in the database that contain the field table name is skey and the three field are
PID -Text -Showing the product ID
SNO -Text -Showing the serial number of the product
Allow -Boolean -True if product is registered
2) What we are doing.
We are running our project and saving the value of the serial key in the the database and the database is already password protect.
After 15 days we are expires our product and asking the user to put a serial number in the text field.
User is able to see the product Id but he is not able to get the serial number. He now give us the product id and we give us the serial number. Now he put the serial number where the project asking for putting the serial number and we match the serial number from the database and it both match the database Boolean value is become true and user get permission to use the project.
Public Product_ID As String
Public Serial_Number1 As String
Public Registered As Boolean 'True if Software registered
‘This function giving us the serial number of the product
Public Function Serial_Number()
Product_ID = Product_Number
Serial_Number1 = Serial_Number2(Product_ID)
TSQL = ""
TSQL = "select * from Skey"
Set RTMP = Get_Special_Record_Set(TSQL)
If RTMP.RecordCount = 1 Then
Registered = True
Exit Function
End If
While Not RTMP.EOF
RTMP.Delete
RTMP.MoveNext
Wend
If RTMP.RecordCount = 0 Then
RTMP.AddNew
RTMP!PID = Product_ID
RTMP!sno = Serial_Number1
RTMP.Update
End If
End Function
Function Product_Number() As String
Dim Temp1 As String
Dim Temp2 As String
Dim A As String
Dim b As String
Dim C As String
Dim d As Integer
Dim E As Integer
Temp1 = mHardDrive.Serial
‘mHardDrive.Serial Here we include a module that showing the serial number of the hard disk and we are using this serial number for making the product id.
A = Left(Temp1, 1)
b = Right(Temp1, 1)
d = 1
For I = 1 To Len(Temp1)
If IsNumeric(Mid(Temp1, I, 1)) Then
E = Mid(Temp1, I, 1)
If E = 0 Then E = 3
d = d * E
End If
Next
Temp2 = "Product" + A + b + CStr(d)
Product_Number = Temp2
End Function
Function Serial_Number2(P As String) As String
‘This is the final function that taking the product id as input and returning the serial number as the out put.
Dim Temp1 As String
Dim Temp2 As String
Dim A As String
Dim b As Integer
Dim C As Integer
Dim d As Integer
Temp1 = P
d = 1
For I = 1 To Len(Temp1)
If IsNumeric(Mid(Temp1, I, 1)) Then
b = Mid(Temp1, I, 1)
If b = 0 Then b = 3
d = d + b
Else
A = A + Mid(Temp1, I, 1)
b = Asc(Mid(Temp1, I, 1))
d = d + b
End If
Next
C = d
d = d + d + d + d
Temp2 = "10" + "-" + "85" + "-" + CStr(d) + "-" + CStr(C) + "85"
Serial_Number2 = Temp2
End Function
'Now in ur submain
Sub Main()
Call Expire_Project 'Expire the project after 15 days
If Expire = False Then
frmLogin.Show
'Form whish u want to display first
End If
If Expire = True Then
FHelp.Show
'this form contain the product id and if u enter the serial number then it registerd the project
End If
End Sub
Any problem please ask....
comment and feedback and rate are welcome
shakti............ :thumb:
Al42
Aug 8th, 2006, 05:27 PM
Save the encoded date as an encoded key name in some program that exists in all versions of Windows.
shakti5385
Aug 8th, 2006, 10:35 PM
Save the encoded date as an encoded key name in some program that exists in all versions of Windows.
explain in brief please ;)
shakti5385
Sep 15th, 2006, 08:18 AM
but the first thing that someone attempting to bypass this would do is check under the registry for any Keys belonging to your app.
Anyone with any knowledge of the registry could get round it.
Bush
Please Explain that what is the batter solution we can implemented in it? :wave:
litlewiki
Sep 19th, 2006, 07:43 AM
Hey you are using savesetting to save the values which is a fixed value in registry hive which is \software\vb and vba program settings.Instead choose a random location everytime,encode the keys and values using say the harddisk serial number or timestamp ...
shakti5385
Sep 19th, 2006, 07:53 AM
Yes i am using the save string for saving the date in the registry, Plese tell what to do it make batter....
thanks
Nerd-Man
Dec 27th, 2006, 11:05 AM
nice source but once you release a program, then it will go in wrong hands and once it is in wrong hands, it will get cracked. i have seen hard expensive protection get crack. so it would be nice if you can add a web protection to it so that even if the program get cracked, you can still be able to deactivate the program using the web activation like the one KeyBuster from www.keybuster.com. they will give you key that can be use by your application and it will check for the key everytime they run your program. so if they share the key with other peoples, then you can quickly deactivate the program and issure a another key. this is the most effective way that i have seen many programmers are using. i have seen a proxy leecher and the programmer use this protection and i haven't seen a crack version of the proxy grabber. so i think web base protection are better as it give you full power to deactivate your programs at anytime you want.
shakti5385
Jan 5th, 2007, 02:07 AM
New One :thumb:
Private Sub Expire_Project()
str = GetSetting("HKey_Lib_Main", "Exp_Classes", "INTValue") 'First Get the Value from the Registry
If Len(Trim(str)) < 1 Then 'If the Registry Value is not set then Set the Value
Call Convert_Into_Letters(Format(Date, "dd-mm-yyyy")) 'Convert Digits into Letters
SaveSetting "HKey_Lib_Main", "Exp_Classes", "INTValue", StartDate
expDate = DateAdd("d", 15, Date) 'Add 15 days to the Current Date
Call Convert_Into_Letters(Format(expDate, "dd-mm-yyyy")) 'Convert Digits into Letters
SaveSetting "HKey_Lib_Main", "Exp_Classes", "EXPValue", StartDate 'Here I have Given 15 days for expiration of the Software You can Give 'n' no of days as you like
Else
str1 = GetSetting("HKey_Lib_Main", "Exp_Classes", "USD") 'If this Registry Value is not Set then
If Len(Trim(str1)) < 1 Then
str = GetSetting("HKey_Lib_Main", "Exp_Classes", "INTValue") 'Get the Previously set Initial Value from the Registry
Call Convert_Into_Digits(str) 'Convert Letters Into Digits
initialDate = CDate(ExpiryDate)
str2 = GetSetting("HKey_Lib_Main", "Exp_Classes", "EXPValue") 'Get the Exp_Classes Value from the Registry
Call Convert_Into_Digits(str2) 'Convert Letters Into Digits
expDate = CDate(ExpiryDate)
If Date > expDate Or Date < initialDate Then 'Compare Registry Values with the Date, if they are bound with in the Initial Value of the Software and Exp_Classes Value of the SOftware then only the Program will run
SaveSetting "HKey_Lib_Main", "Exp_Classes", "USD", "True" 'Now set the USD value to True
MsgBox "Software Has Been Expired; You cannot run the Software by Setting the Date Backwards", vbExclamation, "Software Expired"
Expire = True
Exit Sub
End If
Else
MsgBox "Software Has Been Expired; You cannot run the Software by Setting the Date Backwards", vbExclamation, "Software Expired"
Expire = True
Exit Sub
End If
End If
End Sub
Private Sub Convert_Into_Letters(ByVal SDate As String)
StoreDate = Format(SDate)
StartDate = ""
If Len(StoreDate) > 0 Then
For I = 1 To Len(StoreDate)
Select Case Mid(StoreDate, I, 1)
Case 1: StartDate = StartDate + "F"
Case 2: StartDate = StartDate + "L"
Case 3: StartDate = StartDate + "A"
Case 4: StartDate = StartDate + "Z"
Case 5: StartDate = StartDate + "K"
Case 6: StartDate = StartDate + "T"
Case 7: StartDate = StartDate + "H"
Case 8: StartDate = StartDate + "V"
Case 9: StartDate = StartDate + "P"
Case 0: StartDate = StartDate + "X"
Case "/": StartDate = StartDate + "Q"
Case "-": StartDate = StartDate + "J"
Case "\": StartDate = StartDate + "N"
End Select
Next
End If
End Sub
Private Sub Convert_Into_Digits(ByVal StartDate As String)
ExpiryDate = ""
If Len(StartDate) > 0 Then
For I = 1 To Len(StartDate)
Select Case Mid(StartDate, I, 1)
Case "F": ExpiryDate = ExpiryDate + "1"
Case "L": ExpiryDate = ExpiryDate + "2"
Case "A": ExpiryDate = ExpiryDate + "3"
Case "Z": ExpiryDate = ExpiryDate + "4"
Case "K": ExpiryDate = ExpiryDate + "5"
Case "T": ExpiryDate = ExpiryDate + "6"
Case "H": ExpiryDate = ExpiryDate + "7"
Case "V": ExpiryDate = ExpiryDate + "8"
Case "P": ExpiryDate = ExpiryDate + "9"
Case "X": ExpiryDate = ExpiryDate + "0"
Case "Q": ExpiryDate = ExpiryDate + "/"
Case "J": ExpiryDate = ExpiryDate + "-"
Case "N": ExpiryDate = ExpiryDate + "\"
End Select
Next
End If
End Sub
TysonLPrice
Feb 2nd, 2007, 10:59 AM
It looks like to me all someone has to do is set the date back on the computer to get around that. I do that with some trial software I have. Some trial software doesn't fall for that. I don't know how they get around it.
Thanks!
shakti5385
Feb 3rd, 2007, 05:04 AM
It looks like to me all someone has to do is set the date back on the computer to get around that. I do that with some trial software I have. Some trial software doesn't fall for that. I don't know how they get around it.
Thanks!
If you have some more idea then tell me.
Welcome
BrendanDavis
Feb 5th, 2007, 04:35 AM
You could just set the date back on your computer and bypass that, which is obviously no good.
What you'd be better off doing is having your app reference the date from an outside source, like a timezone website or something like that. Something that a user can't modify unless they hack the website itself. You could save the original load date in a random file in a hidden location, hide it amongst some random encrypted data. For example, insert the date at a specific character point in the middle of a large paragraph of Lorem Ipsum, and then encrypt it via a custom encryption method, and have your app decrypt the info upon startup and reference that specific point for the date, and then compare that date against the web reference.
The main problem you might run into is if someone finds the file somehow and deletes it. Then you have no date to reference. The probability of that happening if you hide the file well enough is slim, especially considering most people won't think to look for a file, but rather look through the registry for the date. To avoid the user being able to use the app after the file is deleted, have the app automatically end trial if the file no longer exists.
It's a crude method, but it's out of the ordinary and it's something most people won't pick up on or figure out right away.
I_Love_My_Vans
Aug 11th, 2007, 02:00 AM
For everyone who in this thread asked how a user could tell if a program is being writen to the registry.
The is a program originally writen by SysInternals (how are now owned by Microsoft) that shows a live display of everything being read and writen to a file or the registry, there is a filter system so I can see exactly what notepad.exe is sending and nothing else, from there you can review the evidence to crack the date in the registry.
http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx
shakti5385
Aug 11th, 2007, 02:10 AM
This code is based on adding the detail in the registry! in the post 18 i change some code that encrypt , i encrypt it using
a,b,c,d
you can change the code there!
Can you tell your client that i add the code in the registry for expire the project i think no and never!
so how he/she know
if any one has other best idea for this the welcome!
DigiRev
Aug 13th, 2007, 02:02 AM
Yeah, as someone already said, there's a program to monitor file/registry access by programs. I never knew of the new one but I've used RegMon and FileMon.
shakti5385 - The first place crackers usually look is the registry. If not there, the file system. With programs like the ones I mentioned it's even easier. Or simple hex edits in the EXE to bypass if/then statements. Or even more, modifying the values stored in memory to "fool" the program.
The only question is whether or not your program is worth the trouble of doing that.
What you should do is just not have your program even run at all if that registry value or file doesn't exist. If a user wants to try and crack a program by changing/deleting stuff then it's his fault if he can no longer use the program without reinstalling.
However, re-installing could just reset the trial period. It would be much easier (but a little less convenient for some users) if you required internet access during the install process. They have to use the internet anyway to download your software. ;)
Keep track of the use of your program via unique IDs found on the computer: hard drive serial, whatever. When they re-install, poll the server to see if they have already installed by checking their IDs against the ones in your database. If they have, don't proceed with the install.
You can also be sneaky and do this same process when they click something like "Check for updates", because that will require internet access anyway.
Just an idea...
Edit: If you do collect information like this, make sure to state it in your EULA (End User License Agreement) and/or TOS (Terms of Service). Just to be fair to the user and prevent any legal issues.
shakti5385
Aug 13th, 2007, 02:08 AM
However, re-installing could just reset the trial period. It would be much easier
this will not happen in this code :)
_RaJ_
Jun 5th, 2008, 05:35 AM
but ur code can be cracked easilly !!
vbsixer
Aug 6th, 2008, 05:32 PM
...or you could use ActiveLock which deals with all the issues noted here and also the issue of the date/time being moved and, its free!!
Just a thought....
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.