AutoHotkey Community

It is currently May 27th, 2012, 12:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: February 25th, 2010, 4:46 pm 
I must say I don't really see why it is needed if you are only running it once, after the calculation of midnight I am assuming this restarts the script but the sleep makes it so that you never hit your own script, so I edited it out.

@JoMa - That is pretty easy... I could just take one of the variables and define it at the top of the script then put it on the end or beginning of the key. The trouble is how do I make it do this and automatically make it get me (Perhaps E-Mail, but I don't know how to do it without the user seeing it) the key to give to them?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2010, 10:34 pm 
Quote:
@JoMa - That is pretty easy... I could just take one of the variables and define it at the top of the script then put it on the end or beginning of the key. The trouble is how do I make it do this and automatically make it get me (Perhaps E-Mail, but I don't know how to do it without the user seeing it) the key to give to them?


Sorry I don't seem to understand :(

SW_PROTECT pop's up a screen that generates a computerID, this is then emailed or sent etc to you where you create the registration key.

What I was thinking was trying to get a 5 day trial, followed by the SW_PROTECT routine prompting registration.

Result is one application to distribute that runs as a trial/demo with a good registration routine built in !

does that make sense ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2010, 7:51 am 
Offline

Joined: February 26th, 2010, 1:11 am
Posts: 38
Cool


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 9:44 am 
I've managed to get this to work with SW_PROTECT.

Resulting in a 5 day working trial and then registration.
This is only going to stop the casual hacker, if someone tries hard enough they'll find out how this has been done.

I'm also looking to add a 'Last Run' value to this. Then if the time is put back past the last run date the script will go straight to the registration screen.

I'll post more details later today !


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 11:25 pm 
Updated script.

Needs sw_protect for HERE

New bit's highlighted in red !

Please be nice and post constructive comments !

Code:
#SingleInstance force
; check for the key value in the ini file created by sw protect. If it's there by pass the day check.
IniRead, key, c:\registration.ini, registration, key, %A_SPACE%
if (key) {
   gosub, Main
   ExitApp
}


ConfigFile=%A_MyDocuments%\hidden.ini

IniRead, Estate, %ConfigFile%, View, Estate, %A_SPACE%
if (!Estate) {
   ins_date = %A_YDay%
   ins_date := ins_date * 457
   IniWrite, %ins_date%, %ConfigFile%, View, Estate
   FileSetTime, 20040122, %ConfigFile%
   FileSetAttrib +RHAS, %ConfigFile%
   }

RegRead, Flatron, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Dev, Flatron
if (!Flatron) {
   ins_date = %A_YDay%
   ins_date := ins_date * 443725
   RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Dev, Flatron, %ins_date%
   }
   
FileGetTime, file_time, %ConfigFile%, C
FormatTime, file_time, %ConfigFile%, YDay

If (file_time != %A_YDay%)
{
ini_value := Estate / 457
reg_value := Flatron / 443725
Transform, ini_value, Round, ini_value
Transform, reg_value, Round, reg_value

if (ini_value != reg_value)
{
      MsgBox,,Your Trial Period Has Expired, `nPlease buy the full version, contact sales@xxxxx.com
      Run, http://www.google.com
gosub, Main

   ExitApp
}     

}   

ConfigRead:
   IniRead, Estate, %ConfigFile%, View, Estate
   Estate := Estate / 457   
   Transform, Estate, Round, Estate
   Check:=A_YDay-Estate
   
   DaysLeft:=5-Check

   
   If DaysLeft = 0
   {
   MsgBox,,Your Trial Period Expires Today, `nYour Trial Period Expires Today`nPlease buy the full version, contact sales@xxxxx.com
   Run, http://www.google.com
gosub, Working

   }     
   
   
   If DaysLeft > 5
   {
      MsgBox,,Your Trial Period Has Expired, `nPlease buy the full version, contact sales@xxxxx.com
         FileSetAttrib -RHAS, %ConfigFile%
         IniWrite, 64357883646, %ConfigFile%, View, Estate
          FileSetTime, 20070322, %ConfigFile%
          FileSetAttrib +RHAS, %ConfigFile%
          Run, http://www.google.com
         gosub, Main

          ExitApp
      }
   else
   {
      If Check > 5
      {
      MsgBox,, Your Trial Period Has Expired, `n Please buy the full version, contact sales@xxxxx.com
         FileSetAttrib -RHAS, %ConfigFile%
         IniWrite, 64357883646, %ConfigFile%, View, Estate
          FileSetTime, 20070322, %ConfigFile%
          FileSetAttrib +RHAS, %ConfigFile%
         Run, http://www.google.com
         gosub, Main

          ExitApp
      }
      else
      {
      if DaysLeft !=0
      {
         MsgBox, %DaysLeft% days left in your Trial Period
         gosub, Working
      }
      }
   }
   
; Force script to reload at night to enforce 5 day limit
Midnight := SubStr( A_Now, 1, 8 ) . "000000"
Midnight += 1, days
Midnight -= A_Now, seconds
Sleep, %Midnight%000
Reload

return

; Auto execute part goes here
Gosub Main

Return
#Include SWProtect-Internal.ahk
#Include SWProtect-GUI.ahk


Main:
   ; Initialize the secret seeds
   SWP_Initialize()  ; with optional 8 secret seeds
   
   ; The syntax is SWP_CheckRegistration( "AppName", "DeveloperEmail" )
   SWP_CheckRegistration( "Test Program", "test@test.com" )
   
   ; The program continues here - we will not reach this section unless
   ; the user entered a valid registration

working:
msgbox This is the working section !!

Return


Report this post
Top
  
Reply with quote  
PostPosted: June 4th, 2010, 11:24 pm 
Offline

Joined: May 11th, 2010, 12:33 pm
Posts: 2
hi all,
this is my first post. and have some questions.
1) if they change system time, will these codes still work?
so, if its possible to get time from time.windows.com or from google time, it would be great.
2) how can we get time from internet, not from PC?
thanx


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2010, 11:53 pm 
changing the time, won't cause any issues.
However changing the date will cause the script to working.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2010, 12:01 am 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
SKAN's SetAtomicTime() gets it's time from the internet.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 22nd, 2011, 3:16 am 
Offline

Joined: November 28th, 2007, 9:54 am
Posts: 69
a ini file is easy to spot. make it harder with another extension in another obscure place.

you could set and check time stamps of windows files and append data to existing files in windows.

write registry keys into existing locations with same names.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, Google Feedfetcher, maul.esel and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group