-
Notifications
You must be signed in to change notification settings - Fork 140
/
main.pas
12867 lines (11741 loc) · 374 KB
/
main.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
Copyright (C) 2002-2020 Massimo Melina (www.rejetto.com)
This file is part of HFS ~ HTTP File Server.
HFS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
HFS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with HFS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
}
{$INCLUDE defs.inc }
unit main;
interface
uses
// delphi libs
Windows, Messages, SysUtils, Forms, Menus, Graphics, Controls, ComCtrls, Dialogs, math,
registry, ExtCtrls, shellapi, ImgList, ToolWin, StdCtrls, strutils, AppEvnts, types,
winsock, clipbrd, shlobj, activex, Buttons, FileCtrl, dateutils, iniFiles, Classes,
System.ImageList, system.Generics.Collections, Vcl.Imaging.GIFImg,
// 3rd part libs. ensure you have all of these, the same version reported in dev-notes.txt
OverbyteIcsWSocket, OverbyteIcsHttpProt, regexpr, OverbyteIcsZLibHigh, OverbyteIcsZLibObj,
// rejetto libs
HSlib, traylib, monoLib, progFrmLib, classesLib;
const
VERSION = '2.4.0 RC8';
VERSION_BUILD = '320';
VERSION_STABLE = {$IFDEF STABLE } TRUE {$ELSE} FALSE {$ENDIF};
CURRENT_VFS_FORMAT :integer = 1;
CRLF = #13#10;
TAB = #9;
BAK_EXT = '.bak';
CORRUPTED_EXT = '.corrupted';
COMMENT_FILE_EXT = '.comment';
VFS_FILE_IDENTIFIER = 'HFS.VFS';
CFG_KEY = 'Software\rejetto\HFS';
CFG_FILE = 'hfs.ini';
TPL_FILE = 'hfs.tpl';
IPS_FILE = 'hfs.ips.txt';
VFS_TEMP_FILE = '~temp.vfs';
HFS_HTTP_AGENT = 'HFS/'+VERSION;
COMMENTS_FILE = 'hfs.comments.txt';
DESCRIPT_ION = 'descript.ion';
DIFF_TPL_FILE = 'hfs.diff.tpl';
FILELIST_TPL_FILE = 'hfs.filelist.tpl';
EVENTSCRIPTS_FILE = 'hfs.events';
MACROS_LOG_FILE = 'macros-log.html';
PREVIOUS_VERSION = 'hfs.old.exe';
SESSION_COOKIE = 'HFS_SID_';
PROTECTED_FILES_MASK = 'hfs.*;*.htm*;descript.ion;*.comment;*.md5;*.corrupted;*.lnk';
G_VAR_PREFIX = '#';
HOURS = 24;
MINUTES = HOURS*60;
SECONDS = MINUTES*60; // Tdatetime * SECONDS = time in seconds
ETA_FRAME = 5; // time frame for ETA (in seconds)
DOWNLOAD_MIN_REFRESH_TIME :Tdatetime = 1/3/SECONDS; // 3 Hz
BYTES_GROUPING_THRESHOLD :Tdatetime = 1/SECONDS; // group bytes in log
IPS_THRESHOLD = 50; // used to avoid an external file for few IPs (ipsEverConnected list)
STATUSBAR_REFRESH = 10; // tenth of second
MAX_RECENT_FILES = 5;
MANY_ITEMS_THRESHOLD = 1000;
KILO = 1024;
MEGA = KILO*KILO;
COMPRESSION_THRESHOLD = 10*KILO; // if more than X bytes, VFS files are compressed
STARTING_SNDBUF = 32000;
YESNO :array [boolean] of string=('no','yes');
DEFAULT_MIME = 'application/octet-stream';
IP_SERVICES_URL = 'http://hfsservice.rejetto.com/ipservices.php';
SELF_TEST_URL = 'http://hfstest.rejetto.com/';
USER_ANONYMOUS = '@anonymous';
USER_ANYONE = '@anyone';
USER_ANY_ACCOUNT = '@any account';
ALWAYS_ON_WEB_SERVER = 'google.com';
ADDRESS_COLOR = clGreen;
BG_ERROR = $BBBBFF;
ENCODED_TABLE_HEADER = 'this is an encoded table'+CRLF;
DEFAULT_MIME_TYPES: array [0..21] of string = (
'*.htm;*.html', 'text/html',
'*.jpg;*.jpeg;*.jpe', 'image/jpeg',
'*.gif', 'image/gif',
'*.png', 'image/png',
'*.bmp', 'image/bmp',
'*.ico', 'image/x-icon',
'*.mpeg;*.mpg;*.mpe', 'video/mpeg',
'*.avi', 'video/x-msvideo',
'*.txt', 'text/plain',
'*.css', 'text/css',
'*.js', 'text/javascript'
);
ICONMENU_NEW = 1;
ICON_UNIT = 31;
ICON_ROOT = 1;
ICON_LINK = 4;
ICON_FILE = 37;
ICON_FOLDER = 6;
ICON_REAL_FOLDER = 19;
ICON_LOCK = 12;
ICON_EASY = 29;
ICON_EXPERT = 35;
USER_ICON_MASKS_OFS = 10000;
resourcestring
S_PORT_LABEL = 'Port: %s';
S_PORT_ANY = 'any';
DISABLED = 'disabled';
S_OK = 'Ok';
// messages
MSG_MENU_VAL = ' (%s)';
MSG_DL_TIMEOUT = 'No downloads timeout';
MSG_MAX_CON = 'Max connections';
MSG_MAX_CON_SING = 'Max connections from single address';
MSG_MAX_SIM_ADDR = 'Max simultaneous addresses';
MSG_MAX_SIM_ADDR_DL = 'Max simultaneous addresses downloading';
MSG_MAX_SIM_DL_SING = 'Max simultaneous downloads from single address';
MSG_MAX_SIM_DL = 'Max simultaneous downloads';
MSG_SET_LIMIT = 'Set limit';
MSG_UNPROTECTED_LINKS = 'Links are NOT actually protected.'
+#13'The feature is there to be used with the "list protected items only..." option.'
+#13'Continue?';
MSG_SAME_NAME ='An item with the same name is already present in this folder.'
+#13'Continue?';
MSG_CONTINUE = 'Continue?';
MSG_PROCESSING = 'Processing...';
MSG_SPEED_KBS = '%.1f kB/s';
MSG_OPTIONS_SAVED = 'Options saved';
MSG_SOME_LOCKED = 'Some items were not affected because locked';
MSG_ITEM_LOCKED = 'The item is locked';
MSG_INVALID_VALUE = 'Invalid value';
MSG_EMPTY_NO_LIMIT = 'Leave blank to get no limits.';
MSG_ADDRESSES_EXCEED = 'The following addresses exceed the limit:'#13'%s';
MSG_NO_TEMP = 'Cannot save temporary file';
MSG_ERROR_REGISTRY = 'Can''t write to registry.'
+#13'You may lack necessary rights.';
MSG_MANY_ITEMS = 'You are putting many files.'
+#13'Try using real folders instead of virtual folders.'
+#13'Read documentation or ask on the forum for help.';
MSG_ADD_TO_HFS = '"Add to HFS" has been added to your Window''s Explorer right-click menu.';
MSG_SINGLE_INSTANCE = 'Sorry, this feature only works with the "Only 1 instance" option enabled.'
+#13#13'You can find this option under Menu -> Start/Exit'
+#13'(only in expert mode)';
MSG_ENABLED = 'Option enabled';
MSG_DISABLED = 'Option disabled';
MSG_COMM_ERROR = 'Network error. Request failed.';
MSG_CON_PAUSED = 'paused';
MSG_CON_SENT = '%s / %s sent';
MSG_CON_RECEIVED = '%s / %s received';
type
Pboolean = ^boolean;
TfileAttribute = (
FA_FOLDER, // folder kind
FA_VIRTUAL, // does not exist on disc
FA_ROOT, // only the root item has this attribute
FA_BROWSABLE, // permit listing of this folder (not recursive, only dir)
FA_HIDDEN, // hidden iterms won't be shown to browsers (not recursive)
{ no more used attributes have to stay for backward compatibility with
{ VFS files }
FA_NO_MORE_USED1,
FA_NO_MORE_USED2,
FA_TEMP, // this is a temporary item and is not part of the VFS
FA_HIDDENTREE, // recursive hidden
FA_LINK, // redirection
FA_UNIT, // logical unit (drive)
FA_VIS_ONLY_ANON, // visible only to anonymous users [no more used]
FA_DL_FORBIDDEN, // forbid download (not recursive)
FA_HIDE_EMPTY_FOLDERS, // (recursive)
FA_DONT_COUNT_AS_DL, // (not recursive)
FA_SOLVED_LNK,
FA_HIDE_EXT, // (recursive)
FA_DONT_LOG, // (recursive)
FA_ARCHIVABLE // (recursive)
);
TfileAttributes = set of TfileAttribute;
Tfile = class;
TconnData = class;
TfileCallbackReturn = set of (FCB_NO_DEEPER, FCB_DELETE, FCB_RECALL_AFTER_CHILDREN); // use FCB_* flags
// returning FALSE stops recursion
TfileCallback = function(f:Tfile; childrenDone:boolean; par, par2:integer):TfileCallbackReturn;
TfileAction = (FA_ACCESS, FA_DELETE, FA_UPLOAD);
Tfile = class (Tobject)
private
locked: boolean;
FDLcount: integer;
function getParent():Tfile;
function getDLcount():integer;
procedure setDLcount(i:integer);
function getDLcountRecursive():integer;
public
name, comment, user, pwd, lnk: string;
resource: string; // link to physical file/folder; URL for links
flags: TfileAttributes;
node: Ttreenode;
size: int64; // -1 is NULL
atime, // when was this file added to the VFS ?
mtime: Tdatetime; // modified time, read from disk
icon: integer;
accounts: array [TfileAction] of TStringDynArray;
filesFilter, foldersFilter, realm, diffTpl,
defaultFileMask, dontCountAsDownloadMask, uploadFilterMask: string;
constructor create(fullpath:string);
constructor createTemp(fullpath:string);
constructor createVirtualFolder(name:string);
constructor createLink(name:string);
property parent:Tfile read getParent;
property DLcount:integer read getDLcount write setDLcount;
function toggle(att:TfileAttribute):boolean;
function isFolder():boolean; inline;
function isFile():boolean; inline;
function isFileOrFolder():boolean; inline;
function isRealFolder():boolean; inline;
function isVirtualFolder():boolean; inline;
function isEmptyFolder(cd:TconnData=NIL):boolean;
function isRoot():boolean; inline;
function isLink():boolean; inline;
function isTemp():boolean; inline;
function isNew():boolean;
function isDLforbidden():boolean;
function url(fullEncode:boolean=FALSE):string;
function relativeURL(fullEncode:boolean=FALSE):string;
function pathTill(root:Tfile=NIL; delim:char='\'):string;
function parentURL():string;
function fullURL(ip, user, pwd:string):string; overload;
function fullURL(ip:string=''):string; overload;
procedure setupImage(newIcon:integer); overload;
procedure setupImage(); overload;
function getAccountsFor(action:TfileAction; specialUsernames:boolean=FALSE; outInherited:Pboolean=NIL):TstringDynArray;
function accessFor(username, password:string):boolean; overload;
function accessFor(cd:TconnData):boolean; overload;
function hasRecursive(attributes: TfileAttributes; orInsteadOfAnd:boolean=FALSE; outInherited:Pboolean=NIL):boolean; overload;
function hasRecursive(attribute: TfileAttribute; outInherited:Pboolean=NIL):boolean; overload;
function getSystemIcon():integer;
function getIconForTreeview():integer;
function getShownRealm():string;
function getFolder():string;
function getRecursiveFileMask():string;
function shouldCountAsDownload():boolean;
function getDefaultFile():Tfile;
procedure recursiveApply(callback:TfileCallback; par:integer=0; par2:integer=0);
procedure getFiltersRecursively(var files,folders:string);
function diskfree():int64;
function same(f:Tfile):boolean;
procedure setName(name:string);
procedure setResource(res:string);
function getDynamicComment(skipParent:boolean=FALSE):string;
procedure setDynamicComment(cmt:string);
function getRecursiveDiffTplAsStr(outInherited:Pboolean=NIL; outFromDisk:Pboolean=NIL):string;
// locking prevents modification of all its ancestors and descendants
procedure lock();
procedure unlock();
function isLocked():boolean;
end; // Tfile
Paccount = ^Taccount;
Taccount = record // user/pass profile
user, pwd, redir, notes: string;
wasUser: string; // used in user renaming panel
enabled, noLimits, group: boolean;
link: TStringDynArray;
end;
Taccounts = array of Taccount;
TfilterMethod = function(self:Tobject):boolean;
Thelp = ( HLP_NONE, HLP_TPL );
TdownloadingWhat = ( DW_UNK, DW_FILE, DW_FOLDERPAGE, DW_ICON, DW_ERROR, DW_ARCHIVE );
TpreReply = (PR_NONE, PR_BAN, PR_OVERLOAD);
TuploadResult = record
fn, reason:string;
speed:integer;
size: int64;
end;
Tsession = class
vars: THashedStringList;
created, ttl, expires: Tdatetime;
public
id, user, ip, redirect: string;
constructor create(const sid:string='');
destructor Destroy; override;
procedure setVar(const k,v:string);
function getVar(const k:string):string;
procedure keepAlive();
procedure setTTL(t:Tdatetime);
end;
Tsessions = Tdictionary<string,Tsession>;
TconnData = class // data associated to a client connection
private
FlastFile: Tfile;
procedure setLastFile(f:Tfile);
public
address: string; // this is address shown in the log, and it is not necessarily the same as the socket address
averageSpeed: real; { calculated on disconnection as bytesSent/totalTime. it is calculated also while
sending and it is different from conn.speed because conn.speed is average speed
in the last second, while averageSpeed is calculated on ETA_FRAME seconds }
time: Tdatetime; // connection start time
requestTime: Tdatetime; // last request start time
tray: TmyTrayicon;
tray_ico: Ticon;
lastFN: string;
countAsDownload: boolean; // cache the value for the Tfile method
{ cache User-Agent because often retrieved by connBox.
{ this value is filled after the http request is complete (HE_REQUESTED),
{ or before, during the request as we get a file (HE_POST_FILE). }
agent: string;
conn: ThttpConn;
account: Paccount;
user, pwd: string;
acceptedCredentials: boolean;
limiter: TspeedLimiter;
tpl: Ttpl;
deleting: boolean; // don't use, this item is about to be discarded
nextDloadScreenUpdate: Tdatetime; // avoid too fast updating during download
disconnectReason: string;
error: string; // error details
eta: record
idx: integer; // estimation time (seconds)
data: array [0..ETA_FRAME-1] of real; // accumulates speed data
result: Tdatetime;
end;
downloadingWhat: TdownloadingWhat;
preReply: TpreReply;
banReason: string;
lastBytesSent, lastBytesGot: int64; // used for print to log only the recent amount of bytes
lastActivityTime, fileXferStart: Tdatetime;
uploadSrc, uploadDest: string;
uploadFailed: string; // reason (empty on success)
uploadResults: array of TuploadResult;
disconnectAfterReply, logLaterInApache, dontLog, fullDLlogged: boolean;
bytesGotGrouping, bytesSentGrouping: record
bytes: integer;
since: Tdatetime;
end;
session: Tsession;
vars, // defined by {.set.}
urlvars, // as $_GET in php
postVars // as $_POST in php
: THashedStringList;
tplCounters: TstringToIntHash;
workaroundForIEutf8: (WI_toDetect, WI_yes, WI_no);
{ here we put just a pointer because the file type would triplicate
{ the size of this record, while it is NIL for most connections }
f: ^file; // uploading file handle
property lastFile:Tfile read FlastFile write setLastFile;
constructor create(conn:ThttpConn);
destructor Destroy; override;
procedure disconnect(reason:string);
procedure logout();
end; // Tconndata
Tautosave = record
every, minimum: integer; // in seconds
last: Tdatetime;
menu: Tmenuitem;
end;
TtreeNodeDynArray = array of TtreeNode;
TstringIntPairs = array of record
str:string;
int:integer;
end;
TmainFrm = class(TForm)
filemenu: TPopupMenu;
newfolder1: TMenuItem;
images: TImageList;
Remove1: TMenuItem;
topToolbar: TToolBar;
startBtn: TToolButton;
ToolButton1: TToolButton;
menuBtn: TToolButton;
menu: TPopupMenu;
About1: TMenuItem;
connmenu: TPopupMenu;
Kickconnection1: TMenuItem;
KickIPaddress1: TMenuItem;
Kickallconnections1: TMenuItem;
Viewhttprequest1: TMenuItem;
Saveoptions1: TMenuItem;
toregistrycurrentuser1: TMenuItem;
tofile1: TMenuItem;
toregistryallusers1: TMenuItem;
timer: TTimer;
urlToolbar: TToolBar;
IPaddress1: TMenuItem;
AutocopyURLonadditionChk: TMenuItem;
foldersbeforeChk: TMenuItem;
Browseit1: TMenuItem;
Openit1: TMenuItem;
appEvents: TApplicationEvents;
logmenu: TPopupMenu;
DumprequestsChk: TMenuItem;
CopyURL1: TMenuItem;
Readonly1: TMenuItem;
Clear1: TMenuItem;
Copy1: TMenuItem;
N3: TMenuItem;
LogtimeChk: TMenuItem;
LogdateChk: TMenuItem;
Saveas1: TMenuItem;
Save1: TMenuItem;
N4: TMenuItem;
connPnl: TPanel;
MinimizetotrayChk: TMenuItem;
Restore1: TMenuItem;
Numberofcurrentconnections1: TMenuItem;
Numberofloggeddownloads1: TMenuItem;
Numberofloggedhits1: TMenuItem;
Exit1: TMenuItem;
Shellcontextmenu1: TMenuItem;
Flashtaskbutton1: TMenuItem;
onDownloadChk: TMenuItem;
onconnectionChk: TMenuItem;
never1: TMenuItem;
N6: TMenuItem;
startminimizedChk: TMenuItem;
N7: TMenuItem;
trayicons1: TMenuItem;
trayfordownloadChk: TMenuItem;
N8: TMenuItem;
Loadfilesystem1: TMenuItem;
Savefilesystem1: TMenuItem;
N1: TMenuItem;
N12: TMenuItem;
usesystemiconsChk: TMenuItem;
N13: TMenuItem;
Officialwebsite1: TMenuItem;
numbers: TImageList;
showmaintrayiconChk: TMenuItem;
Speedlimit1: TMenuItem;
N10: TMenuItem;
Limits1: TMenuItem;
Maxconnections1: TMenuItem;
Maxconnectionsfromsingleaddress1: TMenuItem;
Weblinks1: TMenuItem;
Forum1: TMenuItem;
FAQ1: TMenuItem;
License1: TMenuItem;
Paste1: TMenuItem;
Addfiles1: TMenuItem;
Addfolder1: TMenuItem;
graphSplitter: TSplitter;
Graphrefreshrate1: TMenuItem;
Pausestreaming1: TMenuItem;
Setuserpass1: TMenuItem;
BanIPaddress1: TMenuItem;
N2: TMenuItem;
BannedIPaddresses1: TMenuItem;
Loadrecentfiles1: TMenuItem;
alwaysontopChk: TMenuItem;
Checkforupdates1: TMenuItem;
Rename1: TMenuItem;
Otheroptions1: TMenuItem;
Nodownloadtimeout1: TMenuItem;
Autoclose1: TMenuItem;
Showbandwidthgraph1: TMenuItem;
Pause1: TMenuItem;
reloadonstartupChk: TMenuItem;
MIMEtypes1: TMenuItem;
autocopyURLonstartChk: TMenuItem;
Accounts1: TMenuItem;
encodenonasciiChk: TMenuItem;
encodeSpacesChk: TMenuItem;
URLencoding1: TMenuItem;
traymessage1: TMenuItem;
DMbrowserTplChk: TMenuItem;
Guide1: TMenuItem;
autosaveVFSchk: TMenuItem;
sendHFSidentifierChk: TMenuItem;
persistentconnectionsChk: TMenuItem;
Logfile1: TMenuItem;
VirtualFileSystem1: TMenuItem;
listfileswithhiddenattributeChk: TMenuItem;
listfileswithsystemattributeChk: TMenuItem;
hideProtectedItemsChk: TMenuItem;
StartExit1: TMenuItem;
Font1: TMenuItem;
Newlink1: TMenuItem;
SetURL1: TMenuItem;
usecommentasrealmChk: TMenuItem;
Resetuserpass1: TMenuItem;
Switchtovirtual1: TMenuItem;
LogiconsChk: TMenuItem;
Loginrealm1: TMenuItem;
Logwhat1: TMenuItem;
N9: TMenuItem;
N16: TMenuItem;
logconnectionsChk: TMenuItem;
logDisconnectionsChk: TMenuItem;
logRequestsChk: TMenuItem;
logRepliesChk: TMenuItem;
logFulldownloadsChk: TMenuItem;
logBytesreceivedChk: TMenuItem;
logBytessentChk: TMenuItem;
logServerstartChk: TMenuItem;
logServerstopChk: TMenuItem;
logBrowsingChk: TMenuItem;
Help1: TMenuItem;
Introduction1: TMenuItem;
N18: TMenuItem;
Resetfileshits1: TMenuItem;
Kickidleconnections1: TMenuItem;
Connectionsinactivitytimeout1: TMenuItem;
logOnVideoChk: TMenuItem;
N19: TMenuItem;
Clearfilesystem1: TMenuItem;
HintsfornewcomersChk: TMenuItem;
logUploadsChk: TMenuItem;
only1instanceChk: TMenuItem;
compressedbrowsingChk: TMenuItem;
Numberofloggeduploads1: TMenuItem;
logProgressChk: TMenuItem;
Flagfilesaddedrecently1: TMenuItem;
Flagasnew1: TMenuItem;
confirmexitChk: TMenuItem;
Donotlogaddress1: TMenuItem;
N15: TMenuItem;
Custom1: TMenuItem;
noPortInUrlChk: TMenuItem;
saveTotalsChk: TMenuItem;
Findexternaladdress1: TMenuItem;
findExtOnStartupChk: TMenuItem;
DynamicDNSupdater1: TMenuItem;
Custom2: TMenuItem;
N21: TMenuItem;
CJBtemplate1: TMenuItem;
NoIPtemplate1: TMenuItem;
DynDNStemplate1: TMenuItem;
searchbetteripChk: TMenuItem;
deletePartialUploadsChk: TMenuItem;
Minimumdiskspace1: TMenuItem;
Banthisaddress1: TMenuItem;
modalOptionsChk: TMenuItem;
Address2name1: TMenuItem;
Resetnewflag1: TMenuItem;
beepChk: TMenuItem;
Renamepartialuploads1: TMenuItem;
SelfTest1: TMenuItem;
Opendirectlyinbrowser1: TMenuItem;
maxDLs1: TMenuItem;
Editresource1: TMenuItem;
logBannedChk: TMenuItem;
ToolButton2: TToolButton;
modeBtn: TToolButton;
Addfiles2: TMenuItem;
Addfolder2: TMenuItem;
Clearoptionsandquit1: TMenuItem;
numberFilesOnUploadChk: TMenuItem;
Upload2: TMenuItem;
UninstallHFS1: TMenuItem;
maxIPs1: TMenuItem;
maxIPsDLing1: TMenuItem;
keepBakUpdatingChk: TMenuItem;
Autosaveevery1: TMenuItem;
autoSaveOptionsChk: TMenuItem;
Apachelogfileformat1: TMenuItem;
SwitchON1: TMenuItem;
loadSingleCommentsChk: TMenuItem;
Bindroottorealfolder1: TMenuItem;
Unbindroot1: TMenuItem;
Switchtorealfolder1: TMenuItem;
abortBtn: TToolButton;
Seelastserverresponse1: TMenuItem;
N5: TMenuItem;
logOtherEventsChk: TMenuItem;
supportDescriptionChk: TMenuItem;
Showcustomizedoptions1: TMenuItem;
useISOdateChk: TMenuItem;
browseUsingLocalhostChk: TMenuItem;
Addingfolder1: TMenuItem;
askFolderKindChk: TMenuItem;
defaultToVirtualChk: TMenuItem;
defaultToRealChk: TMenuItem;
enableNoDefaultChk: TMenuItem;
RunHFSwhenWindowsstarts1: TMenuItem;
trayInsteadOfQuitChk: TMenuItem;
Addicons1: TMenuItem;
Iconmasks1: TMenuItem;
CopyURLwithpassword1: TMenuItem;
CopyURLwithdifferentaddress1: TMenuItem;
hisIPaddressisusedforURLbuilding1: TMenuItem;
N20: TMenuItem;
Acceptconnectionson1: TMenuItem;
Anyaddress1: TMenuItem;
autoCommentChk: TMenuItem;
fingerprintsChk: TMenuItem;
CopyURLwithfingerprint1: TMenuItem;
recursiveListingChk: TMenuItem;
Disable1: TMenuItem;
logOnlyServedChk: TMenuItem;
Fingerprints1: TMenuItem;
saveNewFingerprintsChk: TMenuItem;
Createfingerprintonaddition1: TMenuItem;
pwdInPagesChk: TMenuItem;
deleteDontAskChk: TMenuItem;
Updates1: TMenuItem;
updateDailyChk: TMenuItem;
N22: TMenuItem;
Howto1: TMenuItem;
testerUpdatesChk: TMenuItem;
Defaultsorting1: TMenuItem;
Name1: TMenuItem;
Size1: TMenuItem;
Time1: TMenuItem;
Hits1: TMenuItem;
centralPnl: TPanel;
splitV: TSplitter;
browseBtn: TToolButton;
Resettotals1: TMenuItem;
Clearandresettotals1: TMenuItem;
Dontlogsomefiles1: TMenuItem;
preventLeechingChk: TMenuItem;
NumberofdifferentIPaddresses1: TMenuItem;
NumberofdifferentIPaddresseseverconnected1: TMenuItem;
Addresseseverconnected1: TMenuItem;
N24: TMenuItem;
Allowedreferer1: TMenuItem;
ToolButton4: TToolButton;
oemForIonChk: TMenuItem;
portBtn: TToolButton;
resetOptions1: TMenuItem;
quitWithoutAskingToSaveChk: TMenuItem;
highSpeedChk: TMenuItem;
freeLoginChk: TMenuItem;
backupSavingChk: TMenuItem;
graphMenu: TPopupMenu;
Reset1: TMenuItem;
Extension1: TMenuItem;
linksBeforeChk: TMenuItem;
updateAutomaticallyChk: TMenuItem;
stopSpidersChk: TMenuItem;
logPnl: TPanel;
logBox: TRichEdit;
filesPnl: TPanel;
filesBox: TTreeView;
logTitle: TPanel;
filesTitle: TPanel;
graphBox: TPaintBox;
dumpTrafficChk: TMenuItem;
httpsUrlsChk: TMenuItem;
Hide: TMenuItem;
Speedlimitforsingleaddress1: TMenuItem;
macrosLogChk: TMenuItem;
Debug1: TMenuItem;
preventStandbyChk: TMenuItem;
titlePnl: TPanel;
HTMLtemplate1: TMenuItem;
Edit1: TMenuItem;
Changefile1: TMenuItem;
Changeeditor1: TMenuItem;
Restoredefault1: TMenuItem;
logToolbar: TPanel;
splitH: TSplitter;
collapsedPnl: TPanel;
expandBtn: TSpeedButton;
expandedPnl: TPanel;
openLogBtn: TSpeedButton;
searchPnl: TPanel;
logSearchBox: TLabeledEdit;
logUpDown: TUpDown;
openFilteredLog: TSpeedButton;
collapseBtn: TSpeedButton;
copyBtn: TToolButton;
urlBox: TEdit;
Bevel1: TBevel;
enableMacrosChk: TMenuItem;
Donate1: TMenuItem;
Purge1: TMenuItem;
Editeventscripts1: TMenuItem;
maxDLsIP1: TMenuItem;
Maxlinesonscreen1: TMenuItem;
Properties1: TMenuItem;
N11: TMenuItem;
restoreCfgBtn: TToolButton;
N14: TMenuItem;
Runscript1: TMenuItem;
Changeport1: TMenuItem;
logDeletionsChk: TMenuItem;
showMemUsageChk: TMenuItem;
trayiconforeachdownload1: TMenuItem;
tabOnLogFileChk: TMenuItem;
noContentdispositionChk: TMenuItem;
Defaultpointtoaddfiles1: TMenuItem;
switchMode: TMenuItem;
sbar: TStatusBar;
connBox: TListView;
Reverttopreviousversion1: TMenuItem;
updateBtn: TToolButton;
delayUpdateChk: TMenuItem;
oemTarChk: TMenuItem;
procedure FormResize(Sender: TObject);
procedure filesBoxCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean);
procedure newfolder1Click(Sender: TObject);
procedure filesBoxEditing(Sender: TObject; Node: TTreeNode; var AllowEdit: Boolean);
procedure filesBoxEdited(Sender: TObject; Node: TTreeNode; var S: String);
procedure Remove1Click(Sender: TObject);
procedure startBtnClick(Sender: TObject);
procedure filesBoxChange(Sender: TObject; Node: TTreeNode);
procedure Kickconnection1Click(Sender: TObject);
procedure Kickallconnections1Click(Sender: TObject);
procedure KickIPaddress1Click(Sender: TObject);
procedure Viewhttprequest1Click(Sender: TObject);
procedure connmenuPopup(Sender: TObject);
procedure filemenuPopup(Sender: TObject);
procedure About1Click(Sender: TObject);
procedure timerEvent(Sender: TObject);
procedure menuPopup(Sender: TObject);
procedure filesBoxDblClick(Sender: TObject);
procedure filesBoxMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure filesBoxCompare(Sender: TObject; Node1, Node2: TTreeNode;
Data: Integer; var Compare: Integer);
procedure foldersbeforeChkClick(Sender: TObject);
procedure Browseit1Click(Sender: TObject);
procedure Openit1Click(Sender: TObject);
procedure splitVMoved(Sender: TObject);
procedure appEventsShowHint(var HintStr: String;
var CanShow: Boolean; var HintInfo: THintInfo);
procedure logmenuPopup(Sender: TObject);
procedure Readonly1Click(Sender: TObject);
procedure Clear1Click(Sender: TObject);
procedure Copy1Click(Sender: TObject);
procedure Saveas1Click(Sender: TObject);
procedure Save1Click(Sender: TObject);
procedure Clearoptionsandquit1click(Sender: TObject);
procedure appEventsMinimize(Sender: TObject);
procedure appEventsRestore(Sender: TObject);
procedure Restore1Click(Sender: TObject);
procedure Numberofcurrentconnections1Click(Sender: TObject);
procedure Numberofloggeddownloads1Click(Sender: TObject);
procedure Numberofloggedhits1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
procedure onDownloadChkClick(Sender: TObject);
procedure onconnectionChkClick(Sender: TObject);
procedure never1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure filesBoxDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure filesBoxDragDrop(Sender, Source: TObject; X, Y: Integer);
procedure Savefilesystem1Click(Sender: TObject);
procedure filesBoxDeletion(Sender: TObject; Node: TTreeNode);
procedure Loadfilesystem1Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure Officialwebsite1Click(Sender: TObject);
procedure showmaintrayiconChkClick(Sender: TObject);
procedure Speedlimit1Click(Sender: TObject);
procedure tofile1Click(Sender: TObject);
procedure Maxconnections1Click(Sender: TObject);
procedure Maxconnectionsfromsingleaddress1Click(Sender: TObject);
procedure Forum1Click(Sender: TObject);
procedure FAQ1Click(Sender: TObject);
procedure License1Click(Sender: TObject);
procedure Paste1Click(Sender: TObject);
procedure Addfiles1Click(Sender: TObject);
procedure Addfolder1Click(Sender: TObject);
procedure graphSplitterMoved(Sender: TObject);
procedure Graphrefreshrate1Click(Sender: TObject);
procedure Pausestreaming1Click(Sender: TObject);
procedure Comment1Click(Sender: TObject);
procedure filesBoxCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
procedure Setuserpass1Click(Sender: TObject);
procedure browseBtnClick(Sender: TObject);
procedure BanIPaddress1Click(Sender: TObject);
procedure BannedIPaddresses1Click(Sender: TObject);
procedure FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Checkforupdates1Click(Sender: TObject);
procedure Rename1Click(Sender: TObject);
procedure Nodownloadtimeout1Click(Sender: TObject);
procedure alwaysontopChkClick(Sender: TObject);
procedure Showbandwidthgraph1Click(Sender: TObject);
procedure Pause1Click(Sender: TObject);
procedure MIMEtypes1Click(Sender: TObject);
procedure Accounts1Click(Sender: TObject);
procedure traymessage1Click(Sender: TObject);
procedure Guide1Click(Sender: TObject);
procedure filesBoxAddition(Sender: TObject; Node: TTreeNode);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Logfile1Click(Sender: TObject);
procedure Font1Click(Sender: TObject);
procedure Newlink1Click(Sender: TObject);
procedure SetURL1Click(Sender: TObject);
procedure Resetuserpass1Click(Sender: TObject);
procedure Switchtovirtual1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure Loginrealm1Click(Sender: TObject);
procedure Introduction1Click(Sender: TObject);
procedure Resetfileshits1Click(Sender: TObject);
procedure persistentconnectionsChkClick(Sender: TObject);
procedure Kickidleconnections1Click(Sender: TObject);
procedure Connectionsinactivitytimeout1Click(Sender: TObject);
procedure splitHMoved(Sender: TObject);
procedure Clearfilesystem1Click(Sender: TObject);
procedure Numberofloggeduploads1Click(Sender: TObject);
procedure Flagfilesaddedrecently1Click(Sender: TObject);
procedure Flagasnew1Click(Sender: TObject);
procedure Donotlogaddress1Click(Sender: TObject);
procedure Custom1Click(Sender: TObject);
procedure Findexternaladdress1Click(Sender: TObject);
procedure sbarDblClick(Sender: TObject);
procedure NoIPtemplate1Click(Sender: TObject);
procedure Custom2Click(Sender: TObject);
procedure CJBtemplate1Click(Sender: TObject);
procedure DynDNStemplate1Click(Sender: TObject);
procedure Minimumdiskspace1Click(Sender: TObject);
procedure Banthisaddress1Click(Sender: TObject);
procedure Address2name1Click(Sender: TObject);
procedure Resetnewflag1Click(Sender: TObject);
procedure Renamepartialuploads1Click(Sender: TObject);
procedure SelfTest1Click(Sender: TObject);
procedure Opendirectlyinbrowser1Click(Sender: TObject);
procedure noPortInUrlChkClick(Sender: TObject);
procedure maxDLs1Click(Sender: TObject);
procedure MaxDLsIP1Click(Sender: TObject);
procedure Editresource1Click(Sender: TObject);
procedure modeBtnClick(Sender: TObject);
procedure Shellcontextmenu1Click(Sender: TObject);
procedure UninstallHFS1Click(Sender: TObject);
procedure maxIPs1Click(Sender: TObject);
procedure maxIPsDLing1Click(Sender: TObject);
procedure Autosaveevery1Click(Sender: TObject);
procedure CopyURL1Click(Sender: TObject);
procedure Apachelogfileformat1Click(Sender: TObject);
procedure Bindroottorealfolder1Click(Sender: TObject);
procedure Unbindroot1Click(Sender: TObject);
procedure Switchtorealfolder1Click(Sender: TObject);
procedure abortBtnClick(Sender: TObject);
procedure Seelastserverresponse1Click(Sender: TObject);
procedure Showcustomizedoptions1Click(Sender: TObject);
procedure useISOdateChkClick(Sender: TObject);
procedure RunHFSwhenWindowsstarts1Click(Sender: TObject);
procedure askFolderKindChkClick(Sender: TObject);
procedure defaultToVirtualChkClick(Sender: TObject);
procedure defaultToRealChkClick(Sender: TObject);
procedure Addicons1Click(Sender: TObject);
procedure Iconmasks1Click(Sender: TObject);
procedure Anyaddress1Click(Sender: TObject);
procedure filesBoxEndDrag(Sender, Target: TObject; X, Y: Integer);
procedure CopyURLwithfingerprint1Click(Sender: TObject);
procedure Disable1Click(Sender: TObject);
procedure saveNewFingerprintsChkClick(Sender: TObject);
procedure Createfingerprintonaddition1Click(Sender: TObject);
procedure Howto1Click(Sender: TObject);
procedure Name1Click(Sender: TObject);
procedure Size1Click(Sender: TObject);
procedure Time1Click(Sender: TObject);
procedure Hits1Click(Sender: TObject);
procedure Resettotals1Click(Sender: TObject);
procedure menuBtnClick(Sender: TObject);
procedure Clearandresettotals1Click(Sender: TObject);
procedure Dontlogsomefiles1Click(Sender: TObject);
procedure NumberofdifferentIPaddresses1Click(Sender: TObject);
procedure NumberofdifferentIPaddresseseverconnected1Click(Sender: TObject);
procedure Addresseseverconnected1Click(Sender: TObject);
procedure Allowedreferer1Click(Sender: TObject);
procedure filesBoxEnter(Sender: TObject);
procedure filesBoxMouseEnter(Sender: TObject);
procedure filesBoxMouseLeave(Sender: TObject);
procedure filesBoxExit(Sender: TObject);
procedure sbarMouseDown(Sender: TObject; Button: TMouseButton; shift: TShiftState; X, Y: Integer);
procedure portBtnClick(Sender: TObject);
procedure SwitchON1Click(Sender: TObject);
procedure resetOptions1Click(Sender: TObject);
procedure Reset1Click(Sender: TObject);
procedure Extension1Click(Sender: TObject);
procedure findExtOnStartupChkClick(Sender: TObject);
procedure openLogBtnClick(Sender: TObject);
procedure logSearchBoxKeyPress(Sender: TObject; var Key: Char);
procedure graphBoxPaint(Sender: TObject);
procedure logUpDownClick(Sender: TObject; Button: TUDBtnType);
procedure logSearchBoxChange(Sender: TObject);
procedure HideClick(Sender: TObject);
procedure Speedlimitforsingleaddress1Click(Sender: TObject);
procedure Edit1Click(Sender: TObject);
procedure Restoredefault1Click(Sender: TObject);
procedure Changefile1Click(Sender: TObject);
procedure Changeeditor1Click(Sender: TObject);
procedure expandBtnClick(Sender: TObject);
procedure collapseBtnClick(Sender: TObject);
procedure copyBtnClick(Sender: TObject);
procedure urlBoxChange(Sender: TObject);
procedure enableMacrosChkClick(Sender: TObject);
procedure Donate1Click(Sender: TObject);
procedure Purge1Click(Sender: TObject);
procedure Editeventscripts1Click(Sender: TObject);
procedure Maxlinesonscreen1Click(Sender: TObject);
procedure Properties1Click(Sender: TObject);
procedure filesBoxMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure restoreCfgBtnClick(Sender: TObject);
procedure Runscript1Click(Sender: TObject);
procedure logBoxChange(Sender: TObject);
procedure logBoxMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Changeport1Click(Sender: TObject);
procedure trayiconforeachdownload1Click(Sender: TObject);
procedure Defaultpointtoaddfiles1Click(Sender: TObject);
function appEventsHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
procedure connBoxData(Sender: TObject; Item: TListItem);
procedure connBoxAdvancedCustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
Stage: TCustomDrawStage; var DefaultDraw: Boolean);
procedure Reverttopreviousversion1Click(Sender: TObject);
procedure updateBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
function searchLog(dir:integer):boolean;
function getGraphPic(cd:TconnData=NIL): ansistring;
procedure WMDropFiles(var msg:TWMDropFiles);
message WM_DROPFILES;
procedure WMQueryEndSession(var msg:TWMQueryEndSession);
message WM_QUERYENDSESSION;
procedure WMEndSession(var msg:TWMEndSession);
message WM_ENDSESSION;
procedure WMNCLButtonDown(var msg:TWMNCLButtonDown);
message WM_NCLBUTTONDOWN;
procedure trayEvent(sender:Tobject; ev:TtrayEvent);
procedure downloadtrayEvent(sender:Tobject; ev:TtrayEvent);
procedure httpEvent(event:ThttpEvent; conn:ThttpConn);
function addFileRecur(f:Tfile; parent:Ttreenode=NIL):Tfile;
function pointedFile(strict:boolean=TRUE):Tfile;
function pointedConnection():TconnData;
procedure updateSbar();
function getFolderPage(folder:Tfile; cd:TconnData; otpl:Tobject):string;
procedure getPage(sectionName:string; data:TconnData; f:Tfile=NIL; tpl2use:Ttpl=NIL);
function selectedConnection():TconnData;
function sendPic(cd:TconnData; idx:integer=-1):boolean;
procedure ipmenuclick(sender:Tobject);
procedure acceptOnMenuclick(sender:Tobject);
procedure copyURLwithAddressMenuClick(sender:Tobject);
procedure copyURLwithPasswordMenuClick(sender:Tobject);
procedure updateTrayTip();
procedure updateCopyBtn();
procedure setTrayShows(s:string);
procedure addTray();
procedure refreshConn(conn:TconnData);
function getVFS(node:Ttreenode=NIL):ansistring;
procedure setVFS(vfs:ansistring; node:Ttreenode=NIL);
procedure setnoDownloadTimeout(v:integer);
procedure addDropFiles(hnd:Thandle; under:Ttreenode);
procedure pasteFiles();
function addFilesFromString(files:string; under:Ttreenode=NIL):Tfile;
procedure setGraphRate(v:integer);
procedure updateRecentFilesMenu();
procedure recentsClick(sender:Tobject);
procedure popupMainMenu();
procedure updateAlwaysOnTop();
procedure initVFS();
procedure refreshIPlist();
procedure updateUrlBox();
procedure loadVFS(fn:string);
procedure compressReply(cd:TconnData);
procedure purgeConnections();
procedure setEasyMode(easy:boolean=TRUE);
procedure hideGraph();
procedure showGraph();
function fileAttributeInSelection(fa:TfileAttribute):boolean;
procedure progFrmHttpGetUpdate(sender:TObject; buffer:pointer; Len:integer);
procedure recalculateGraph();
public
procedure statusBarHttpGetUpdate(sender:TObject; buffer:pointer; Len:integer);
procedure remove(node:Ttreenode=NIL);
function setCfg(cfg:string; alreadyStarted:boolean=TRUE):boolean;
function getCfg(exclude:string=''):string;
function saveCFG():boolean;
function addFile(f:Tfile; parent:Ttreenode=NIL; skipComment:boolean=FALSE):Tfile;
procedure add2log(lines:string; cd:TconnData=NIL; clr:Tcolor=Graphics.clDefault);
function findFilebyURL(url:string; parent:Tfile=NIL; allowTemp:boolean=TRUE):Tfile;
function ipPointedInLog():string;
procedure saveVFS(fn:string='');
function finalInit():boolean;