forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


External Registration Info.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1710
Location: Space and Time

PostPosted: Mon Dec 09, 2002 2:05 pm    Post subject: External Registration Info. Reply with quote

Here is a little script that I use to save my DLL registration info. Compile
and put in the TOOLS dir. You can double click on an item and it will insert
the code into your script.

Code:

:Reg

   dialog CREATE,External Registration Information,-1,0,232,255,SMALLCAP,Class ExternalWin,ONTOP
   rem *** Modified by Dialog Designer on 6/16/2002 - 12:26 ***
   dialog ADD,GROUP,GROUP1,0,1,230,176
   dialog ADD,LIST,Info,5,4,224,144,,,Dblclick
   dialog ADD,TEXT,TEXT1,181,3,,,External File Name:
   dialog ADD,EDIT,ExtFileName,178,99,128,19
   dialog ADD,TEXT,TEXT2,204,2,,,Registration Info:
   dialog ADD,EDIT,RegInfo,204,85,142,19
   dialog ADD,BUTTON,Add,150,4,64,24,Add
   dialog ADD,BUTTON,Delete,150,71,64,24,Delete
   dialog ADD,BUTTON,Ok,228,163,64,24,Ok
   if @file(@path(%0)External.Dat)
      list Loadfile,Info,@path(%0)External.Dat
   end
   dialog SHOW
   window activate,#ExternalWin

:Evloop
   wait event
   %e = @event()
   goto %e

:DeleteButton
   if @dlgtext(Info)
      list delete,Info
   end
   goto evloop

:Infodblclick
   if @winexists(#TMainWin)
   Option fieldsep,@tab()
   parse "%a;%b", @dlgtext(info)
   option fieldsep,"|"
   clipboard set,"External "%a","%b
   window send,#TMainWin,@ctrl(V)
   else
      Warn VDS Not Running.
   end
   goto evloop

:AddButton
   if @both(@dlgtext(ExtFileName),@dlgtext(RegInfo))
      list create,1,sorted
      list assign,1,Info
      list add,1,@upper(@dlgtext(ExtFileName))@tab()@Dlgtext(RegInfo)
      list clear,Info
      list assign,Info,1
      list close,1
   else
      info Both fields must be filled out.
      goto evloop
   end
   goto evloop

:Close
:OkButton
   list savefile,Info,@path(%0)External.dat


Updates:

12-9-2002: Fixed small bug

_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Dec 09, 2002 11:58 pm    Post subject: Reply with quote

____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Nice code. Wink

I modified it to work a little differently, and I also modified it so that it
has an option to encrypt the data file and you can also password protect
the program. The current password is "test"; make sure it is entered
exactly as shown, otherwise you will be denied access to the program.

Code:
REM ===================================================================================================================
REM By LiquidCode
REM Modified by FreezingFire
REM Text encryption code by iMPA, see http://www.vdsworld.com/archive/index.php?page=topic&board=3&topic=108 for script
REM ===================================================================================================================

rem %%key defines the password to encrypt/decrypt data file and to enter the program
%%key = test
rem Set %%password_protect to "1" if you wish to password protect the database program
%%password_protect = 1

TITLE Database
if %%password_protect
%%pass_dlg = @input(Enter password:,,PASSWORD)
if @not(@equal(%%pass_dlg,%%key,EXACT))
  %%msg_dlg_01 = @msgbox(You are not authorized to access this program,No Entry,$010)
  stop
end
end
 
:Reg

   dialog CREATE,External Registration Information,-1,0,232,255,SMALLCAP,Class ExternalWin,ONTOP
   dialog ADD,GROUP,GROUP1,0,1,230,176
   dialog ADD,LIST,Info,5,4,224,144,,,Dblclick
   dialog ADD,TEXT,TEXT1,181,3,,,External File Name:
   dialog ADD,EDIT,ExtFileName,178,99,128,19
   dialog ADD,TEXT,TEXT2,204,2,,,Registration Info:
   dialog ADD,EDIT,RegInfo,204,85,142,19
   dialog ADD,BUTTON,Add,150,4,64,24,Add
   dialog ADD,BUTTON,Delete,150,71,64,24,Delete
   dialog ADD,BUTTON,Ok,228,163,64,24,Ok
   if @file(@path(%0)External.Dat)
      list Loadfile,Info,@path(%0)External.Dat
     gosub Decrypt
   end
   dialog SHOW
   window activate,#ExternalWin

:Evloop
   wait event
   %e = @event()
   goto %e

:Decrypt
if @null(@text(info))
exit
end
  %%input = @dlgtext(info)
  %%pass = %%key
  %%output = ""
  %i = 1
  %p = 1
  repeat
    rem step by step     
    %%in = @substr(%%input,%i,%i)
    %%pa = @substr(%%pass,%p,%p)
    %1 = @asc(%%in)
    %2 = @asc(%%pa)
    %3 = @sum(@diff(%1,%2),64)
    rem we add 64 according with the encription procedure
    if @greater(0,%3)
      %3 = @sum(%3,@diff(256,32))
      rem to prevent errors
    end
    %%output = %%output@chr(%3)
    %i = @succ(%i)
    %p = @succ(%p)
    if @greater(%p,@len(%%pass))
      %p = 1
    end
  until @greater(%i,@len(%%input))
  dialog set,info,%%output
exit

:DeleteButton
   if @dlgtext(Info)
      list delete,Info
   end
   goto evloop

:Infodblclick
   if @winexists(#TMainWin)
   Option fieldsep,@tab()
   parse "%a;%b", @dlgtext(info)
   option fieldsep,"|"
   clipboard set,"External "%a","%b @cr()
   window send,#TMainWin,@ctrl(V)
   else
      Warn VDS is not running. Please start VDS and try again.
   end
   goto evloop

:AddButton
   if @both(@dlgtext(ExtFileName),@dlgtext(RegInfo))
      list create,1,sorted
      list assign,1,Info
      list add,1,@upper(@dlgtext(ExtFileName))@tab()@Dlgtext(RegInfo)
      list clear,Info
      list assign,Info,1
      list close,1
   else
      info Both fields must be filled out
      goto evloop
   end
   goto evloop


:Close
:OkButton
:Encrypt
if @null(@text(info))
exit
end
  %%input = @text(info)
  %%pass = %%key
  %%output = ""
  %i = 1
  %p = 1
  repeat
    rem step by step
    %%in = @substr(%%input,%i,%i)
    %%pa = @substr(%%pass,%p,%p)
    %1 = @diff(@asc(%%in),32)
    %2 = @diff(@asc(%%pa),32)
    rem to avoid binary characters
    %3 = @mod(@sum(%1,%2),@diff(256,32))
    %%output = %%output@chr(%3)
    %i = @succ(%i)
    %p = @succ(%p)
    if @greater(%p,@len(%%pass))
      %p = 1
    end
  until @greater(%i,@len(%%input))
  list create,1
  list add,1,%%output
  list savefile,1,@path(%0)External.dat
  list close,1
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1710
Location: Space and Time

PostPosted: Tue Dec 10, 2002 1:12 pm    Post subject: Reply with quote

Nice addition FF. I added encryption at one point, but I got tired of always
entering a password. Wink I'm a little lazy. Rolling Eyes

_________________
Chris
Http://vdsfreak.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Tue Dec 10, 2002 9:35 pm    Post subject: Reply with quote

I am still using the encryption, although I set the %%password_protect to
null so that I don't have to enter a password, but the data files are still
encrypted. For example, if your data file leaked out somehow you would
have to have the orginal compiled EXE with the unique key that would be
specified to decrypt it. To make your program even more secure without
entering a password you could add the following lines to it:

Code:
if @not(@equal(@env(username),user_name_here))
stop
end


So that you must have the username specified running on the computer
to access the database.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Dec 11, 2002 4:16 pm    Post subject: Reply with quote

But if someone has your data, because he can access your machine (from
remote) and he knows that it also checks for a username, he can get that
too... But, it's a clever idea if nobody knows... Wink
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Dec 11, 2002 10:33 pm    Post subject: Reply with quote

That was an example. Of course, other features such as hard drive serial
number and amount of RAM, etc. could be used to determine if the data
was actually being viewed on the correct machine. Of course, you would
have to make sure your logon password was secure so that an unauthorized
user wouldn't have access to your data or data files.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2144
Location: A House

PostPosted: Thu Dec 12, 2002 12:04 am    Post subject: Reply with quote

The problem with using system information, is that it also can
change. I myself change parts in and out maybe several times
a year, especially hard drives.

-Garrett
Back to top
View user's profile Send private message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Thu Dec 12, 2002 3:33 pm    Post subject: Reply with quote

That's true about parts changing...but I still like the ideal. Maybe something simple, like going off of the HD Label which is easily changed, would take less than a minute after you install a new HD to make the label correct.

NodNarb
Back to top
View user's profile Send private message AIM Address
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1537

PostPosted: Thu Dec 12, 2002 5:51 pm    Post subject: Reply with quote

You might be able to check the Bios manufacturer and use that as a way to validate. The only time a bios would change is if someone purchased a new pc or had to replace the motherboard on their current pc.
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2144
Location: A House

PostPosted: Thu Dec 12, 2002 7:25 pm    Post subject: Reply with quote

True... I change mother boards the least. While hd's and other parts
may change several times in the year, the mother board isn't changed
but every few years.

-Garrett
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Dec 12, 2002 7:35 pm    Post subject: Reply with quote

You can also use this to encrypt:

Code:
@verinfo(@windir()\explorer.exe,cdnptvxy)


You only have to save the data if you install a new Windows version...
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1537

PostPosted: Thu Dec 12, 2002 10:23 pm    Post subject: Reply with quote

The problem with that is when you install service packs it modifies many of the values you're querying. For instance I have service pack 1 of Windows XP and that shows up in the @verinfo(@windir()\explorer.exe,cdnptvxy) that you used, it would be different for anyone who hasn't upgraded to the new service pack.
Back to top
View user's profile Send private message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Fri Dec 13, 2002 5:35 pm    Post subject: Reply with quote

I don't know...it is extremely simple to check the HD Label...and I don't even know how (w/o research) to check the BIOS manufacturer. Not only that HD Labels can be changed, which I find to be an advantage as long as you remember what it's supposed to be. (Or have an odd document).

You know what a even better ideal may be...have a key file in the root directory, like VDS and other programs use for registration. Have the key file be part of the encryption/decryption routine.


NodNarb
Back to top
View user's profile Send private message AIM Address
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 571
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 4:15 am    Post subject: Reply with quote

WOW!!

GeoTrail is totally blown away.
That was a cool script. Wink

Any way to add a feature like this:
When you double click a selection the info get copied to the clipboard like this: external filename.dll,user|regno

That would be cool.
Would do it myself, but I don't have a clue how.
YET!! Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 571
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 4:19 am    Post subject: Reply with quote

Woops.
Sorry. It already does that. My bad. Me so stupid Laughing Embarassed

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group