-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAcrylicConsole.dpr
129 lines (98 loc) · 3.92 KB
/
AcrylicConsole.dpr
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
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
program
AcrylicConsole;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
{$APPTYPE CONSOLE}
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
uses
Classes,
SysUtils,
Windows,
AcrylicVersionInfo in 'AcrylicVersionInfo.pas',
AddressCache in 'AddressCache.pas',
CommonUtils in 'CommonUtils.pas',
CommunicationChannels in 'CommunicationChannels.pas',
Configuration in 'Configuration.pas',
ConsoleTracerAgent in 'ConsoleTracerAgent.pas',
DnsForwarder in 'DnsForwarder.pas',
DnsOverHttpsCache in 'DnsOverHttpsCache.pas',
DnsProtocol in 'DnsProtocol.pas',
DnsResolver in 'DnsResolver.pas',
Environment in 'Environment.pas',
EnvironmentVariables in 'EnvironmentVariables.pas',
FileIO in 'FileIO.pas',
FileStreamLineEx in 'FileStreamLineEx.pas',
FileTracerAgent in 'FileTracerAgent.pas',
HitLogger in 'HitLogger.pas',
HostsCache in 'HostsCache.pas',
HostsCacheBinaryTrees in 'HostsCacheBinaryTrees.pas',
IPUtils in 'IPUtils.pas',
MD5 in 'MD5.pas',
MemoryManager in 'MemoryManager.pas',
MemoryStore in 'MemoryStore.pas',
PatternMatching in 'PatternMatching.pas',
PCRE in 'PCRE.pas',
PerlRegEx in 'PerlRegEx.pas',
SessionCache in 'SessionCache.pas',
Tracer in 'Tracer.pas',
WinHttp in 'WinHttp.pas',
WinSock in 'WinSock.pas';
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
var
i: Integer;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
var
NoLog: Boolean;
NoBanner: Boolean;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
begin
DecimalSeparator := '.';
SetConsoleCtrlHandler(nil, True);
if ((ParamCount = 1) and (ParamStr(1) = '/?')) then begin
WriteLn('==============================================================================');
WriteLn('Acrylic DNS Proxy Console');
WriteLn('==============================================================================');
WriteLn;
WriteLn('Usage:');
WriteLn(' AcrylicConsole.exe [/NoBanner] [/NoLog]');
WriteLn;
WriteLn('Options:');
WriteLn(' /NoBanner');
WriteLn(' Does not write the application banner to the console.');
WriteLn(' /NoLog');
WriteLn(' Does not write the application log to the console.');
WriteLn;
WriteLn('Examples:');
WriteLn(' AcrylicConsole.exe');
WriteLn(' AcrylicConsole.exe /NoBanner /NoLog');
Exit;
end;
NoLog := False;
NoBanner := False;
for i := 1 to ParamCount do begin
if (ParamStr(i) = '/NoLog') then NoLog := True else if (ParamStr(i) = '/NoBanner') then NoBanner := True;
end;
if not(NoBanner) then begin
WriteLn('==============================================================================');
WriteLn('Acrylic DNS Proxy Console Press ENTER To Quit');
WriteLn('==============================================================================');
end;
TConfiguration.Initialize; TTracer.Initialize; if not(NoLog) then TTracer.SetTracerAgent(TConsoleTracerAgent.Create);
if TTracer.IsEnabled then TTracer.Trace(TracePriorityInfo, 'Acrylic version is ' + AcrylicVersionNumber + ' released on ' + AcrylicReleaseDate + '.');
TDnsResolver.StartResolver;
ReadLn; // Wait until the ENTER key is pressed
TDnsResolver.StopResolver;
TTracer.Finalize; TConfiguration.Finalize;
end.