home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / encryption / enc_2 / !Encrypt / !Runimage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1998-04-17  |  47KB  |  1,871 lines

  1.  >!RunImage
  2.  Main 'Ultimate Encryption' program
  3.  by Stephen Sloan
  4.  to provide a encryption system for files and directories
  5.  that is as secure as possible
  6.  Stephen Sloan 1996-98
  7.  RunImage version 0.98a (23 Mar 1998)
  8. initswis
  9.  OSGetEnv% 
  10.  commandstring$
  11. appname$="Encrypt"
  12. tellthemoff(
  13. initvars
  14. initflags
  15. initheap
  16. initwimp
  17. errbox
  18. LoadChoices
  19. LoadMessages("<Encrypt$Dir>.Messages")
  20. initwindows
  21. iconbar
  22. totalreset
  23. checkloaded
  24. errbox
  25.  WimpPoll%,pollmask%,q%,50 
  26.  reason%
  27.  reason% 
  28. nullevent
  29.  WimpOpenWindow%,,q%
  30. closewindow(!q%)
  31. checkmouse(!q%,q%!4,q%!8,q%!12,q%!16,q%!20)
  32. drag(q%)
  33. keypressed(q%!4,q%!24)
  34. menuselect
  35.  17,18:
  36. message
  37. double
  38.  Status$="D" 
  39.  Verify% 
  40.  Double% 
  41. passtest$=
  42. getstr(passtext)
  43.  passtest$=firstphrase$ 
  44. tellthemoff(
  45. ExpandMessage("NoMatch"))
  46. Double%=
  47. grey(mainhand%,12):
  48. iconredraw(mainhand%,12)
  49. grey(mainhand%,13):
  50. iconredraw(mainhand%,13)
  51. ungrey(mainhand%,17):
  52. iconredraw(mainhand%,17)
  53. textaddr(mainhand%,13)="Enter":
  54. iconredraw(mainhand%,13)
  55. textaddr(mainhand%,16)="Pass Phrase":
  56. iconredraw(mainhand%,16)
  57. firstphrase$=""
  58. textaddr(mainhand%,14)="":
  59. iconredraw(mainhand%,14)
  60. "Wimp_SetCaretPosition",mainhand%,14,,,-1
  61.  $passtext=$FNtextaddr(mainhand%,14)
  62. Double%=
  63. textaddr(mainhand%,16)="Verify":
  64. iconredraw(mainhand%,16)
  65. textaddr(mainhand%,13)="Process":
  66. iconredraw(mainhand%,13)
  67. grey(mainhand%,17):
  68. iconredraw(mainhand%,17)
  69.  PROCungrey(mainhand%,12)
  70. R"firstphrase$=
  71. getstr(passtext)
  72. textaddr(mainhand%,14)=&0D
  73. textaddr(mainhand%,14)+4)=&0D
  74. textaddr(mainhand%,14)="":
  75. iconredraw(mainhand%,14)
  76. "Wimp_SetCaretPosition",mainhand%,14,,,-1
  77.  $passtext=$FNtextaddr(mainhand%,14)
  78. nullevent
  79.  secmesson%=1 
  80. >cyc% 
  81. secmess
  82.  IF Double% THEN
  83.  IF $passtext=firstphrase$ THEN
  84.  IF NOT same% THEN PROCungrey(mainhand%,12)
  85.  same%=TRUE
  86.  ELSE
  87.  IF same% THEN PROCgrey(mainhand%,12):same%=FALSE
  88.  ENDIF
  89.  ENDIF
  90. keypressed(icon%,key%)
  91.  key% 
  92.  Loaded% 
  93.  (icon%=10 
  94.  icon%=14) 
  95. double 
  96. dosave(
  97. getstr(savetext))
  98.  WimpProcessKey%,key%
  99.  WimpProcessKey%,key%
  100.  Decrypt% 
  101. greyed(mainhand%,17) 
  102. seticonon(mainhand%,17)
  103. seticonoff(mainhand%,18)
  104. ungrey(mainhand%,12):
  105. iconredraw(mainhand%,12)
  106. ungrey(mainhand%,13):$
  107. textaddr(mainhand%,13)="Process"
  108. iconredraw(mainhand%,13)
  109. Status$="D"
  110.  directory% 
  111. setsaveicon("file_"+Decryptfiletype$)
  112. seticonon(mainhand%,18)
  113. seticonoff(mainhand%,17)
  114. Status$="E"
  115. greyed(mainhand%,18) 
  116. seticonon(mainhand%,18)
  117. seticonoff(mainhand%,17)
  118.  directory% 
  119. setsaveicon("file_230")
  120. Status$="E"
  121.  Verify% 
  122. textaddr(mainhand%,13)="Enter":
  123. iconredraw(mainhand%,13)
  124. grey(mainhand%,12):
  125. iconredraw(mainhand%,12)
  126. PGP%=
  127. updatePGP
  128. checkforpgp
  129.  PGPicon% 
  130.  PGP%=
  131. updatePGP
  132.  icon%=14 
  133.  hide% 
  134.  hide%=
  135.  hide%=
  136. updatehide
  137.  WimpProcessKey%,key%
  138.  WimpProcessKey%,key%
  139.  Status$="E" 
  140.  Double% 
  141.  firstphrase$=$passtext 
  142. ungrey(mainhand%,12)
  143. ungrey(mainhand%,13)
  144. grey(mainhand%,12)
  145. grey(mainhand%,13)
  146.  IF Status$="D" THEN PROCungrey(mainhand%,12)
  147. updatePGP
  148.  PGP% 
  149. seticonon(optshand%,4)
  150. seticonoff(optshand%,3)
  151. seticonon(optshand%,3)
  152. seticonoff(optshand%,4)
  153. updatehide
  154.  hide% 
  155. seticonvalid(mainhand%,14,"R7;KAN;D*")
  156. seticonon(optshand%,2)
  157. seticonvalid(mainhand%,14,"R7;KAN")
  158. seticonoff(optshand%,2)
  159. updatequery
  160.  query% 
  161. seticonon(optshand%,6)
  162. seticonoff(optshand%,6)
  163. updateverify
  164.  Verify% 
  165. seticonon(optshand%,11)
  166. seticonoff(optshand%,11)
  167. initvars
  168.  msg_blk% 256,cho_blk% 256, textsecmess$(50)
  169.  q% &FF,buffer% 255,iconinf% &1FF,menubuf% &5FF,mess% 68,ic% 64,junk% &1FF, savetext 512, keybuff% 4200, iv% 12, hash% 16, hash2% 16
  170.  useful% &FF,ictext% &FF,icvalid% 64,text 1024,passtext 1024
  171.  templates% &2000,menhlp% 128
  172.  menu_block% &FF,data_block% 64
  173.  C% 50,string% 8
  174. menu_free% = menu_block%
  175. current_menu%=-1
  176. menu_x%=0:menu_y%=0
  177. /wbcol=0:mbcol=2:wfcol=7:tfcol=7:mainmenu%=0
  178. op%=-1
  179. seed%=
  180. (253)+1
  181. FileLoadFull$="Encrypted"
  182.  OSFile%,5,"<Encrypt$Dir>.!Sprites" 
  183.  ,,,,splen%
  184.  Encryptsprites% splen%+4
  185. !Encryptsprites%=splen%
  186.  OSFile%,255,"<Encrypt$Dir>.!Sprites",Encryptsprites%+4
  187. pollmask%=1
  188. X%=&20000:!iv%=0:iv%!4=0
  189. Decryptfiletype$="FFF"
  190. initwimp
  191. $q%="TASK"
  192.  junk%!0=6:junk%!4=1:junk%!8=2:junk%!12=3:junk%!16=4:junk%!20=5:junk%!24=&502:junk%!28=10:junk%!32=6:junk%!36=7:junk%!40=8:junk%!44=0
  193. !junk%=0
  194.  WimpInitialise%,310,!q%,"Ultimate Encryption",junk% 
  195.  version%,mytask%
  196. initswis
  197.  "XOS_SWINumberFromString",,"XOS_SWINumberFromString" 
  198.  XOSSWINumberFromString%
  199.  XOSSWINumberFromString%,,"Encrypt_Encrypt" 
  200.  EncryptEncrypt%,v%
  201.  (v% 
  202. (EncryptEncrypt%)
  203.  XOSSWINumberFromString%,,"Wimp_ProcessKey" 
  204.  WimpProcessKey%
  205.  XOSSWINumberFromString%,,"OS_File" 
  206.  OSFile%
  207.  XOSSWINumberFromString%,,"OS_Module" 
  208.  OSModule%
  209.  XOSSWINumberFromString%,,"OS_GetEnv" 
  210.  OSGetEnv%
  211.  XOSSWINumberFromString%,,"Wimp_Initialise" 
  212.  WimpInitialise%
  213.  XOSSWINumberFromString%,,"Wimp_PollIdle" 
  214.  WimpPoll%
  215.  XOSSWINumberFromString%,,"Wimp_OpenWindow" 
  216.  WimpOpenWindow%
  217.  XOSSWINumberFromString%,,"MessageTrans_FileInfo" 
  218.  MessageTransFileInfo%
  219.  XOSSWINumberFromString%,,"MessageTrans_OpenFile" 
  220.  MessageTransOpenFile%
  221.  XOSSWINumberFromString%,,"Wimp_GetPointerInfo" 
  222.  WimpGetPointerInfo%
  223.  XOSSWINumberFromString%,,"Wimp_SendMessage" 
  224.  WimpSendMessage%
  225.  XOSSWINumberFromString%,,"Wimp_GetIconState" 
  226.  WimpGetIconState%
  227.  XOSSWINumberFromString%,,"OS_ReadVarVal" 
  228.  OSReadVarVal%
  229.  XOSSWINumberFromString%,,"Wimp_TransferBlock" 
  230.  WimpTransferBlock%
  231.  XOSSWINumberFromString%,,"Hourglass_Off" 
  232.  HourglassOff%
  233.  XOSSWINumberFromString%,,"Hourglass_On" 
  234.  HourglassOn%
  235.  XOSSWINumberFromString%,,"Hourglass_Percentage" 
  236.  HourglassPercentage%
  237.  XOSSWINumberFromString%,,"Wimp_DeleteIcon" 
  238.  WimpDeleteIcon%
  239.  XOSSWINumberFromString%,,"Wimp_CreateIcon" 
  240.  WimpCreateIcon%
  241.  XOSSWINumberFromString%,,"Wimp_GetWindowState" 
  242.  WimpGetWindowState%
  243.  XOSSWINumberFromString%,,"DragASprite_Start" 
  244.  DragASpriteStart%
  245.  XOSSWINumberFromString%,,"Wimp_GetMenuState" 
  246.  WimpGetMenuState%
  247.  XOSSWINumberFromString%,,"Wimp_DecodeMenu" 
  248.  WimpDecodeMenu%
  249.  XOSSWINumberFromString%,,"XMessageTrans_Lookup" 
  250.  XMessageTransLookup%
  251.  XOSSWINumberFromString%,,"Wimp_SpriteOp" 
  252.  WimpSpriteOp%
  253.  XOSSWINumberFromString%,,"Wimp_CreateMenu" 
  254.  WimpCreateMenu%
  255.  XOSSWINumberFromString%,,"Wimp_DecodeMenu" 
  256.  WimpDecodeMenu%
  257.  XOSSWINumberFromString%,,"Wimp_SetIconState" 
  258.  WimpSetIconState%
  259.  XOSSWINumberFromString%,,"Wimp_DragBox" 
  260.  WimpDragBox%
  261.  XOSSWINumberFromString%,,"Wimp_ReportError" 
  262.  WimpReportError%
  263.  XOSSWINumberFromString%,,"XMessageTrans_CloseFile" 
  264.  XMessageTransCloseFile%
  265.  XOSSWINumberFromString%,,"XOS_Module" 
  266.  XOSModule%
  267.  XOSSWINumberFromString%,,"Wimp_CloseDown" 
  268.  WimpCloseDown%
  269.  XOSSWINumberFromString%,,"Wimp_LoadTemplate" 
  270.  WimpLoadTemplate%
  271.  XOSSWINumberFromString%,,"Wimp_CreateWindow" 
  272.  WimpCreateWindow%
  273.  XOSSWINumberFromString%,,"Wimp_CloseWindow" 
  274.  WimpCloseWindow%
  275.  XOSSWINumberFromString%,,"OS_ReadMemMapInfo" 
  276.  OSReadMemMapInfo%
  277.  XOSSWINumberFromString%,,"Wimp_SlotSize" 
  278.  WimpSlotSize%
  279.  XOSSWINumberFromString%,,"OS_Heap" 
  280.  OSHeap%
  281.  XOSSWINumberFromString%,,"XOS_Heap" 
  282.  XOSHeap%
  283.  XOSSWINumberFromString%,,"Wimp_OpenTemplate" 
  284.  WimpOpenTemplate%
  285.  XOSSWINumberFromString%,,"Wimp_CloseTemplate" 
  286.  WimpCloseTemplate%
  287.  XOSSWINumberFromString%,,"OS_GBPB" 
  288.  OSGBPB%
  289.  XOSSWINumberFromString%,,"Wimp_ForceRedraw" 
  290.  WimpForceRedraw%
  291. LoadChoices
  292. GetChoices(0):
  293.  MessageTransFileInfo%,,"<Encrypt$Dir>.Choices"
  294. )!name$="<Encrypt$Dir>.Choices"
  295.  OSModule%, 6,,, 17+
  296. (name$) 
  297.  ,,cho_desc%
  298. $(cho_desc%+16)=name$
  299.  MessageTransOpenFile%,cho_desc%,cho_desc%+16
  300. GetChoices(1)
  301.  XMessageTransCloseFile%,cho_desc%
  302.  XOSModule%, 7,, cho_desc%
  303. GetChoices(stat%)
  304.  stat% 
  305. 7(hide%=(
  306. ExpandChoices("Hide")="Yes")
  307. 8*query%=
  308. ExpandChoices("Query")="No")
  309. 9&PGP%=(
  310. ExpandChoices("PGP")="Yes")
  311. :,Verify%=(
  312. ExpandChoices("Verify")="Yes")
  313. tellthemoff("Choices file cannot be found - reverting to defaults")
  314. hide%=
  315. query%=
  316. PGP%=
  317. Verify%=
  318. SaveChoices
  319. checkforpgp
  320. SaveChoices
  321. J+choiceshand%=
  322. ("<Encrypt$Dir>.Choices")
  323. writetochoicesfile("# Choices file for Encrypt")
  324. writetochoicesfile("# Saved on:"+
  325. writetochoicesfile("")
  326. writetochoicesfile("Query:"+
  327. YesNo(query%))
  328. writetochoicesfile("Hide:"+
  329. YesNo(hide%))
  330. writetochoicesfile("PGP:"+
  331. YesNo(PGP%))
  332. writetochoicesfile("Verify:"+
  333. YesNo(Verify%))
  334. writetochoicesfile("")
  335. writetochoicesfile("# End")
  336. #choiceshand%
  337. choiceshand%=
  338. writetochoicesfile(a$)
  339. #choiceshand%,a$
  340. YesNo(a%)
  341.  ="Yes" 
  342.  ="No"
  343. checkforpgp
  344.  X%+OSReadVarVal%,"PGPPATH",junk%,256,0,0 
  345.  ,,r2%;ok%
  346.  ok% 
  347.  $junk%="" 
  348.  junk%?r2%=13
  349.  $junk%="" 
  350.  PGP% 
  351. tellthemoff("Can't find PGP")
  352. PGP%=
  353. PGPicon%=
  354. PGPicon%=
  355. LoadMessages(name$)
  356.  255,"Cannot find message file"
  357.  MessageTransFileInfo%,, name$
  358.  OSModule%, 6,,, 17+
  359. (name$) 
  360.  ,,msg_desc%
  361. $(msg_desc%+16)=name$
  362.  MessageTransOpenFile%,msg_desc%,msg_desc%+16
  363. y#appname$=
  364. ExpandMessage("NAME")
  365. z&purpose$=
  366. ExpandMessage("PURPOSE")
  367. {&version$=
  368. ExpandMessage("VERSION")
  369. dosave(s$)
  370.  directory% 
  371.  $passtext<>"" 
  372. DoStuff(s$)
  373. tellthemoff(
  374. ExpandMessage("PASSWORD"))
  375. s$,".")<1 
  376. s$,":")<1 
  377. s$,"<")<1 
  378. tellthemoff(
  379. ExpandMessage("TOSAVE"))
  380.  $passtext<>"" 
  381. DoStuff(s$):
  382. closemenu
  383. tellthemoff(
  384. ExpandMessage("PASSWORD"))
  385. drag(q%)
  386.  file$
  387. !q%=mainhand%:q%!4=12
  388.  WimpGetIconState%,,q%
  389. file$=$(q%+28)
  390.  WimpGetPointerInfo%,,q%
  391. q%!20=q%!12
  392. q%!24=q%!16
  393. q%!28=q%!0
  394. q%!32=q%!4
  395.  directory% 
  396.  Ramload% 
  397.  q%!36=lenofinputfile% 
  398.  q%!36=transptr%
  399. q%!0=64:q%!12=0
  400. Jq%!16=1:
  401.  Status$="D" 
  402.  q%!40=
  403. ("&"+
  404. Decryptfiletype$,3)) 
  405.  q%!40=&230
  406. q%!36=0:q%!0=64:q%!12=0
  407. q%!16=1:q%!40=&000
  408. %$(q%+44)=
  409. lastbit($savetext)+
  410.  WimpSendMessage%,17,q%,q%!20,q%!24
  411. getstr(a%)
  412.  ?a%>=32
  413. (?a%)
  414.     a%+=1
  415. lastbit(s$)
  416. s$,":")>0
  417. s$,":")+1)
  418. s$,".")>0
  419. s$,".")+1)
  420. textaddr(hand%,icon%)
  421. geticoninfo(hand%,icon%)
  422. =iconinf%!28
  423. geticoninfo(hand%,icon%)
  424. !iconinf%=hand%
  425. iconinf%!4=icon%
  426.  WimpGetIconState%,,iconinf%
  427. message
  428.  task%,ref%
  429. task%=q%!4
  430. ref%=q%!8
  431.  q%!16 
  432. shutdownwimp
  433.  IF NOT Loaded% THEN
  434.  PROCtotalreset
  435.  task%=mytask% 
  436. Loaded%=
  437. :Ramload%=
  438. FileType$=(
  439. ~(q%!40))
  440. FileLoadFull$="Untitled"
  441. FileLoadName$=FileLoadFull$
  442. tempbufsize%=q%!36
  443.  tempbufsize%=-1 tempbufsize%=1024
  444.  PROCfreeablock(Infile%)
  445. $Infile%=
  446. getablock(tempbufsize%)
  447. retinfile%=Infile%
  448. transptr%=0
  449. q%!20=Infile%
  450. q%!24=tempbufsize%
  451. q%!12=ref%
  452. q%!16=6
  453.  WimpSendMessage%,18,q%,task%
  454.  PROCgrey(mainhand%,21)
  455.  ENDIF
  456.  saving% 
  457.  WimpTransferBlock%,mytask%,q%,mytask%,buffer%,240
  458. dosave(
  459. getstr(q%+44))
  460.  WimpTransferBlock%,mytask%,buffer%,mytask%,q%,240
  461. saving%=
  462.  SYS WimpGetPointerInfo%,,q%
  463.  q%!20=q%!12
  464.  q%!24=q%!16
  465.  q%!28=!q%
  466.  q%!32=q%!4
  467.  !q%=44
  468.  q%!12=ref%
  469.  q%!16=3
  470.  q%!40=0
  471.  SYS WimpSendMessage%,17,q%
  472.  waitingforack%=TRUE
  473.  error% 
  474. q%!12=q%!8
  475. !q%=256
  476. q%!16=3
  477.  WimpSendMessage%,18,q%,q%!20,q%!24
  478. closemenu
  479.  q%!12=0 
  480. getstr(q%+44)
  481. loadack
  482. LoadFrom(f$)
  483.  PROCgrey(mainhand%,21)
  484.  4:waitingforack%=
  485.  q%!40=&230 
  486. getstr(q%+44)
  487. 6q%!12=q%!8:q%!16=4:
  488. "Wimp_SendMessage",17,q%,q%!4
  489. LoadFrom(f$)
  490.  directory% 
  491.  Status$="D" 
  492.  q%!4<>mytask% 
  493. ram_trans
  494.  Stop encrypted files being ramtransferred
  495. tellthemoff(
  496. ExpandMessage("NORAMTRA"))
  497. transptr%=transptr%+q%!24
  498.  transptr%<tempbufsize% 
  499.  Outfile%=FNgetablock(transptr%+16)
  500. FileLoadFull$="Untitled"
  501. FileLoadName$=FileLoadFull$
  502. textaddr(mainhand%,4)=FileLoadFull$
  503. setloadicon("file_"+FileType$)
  504. iconredraw(mainhand%,4)
  505. iconredraw(mainhand%,1)
  506.  PROCgrey(mainhand%,21)
  507. ("&"+FileType$)<>&230 
  508. Decrypt%=
  509. seticonoff(mainhand%,17)
  510. seticonon(mainhand%,18)
  511. grey(mainhand%,17)
  512. setsaveicon("file_230")
  513. Decrypt%=
  514. Status$="D"
  515. #!Decryptfiletype$=$(Infile%+4)
  516. Dfiletype$=Decryptfiletype$
  517. setsaveicon(Dfiletype$)
  518. seticonon(mainhand%,17)
  519. seticonoff(mainhand%,18)
  520. ungrey(mainhand%,12)
  521. ungrey(mainhand%,10)
  522. ungrey(mainhand%,13)
  523.  mainopen% 
  524. reopen(mainhand%,400,400)
  525. "Wimp_SetCaretPosition",mainhand%,14,,,-1
  526. wintofront(mainhand%)
  527. 3'Infile%=
  528. extendablock(Infile%,1024)
  529. tempbufsize%+=1024
  530. q%!20=Infile%+transptr%
  531. 6 q%!24=tempbufsize%-transptr%
  532. q%!12=ref%
  533. q%!16=6
  534.  WimpSendMessage%,18,q%,task%
  535.  desktop_save_handle%
  536. desktop_save_handle%=q%!20
  537.  OSReadVarVal%,"Encrypt$Dir",q%,256,0,0 
  538. ,,r2%
  539. q%?r2%=13
  540. #desktop_save_handle%,"Run "+$q%
  541.  &502:
  542. HelpRequested(q%)
  543.  OTHERWISE:PROCtellthemoff(STR$(q%!16))
  544. directoryprocess(dir$)
  545.  recurse% 
  546. loaddir$=dir$
  547. over%=(loaddir$=savedir$)
  548. recurse%=
  549. per%=0
  550. O per%+=1:
  551.  per%>99 
  552.  per%-=99
  553.  "Hourglass_Percentage",per%
  554. Q#dir$=
  555. dir$,
  556. (dir$)-
  557. (loaddir$))
  558.  OSFile%,8,savedir$+dir$
  559.  $passtext="" 
  560. tellthemoff(
  561. ExpandMessage("PASSWORD")):
  562.  PROCtotalreset
  563.  A%,R%,file$,name$,Q%,W%,Y%
  564. file$="*"
  565.  "OS_GBPB",11,loaddir$+dir$,C%,1,R%,50,file$ 
  566.  ,,,,R%
  567.  R%>0 
  568. name$=""
  569.  ?(C%+29+A%)<>0
  570.  ?(C%+29+A%)>31 name$+=
  571. ?(C%+29+A%)
  572. _    A%+=1
  573. a    T%+=1
  574.  !(C%+16)<>2 
  575.  ((!C% 
  576.  &FFF00000) 
  577.  &100000)=-1 
  578. Y%=((!C% 
  579.  &FFFFF) 
  580.  &100)
  581.  over% 
  582.  Status$="E" 
  583.  Y%<>&230 
  584. batchprocessfile(dir$+"."+name$,Y%)
  585.  Y%=&230 
  586. batchprocessfile(dir$+"."+name$,Y%)
  587. batchprocessfile(dir$+"."+name$,Y%)
  588.  "OS_FSControl",18,,Y% 
  589.  ,,Q%,W%
  590. string%!0=Q%
  591. string%!4=W%
  592. string%!8=13
  593. s    M%+=1
  594.  !(C%+16)=2 
  595. w    D%+=1
  596. x $useful%=savedir$+dir$+name$
  597. directoryprocess(loaddir$+dir$+"."+name$)
  598.  R%=-1
  599. batchprocessfile(f$,filetype%)
  600. process%=
  601.  bodge f$
  602. newf$=f$
  603. f$=loaddir$+f$
  604. loadintomem(f$)
  605.  Status$="D" 
  606.  PROCtellthemoff("Decrypt")
  607.  filetype%<>&230 
  608. &process%=
  609. :savefiletype%=filetype%
  610. Decrypt%=
  611. :Status$="D"
  612. !Decryptfiletype$=$(Infile%+4)
  613.  ?(Infile%+3)=&0D:
  614.  Status$="D" 
  615.  Decryptfiletype$=$(Infile%)
  616. CDfiletype$=Decryptfiletype$:
  617.  PROCtellthemoff(Decryptfiletype$)
  618. #savefiletype%=
  619. ("&"+Dfiletype$)
  620. FileLoadFull$=f$
  621.  Status$="E" 
  622.  filetype%=&230 
  623.  process%=
  624. savefiletype%=&230
  625.  process% 
  626. ramcrypt
  627.  error% 
  628.  OSFile%,10,savedir$+newf$,savefiletype%,,Infile%,Infile%+lenofinputfile%
  629. returnablock(retinfile%)
  630. ram_trans
  631.  $passtext<>"" 
  632. ramcrypt
  633.  firstsave% 
  634.  sourcebuff%=Infile%:bytesleft%=lenofinputfile%-1
  635. :firstsave%=
  636. RamSave(q%,mytask%,sourcebuff%,bytesleft%)
  637. RamSave(q%,task%,
  638.  scrbuff%,
  639.  bytes%)
  640.  btrans%,code%,dbuff%,dtask%,last%
  641. dtask%=q%!4:dbuff%=q%!20
  642.  bytes%>=q%!24 
  643. btrans%=q%!24
  644. code%=18:last%=
  645. btrans%=bytes%
  646. code%=17:last%=
  647.  WimpTransferBlock%,task%,scrbuff%,dtask%,dbuff%,btrans%
  648. %scrbuff%+=btrans%:bytes%-=btrans%
  649. q%!12=q%!8:q%!16=7
  650. q%!20=dbuff%:q%!24=btrans%
  651.  WimpSendMessage%,code%,q%,dtask%
  652. =last%
  653. LoadFrom(f$)
  654. totalreset
  655. ungrey(mainhand%,17)
  656. ungrey(mainhand%,18)
  657.  mainopen% 
  658. reopen(mainhand%,400,400)
  659. "Wimp_SetCaretPosition",mainhand%,14,,,-1
  660. wintofront(mainhand%)
  661. filetype(f$)>-1 
  662.  han%
  663. Loaded%=
  664. issf%=
  665. FileLoadFull$=f$
  666. )FileLoadName$=
  667. GetName(FileLoadFull$)
  668. textaddr(mainhand%,4)=FileLoadFull$
  669.  megamem% 
  670. textaddr(mainhand%,10)=FileLoadFull$
  671. setloadicon("file_"+
  672. filetype(f$)))
  673. iconredraw(mainhand%,4)
  674. iconredraw(mainhand%,1)
  675. filetype(f$)<>&230 
  676. Decrypt%=
  677. seticonoff(mainhand%,17)
  678. seticonon(mainhand%,18)
  679. grey(mainhand%,17)
  680. setsaveicon("file_230")
  681.  Verify% 
  682. grey(mainhand%,12)
  683. textaddr(mainhand%,13)="Enter"
  684. Decrypt%=
  685. Status$="D"
  686. seticonon(mainhand%,17)
  687. seticonoff(mainhand%,18)
  688. ungrey(mainhand%,12)
  689.  Verify% 
  690. ungrey(mainhand%,12)
  691. ungrey(mainhand%,10)
  692. ungrey(mainhand%,13)
  693.  megamem% 
  694. loadintomem(f$):$
  695. textaddr(mainhand%,10)=FileLoadFull$
  696.  Status$="D" 
  697.  ?(Infile%+3)=&0D:
  698.  Status$="D" 
  699.  Decryptfiletype$=$(Infile%) 
  700.  Decryptfiletype$=$(Infile%+4)
  701. Dfiletype$=Decryptfiletype$
  702. setsaveicon("file_"+Dfiletype$)
  703. FileLoadFull$=f$
  704. setsaveicon("directory")
  705. setloadicon("directory")
  706. directory%=
  707. Loaded%=
  708. ungrey(mainhand%,12)
  709. ungrey(mainhand%,10)
  710. textaddr(mainhand%,10)=f$
  711. textaddr(mainhand%,4)=f$
  712. ungrey(mainhand%,13)
  713. Decrypt%=
  714. Status$="E"
  715.  Verify% 
  716. textaddr(mainhand%,13)="Enter":
  717. iconredraw(mainhand%,13)
  718. grey(mainhand%,12):
  719. iconredraw(mainhand%,12)
  720.  PROCdirectoryprocess(f$)
  721.  IF query% THEN PROCtellthemoff(FNExpandMessage("DirectoryCaution"))
  722. loadintomem(f$)
  723.  OSFile%,5,f$ 
  724.  ,,,,lenofinputfile%
  725. ZInfile%=
  726. getablock(lenofinputfile%+64):
  727.  PROCtellthemoff(STR$~(Infile%)):PRINT Infile%
  728. retinfile%=Infile%
  729. Infile%+=4
  730.  OSFile%,255,f$,Infile%,0
  731. filetype(f$)
  732.  Ramload% 
  733.  =FileType$
  734.  f%,type%
  735.  OSFile%,17,f$ 
  736.  type%,,f%
  737.  type%<>1 
  738.  = -2
  739.  (f%>>>20)=&FFF 
  740.  = (f%>>>8)
  741. &FFF 
  742.  = -1
  743. loadack
  744. !q%=20
  745. q%!12=ref%
  746. q%!16=4
  747.  WimpSendMessage%,17,q%
  748. setspriteicon(hand%,icon%,n$)
  749. spriten$=n$
  750. geticoninfo(hand%,icon%)
  751.  WimpDeleteIcon%,,iconinf%
  752. (n$)<12 n$+=
  753.  i%=0 
  754. (n$)-1
  755. !?(iconinf%+28+i%)=
  756. n$,i%+1)
  757. iconinf%!4=hand%
  758.  WimpCreateIcon%,,iconinf%+4 
  759.  saveicon%
  760. iconredraw(hand%,icon%)
  761. setsaveicon(n$)
  762. setspriteicon(mainhand%,12,n$)
  763. setloadicon(n$)
  764. setspriteicon(mainhand%,1,n$)
  765. Query2(s$)
  766.  query% 
  767. Query(s$) 
  768. DoStuff(Save$)
  769. error%=
  770.  directory% 
  771. Save$,FileLoadFull$+".")=1 
  772. tellthemoff(
  773. ExpandMessage("NoRecurse")):error%=
  774. savedir$=Save$
  775. Query2(
  776. ExpandMessage("DirectoryCheck"+Status$))<>2 
  777.  "Hourglass_On"
  778. directoryprocess(FileLoadFull$)
  779.  "Hourglass_Smash"
  780. totalreset
  781.  Save$=FileLoadFull$ 
  782.  megamem% 
  783. tellthemoff(
  784. ExpandMessage("OVERCOPY")):
  785.  Save$=FileLoadFull$ 
  786.  megamem% 
  787. Query2(
  788. ExpandMessage("ARESURE"))=2 
  789. ramcrypt
  790.  PROCtellthemoff(Filetype$)
  791.  error% 
  792.  "OS_File",10,Save$,
  793. ("&"+Filetype$),,Infile%,Infile%+lenofinputfile%
  794. totalreset
  795. ramcrypt
  796.  SYS "Hourglass_On"
  797.  Ramload% 
  798.  lenofinputfile%=transptr%
  799.  Coun%,ag,overfile%
  800. Pass$=$passtext
  801. In$=FileLoadFull$
  802. Length%=
  803. (Pass$)
  804. $text=$passtext
  805.  inpos%,outpos%
  806. inpos%=0:outpos%=0
  807. S9Adrinfile%=Infile%:
  808.  PROCtellthemoff(STR$~(?Infile%))
  809.  Status$="D" 
  810.  ________________ Decrypt the file _______________
  811. Method%=?(Infile%+3)
  812.  Method% 
  813.  &0D:
  814.        EOR file format
  815.  directory%:
  816. tellthemoff(
  817. ExpandMessage("Crackable"))
  818. Filetype$=$Infile%
  819. seed%=Infile%!4 
  820.  ?text
  821. Adrinfile%=Infile%+8
  822. Infile%+=8
  823. lenofinputfile%-=8
  824.  EncryptEncrypt%,text,Adrinfile%,lenofinputfile%,Length%,seed%
  825.  &0F:
  826.        PGP file format  (with/without hash)
  827.  PGPicon% 
  828. overfile%=?(Infile%+2)
  829. Filetype$=$(Infile%+4)
  830. Adrinfile%=Infile%+8
  831. Infile%+=8
  832. lenofinputfile%-=8
  833. pass$=$text
  834.  OSReadVarVal%,"Wimp$Scrap",junk%,256,0,0 
  835. ,,r2%
  836. junk%?r2%=13
  837. filescrap$=$junk%
  838.  OSFile%,10,filescrap$,&FFF,,Infile%,Infile%+lenofinputfile%
  839. ue$junk%="pgp -d "+filescrap$+" +verbose=0 +force -z"+
  840. (34)+pass$+
  841. (34)+"+batchmode -o "+filescrap$
  842.  "Wimp_StartTask",junk%
  843. returnablock(retinfile%)
  844. loadintomem(filescrap$)
  845.  "Wipe "+filescrap$+" ~CF~R~V"
  846.  Check if file has hash and if so check it
  847.  overfile%<255 
  848. hash%=
  849. hash(Pass$)
  850. ~3correct%=(!(Infile%+lenofinputfile%-16)=!hash%)
  851.  correct% 
  852.  correct%=(!(Infile%+lenofinputfile%-12)=hash%!4)
  853.  correct% 
  854.  correct%=(!(Infile%+lenofinputfile%-8)=hash%!8)
  855.  correct% 
  856.  correct%=(!(Infile%+lenofinputfile%-4)=hash%!12)
  857.  correct% 
  858. incorrectkey
  859. lenofinputfile%-=16
  860. "lenofinputfile%-=(8-overfile%)
  861. tellthemoff("File "+In$+" cannot be decrypted - please locate PGP")
  862. error%=
  863.  &0E:
  864.        Blowfish file format - EBC mode
  865. Filetype$=$(Infile%+4)
  866. overfile%=?(Infile%+2)
  867. Adrinfile%=Infile%+8
  868. Infile%+=8
  869. lenofinputfile%-=8
  870.  "Blowfish_Initialise",$text,Length%
  871.  "Blowfish_Decode",Adrinfile%,Adrinfile%,lenofinputfile%
  872. #lenofinputfile%-=(8-overfile%):
  873.  &10:
  874.        Blowfish file format - CBC mode
  875. Filetype$=$(Infile%+4)
  876. overfile%=?(Infile%+2)
  877. Adrinfile%=Infile%+8
  878. Infile%+=8
  879. lenofinputfile%-=8
  880.  "Blowfish_ExpandKey",text,Length%,keybuff%
  881.  "Blowfish_DecryptBlockCBC",Adrinfile%,lenofinputfile%,keybuff%,iv%,8
  882. "lenofinputfile%-=(8-overfile%)
  883. !lenofinputfile%-=4:Infile%+=4
  884.  &11:
  885.        Blowfish file format - CBC with hash
  886. Filetype$=$(Infile%+4)
  887. overfile%=?(Infile%+2)
  888. Adrinfile%=Infile%+8
  889. Infile%+=8
  890. lenofinputfile%-=8
  891.  "Blowfish_ExpandKey",text,Length%,keybuff%
  892.  "Blowfish_DecryptBlockCBC",Adrinfile%,lenofinputfile%,keybuff%,iv%,8
  893.  Check hash
  894. hash%=
  895. hash(Pass$)
  896. 3correct%=(!(Infile%+lenofinputfile%-16)=!hash%)
  897.  correct% 
  898.  correct%=(!(Infile%+lenofinputfile%-12)=hash%!4)
  899.  correct% 
  900.  correct%=(!(Infile%+lenofinputfile%-8)=hash%!8)
  901.  correct% 
  902.  correct%=(!(Infile%+lenofinputfile%-4)=hash%!12)
  903.  correct% 
  904. incorrectkey
  905. lenofinputfile%-=16
  906. "lenofinputfile%-=(8-overfile%)
  907. !lenofinputfile%-=4:Infile%+=4
  908.  ________________ Encrypt the file _______________
  909.  PGP% 
  910. PGPencrypt
  911.  PROCtellthemoff(STR$(lenofinputfile%))
  912.  add hash
  913.  ?Adrinfile%=1
  914.  !(Adrinfile%+lenofinputfile%)=FNhash(Pass$)
  915.  lenofinputfile%+=4
  916.  n=0 
  917. "?(Infile%+lenofinputfile%+n)=0
  918. !Infile%-=4:lenofinputfile%+=4
  919.  n=0 
  920. ?(Infile%+n)=0
  921. $overfile%=(lenofinputfile%+8)
  922. .lenofinputfile%=((lenofinputfile%+8)
  923.  8)*8
  924.  bodge length to account for 8-byte chunks
  925.  ups filelength to nearest 8 bytes
  926.  add 16 byte hash to the end of the file
  927. hash%=
  928. hash(Pass$)
  929. lenofinputfile%+=16
  930. (!(Infile%+lenofinputfile%-16)=!hash%
  931. )!(Infile%+lenofinputfile%-12)=hash%!4
  932. (!(Infile%+lenofinputfile%-8)=hash%!8
  933. )!(Infile%+lenofinputfile%-4)=hash%!12
  934.  PROCtellthemoff(STR$~(?Adrinfile%))
  935. blowfishencrypt(text,Length%,Infile%,lenofinputfile%)
  936.  WimpTransferBlock%,mytask%,Infile%,mytask%,Infile%+8,lenofinputfile%
  937. lenofinputfile%+=8
  938. ?Infile%=5
  939. ?(Infile%+1)=65
  940. ?(Infile%+3)=&11
  941.  Ramload% 
  942.  $(Infile%+4)=FileType$ 
  943.  $(Infile%+4)=
  944. filetype(f$))
  945. ?(Infile%+2)=overfile%
  946. Filetype$="230"
  947.  SYS "Hourglass_Smash"
  948. incorrectkey
  949. error%=
  950.  directory% 
  951. tellthemoff(
  952. ExpandMessage("WrongKey"))
  953.  direrr% 
  954.  direrr%=
  955. tellthemoff(
  956. ExpandMessage("WrongKeyDir"))
  957. hash(pass$)
  958.  over%,n,length%
  959. length%=
  960.  pass$
  961. $junk%=pass$
  962.  n=1 
  963. ?(junk%+length%+n)=0
  964. /over%=
  965. (length%/16):over%-=(length% 
  966.  16>0)
  967. +!hash%=0:hash%!4=0:hash%!8=0:hash%!12=0
  968.  n=0 
  969.  over%-1
  970. !hash%+=junk%!(n*16)
  971. hash%!4+=junk%!(n*16)+4
  972. hash%!8+=junk%!(n*16)+8
  973. hash%!12+=junk%!(n*16)+12
  974. =hash%
  975. blowfishencrypt(passadr%,length%,plainadr%,lenplain%)
  976.  "Blowfish_ExpandKey",passadr%,length%,keybuff%
  977.  "Blowfish_EncryptBlockCBC",plainadr%,lenplain%,keybuff%,iv%,8
  978. PGPencrypt
  979.  pass$
  980.  Add hash - PGP will check but won't inform if pass is wronh
  981. $overfile%=(lenofinputfile%+8)
  982. .lenofinputfile%=((lenofinputfile%+8)
  983.  8)*8
  984. hash%=
  985. hash(Pass$)
  986. lenofinputfile%+=16
  987. (!(Infile%+lenofinputfile%-16)=!hash%
  988. )!(Infile%+lenofinputfile%-12)=hash%!4
  989. (!(Infile%+lenofinputfile%-8)=hash%!8
  990. )!(Infile%+lenofinputfile%-4)=hash%!12
  991.  hash added
  992. pass$=$text
  993.  OSReadVarVal%,"Wimp$Scrap",junk%,256,0,0 
  994. ,,r2%
  995. junk%?r2%=13
  996. filescrap$=$junk%
  997.  OSFile%,10,filescrap$,&FFF,,Infile%,Infile%+lenofinputfile%
  998. e$junk%="pgp -c "+filescrap$+" +verbose=0 +force -z"+
  999. (34)+pass$+
  1000. (34)+"+batchmode -o "+filescrap$
  1001.  "Wimp_StartTask",junk%
  1002. returnablock(retinfile%)
  1003. loadintomem(filescrap$)
  1004.  "Wipe "+filescrap$+" ~CF~R~V"
  1005.  WimpTransferBlock%,mytask%,Infile%,mytask%,Infile%+8,lenofinputfile%
  1006. lenofinputfile%+=8
  1007. ?(Infile%+1)=90
  1008. ?(Infile%+3)=&0F
  1009.  Ramload% 
  1010.  $(Infile%+4)=FileType$ 
  1011.  $(Infile%+4)=
  1012. filetype(f$))
  1013. ?(Infile%+2)=overfile%
  1014.  ?(Infile%+2)=&FF
  1015. Filetype$="230"
  1016. initsavedrag(savehand%,icon%)
  1017.  x%,y%,ysize%,spritetodrag$
  1018. !q%=savehand%
  1019.  WimpGetWindowState%,,q%
  1020. ysize%=q%!16-q%!8
  1021. x%=q%!4:y%=q%!8
  1022. q%!4=icon%
  1023.  WimpGetIconState%,,q%
  1024. !q%=q%!8+x%
  1025. q%!4=q%!12+y%+ysize%
  1026. q%!8=q%!16+x%
  1027. q%!12=q%!20+y%+ysize%
  1028. saving%=
  1029. dragging%=
  1030. <&FileSave$=$
  1031. textaddr(mainhand%,10)
  1032.  Status$="D" 
  1033.  Dfiletype$=Decryptfiletype$ 
  1034.  Dfiletype$="230"
  1035.  directory% 
  1036.  spritetodrag$="directory" 
  1037.  spritetodrag$="file_"+Dfiletype$
  1038.  DragASpriteStart%,%11000101,1,spritetodrag$,q%
  1039. GetName(FilePath$)
  1040. (FilePath$)+1
  1041. E    a%-=1
  1042. FilePath$,a%,1)="."
  1043. FilePath$,a%+1)
  1044. sendmessage(mess$)
  1045. !mess%=64
  1046. mess%!4=mytask%
  1047. mess%!8=0
  1048. mess%!12=0
  1049. mess%!16=&80EC0
  1050. $(mess%+20)=mess$
  1051.  WimpSendMessage%,17,mess%
  1052. HelpRequested(Block%)
  1053.  help$
  1054.  Window%, Icon%
  1055. Block%!16=&503
  1056. Block%!12=Block%!8
  1057. Window%=Block%!32
  1058. Icon%=Block%!36
  1059. Z%help$=
  1060. GetHelpText(Window%,Icon%)
  1061. help$=
  1062. ExpandMessage(help$)
  1063. $(Block%+20)=
  1064. help$,232)
  1065. !Block%=(
  1066.  help$+25) 
  1067.  WimpSendMessage%,17,Block%,Block%!4
  1068. GetHelpText(w%,i%)
  1069.  mainhand%
  1070.  1,6:
  1071.  Loaded% 
  1072.  h$="MAINLOFT" 
  1073.  h$="MAINLOAD"
  1074.  Loaded% 
  1075.  h$="MAINLOFT" 
  1076.  h$="MAINLOFN"
  1077.  12:h$="MAINSAVI"
  1078.  10:h$="MAINSAVF"
  1079.  13:h$="MAINOK"
  1080.  20:h$="MAINRESE"
  1081.  17:h$="MAINDECR"
  1082.  18:h$="MAINENCR"
  1083.  14:h$="MAINCODE"
  1084.  21:h$="MAINRAMP"
  1085.  h$="MAIN"
  1086.  infohand%
  1087.  3:h$="I3"
  1088. :h$="I"
  1089.  optshand%
  1090.  3:h$="OPTSBLOW"
  1091.  4:h$="OPTSPGP"
  1092.  2:h$="OPTSHIDE"
  1093.  6:h$="OPTSDIRW"
  1094.  9:h$="OPTSREST"
  1095.  8:h$="OPTSSAVE"
  1096.  10:h$="OPTSCLOS"
  1097.  11:h$="OPTSVERI"
  1098.  h$="OPTS"
  1099.  i%=Encrypticon% 
  1100.  h$="ICON"
  1101. menuhelp(w%,i%)
  1102. menuhelp(w%,i%)
  1103.  h$,menu_text$
  1104.  WimpGetMenuState%,1,menhlp%,w%,i%
  1105.  WimpDecodeMenu%,,current_menu%,menhlp%,
  1106. 200," ") 
  1107.  ,,,menu_text$
  1108. h$="Menu"+menu_text$
  1109. ExpandChoices(tag$)
  1110. ExpandChoicesArgs(tag$,"","")
  1111. ExpandChoicesArgs(tag$,arg1$,arg2$)
  1112.  flags%,length%,meg$
  1113.  XMessageTransLookup%,cho_desc%,tag$,cho_blk%,256,arg1$,arg2$ 
  1114.  ,,,length%;flags%
  1115.  flags% 
  1116. %msg$="Message "+tag$+" not found"
  1117. cho_blk%?length%=13
  1118. msg$=$(cho_blk%)
  1119.     =msg$
  1120. ExpandMessage(tag$)
  1121. ExpandMessageArgs(tag$,"","")
  1122. ExpandMessageArgs(tag$,arg1$,arg2$)
  1123.  flags%,length%,meg$
  1124.  XMessageTransLookup%,msg_desc%,tag$,msg_blk%,256,arg1$,arg2$ 
  1125.  ,,,length%;flags%
  1126.  flags% 
  1127. %msg$="Message "+tag$+" not found"
  1128. msg_blk%?length%=13
  1129. msg$=$(msg_blk%)
  1130.     =msg$
  1131. checkmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
  1132.  (b% 
  1133.  5)>0 
  1134.  handle% 
  1135.  mainopen% 
  1136. reopen(mainhand%,400,400) 
  1137. wintofront(mainhand%)
  1138.  optshand%:
  1139.  icon% 
  1140. LoadChoices:
  1141. setoptswin:
  1142.  b%=4 
  1143. closewindow(optshand%)
  1144. SaveChoices
  1145.  3:PGP%=
  1146. updatePGP
  1147.  4:PGP%=
  1148. updatePGP
  1149.  2:hide%=
  1150. (hide%):
  1151. updatehide
  1152.  6:query%=
  1153. (query%):
  1154. updatequery
  1155.  11:Verify%=
  1156. (Verify%):
  1157. updateverify
  1158.  b%=4 
  1159. closewindow(optshand%)
  1160.  mainhand%:
  1161.  icon% 
  1162.  b%=1 
  1163. seticonon(mainhand%,icon%)
  1164.  directory% 
  1165. setsaveicon("file_230")
  1166. Status$="E"
  1167.  Verify% 
  1168. textaddr(mainhand%,13)="Enter":
  1169. iconredraw(mainhand%,13)
  1170. grey(mainhand%,12):
  1171. iconredraw(mainhand%,12)
  1172.  Decrypt% 
  1173.  b%=1 
  1174. seticonon(mainhand%,icon%)
  1175. ungrey(mainhand%,12):
  1176. iconredraw(mainhand%,12)
  1177. ungrey(mainhand%,13):$
  1178. textaddr(mainhand%,13)="Process"
  1179. iconredraw(mainhand%,13)
  1180. Status$="D"
  1181.  directory% 
  1182. setsaveicon("file_"+Decryptfiletype$)
  1183. seticonon(mainhand%,18)
  1184. seticonoff(mainhand%,17)
  1185. Status$="E"
  1186. totalreset
  1187. initsavedrag(mainhand%,12)
  1188. double 
  1189. dosave(
  1190. getstr(savetext))
  1191.  directory% 
  1192. dosave("<Wimp$Scrap>")
  1193. "Settype <Wimp$Scrap> &"+Filetype$
  1194. $junk%="Run <Wimp$Scrap>"
  1195.  "Wimp_StartTask",junk%
  1196. &$junk%="Wipe <Wimp$Scrap> ~CF~R~V"
  1197.  "Wimp_StartTask",junk%
  1198.  optsopen% 
  1199. reopen(optshand%,450,450) 
  1200. wintofront(optshand%)
  1201.  IF hide% THEN hide%=FALSE ELSE hide%=TRUE
  1202.  PROCupdatehide
  1203.  (b% 
  1204.  2)>0 
  1205.  handle% 
  1206.  infohand%:
  1207.  icon% 
  1208. secmess
  1209.  mainhand%
  1210.  PROCshow_menu(main_menu%,mousex%-64,mousey%)
  1211. endcyc
  1212. show_menu(icon_menu%,!q%-64,
  1213. menu_height(icon_menu%)+48)
  1214. totalreset
  1215. textaddr(mainhand%,16)="Pass Phrase":
  1216. iconredraw(mainhand%,16)
  1217. textaddr(mainhand%,13)="Process":
  1218. iconredraw(mainhand%,13)
  1219. ungrey(mainhand%,12)
  1220. ungrey(mainhand%,13)
  1221. grey(mainhand%,17)
  1222. grey(mainhand%,18)
  1223. seticonon(mainhand%,18)
  1224. seticonoff(mainhand%,17)
  1225. grey(mainhand%,10)
  1226. grey(mainhand%,12)
  1227. grey(mainhand%,13)
  1228.  PROCseticonon(mainhand%,21)
  1229.  PROCungrey(mainhand%,21)
  1230.  megamem% 
  1231. returnablock(retinfile%)
  1232. megamem%=
  1233. Loaded%=
  1234. :Ramload%=
  1235. FileLoadFull$="Encypted"
  1236. textaddr(mainhand%,10)=FileLoadFull$:
  1237. iconredraw(mainhand%,10)
  1238. textaddr(mainhand%,4)="":
  1239. iconredraw(mainhand%,4)
  1240. textaddr(mainhand%,14)="":
  1241. iconredraw(mainhand%,14)
  1242. setloadicon("loadicon"):
  1243. iconredraw(mainhand%,1)
  1244.  mainopen% 
  1245. "Wimp_SetCaretPosition",mainhand%,14,,,-1
  1246. Decrypt%=
  1247. Double%=
  1248. :pollmask%=1
  1249. Status$="E"
  1250. updated%=
  1251. Loaded%=
  1252. saving%=
  1253. dragging%=
  1254. waitingforack%=
  1255.  mainopen%=TRUE
  1256. directory%=
  1257. recurse%=
  1258. error%=
  1259. direrr%=
  1260. filesincluded%=0
  1261. wkin%=-1
  1262. wkout%=-1
  1263. Dfiletype$="file_230"
  1264. filestat$="n"
  1265. firstphrase$="."
  1266. !iv%=0
  1267. iv%!4=0
  1268. setsaveicon("file_230")
  1269. checkforpgp
  1270. create_menu(menu$)
  1271.  menu_ptr%,width%,title$
  1272. menu_ptr% = menu_free%
  1273. .!title$    = 
  1274. field(menu$,",")
  1275. (title$) > 12 
  1276. $(menu_ptr%) = 
  1277. title$,12)
  1278. width% = 12
  1279. $(menu_ptr%) = title$
  1280. width% = 
  1281. (title$)
  1282. 6(menu_ptr%?12 = 7  : menu_ptr%?13 = 2
  1283. 7(menu_ptr%?14 = 7  : menu_ptr%?15 = 0
  1284. 8(menu_ptr%!20 = 44 : menu_ptr%!24 = 0
  1285. 9"menu_item_ptr% = menu_ptr% + 4
  1286.  menu$ <> ""
  1287. menu_item_ptr% += 24
  1288. <"menu_item$ = 
  1289. field(menu$,",")
  1290. !menu_item_ptr%  = 0
  1291. menu_item_ptr%!4 = -1
  1292. menu_item_ptr%!8 = &7000021
  1293. "#$%^",
  1294. menu_item$)) > 0
  1295. menu_item$) 
  1296.  "#" : ?menu_item_ptr%   = ?menu_item_ptr%   
  1297.  %00000001
  1298.  "$" : ?menu_item_ptr%   = ?menu_item_ptr%   
  1299.  %00000010
  1300.  "%" : menu_item_ptr%?10 = menu_item_ptr%?10 
  1301.  %01000000
  1302.  "^" : ?menu_item_ptr%   = ?menu_item_ptr%   
  1303.  %00000100
  1304. menu_item$ = 
  1305. menu_item$)
  1306. (menu_item$) > width% 
  1307.  width% = 
  1308. (menu_item$)
  1309. J,$(menu_item_ptr%+12) = menu_item$ + 
  1310. L1?menu_item_ptr% = ?menu_item_ptr% 
  1311.  %10000000
  1312. M*menu_ptr%!16    = (width% * 8 + 6) * 2
  1313. N)menu_free%      = menu_item_ptr% + 24
  1314. =menu_ptr%
  1315. show_menu(menu%,x%,y%)
  1316. current_menu% = menu%
  1317. menu_x%       = x%
  1318. menu_y%       = y%
  1319.  WimpCreateMenu%,,menu%,x%,y%
  1320. reshow_menu
  1321. show_menu(current_menu%,menu_x%,menu_y%)
  1322. decode_menu
  1323.  menu_text$
  1324.  WimpDecodeMenu%,,current_menu%,q%,
  1325. 200," ") 
  1326.  ,,,menu_text$
  1327. =menu_text$
  1328. menu_attach(menu%,position%,attachment%)
  1329. b7menu%!(28 + 24 * (position% - 1) + 4) = attachment%
  1330. menu_height(menu%)
  1331.  height%,menu_item_ptr%
  1332. menu_item_ptr% = menu% + 28
  1333. height%        = 0
  1334.  (?menu_item_ptr% 
  1335.  %10000000) = 0
  1336. menu_item_ptr% += 24
  1337. height%        += 1
  1338. =96 + (44 * (height% + 1))
  1339. menu_tick_toggle(menu%,position%)
  1340. oMmenu%?(28 + 24 * (position% - 1)) = menu%?(28 + 24 * (position% - 1)) 
  1341. set_menu_tick(menu%,position%,ticked%)
  1342.  ticked% 
  1343. tMmenu%?(28 + 24 * (position% - 1)) = menu%?(28 + 24 * (position% - 1)) 
  1344. vUmenu%?(28 + 24 * (position% - 1)) = menu%?(28 + 24 * (position% - 1)) 
  1345.  %11111110
  1346. menu_ticked(menu%,position%)
  1347.  result%
  1348.  (menu%?(28 + 24 * (position% - 1)) 
  1349.  1) > 0 
  1350. result% = 
  1351. result% = 
  1352. =result%
  1353. adjust_pressed
  1354.  WimpGetPointerInfo%,,junk%
  1355. = (junk%!8 
  1356. field(
  1357.  menu$, separator$)
  1358.  result$
  1359. 7result$ = 
  1360. menu$,
  1361. menu$+separator$,separator$) - 1)
  1362. /menu$   = 
  1363. menu$,
  1364. (menu$) - 
  1365. (result$) - 1)
  1366. =result$
  1367. iconbar
  1368. +Encrypticon%=
  1369. IconBarNoText("IconB",-1)
  1370. oldiconbar
  1371. $icvalid%="SIconB"
  1372. $ictext%="Encrypt"
  1373. 4!ic%=-1:ic%!4=0:ic%!8=-16:ic%!12=96+32:ic%!16=86
  1374. ,ic%!20=%00010111000000000011000100101011
  1375.  ic%!24=ictext%
  1376. ic%!24=0
  1377. ic%!28=icvalid%
  1378. ic%!32=
  1379. ($ictext%)+1
  1380.  WimpCreateIcon%,,ic% 
  1381.  Encrypticon%
  1382. IconBarNoText(barname$,end%)
  1383.  iconhandle%,width%
  1384.  WimpSpriteOp%,40,-1,barname$ 
  1385.  ,,,width%
  1386. q%!0=end%
  1387. q%!4=0
  1388. q%!8=0
  1389. q%!12=(width%*2)
  1390. q%!16=92
  1391. q%!20=%10000000000010
  1392. $(q%+24)=barname$
  1393.  WimpCreateIcon%,,q% 
  1394.  iconhandle%
  1395. =iconhandle%
  1396. updiconbar
  1397. !ic%=-1
  1398. ic%!4=Encrypticon%
  1399. ic%!8=0
  1400. ic%!12=0
  1401.  WimpSetIconState%,,ic%
  1402. updiconbartext(text$)
  1403. $ictext%=text$
  1404. !ic%=-1
  1405. ic%!4=Encrypticon%
  1406. ic%!8=0
  1407. ic%!12=0
  1408.  WimpSetIconState%,,ic%
  1409. seticonvalid(win%,icon%,text$)
  1410. 3q%!0=win%:q%!4=icon%:
  1411.  "Wimp_GetIconState",,q%
  1412.  ((q%!24) 
  1413.  &100)=0 
  1414.  Icon not indirected
  1415. *$(q%!32)=text$:
  1416. iconredraw(win%,icon%)
  1417. menuselect
  1418.  adjust%,menu_text$,opmenu$
  1419. adjust%=
  1420. adjust_pressed
  1421. menu_text$=
  1422. decode_menu
  1423. field(menu_text$,".") 
  1424.  "Help":
  1425.  "Filer_Run <Encrypt$Dir>.!Help"
  1426.  "Web Page":
  1427. launchURI("http://www.argonet.co.uk/users/hsloan/Stephens")
  1428.  "Options":
  1429.  optsopen% 
  1430. reopen(optshand%,450,450) 
  1431. wintofront(optshand%)
  1432.  "Quit":
  1433. shutdownwimp
  1434.  adjust% 
  1435. reshow_menu
  1436. errbox
  1437.  buffer%
  1438. op%=-1
  1439.  PROCupdiconbar
  1440. buffer%=useful%
  1441.  WimpDragBox%,,-1
  1442. !buffer%=
  1443.  $(buffer%+4)=
  1444. $+" / "+
  1445.  WimpReportError%,buffer%,3,appname$ 
  1446.  ,what%
  1447.  what%=2 
  1448. shutdownwimp
  1449. Query(message$)
  1450.  clickin%
  1451.     !q%=0
  1452. $(q%+4)=message$+
  1453.  WimpReportError%,q%,19,appname$ 
  1454.  ,clickin%
  1455. =clickin%
  1456. shutdownwimp
  1457.  choiceshand% 
  1458. #choiceshand%
  1459.  XMessageTransCloseFile%,msg_desc%
  1460.  XOSModule%, 7,, msg_desc%
  1461. $q%="TASK"
  1462.  WimpCloseDown%,mytask%,!q%
  1463. loadtemplate(n$):
  1464.  tsize%,blk%,ok%
  1465.  "Wimp_OpenTemplate",,"<Encrypt$Dir>.Templates"
  1466.  "Wimp_LoadTemplate",,0,,,,n$,0 
  1467.  ,,tsize%
  1468.  blk% tsize%
  1469.  "Wimp_LoadTemplate",,templates%,blk%,blk% + tsize%,-1,n$,0 
  1470.  ,,,,,,ok%
  1471.  "Wimp_CloseTemplate"
  1472.  ok%=0 
  1473.  &803, "Template file "+n$+" not found"
  1474.  n$<>"Save" 
  1475.  templates%!64=Encryptsprites%
  1476.  "Wimp_CreateWindow",,templates% 
  1477.  blk%
  1478.     =blk%
  1479. createwindow(name$)
  1480. loadtemplate(name$)
  1481.  -----------
  1482.  hand%,ii%,ics%,a%
  1483.  WimpLoadTemplate%,,templates%,ind%,indir%+&1FFF,-1,name$,0 
  1484.  ,,ind%
  1485.  name$<>"Save" templates%!64=Encryptsprites%
  1486. ics%=templates%!84
  1487.  ics%>0 
  1488.  ii%=0 
  1489.  ics%-1
  1490. a%=templates%+88+32*ii%
  1491.  ((a%!16) 
  1492.  %10)=%10 
  1493.  a%!16=((a%!16) 
  1494.  %100000000)
  1495. sp$=$(a%+20)
  1496.  a%!20 12
  1497. $(a%!20)=sp$
  1498. a%!24=Encryptsprites%
  1499. a%!28=
  1500. (sp$)
  1501.  WimpCreateWindow%,,templates% 
  1502.  hand%
  1503. =hand%
  1504. wintofront(handle%)
  1505. q%!0=handle%
  1506. "Wimp_GetWindowState",,q%
  1507. q%!28=-1
  1508. "Wimp_OpenWindow",,q%
  1509. reopen(hand%,x%,y%)
  1510.  hand%=mainhand% 
  1511.  mainopen%=
  1512.  hand%=optshand% 
  1513. optsopen%=
  1514. checkforpgp
  1515.  PGPicon%=
  1516. grey(optshand%,4):PGP%=
  1517. ungrey(optshand%,4)
  1518. updatePGP
  1519. !q%=hand%
  1520.  WimpGetWindowState%,,q%
  1521. workw%=q%!12-q%!4
  1522. workh%=q%!16-q%!8
  1523. openwindow(hand%,x%,y%,x%+workw%,y%+workh%,0,0,-1)
  1524. openwindow(hand%,x0%,y0%,x1%,y1%,sx%,sy%,bhandle%)
  1525.  hand%<>-1 
  1526.  hand%=mainhand% 
  1527.  mainopen%=
  1528. q%!0=hand%:q%!28=bhandle%
  1529. *)q%!4=x0%:q%!8=y0%:q%!12=x1%:q%!16=y1%
  1530. q%!20=sx%:q%!24=sy%
  1531.  WimpOpenWindow%,,q%
  1532.  hand%=mainhand% 
  1533. "Wimp_SetCaretPosition",mainhand%,14,,,-1
  1534. windowtitle(win%,a$)
  1535.  loc%,a$
  1536. q%!0=win%
  1537.  "Wimp_GetWindowInfo",,q%+1
  1538. loc%=!(q%+76)
  1539. getstr(loc%)<>a$ 
  1540. $loc%=a$:q%!32=win%
  1541.  "Wimp_GetWindowOutline",,q%+32
  1542.  "Wimp_ForceRedraw",-1,q%!36,q%!16,q%!44,q%!48
  1543. closewindow(hand%)
  1544.  hand%=mainhand% 
  1545.  mainopen%=
  1546.  hand%=optshand% 
  1547.  optsopen%=
  1548. !q%=hand%
  1549.  WimpCloseWindow%,,q%
  1550. initheap
  1551. heap%=
  1552.  OSReadMemMapInfo% 
  1553.  heappagesize%
  1554. heapslotsize%=heap%-&8000
  1555.  heapsize%=32*1024
  1556.  WimpSlotSize%,heapslotsize%+heappagesize%,-1 
  1557.  heapslotsize%
  1558. J heapend%=heapslotsize%+&8000
  1559.  heapend%<=heap% 
  1560. ExpandMessage("OUTOFMEM")
  1561. heapsize%=heapend%-heap%
  1562.  OSHeap%,0,heap%,,heapsize%
  1563. getablock(size%)
  1564.  maxfree%,nrpages%,oldheapend%,ptr%
  1565.  OSHeap%,1,heap% 
  1566.  maxfree%
  1567.  size%>maxfree% 
  1568. T&nrpages%=1+(size% 
  1569.  heappagesize%)
  1570.  WimpSlotSize%,heapslotsize%+nrpages%*heappagesize%,-1 
  1571.  heapslotsize%
  1572. oldheapend%=heapend%
  1573. W heapend%=heapslotsize%+&8000
  1574.  OSHeap%,5,heap%,,heapend%-oldheapend%
  1575.  OSHeap%,1,heap% 
  1576.  ,,maxfree%
  1577.  size%>maxfree% 
  1578. ptr%=-1
  1579.  OSHeap%,2,heap%,,size% 
  1580.  ,,ptr%
  1581. `    =ptr%
  1582. freeablock(
  1583.  loc%)
  1584.  loc%>0 
  1585.  OSHeap%,3,heap%,loc%
  1586. loc%=-1
  1587. returnablock(
  1588.  ptr%)
  1589.  maxfree%,nrpages%,flg%
  1590.  XOSHeap%,3,heap%,ptr% 
  1591.  ;flg%
  1592.  (flg% 
  1593.  1)=0 
  1594.  OSHeap%,1,heap% 
  1595.  ,,maxfree%
  1596.  maxfree%>heappagesize% 
  1597. nrpages%=0
  1598.  XOSHeap%,5,heap%,,-heappagesize% 
  1599.  ;flg%
  1600.  (flg% 
  1601.  1)=0 
  1602.  nrpages%+=1
  1603.  (flg% 
  1604.  1)<>0
  1605.  nrpages%>0 
  1606.  WimpSlotSize%,heapslotsize%-nrpages%*heappagesize%,-1 
  1607.  heapslotsize%
  1608. u heapend%=heapslotsize%+&8000
  1609.  OSHeap%,5,heap%,,(heapend%-heap%)-heap%!12
  1610. ptr%=0
  1611. ptr%=-1
  1612. extendablock(loc%,size%)
  1613.  XOSHeap%,6,heap%,loc% 
  1614.  ;ok%
  1615.  (ok% 
  1616. loc%=-3
  1617.  XOSHeap%,4,heap%,loc%,size% 
  1618.  ,,loc%;ok%
  1619.  (ok% 
  1620.  loc%=-2
  1621.     =loc%
  1622. largest
  1623.  largest%
  1624.  OSHeap%,1,heap% 
  1625.  ,,largest%
  1626. =largest%
  1627. tellthemoff(t$)
  1628.  err%
  1629. err%=useful%
  1630. !err%=0
  1631. $(err%+4)=t$+
  1632.  "Wimp_ReportError",err%,1,appname$
  1633. MainWindow(icon%,button%)
  1634. IconBGdSet(w%,i%,c%)
  1635. q%!0=w%
  1636. q%!4=i%
  1637. q%!8=0
  1638. q%!12=0
  1639. q%?11=c%<<4
  1640. q%?15=240
  1641.  WimpSetIconState%,,q%
  1642. initwindows
  1643.  ind%=indir%
  1644.  SYS WimpOpenTemplate%,,"<Encrypt$Dir>.Templates"
  1645. #infohand%=
  1646. createwindow("Info")
  1647. #mainhand%=
  1648. createwindow("Main")
  1649. #optshand%=
  1650. createwindow("Opts")
  1651.  SYS WimpCloseTemplate%
  1652. $savetext=
  1653. textaddr(mainhand%,10)
  1654. $passtext=
  1655. textaddr(mainhand%,14)
  1656. textaddr(mainhand%,10)=FileLoadFull$
  1657. textaddr(infohand%,1)=appname$
  1658. textaddr(infohand%,2)=purpose$
  1659. textaddr(infohand%,3)="
  1660.  Stephen Sloan 1996-97"
  1661. textaddr(infohand%,11)="Version "+version$
  1662. grey(mainhand%,10)
  1663. grey(mainhand%,12)
  1664. grey(mainhand%,13)
  1665. setoptswin
  1666. Hicon_menu%=
  1667. create_menu("Encrypt,Info$,Options,Help,Web Page$,Quit")
  1668. menu_attach(icon_menu%,1,infohand%)
  1669.  main_menu%=FNcreate_menu("Encrypt,Info,Options,Help,Web Page")
  1670.  PROCmenu_attach(main_menu%,1,infohand%)
  1671. setoptswin
  1672.  PGPicon%=
  1673. grey(optshand%,4):PGP%=
  1674. updatePGP
  1675. updatehide
  1676. updatequery
  1677. updateverify
  1678. initflags
  1679. direrr%=
  1680. same%=
  1681. choiceshand%=
  1682. error%=
  1683. filestat$="n"
  1684. directory%=
  1685. query%=
  1686. PGPicon%=
  1687. Double%=
  1688. Verify%=
  1689. PGP%=
  1690. hide%=
  1691. recurse%=
  1692. Ramload%=
  1693. firstsave%=
  1694. Decrypt%=
  1695. Status$="E"
  1696. updated%=
  1697. Loaded%=
  1698. saving%=
  1699. dragging%=
  1700. waitingforack%=
  1701. mainopen%=
  1702. optsopen%=
  1703. filesincluded%=0
  1704. wkin%=-1
  1705. wkout%=-1
  1706. +Dfiletype$="230":Decryptfiletype$="230"
  1707. megamem%=
  1708. initsecmess
  1709.  OSCLI "RMEnsure Encrypt 0.03 RMRun <Encrypt$Dir>.Encrypt"
  1710.  OSCLI "RMEnsure Encrypt 0.03 Error Encrypt module cannot be found"
  1711. checkloaded
  1712. commandstring$," -quit ")
  1713. " -quit "
  1714. commandstring$,I%,1)=" ":I%+=1:
  1715. commandstring$+" "," ",I%+1)
  1716.  I%+=1:
  1717. commandstring$,I%,1)<>" "
  1718. commandstring$,I%)
  1719. f$+" "," ")-1)
  1720.  f$<>"" 
  1721. filetype(f$) 
  1722.  &230:
  1723. LoadFrom(f$)
  1724.  -2: 
  1725.  1,"File '"+f$+"' not found"
  1726.  f$=""
  1727. closemenu
  1728.  WimpCreateMenu%,,-1
  1729. writeblock(base%,size%)
  1730.  OSGBPB%,2,out%,base%,size%
  1731. readblock(base%,size%)
  1732.  OSGBPB%,4,in%,base%,size%
  1733. count(A%,B%,C%,
  1734.  complen%)
  1735. complen%=
  1736. (comp)
  1737. =(complen%<z2%!8)
  1738. firstbit(f$)
  1739. (f$)+1
  1740.     i%-=1
  1741.  i%=0 
  1742. f$,i%,1)="."
  1743. f$,i%-1)
  1744. readword
  1745.  i%=0 
  1746. i%?z2%=
  1747.     =!z2%
  1748. writeword(w%)
  1749. !junk%=w%
  1750.  i%=0 
  1751. #out%,junk%?i%
  1752. textaddr(infohand%,4)="Hello world!"
  1753. makemenus:
  1754. openmenu(menuhandle%,mainmenu%,menux%,menuy%)
  1755. initsecmess
  1756. secmess%=0
  1757.  count%,str$
  1758. count%=0
  1759.  str$
  1760.  str$<>"" 
  1761. textsecmess$(count%)=str$
  1762. count%+=1
  1763.  str$=""
  1764. len%=count%-1
  1765. secmesson%=0
  1766. secmess
  1767.  secmesson%=0 
  1768.  secmesson%=1:cyc%=
  1769. +100:pollmask%=0:
  1770.  pollmask%=1 
  1771.  pollmask%=0
  1772. cyc%=
  1773.  secmess%<=len%+4 
  1774.  secmess%>3 
  1775. textaddr(infohand%,11)=textsecmess$(secmess%-4):
  1776. iconredraw2(infohand%,11)
  1777.  secmess%<len%+4 
  1778.  secmess%<=3 
  1779. textaddr(infohand%,3)="
  1780.  Stephen Sloan 199"+
  1781. (secmess%+5):
  1782. iconredraw2(infohand%,10)
  1783.  secmess%>len%+4 
  1784. textaddr(infohand%,11)="Version "+version$:secmess%=-1:
  1785. iconredraw(infohand%,11)
  1786. secmess%+=1
  1787. iconredraw(w%,i%)
  1788. q%!0=w%
  1789. q%!4=i%
  1790.  WimpGetIconState%,,q%
  1791.  WimpForceRedraw%,q%!0,q%!8,q%!12,q%!16,q%!20
  1792. iconredraw2(w%,i%)
  1793. q%!0=w%
  1794. q%!4=i%
  1795.  WimpGetIconState%,,q%
  1796.  WimpForceRedraw%,q%!0,q%!8+1,q%!12+1,q%!16-1,q%!20-1
  1797. grey(hand%,icon%)
  1798. !q%=hand%:q%!4=icon%
  1799. q%!8=1<<22:q%!12=1<<22
  1800.  WimpSetIconState%,,q%
  1801. ungrey(hand%,icon%)
  1802. !q%=hand%:q%!4=icon%
  1803. q%!8=0:q%!12=1<<22
  1804.  WimpSetIconState%,,q%
  1805. greyed(hand%,icon%)
  1806. geticoninfo(hand%,icon%)
  1807. =(iconinf%!24 
  1808.  1<<22)>0
  1809. seticonon(hand%,icon%)
  1810. !q%=hand%:q%!4=icon%
  1811. q%!8=1<<21:q%!12=1<<21
  1812.  WimpSetIconState%,,q%
  1813. seticonoff(hand%,icon%)
  1814. !q%=hand%:q%!4=icon%
  1815. q%!8=0:q%!12=1<<21
  1816.  WimpSetIconState%,,q%
  1817. launch_acorn_URI(uri$)
  1818. uri_version% = 
  1819. uri_version
  1820.  uri_version% > 0 
  1821.  "URI_Dispatch",1,uri$+
  1822. (0),mytask% 
  1823.  uri_flags%,uri_handler_th%,uri_handle%;flags%
  1824.  uri_flags% 
  1825.  uri_version% = -2 : 
  1826.  URI Rejected can't process.
  1827. = uri_version%
  1828. uri_version
  1829.  version%,swi%
  1830.  "XOS_SWINumberFromString",,"URI_Version" 
  1831.  swi%;flags%
  1832.  (flags%
  1833. 1) = 0 
  1834.  "URI_Version" 
  1835.  version% 
  1836.  version% = -1
  1837. = version%
  1838. launchURI(uri$)
  1839.  Try Acorn
  1840.  IF FNlaunch_acorn_URI(uri$) < 0 THEN
  1841.  Not worked - try ANT
  1842. useful%!0=256
  1843. useful%!12=0
  1844. 'useful%!16=&4af80 : 
  1845.  wimp_MOPENURL
  1846. $(useful%+20)=uri$+
  1847.  WimpSendMessage%,18,useful%,0,0
  1848.  ENDIF
  1849. endcyc
  1850. textaddr(infohand%,11)="Version "+version$
  1851. textaddr(infohand%,3)="
  1852.  Stephen Sloan 1996-98"
  1853. secmess%=0
  1854. secmesson%=0
  1855. pollmask%=1
  1856.  "And God said:","
  1857. Thou shalt not buy PC
  1858. ","Program dedicated to","Hannah F
  1859. tterer.","A huge hi to"
  1860.  "everyone on the","Saint Michael
  1861. s","German Exchange 1996"
  1862.  "mainly","Christoph W
  1863. ssner and","Tillman W
  1864. rn.","Most respect ever","reserved for","Hannah F
  1865. tterer,","Also a big hello to","Lyndsay Webb","and Rena Trybocka","Yet more his to"
  1866.  "Madeline Lasco","and the insane lot","on the ESSkiA Trip 1996.","A special mention for","Laura McVicker","and the rest of the crew from","Saint Michael
  1867. s 1992-1997 "
  1868.  "Hi also to","the Runshaw College lot","and the","Park Hall","hotel staff"
  1869.  "especially","Claire Green",""Hi to anyone else","I haven
  1870. t mentioned","but should have.",""
  1871.