home *** CD-ROM | disk | FTP | other *** search
- PROC macro:
- global e$(1),f$(30),k$(100,25),l$(100,25),m$(6),p$(8),s$(25),v$(30),q(8),n,m,o,r%,f%
-
- rem ███████████████████████████████████████
- rem █ CodeSafe - ╕Huub Linthorst, 1997 █
- rem █ MacSys macro to store secret codes █
- rem █ E-mail: linthors@chem.leidenuniv.nl █
- rem ███████████████████████████████████████
-
- m$="window" rem Show mode (blink or window)
- e$="m" rem drive containing JBMACFIX.OPO (if present)
- f$="loc::m:\wrd\codesafe.wrd" rem File for data export
-
- v$="v.1.1 - ╕Huub Linthorst, 1997"
- useapp:("active")
- tomacro:
- dinit "CodeSafe "+v$
- dxinput p$,"Master password"
- if dialog
- if len(p$)>0
- tofront:
- p$=mid$(p$+p$+p$+p$+p$+p$+p$+p$,1,8)
- n=1
- while n<9
- q(n)=asc(mid$(p$,n,1))
- n=n+1
- endwh
- p4:
- endif
- endif
- tofront:
- endp
-
- proc p2:
- p2::
- p9:
- giprint:("CodeSafe is loading definitions...")
- position 1
- while not eof
- k$(pos)=D.k$
- l$(pos)=D.l$
- next
- endwh
- if f%=1
- r%=1
- lopen f$
- lprint "FOR SECURITY, REMOVE THIS FILE ASAP !"
- lprint ""
- lprint ""
- while r%<pos
- lprint k$(r%)
- p0:
- lprint s$
- lprint "───"
- r%=r%+1
- endwh
- close
- lclose
- dinit:("")
- dtext:("","CodeSafe printed data to file",2)
- dtext:("",f$,$202)
- dtext:("","",0)
- dtext:("","FOR SECURITY, REMOVE THIS FILE ASAP !",$102)
- dtext:("","",0)
- dialog:
- goto x::
- endif
-
- dinit: ("View code ("+num$(pos-1,3)+" entries)")
- dchoicea: (1,"",addr(k$()),pos-1)
- r%=dialog:
- close
- if r%<>0
- p0:
- endif
- dinit: ("")
- if m$="window"
- dtext: ("Description:",k$(r%),0)
- dtext: ("Secret code:",s$,$200)
- else
- giprint: ("Code: "+s$)
- endif
- dtext: ("","View another code?",2)
- dbuttons: ("Yes,%y,No,%n")
- r%=dialog:
- if r%=1
- goto p2::
- endif
- x::
- endp
-
- proc p4:
- dinit:("CodeSafe")
- dbuttons:("View,%v,Add,%a,Open DB,%o,Print,%p")
- r%=dialog:
- if r%=1
- p2:
- elseif r%=2
- p3:
- elseif r%=3
- if exist ("loc::"+e$+":\app\jbmacfix.opo")
- runjb:("data","m:\dat\codesafe.dat",actpid%:)
- else
- runappc:("data","m:\dat\codesafe.dat")
- endif
- elseif r%=4
- f%=1
- p2:
- endif
- endp
-
- proc p3:
- p3::
- k$(1)=""
- l$(1)=""
- dinit: ("Data entry")
- dedit: (addr(k$(1)),"Description",20)
- dtext: ("Secret code","",0)
- if dialog: and len(k$(1))>0
- else
- goto x::
- endif
- dinit: ("Data entry")
- dtext: ("Description",k$(1),0)
- dedit: (addr(l$(1)),"Secret code",20)
- dialog:
- if l$(1)=p$
- beep:(8,1000)
- giprint: ("Master password may not be saved...")
- elseif len(k$(1))>0
- r%=1
- o=1
- p0:
- p9:
- D.k$=k$(1)
- D.l$=s$
- append
- close
- giprint: ("Code saved...")
- dinit: ("Store another code?")
- dbuttons: ("Yes,%y,No,%n")
- r%=dialog:
- if r%=1
- goto p3::
- endif
- endif
- x::
- endp
-
- proc p9:
- if exist ("loc::m:\dat\CodeSafe.dat")
- open "loc::m:\dat\CodeSafe.dat",D,k$,l$
- else
- create "loc::m:\dat\CodeSafe.dat",D,k$,l$
- endif
- return
- endp
-
- proc p0:
- s$=""
- n=8
- m=1
- while m<=len(l$(r%))
- if o=1
- s$=s$+chr$((asc(mid$(l$(r%),m,1)))+q(n))
- else
- s$=s$+chr$((asc(mid$(l$(r%),m,1)))-q(n))
- endif
- m=m+1
- n=n-1
- if n=0
- n=8
- endif
- endwh
- return
- endp
-
- proc runjb:(a$,f$,act%)
- rem ╕JBSoft 1996
- local buf%(128),name$(128),p%(6)
- name$="JBMSRS"
- pokew addr(buf%()),act%
- poke$ uadd(addr(buf%()),2),a$
- poke$ uadd(addr(buf%()),3+len(a$)),f$
- call($228b,0,255,6,addr(buf%()),addr(name$)+1)
- name$=parse$("jbmacfix.opo",cmd$(1),p%())
- runapp:(name$,"")
- endp
-
-