-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQCheckify.dpr
More file actions
44 lines (37 loc) · 1.52 KB
/
Copy pathQCheckify.dpr
File metadata and controls
44 lines (37 loc) · 1.52 KB
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
program QCheckify;
uses
Vcl.Forms,
Windows,
SysUtils,
uQCEngine in 'Units\Units_Helper\uQCEngine.pas',
CRCArraysTable in 'Units\Units_Helper\CRCArraysTable.pas',
uResourceProtector in 'Units\Units_Helper\uResourceProtector.pas',
QCUnit1 in 'Units\Checkify\QCUnit1.pas' {HashChecksum},
uStrings in 'Units\Units_Helper\uStrings.pas';
{$R '_Libraries\ResCheckify.res'}
// {$R '_Libraries\Chekcsum.res'}
const
FormResources: array[0..0] of record Name: string; Hash: string; ResType: PChar; end = (
(Name: 'THashChecksum'; Hash: '2FE84DAE3F945122B1439F2DE1EEB2EC'; ResType: RT_RCDATA) );
procedure CheckFormsHashIntegrity;
var i: Integer; ActualHash: string; MyExeName: string;
begin
MyExeName := ExtractFileName(ParamStr(0));
for i := 0 to High(FormResources) do
begin
ActualHash := CalculateUniversalResourceHash(FormResources[i].Name, FormResources[i].ResType);
if (ActualHash = 'ERROR') or (not SameText(ActualHash, FormResources[i].Hash)) then
begin
MessageBoxW(Application.Handle, PWideChar('The application was unable to start correctly (0xC0000005).' + sLineBreak + 'Click OK to close the application.'), PWideChar(MyExeName + ' - Application Error'), MB_OK or MB_ICONERROR or MB_TOPMOST);
Halt(1);
end;
end;
end;
begin
CheckFormsHashIntegrity;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.Title := MY_APP_NAME_CHECKIFY;
Application.CreateForm(THashChecksum, HashChecksum);
Application.Run;
end.