Results 1 to 26 of 26

Thread: Make a trial version! help!

  1. #1

    Thread Starter
    Lively Member Xcoder's Avatar
    Join Date
    Jan 2004
    Posts
    120

    Make a trial version! help!

    oh my, I need to create a trial version of some software Im developing, I know how to write stuff deep in the registry, like current system date, but, how do I avoid the fact that the user might change the system's date and time?
    Last edited by Xcoder : 09-10-2001 at 12:45 AM.

  2. #2
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    You cant, come up with a better method.

  3. #3
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    Complete protection is nearly impossible to achieve. Perhaps you'd better create a demo version? Let the user use all functions in the app, except the ones that generate the output, whatever that may be.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  4. #4

    Thread Starter
    Lively Member Xcoder's Avatar
    Join Date
    Jan 2004
    Posts
    120
    yeah, those hackers got it going, is there another way of knowing the exact time? perhaps something like tickcount ? (I know it only records the time since windows started) or maybe checking the BIOS?
    Last edited by Xcoder : 09-10-2001 at 12:45 AM.

  5. #5
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Yup it can be done. You need a db or the like at your end. Once the User installs the app they need to get an activation key to use the trial version so they conect to your server. Well grab their hard drive serial number or what ever, bit like what win XP does, well XP actually grabs a whole range of serials/info for your PC they wraps this up with some algo making it next to impossible to crack, then send this serial number to your db and store it there. If they try to resuse the app after the trial period ends you have their record in your db to deny a new activation key.

    Only problem here is with the legal side. It may be illegal to grab somebodies HD serial number and retrive it like this, just guessing.

  6. #6
    Hyperactive Member csar's Avatar
    Join Date
    Mar 2002
    Location
    Siam
    Posts
    288
    you may use installation date (create date of your .exe file) to count down for expired date in trial version.

    BTW, to protect user from changing system date between installation, recheck difference between current date with installed date again. It should not be greater than trial period days. (ex.30 day)

    Hope this help you

    Don't leave it till tomorrow, Do It Now!
    5361726176757468204368616E63686F747361746869656E

  7. #7
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    CT
    Posts
    17,882
    If someone is willing to change there system date to run "stolen" softare, then let karma take care of them...

    As far as legal aspects of getting hardware info, simply post some very detailed, and small font, "ACCEPT THIS" clause that mentions the fact that you will be "retrieving" this information and go with that. Don't BS this info - be real - take it from some "ACCEPT THIS" clauses that other vendors us (M$) and work your wording into it - if it's not already there.

  8. #8
    Junior Member
    Join Date
    Jun 2004
    Posts
    27
    Originally posted by Xcoder
    yeah, those hackers got it going, is there another way of knowing the exact time? perhaps something like tickcount ? (I know it only records the time since windows started) or maybe checking the BIOS?
    i got a way, pull server time from the server, and use Harddrive serials for the program.....

    checks server for date that it is, and the server uses 30 day periods, then it puts HD serial on a list, then the program checks.... i guess....


    just an idea.... probably wont work too well

  9. #9
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    Creating an MD5 hash using hardware serial numbers is a good way to go, since it's a one-way hash, it doesn't jeapordize anything (Though I don't know what you can do to someone just with their hardware info).

    Or you could set the program to run only say, 30 times for 10 minutes each time. Keep the number of uses on a file hidden deep in the system somewhere, and use Neolite or such to compress the compiled EXE making it a pain for crackers to edit it.

    Just throwing some ideas out for ya.

  10. #10
    Addicted Member Abilio's Avatar
    Join Date
    May 2003
    Location
    Aveiro - Portugal
    Posts
    222
    Use GetFileInformationByHandle API to stop execution after a giving date

  11. #11
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    Just set a limited amount of uses
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  12. #12
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245
    try this....

    [CODE]

    Option Explicit

    Public Function DateGood(NumDays As Integer) As Boolean
    'The purpose of this module is to allow you to place a time
    'limit on the unregistered use of your shareware application.
    'This module can not be defeated by rolling back the system clock.
    'Simply call the DateGood function when your application is first
    'loading, passing it the number of days it can be used without
    'registering.
    '
    'Ex: If DateGood(30)=False Then
    ' CrippleApplication
    ' End if
    'Register Parameters:
    ' CRD: Current Run Date
    ' LRD: Last Run Date
    ' FRD: First Run Date

    Dim TmpCRD As Date
    Dim TmpLRD As Date
    Dim TmpFRD As Date

    TmpCRD = Format(Now, "m/d/yy")
    TmpLRD = GetSetting(App.EXEName, "Param", "LRD", "1/1/2000")
    TmpFRD = GetSetting(App.EXEName, "Param", "FRD", "1/1/2000")
    DateGood = False

    'If this is the applications first load, write initial settings
    'to the register
    If TmpLRD = "1/1/2000" Then
    SaveSetting App.EXEName, "Param", "LRD", TmpCRD
    SaveSetting App.EXEName, "Param", "FRD", TmpCRD
    End If
    'Read LRD and FRD from register
    TmpLRD = GetSetting(App.EXEName, "Param", "LRD", "1/1/2000")
    TmpFRD = GetSetting(App.EXEName, "Param", "FRD", "1/1/2000")

    If TmpFRD > TmpCRD Then 'System clock rolled back
    DateGood = False
    ElseIf Now > DateAdd("d", NumDays, TmpFRD) Then 'Expiration expired
    DateGood = False
    ElseIf TmpCRD > TmpLRD Then 'Everything OK write New LRD date
    SaveSetting App.EXEName, "Param", "LRD", TmpCRD
    DateGood = True
    ElseIf TmpCRD = Format(TmpLRD, "m/d/yy") Then
    DateGood = True
    Else
    DateGood = False
    End If
    End Function


    'Usage

    Private Sub Form_Activate()
    If Not DateGood(30) Then
    MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
    Unload Me
    End If
    End Sub


    CODE]
    A lowly programmer.

    http://www.sentinalgroup.com

  13. #13
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    when they first use it create a file with the date and check against that for date changes
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  14. #14

    Thread Starter
    Lively Member Xcoder's Avatar
    Join Date
    Jan 2004
    Posts
    120
    thanks guys, Ill give it a go, Ill come back to you with my solution
    Last edited by Xcoder : 09-10-2001 at 12:45 AM.

  15. #15

    Thread Starter
    Lively Member Xcoder's Avatar
    Join Date
    Jan 2004
    Posts
    120
    Ok guys, I have a preliminar version, and the final step is to save a date in some file, my question to you is, where do I save this file? and with what extension? could you point me to a temp folder that will always exist?
    Last edited by Xcoder : 09-10-2001 at 12:45 AM.

  16. #16
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    Put it in your app path and make it any format you want, or even encrypt it.

  17. #17

  18. #18
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Here's a sample app i put together with some light encryption, just to get an idea. Assumes you are using a personal server.
    Attached Files Attached Files

  19. #19
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228
    What I suggest you do is do things the best best way possible. What you do is this, you give out a trial version, of course. The trial version would be an entirely different program.

    I don't mean you do things like stop the program's true functionality to show, I mean you actually remove the code that makes the program's final functionality actually happen.

    Then you manually deal with sales through some sort of online shopping cart and then send it out yourself, with a specific serial number that's been hashed twelve times over (with different methods) inside of the actual executable. Make sure there is a way to validate whether the hash is legitimate or no.

    Have the program automatically send the hashed information to some server on startup. If the hash is invalid, has some peculiarity, or you get the same hash from lots of computers, you just got yourself a bust. >:)

    EDIT: I know this would erquire alot of manual work, but it will make pirating your software a pain in the ass.
    Luke

  20. #20
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    There is a way to set the date last modified so you could place it in the system32 folder or somewhere hidden and change the date to prevent somebody searching for it
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  21. #21
    Lively Member
    Join Date
    May 2005
    Posts
    125

    Re: Make a trial version! help!

    Hi HELPmyVB, thanks for the 30 day shareware example. I need to creat a shareware process very similiar to that only I need it to be converted into an hours limit instead of days. I'm pretty new to VB6 and I took a long shot at converting it myself but it was unsuccessful. If anyone can tell me how to fix where i went wrong I would really appreciate it very much.

    VB Code:
    1. Option Explicit
    2.  
    3. Public Function TimeGood(NumHours As Integer) As Boolean
    4. 'The purpose of this module is to allow you to place a time
    5. 'limit on the unregistered use of your shareware application.
    6. 'This module can not be defeated by rolling back the system clock.
    7. 'Simply call the DateGood function when your application is first
    8. 'loading, passing it the number of days it can be used without
    9. 'registering.
    10. '
    11. 'Ex: If TimeGood(6)=False Then
    12. ' CrippleApplication
    13. ' End if
    14. 'Register Parameters:
    15. ' CRT: Current Run Time
    16. ' LRT: Last Run Time
    17. ' FRT: First Run Time
    18.  
    19. Dim TmpCRT As Date
    20. Dim TmpLRT As Date
    21. Dim TmpFRT As Date
    22.  
    23. TmpCRT = Format(Now, "hh:mm:ss")
    24. TmpLRT = GetSetting(App.EXEName, "Param", "LRT", "00:00:00")
    25. TmpFRT = GetSetting(App.EXEName, "Param", "FRT", "00:00:00")
    26. TimeGood = False
    27.  
    28. 'If this is the applications first load, write initial settings
    29. 'to the register
    30. If TmpLRT = "00:00:00" Then
    31. SaveSetting App.EXEName, "Param", "LRT", TmpCRT
    32. SaveSetting App.EXEName, "Param", "FRT", TmpCRT
    33. End If
    34. 'Read LRT and FRT from register
    35. TmpLRT = GetSetting(App.EXEName, "Param", "LRT", "00:00:00")
    36. TmpFRT = GetSetting(App.EXEName, "Param", "FRT", "00:00:00")
    37.  
    38. If TmpFRT > TmpCRT Then 'System clock rolled back
    39. TimeGood = False
    40. ElseIf Now > TimeAdd("h", NumHours, TmpFRT) Then 'Expiration expired
    41. TimeGood = False
    42. ElseIf TmpCRT > TmpLRT Then 'Everything OK write New LRT date
    43. SaveSetting App.EXEName, "Param", "LRT", TmpCRT
    44. TimeGood = True
    45. ElseIf TmpCRT = Format(TmpLRT, "hh:mm:ss") Then
    46. TimeGood = True
    47. Else
    48. TimeGood = False
    49. End If
    50. End Function
    51.  
    52.  
    53. 'Usage
    54.  
    55. Private Sub Form_Activate()
    56. If Not TimeGood(6) Then
    57. MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
    58. Unload Me
    59. End If
    60. End Sub

    When I compile it to test, I get an error at "TimeAdd" it says "sub or function not defined" in the error and i'm not sure how to fix it if possibly at all.

    Looking forward to any advice and/or examples. Thanks.

  22. #22
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Make a trial version! help!

    Well, TimeAdd is not a VB function or reserved keyword. You may be thinking of DateDiff

  23. #23
    Lively Member
    Join Date
    May 2005
    Posts
    125

    Re: Make a trial version! help!

    Thanks Hack, but I looked in AllApi's Api Guide and Api Viewer but dont see that in the functions list. Also I changed the script with that information but it starts off saying trial expired. What I need is for it to wait 6 hours or possibly more then expire. thanks again.

  24. #24
    Lively Member
    Join Date
    May 2005
    Posts
    125

    Re: Make a trial version! help!

    Ok so the script now looks like this:

    VB Code:
    1. Option Explicit
    2.  
    3. Public Function TimeGood(NumHours As Integer) As Boolean
    4. 'The purpose of this module is to allow you to place a time
    5. 'limit on the unregistered use of your shareware application.
    6. 'This module can not be defeated by rolling back the system clock.
    7. 'Simply call the DateGood function when your application is first
    8. 'loading, passing it the number of days it can be used without
    9. 'registering.
    10. '
    11. 'Ex: If TimeGood(6)=False Then
    12. ' CrippleApplication
    13. ' End if
    14. 'Register Parameters:
    15. ' CRT: Current Run Time
    16. ' LRT: Last Run Time
    17. ' FRT: First Run Time
    18.  
    19. Dim TmpCRT As Date
    20. Dim TmpLRT As Date
    21. Dim TmpFRT As Date
    22.  
    23. TmpCRT = Format(Now, "hh:mm:ss")
    24. TmpLRT = GetSetting(App.EXEName, "Param", "LRT", "00:00:00")
    25. TmpFRT = GetSetting(App.EXEName, "Param", "FRT", "00:00:00")
    26. TimeGood = False
    27.  
    28. 'If this is the applications first load, write initial settings
    29. 'to the register
    30. If TmpLRT = "00:00:00" Then
    31. SaveSetting App.EXEName, "Param", "LRT", TmpCRT
    32. SaveSetting App.EXEName, "Param", "FRT", TmpCRT
    33. End If
    34. 'Read LRT and FRT from register
    35. TmpLRT = GetSetting(App.EXEName, "Param", "LRT", "00:00:00")
    36. TmpFRT = GetSetting(App.EXEName, "Param", "FRT", "00:00:00")
    37.  
    38. If TmpFRT > TmpCRT Then 'System clock rolled back
    39. TimeGood = False
    40. ElseIf Now > DateDiff("h", NumHours, TmpFRT) Then 'Expiration expired
    41. TimeGood = False
    42. ElseIf TmpCRT > TmpLRT Then 'Everything OK write New LRT date
    43. SaveSetting App.EXEName, "Param", "LRT", TmpCRT
    44. TimeGood = True
    45. ElseIf TmpCRT = Format(TmpLRT, "hh:mm:ss") Then
    46. TimeGood = True
    47. Else
    48. TimeGood = False
    49. End If
    50. End Function
    51.  
    52.  
    53. 'Usage
    54.  
    55. Private Sub Form_Activate()
    56. If Not TimeGood(6) Then
    57. MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
    58. Unload Me
    59. End If
    60. End Sub

    Can anyone see why its not waiting 6 hours before expiring?

    BTW, HappyBirthday HACK! :mike: :mike:
    Last edited by Resilience; May 13th, 2005 at 01:10 PM.

  25. #25
    Lively Member
    Join Date
    May 2005
    Posts
    125

    Re: Make a trial version! help!

    Here, I changed the code up a bit so instead of "Last Run Time" I added in "Max Run Time". It seemed to make more sense to me but im still recieving that same expired error right on startup.


    VB Code:
    1. Option Explicit
    2.  
    3. Public Function TimeGood(NumHours As Integer) As Boolean
    4. 'The purpose of this module is to allow you to place a time
    5. 'limit on the unregistered use of your shareware application.
    6. 'This module can not be defeated by rolling back the system clock.
    7. 'Simply call the DateGood function when your application is first
    8. 'loading, passing it the number of days it can be used without
    9. 'registering.
    10. '
    11. 'Ex: If TimeGood(6)=False Then
    12. ' CrippleApplication
    13. ' End if
    14. 'Register Parameters:
    15. ' CRT: Current Run Time
    16. ' FRT: First Run Time
    17. ' MRT: Max Run Time
    18.  
    19. Dim TmpCRT As Date
    20. Dim TmpFRT As Date
    21. Dim TmpMRT As Date
    22.  
    23. TmpCRT = Format(Now, "hh:mm:ss")
    24. TmpFRT = GetSetting(App.EXEName, "Param", "FRT", "00:00:00")
    25. TmpMRT = GetSetting(App.EXEName, "Param", "MRT", "06:00:00")
    26. TimeGood = False
    27.  
    28. 'If this is the applications first load, write initial settings
    29. 'to the register
    30. If TmpFRT = "00:00:00" Then
    31. SaveSetting App.EXEName, "Param", "FRT", TmpCRT
    32. End If
    33. 'Read MRT and FRT from register
    34. TmpMRT = GetSetting(App.EXEName, "Param", "MRT", "06:00:00")
    35. TmpFRT = GetSetting(App.EXEName, "Param", "FRT", "00:00:00")
    36.  
    37. If TmpFRT > TmpCRT Then 'System clock rolled back
    38. TimeGood = False
    39. ElseIf Now > DateDiff("h", TmpFRT, NumHours) Then 'Expiration expired
    40. TimeGood = False
    41. ElseIf TmpCRT < TmpMRT Then 'Everything OK write New LRT date
    42. SaveSetting App.EXEName, "Param", "MRT", TmpCRT
    43. TimeGood = True
    44. ElseIf TmpCRT = Format(TmpMRT, "hh:mm:ss") Then
    45. TimeGood = True
    46. Else
    47. TimeGood = False
    48. End If
    49. End Function
    50.  
    51.  
    52. 'Usage
    53.  
    54. Private Sub Form_Activate()
    55. If Not TimeGood(6) Then
    56. MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
    57. Unload Me
    58. End If
    59. End Sub

    I didnt think this would be too hard for those who actually know what they're doing unlike me lol

  26. #26
    Hyperactive Member
    Join Date
    Apr 2004
    Location
    Philippines
    Posts
    285

    Re: Make a trial version! help!

    hi, i modified your code and i think i made it work
    VB Code:
    1. Option Explicit
    2.  
    3. Public Function TimeGood(NumHours As Integer) As Boolean
    4. 'The purpose of this module is to allow you to place a time
    5. 'limit on the unregistered use of your shareware application.
    6. 'This module can not be defeated by rolling back the system clock.
    7. 'Simply call the DateGood function when your application is first
    8. 'loading, passing it the number of days it can be used without
    9. 'registering.
    10. '
    11. 'Ex: If TimeGood(6)=False Then
    12. ' CrippleApplication
    13. ' End if
    14. 'Register Parameters:
    15. ' CRT: Current Run Time
    16. ' LRT: Last Run Time
    17. ' FRT: First Run Time
    18.  
    19. Dim TmpCRT As Date
    20. Dim TmpLRT As Date
    21. Dim TmpFRT As Date
    22.  
    23. TmpCRT = Now
    24. TmpLRT = CDate(GetSetting(App.EXEName, "Param", "LRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")))
    25. TmpFRT = CDate(GetSetting(App.EXEName, "Param", "FRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")))
    26. TimeGood = False
    27.  
    28.  
    29. 'If this is the applications first load, write initial settings
    30. 'to the register
    31. If DateDiff("s", TmpLRT, TmpCRT) = 0 Then
    32. SaveSetting App.EXEName, "Param", "LRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")
    33. SaveSetting App.EXEName, "Param", "FRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")
    34. End If
    35. 'Read LRT and FRT from register
    36. TmpLRT = CDate(GetSetting(App.EXEName, "Param", "LRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")))
    37. TmpFRT = CDate(GetSetting(App.EXEName, "Param", "FRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")))
    38.  
    39. If DateDiff("s", TmpFRT, TmpCRT) < 0 Then 'System clock rolled back
    40. TimeGood = False
    41. ElseIf (DateDiff("s", TmpFRT, TmpCRT) - (NumHours * 60 * 60)) >= 0 Then 'Expiration expired
    42. TimeGood = False
    43. ElseIf DateDiff("s", TmpLRT, TmpCRT) >= 0 Then 'Everything OK write New LRT date
    44. SaveSetting App.EXEName, "Param", "LRT", Format(TmpCRT, "mm/dd/yy hh:mm:ss AM/PM")
    45. TimeGood = True
    46. ElseIf DateDiff("h", TmpCRT, TmpLRT) = 0 Then
    47. TimeGood = True
    48. Else
    49. TimeGood = False
    50. End If
    51. End Function
    52.  
    53. 'Usage
    54. Private Sub Form_Activate()
    55. If Not TimeGood(6) Then
    56. MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
    57. Unload Me
    58. End If
    59. End Sub

    but i think that this is not so effective... the user could just delete the entries from the registry and countdown would be reset.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width