Hack Forums
[.NET] Give your applications time limits OFFLINE!!! - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Give your applications time limits OFFLINE!!! (/showthread.php?tid=796212)



Give your applications time limits OFFLINE!!! - kbhawkman - Nov 5, 2010

This code is to teach you how to make sure your applications are unuasble after a certain date and time. This can be cracked by changing your PC time but you can always encrypt the time 👍

Please give credits to me (kbhawkman)!

Code
'Coded by kbhawkman
'Give credits if you use this in your programs (even if you modify this slightly)
'11/5/2010
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()
        Me.Text = DateTime.Now
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.Text = DateTime.Now
        If DateTime.Now > "11/5/2010 4:50:00 PM" Then 'Replace "11/5/2010 4:50:00 PM" with a date and time :D
            Application.Exit()
        Else
        End If
    End Sub
End Class



* - LeisureDeveloper - Nov 5, 2010

How will encrypting the time help? The user can still change the time...


* - kbhawkman - Nov 5, 2010

(Nov 5, 2010 05:09 PM)LeisureDeveloper Wrote:  How will encrypting the time help? The user can still change the time...

So if someone uses reflector or something to decompile the app then the time that you have set will not be shown to them. So they do not know how early they have to set their PC's back.


* - This Girl Is On Fire - Nov 5, 2010

Then they set it back 1 year and it will work..


* - kbhawkman - Nov 5, 2010

(Nov 5, 2010 05:14 PM)exprezzed Wrote:  Then they set it back 1 year and it will work..

this is just meant to be a simple code. Also not wants to be changing the time of their PC just for an application.


* - LeisureDeveloper - Nov 5, 2010

Tip: set a minimum time (set it to the day the program is released) so that if the current time is less than the minimum time the program disables automatically, preventing them from trying more possibilities.


* - kbhawkman - Nov 5, 2010

(Nov 5, 2010 05:18 PM)LeisureDeveloper Wrote:  Tip: set a minimum time (set it to the day the program is released) so that if the current time is less than the minimum time the program disables automatically, preventing them from trying more possibilities.

I am not quite understanding you by the way you are wording yourself. Could you post some code for what you mean or explain a bit more in depth please :D


* - Kōtei - Nov 5, 2010

Jesus, why does everyone expect EVERY DAMN SNIPPET to be advanced?


* - LeisureDeveloper - Nov 5, 2010

Quote:I am not quite understanding you by the way you are wording yourself. Could you post some code for what you mean or explain a bit more in depth please :D

Here's some pseudocode:

Date min = timeProgramWasCreated
Date max = 21/12/2010

if date.now < min then
msgbox("you tried to cheat, you get nothing")
deactivateProgram()
end if

if date.now > max then
msgbox("trial is over")
deactivateProgram()
end if

--
or better, set the minimum date to the day the program was first run on (use two settings, a boolean to hold if it's the first time the program is running, and the time the program first ran)

if my.settings.runningFirstTime then
my.settings.firstTimeProgramRan = date.now
my.settings.runningFirstTime = false
end if


* - kbhawkman - Nov 5, 2010

(Nov 5, 2010 05:35 PM)LeisureDeveloper Wrote:  Here's some pseudocode:

Date min = timeProgramWasCreated
Date max = 21/12/2010

if date.now < min then
msgbox("you tried to cheat, you get nothing")
deactivate program
end if

if date.now > max then
msgbox("trial is over")
deactivate program
end if

That is basically mine except in reverse. WTF?

(Nov 5, 2010 05:25 PM)Xypher Wrote:  Jesus, why does everyone expect EVERY DAMN SNIPPET to be advanced?

Thank You!

It is just meant to be an idea that may help some people.
I wish people could just say "Thank You" instead of flaming.


* - LeisureDeveloper - Nov 5, 2010

Quote:That is basically mine except in reverse. WTF?
Take a closer look, there's a function that checks to make sure the user didn't set an unrealistic time.

Quote:It is just meant to be an idea that may help some people.
I wish people could just say "Thank You" instead of flaming.
Sorry, it really is some nice code. :)
But it can still be easily bypassed if the user changes the time on his computer.


* - ident - Nov 5, 2010

Whats with the duplicate coding? Else what???? Not to mention is is pointless.


* - kbhawkman - Nov 5, 2010

People do not seem to like me trying to help and share ideas.

/Thread Closed