• R/O
  • SSH
  • HTTPS

zolm: Commit


Commit MetaInfo

Revisión82 (tree)
Tiempo2017-12-26 06:19:53
Autorderekwildstar

Log Message

Tentativas de proteger um executável

Cambiar Resumen

Diferencia incremental

--- trunk/CLIENTE/BIN/Proteção Binária.txt (nonexistent)
+++ trunk/CLIENTE/BIN/Proteção Binária.txt (revision 82)
@@ -0,0 +1,29 @@
1+1. Em cada unit do projeto a ser protegido, ou no mínimo em uma unit, inclua o seguinte bloco de código no final:
2+
3+{$I DEBUG.inc}
4+{$I CRC32.inc}
5+{$I DLL.inc}
6+
7+initialization
8+
9+DebugCheck;
10+DLLCheck;
11+VerificarCRC32(GetModuleName(HInstance));
12+
13+Caso a unit já contenha uma seção initialization, ajuste para que haja estas linhas
14+
15+2. Em cada unit onde o passo 1 foi executado, inclua na cláusula uses "TlHelp32" e "Windows", caso não existam
16+
17+3. Compile o executável e gere a partir dele seu CRC32 usando p CRC32Gen. Você pode arrastar o executável em cima
18+ do executável do CRC32Gen para gerar o arquivo .crc
19+
20+4. Para DLLs o procedimento é o mesmo, apenas diferente é o bloco protetor, o qual deverá ser:
21+
22+{$I DEBUG.inc}
23+{$I CRC32.inc}
24+
25+initialization
26+
27+DebugCheck;
28+VerificarCRC32(GetModuleName(HInstance));
29+VerificarCRC32(ParamStr(0));
--- trunk/CLIENTE/BIN/petite.txt (nonexistent)
+++ trunk/CLIENTE/BIN/petite.txt (revision 82)
@@ -0,0 +1,378 @@
1+Petite 2.4
2+Copyright (c) 1998-2015 Un4seen Developments Ltd. All rights reserved.
3+
4+Files that you should have found in the Petite package
5+======================================================
6+PETITE.EXE The Petite executable (console version)
7+PETGUI.EXE The Petite executable (GUI version)
8+PETITE.TXT This file
9+
10+
11+What's the point?
12+=================
13+Petite is a Win32 (Windows 95/98/2000/NT/XP/Vista/7/etc) executable
14+compressor. It allows compression of the whole executable - code, data and
15+resources. Petite automatically decides which parts of the executable can
16+be compressed and which parts need to be left as they are. The compressed
17+executable can be run as if it was the original uncompressed version.
18+
19+
20+Why "Petite"?
21+=============
22+The file format of Win32 executables is called the "Portable Executable"
23+file format, "PE" for short. Petite means "of small and dainty build",
24+which kind of describes the executables after they have been compressed!
25+And, Petite obviously begins with "PE"! Clever huh? :)
26+
27+
28+Main Features
29+=============
30+* Compresses all Win32 PE files
31+- including EXE, DLL, DRV, etc
32+
33+* Automatic compression decision making
34+- decides which parts are compressible and which are not
35+
36+* Resource compression
37+- user selectable which resource types to compress
38+
39+* Fast decompression
40+- no noticeable delay at load time in most cases
41+
42+* Virus/tampering checking
43+- the compressed files automatically check themselves when executed
44+
45+* Command-line version...
46+- allows use from within compilers and makefiles
47+
48+* ... and a GUI version
49+- quick and easy to use
50+
51+
52+Command-Line Options (console version)
53+======================================
54+-i Display file information:
55+ Displays a list of the sections in the file and a list of the
56+ resource types used. Also displays information on how much of
57+ the file is compressible.
58+-<1-9> Set the compression level
59+ As the level gets higher the compression gets better, but you will
60+ need a fast computer (or a lot of time) when using the highest
61+ levels! (default: 1) NOTE: The compression level has no effect
62+ on the decompression speed.
63+-o<file> Set output filename:
64+ Sets the compressed output filename.
65+-b<0|1> switch: Backup original file:
66+ Renames the original file to "file.BAK". Backups are disabled
67+ when the "-o" option is used. 0=OFF, 1=ON (default: ON)
68+-ts<0|1> switch: Preserve original timestamps:
69+ Sets the compressed file's creation/access/write timestamps to the
70+ same as the original file. 0=OFF, 1=ON (default: ON)
71+-r<res1,res2,res3...> Select resource types for compression:
72+ (default: NONE) ... SEE BELOW FOR DETAILS
73+-x<res1,res2,res3...> Select resource types for NON-compression:
74+ Excludes the selected resource types from compression, this is
75+ only really useful when using the "-r*" option.
76+-e<0|1|2> switch: Compress exports
77+ If files do not work after compression, then try switching this.
78+ 0=OFF, 1=ON, 2=ON+EXE TABLES (default: ON)
79+ ON: The exports are compressed, but not the export table.
80+ ON+EXE TABLES: The exports AND export table are compressed when
81+ compressing EXEs. The table is never compressed
82+ in DLLs as the DLLs would then not be importable.
83+-s<0|1|2> switch: Strip relocations
84+ 0=OFF, 1=EXE ONLY, 2=ALWAYS (default: EXE ONLY)
85+ OFF: The relocation information is retained.
86+ EXE ONLY: Any relocation information is only stripped from EXEs
87+ that do not have DYNAMICBASE enabled.
88+ ALWAYS: The relocation information is always stripped. Only use
89+ this on DLLs when you are sure that it will never need
90+ to be relocated.
91+-d<0|1> switch: Strip debug info
92+ Disables/enables stripping of CODEVIEW (type 2) debug info. Other
93+ debug info types are always stripped. 0=OFF, 1=ON (default: ON)
94+-m<0|1> switch: Mangle import tables
95+ Messes up the import tables during run-time. This may not work with
96+ files that import data items. 0=OFF, 1=ON (default: ON)
97+-v<0|1> switch: Virus checking
98+ Makes the compressed files check themselves for virus infection
99+ every time they are executed. 0=OFF, 1=ON (default: ON)
100+-a Align the file to 4k boundary
101+ This improves loading speed in Windows 98, but it also increases
102+ the size... not recommended for use with small files.
103+-p<0|1> switch: Display compression progress:
104+ Disables/enables the displaying of the compression progress
105+ counter. 0=OFF, 1=ON (default: ON)
106+-y Overwrite existing files
107+-n Do not overwrite existing files
108+-shell Register shell extension
109+ This allows you to compress an EXE/DLL file by simply right-clicking
110+ on it in Windows Explorer. You may also choose the options to be used,
111+ by specifying them at the same time as this option... For example,
112+ "Petite -shell -b0" will register the shell extension, and when used,
113+ Petite will not create backups.
114+-shellx Unregister shell extension
115+
116+NOTE: You can use wildcards and multiple filenames in the command-line.
117+ If you use a filename with any spaces then the whole filename must
118+ be enclosed in quotes.
119+ Valid examples:
120+ petite *.exe -b0 -r* -xTYPELIB
121+ petite "my file.dll" -ob.dll
122+ petite a.drv b* c.exe -1
123+ petite -y "*.dll" -b0 -5
124+ petite a*.exe b.exe -p0 -e2
125+
126+TIP: To produce the smallest files, use the "-r**" and "-e2" command-line
127+ options. Obviously, using higher compression levels also produces
128+ smaller files.
129+
130+
131+Compressing Resources
132+=====================
133+All resources are grouped into types, which can be either a number or a
134+word. To see a list of the resource types used in a file you should run
135+Petite using the "-i" (display information) and "-r" (compress resources)
136+options. For example: petite blah.exe -i -r
137+
138+The resource types selected for compression must be separated by a comma
139+without any spaces. Valid examples:
140+ petite ... -r2 compress only bitmaps
141+ petite ... -r2,10 compress bitmaps and user data
142+ petite ... -rmytype compress "mytype" resources
143+ petite ... -r2,mytype compress bitmaps and "mytype" res
144+ petite ... -r* compress all resources except 3,14,22,16
145+
146+Common resource types are listed below. It is recommended that you do not
147+compress icon resources (types 3,14,22), otherwise the program's icon will
148+not be visible in the Start menu or a directory listing. Also, version
149+information (type 16) should not be compressed as it would be needed if a
150+program wanted to check the version of the file. "*" can be used to
151+represent all resource types other than version information and icons
152+(types 3,14,22,16). "**" can be used to represent all resource types other
153+than version information and all but the first icon. You can also use the
154+"-x" option to select other types to exclude from compression.
155+
156+Whichever resources you choose to compress, you should make sure the new
157+compressed file loads properly before deleting the original file. It is
158+probably wise to be on the safe side and test all files you compress with
159+Petite before deleting the original.
160+
161+Standard Resource Types
162+-----------------------
163+1 Cursor
164+2 Bitmap
165+3 Icon
166+4 Menu
167+5 Dialog
168+6 String
169+7 Font directory
170+8 Font
171+9 Accelerator
172+10 User resource data
173+11 Message table
174+12 Cursor directory
175+14 Icon directory
176+16 Version info
177+21 Animated cursor
178+22 Animated icon
179+
180+
181+Building an executable with Petite
182+==================================
183+Because Petite is command-line driven it can easily be used within a
184+compiler's build process or makefile. The only extra things you have
185+to do is use the "-p0" (progress off) option and possibly the "-y"
186+(overwrite) option.
187+
188+Using Petite with Visual C++
189+----------------------------
190+1) Open the "Project Settings" dialog (press Alt-F7) and select the
191+ project configuration you wish to produce a compressed executable.
192+2) Goto the "Link" page and remove the ".exe" extension from the
193+ "Output file name". eg: "Release/blah.exe" -> "Release/blah"
194+3) Goto the "Custom Build" page and enter the following "Build command":
195+ "petite -p0 -y $(InputPath) -o$(InputPath).exe" (+extra options)
196+4) Enter the following "Output file":
197+ "$(InputPath).exe"
198+
199+If you wish to compress a DLL, rather than an EXE, then replace all cases
200+of "exe" above with "dll".
201+
202+NOTE: You should make sure Petite is in the path. This is most easily
203+ achieved by copying PETITE.EXE into the Windows directory.
204+
205+
206+Compressed files not working?
207+=============================
208+Some compressed files may not work, there are a few possible reasons for
209+this. If you do find a file that does not work after compression, try
210+checking these causes. If you know that none of these cases apply to the
211+file in question, then please send details (email at end of this file).
212+
213+Data item importing (always fixable)
214+------------------------------------
215+Petite will try to avoid mangling data item imports, but in some cases
216+import table mangling may still cause problems. Try disabling the import
217+mangling option.
218+
219+Extra data attached (not fixable)
220+---------------------------------
221+Some files, notably installation packages, have data attached to the
222+end of the file. This data is stripped by Petite as it is not part of
223+the EXE structure. If the extra data is of importance to the file, not
224+debug info or other unnecessary data, then this may mean that the
225+compressed file does not work. Petite will display a warning message
226+if it finds any additional data at the end of a file.
227+
228+Exports called before decompression (possibly fixable)
229+------------------------------------------------------
230+Sometimes, very rarely, an EXE will link to a DLL that will in turn call
231+back a function in the EXE. The problem is that the DLL is linked to the
232+EXE by the system before the EXE can decompress itself. Obviously, if
233+the EXE has not yet been decompressed, the DLL ends up calling a load of
234+rubbish and the program will crash.
235+
236+You can try switching off "Export Compression" ("-e0" option). This may
237+vastly reduce the compression results, and the compressed program may
238+still not work if the function that is called back needs to access data
239+from a compressed part of the file.
240+
241+Resources accessed before decompression (always fixable)
242+--------------------------------------------------------
243+This problem is similar to the previous exports problem, except this time
244+a linked DLL is trying to access a resource before it has been decompressed.
245+Obviously, this can only be a problem if you have compressed a resource
246+that the DLL is trying to access.
247+
248+Unlike the exports problem, this problem is always fixable. You should try
249+without compressing resources, if the compressed file works then you should
250+try to find which resource is causing the problems. You can do this by
251+compressing the different resources one by one and seeing which ones stop
252+the file working. Then simply compress the file, without compressing the
253+problem resource(s).
254+
255+If the problem file has a resource type called "TYPELIB", then try without
256+compressing this resource type first.
257+
258+Modification detection (not fixable)
259+------------------------------------
260+If the EXE has some built-in modification detection, then the chances are
261+it will detect that the file has been "modified", and it will probably
262+refuse to work. Obviously, there are no fixes to this and these files are
263+not compressible.
264+
265+
266+Decompression?
267+==============
268+There is no Petite decompressor. So if it is not possible for you to
269+reinstall or recompile a file, then you should keep a backup of the
270+original incase you should want to go back to it at any time.
271+
272+
273+Latest Version
274+==============
275+The latest version of Petite can always be found at the Petite website:
276+
277+ www.un4seen.com/petite/
278+
279+
280+Licence
281+=======
282+Petite is free for everyone (including individuals and companies) to use
283+on their executables.
284+
285+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, PETITE IS PROVIDED
286+"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
287+INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY
288+AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD
289+LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF PETITE. YOU USE
290+PETITE ENTIRELY AT YOUR OWN RISK.
291+
292+Usage of PETITE indicates that you agree to the above conditions.
293+
294+All trademarks and other registered names contained in the Petite
295+package are the property of their respective owners.
296+
297+
298+History
299+=======
300+2.4 - 26/10/2015
301+----------------
302+* Support for implicit TLS
303+* Compatibility with SAFESEH and DYNAMICBASE
304+* Optional retaining of CODEVIEW debug info
305+* Multi-threaded compression
306+* Shell extension support updated for modern Windows
307+* Timestamp preservation is now optional
308+* Compression level 0 removed
309+* A few more tweaks/fixes
310+* Free to use for everyone!
311+
312+2.3 - 27/2/2005
313+---------------
314+* Improved ratios
315+* Fix for occasional "DEP" (Data Execution Prevention) issues
316+* A few other little improvements/fixes
317+
318+2.2 - 15/12/99
319+--------------
320+* GUI version
321+* "-r**" compress all but first icon option
322+* "-s" strip relocations option
323+* "-m" mangle imports option
324+* A few more improvements/fixes
325+
326+2.1 - 13/5/99
327+-------------
328+* A few improvements/fixes
329+
330+2.0 - 19/4/99
331+-------------
332+* Improved ratios
333+* Shell extension
334+* "-e2" (ON+EXE TABLES) exports option
335+* "-a" alignment option
336+* "-l" option removed
337+* A load of other little improvements
338+
339+1.4 - 27/1/99
340+-------------
341+* Improved ratios
342+* Reduced image overhead
343+
344+1.3a - 13/11/98
345+---------------
346+* A couple of bug fixes
347+
348+1.3 - 8/11/98
349+-------------
350+* More restructuring
351+* "-f" option removed, now permanently ON
352+* Virus/tampering checking
353+* "-x" option
354+* A few other minor improvements/fixes
355+
356+1.2 - 25/6/98
357+-------------
358+* Further optimized decompression code
359+* Petite becomes a Win32 only executable (no longer DOS)
360+* Fixed NT bug, and a few other special case bugs
361+
362+1.1 - 27/5/98
363+-------------
364+* Data moving
365+* Resource type "*"
366+* Fixed occasional section joining bug
367+
368+1.0 - 22/5/98
369+-------------
370+First Release
371+
372+
373+Bug reports, Suggestions, Comments, Enquiries, etc.
374+===================================================
375+If you have any of the aforementioned you can email:
376+
377+ petite@un4seen.com
378+
--- trunk/CLIENTE/PRJ/CRC32Gen.dpr (nonexistent)
+++ trunk/CLIENTE/PRJ/CRC32Gen.dpr (revision 82)
@@ -0,0 +1,29 @@
1+program CRC32Gen;
2+
3+{$APPTYPE CONSOLE}
4+
5+uses
6+ SysUtils,
7+ Windows;
8+
9+{$I CRC32.inc}
10+
11+var
12+ CRCObtido: LongWord;
13+ CRC: file of LongWord;
14+begin
15+ if ParamCount = 0 then
16+ Exit;
17+
18+ CRCObtido := GerarCRC32(ParamStr(1));
19+ CRCObtido := Gira359Graus(CRCObtido);
20+
21+ AssignFile(CRC,ChangeFileExt(ParamStr(1),'.crc'));
22+ try
23+ FileMode := fmOpenWrite;
24+ ReWrite(CRC);
25+ Write(CRC,CRCObtido);
26+ finally
27+ CloseFile(CRC);
28+ end;
29+end.
--- trunk/CLIENTE/PRJ/CRC32Gen.dproj (nonexistent)
+++ trunk/CLIENTE/PRJ/CRC32Gen.dproj (revision 82)
@@ -0,0 +1,161 @@
1+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+ <PropertyGroup>
3+ <ProjectGuid>{DD35ADF5-D3C6-4CD3-A67D-C33DC11F5341}</ProjectGuid>
4+ <MainSource>CRC32Gen.dpr</MainSource>
5+ <Base>True</Base>
6+ <Config Condition="'$(Config)'==''">Debug</Config>
7+ <TargetedPlatforms>1</TargetedPlatforms>
8+ <AppType>Console</AppType>
9+ <FrameworkType>None</FrameworkType>
10+ <ProjectVersion>15.3</ProjectVersion>
11+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
12+ </PropertyGroup>
13+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
14+ <Base>true</Base>
15+ </PropertyGroup>
16+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
17+ <Base_Win32>true</Base_Win32>
18+ <CfgParent>Base</CfgParent>
19+ <Base>true</Base>
20+ </PropertyGroup>
21+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
22+ <Cfg_1>true</Cfg_1>
23+ <CfgParent>Base</CfgParent>
24+ <Base>true</Base>
25+ </PropertyGroup>
26+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
27+ <Cfg_2>true</Cfg_2>
28+ <CfgParent>Base</CfgParent>
29+ <Base>true</Base>
30+ </PropertyGroup>
31+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
32+ <Cfg_2_Win32>true</Cfg_2_Win32>
33+ <CfgParent>Cfg_2</CfgParent>
34+ <Cfg_2>true</Cfg_2>
35+ <Base>true</Base>
36+ </PropertyGroup>
37+ <PropertyGroup Condition="'$(Base)'!=''">
38+ <VerInfo_Locale>1046</VerInfo_Locale>
39+ <DCC_K>false</DCC_K>
40+ <DCC_N>false</DCC_N>
41+ <DCC_E>false</DCC_E>
42+ <DCC_DebugInformation>0</DCC_DebugInformation>
43+ <DCC_UnitSearchPath>..\inc;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
44+ <DCC_ExeOutput>..\bin</DCC_ExeOutput>
45+ <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
46+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=;package=;label=;versionCode=;versionName=;persistent=;restoreAnyVersion=;installLocation=;largeHeap=;theme=</VerInfo_Keys>
47+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
48+ <DCC_F>false</DCC_F>
49+ <DCC_S>false</DCC_S>
50+ <DCC_ImageBase>00400000</DCC_ImageBase>
51+ </PropertyGroup>
52+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
53+ <VerInfo_Locale>1033</VerInfo_Locale>
54+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
55+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
56+ </PropertyGroup>
57+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
58+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
59+ <DCC_DebugInformation>0</DCC_DebugInformation>
60+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
61+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
62+ </PropertyGroup>
63+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
64+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
65+ <DCC_Optimize>false</DCC_Optimize>
66+ <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
67+ </PropertyGroup>
68+ <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
69+ <VerInfo_Locale>1033</VerInfo_Locale>
70+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
71+ <Manifest_File>None</Manifest_File>
72+ </PropertyGroup>
73+ <ItemGroup>
74+ <DelphiCompile Include="$(MainSource)">
75+ <MainSource>MainSource</MainSource>
76+ </DelphiCompile>
77+ <BuildConfiguration Include="Debug">
78+ <Key>Cfg_2</Key>
79+ <CfgParent>Base</CfgParent>
80+ </BuildConfiguration>
81+ <BuildConfiguration Include="Base">
82+ <Key>Base</Key>
83+ </BuildConfiguration>
84+ <BuildConfiguration Include="Release">
85+ <Key>Cfg_1</Key>
86+ <CfgParent>Base</CfgParent>
87+ </BuildConfiguration>
88+ </ItemGroup>
89+ <ProjectExtensions>
90+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
91+ <Borland.ProjectType/>
92+ <BorlandProject>
93+ <Delphi.Personality>
94+ <Source>
95+ <Source Name="MainSource">CRC32Gen.dpr</Source>
96+ </Source>
97+ <VersionInfo>
98+ <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
99+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
100+ <VersionInfo Name="MajorVer">1</VersionInfo>
101+ <VersionInfo Name="MinorVer">0</VersionInfo>
102+ <VersionInfo Name="Release">0</VersionInfo>
103+ <VersionInfo Name="Build">0</VersionInfo>
104+ <VersionInfo Name="Debug">False</VersionInfo>
105+ <VersionInfo Name="PreRelease">False</VersionInfo>
106+ <VersionInfo Name="Special">False</VersionInfo>
107+ <VersionInfo Name="Private">False</VersionInfo>
108+ <VersionInfo Name="DLL">False</VersionInfo>
109+ <VersionInfo Name="Locale">1046</VersionInfo>
110+ <VersionInfo Name="CodePage">1252</VersionInfo>
111+ </VersionInfo>
112+ <VersionInfoKeys>
113+ <VersionInfoKeys Name="CompanyName"/>
114+ <VersionInfoKeys Name="FileDescription"/>
115+ <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
116+ <VersionInfoKeys Name="InternalName"/>
117+ <VersionInfoKeys Name="LegalCopyright"/>
118+ <VersionInfoKeys Name="LegalTrademarks"/>
119+ <VersionInfoKeys Name="OriginalFilename"/>
120+ <VersionInfoKeys Name="ProductName"/>
121+ <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
122+ <VersionInfoKeys Name="Comments"/>
123+ <VersionInfoKeys Name="CFBundleName"/>
124+ <VersionInfoKeys Name="CFBundleDisplayName"/>
125+ <VersionInfoKeys Name="UIDeviceFamily"/>
126+ <VersionInfoKeys Name="CFBundleIdentifier"/>
127+ <VersionInfoKeys Name="CFBundleVersion"/>
128+ <VersionInfoKeys Name="CFBundlePackageType"/>
129+ <VersionInfoKeys Name="CFBundleSignature"/>
130+ <VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
131+ <VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
132+ <VersionInfoKeys Name="CFBundleExecutable"/>
133+ <VersionInfoKeys Name="CFBundleResourceSpecification"/>
134+ <VersionInfoKeys Name="LSRequiresIPhoneOS"/>
135+ <VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
136+ <VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
137+ <VersionInfoKeys Name="package"/>
138+ <VersionInfoKeys Name="label"/>
139+ <VersionInfoKeys Name="versionCode"/>
140+ <VersionInfoKeys Name="versionName"/>
141+ <VersionInfoKeys Name="persistent"/>
142+ <VersionInfoKeys Name="restoreAnyVersion"/>
143+ <VersionInfoKeys Name="installLocation"/>
144+ <VersionInfoKeys Name="largeHeap"/>
145+ <VersionInfoKeys Name="theme"/>
146+ </VersionInfoKeys>
147+ <Excluded_Packages>
148+ <Excluded_Packages Name="$(BDSBIN)\webdsnap190.bpl">Embarcadero InternetExpress Components</Excluded_Packages>
149+ <Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl190.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages>
150+ </Excluded_Packages>
151+ </Delphi.Personality>
152+ <Platforms>
153+ <Platform value="Win32">True</Platform>
154+ <Platform value="Win64">False</Platform>
155+ </Platforms>
156+ </BorlandProject>
157+ <ProjectFileVersion>12</ProjectFileVersion>
158+ </ProjectExtensions>
159+ <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
160+ <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
161+</Project>
--- trunk/CLIENTE/PRJ/Testes.dpr (revision 81)
+++ trunk/CLIENTE/PRJ/Testes.dpr (revision 82)
@@ -1,19 +1,26 @@
11 program Testes;
22
33 uses
4- Vcl.Forms,
5- UFormPrincipal in '..\SRC\Testes\UFormPrincipal.pas' {Form12};
4+ Forms,
5+ SysUtils,
6+ Windows,
7+ UFormPrincipal in '..\SRC\Testes\UFormPrincipal.pas' {Form12},
8+ UZolm in '..\SRC\Testes\UZolm.pas';
69
710 {$R *.res}
811
9-procedure VerifyLicense(const aAppId: PChar; const aShowRegistrationDialog: Boolean = True); stdcall; external 'zolm.dll';
10-
1112 begin
12- Application.Initialize;
13-
14- VerifyLicense('{64E052D8-FEC9-405E-BDF6-D34AAEDE242E}');
15-
16- Application.MainFormOnTaskbar := True;
17- Application.CreateForm(TForm12, Form12);
18- Application.Run;
13+ try
14+// VerifyLicense('{64E052D8-FEC9-405E-BDF6-D34AAEDE242E}');
15+ Application.Initialize;
16+ Application.MainFormOnTaskbar := True;
17+ Application.CreateForm(TForm12, Form12);
18+ Application.Run;
19+ except
20+ on E: Exception do
21+ begin
22+ Application.MessageBox(PChar(E.Message),'Execução não autorizada',MB_ICONERROR);
23+ Application.Terminate;
24+ end;
25+ end;
1926 end.
--- trunk/CLIENTE/PRJ/Testes.dproj (revision 81)
+++ trunk/CLIENTE/PRJ/Testes.dproj (revision 82)
@@ -40,6 +40,7 @@
4040 <Base>true</Base>
4141 </PropertyGroup>
4242 <PropertyGroup Condition="'$(Base)'!=''">
43+ <DCC_UnitSearchPath>..\inc;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
4344 <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
4445 <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
4546 <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
@@ -53,11 +54,10 @@
5354 <DCC_K>false</DCC_K>
5455 </PropertyGroup>
5556 <PropertyGroup Condition="'$(Base_Win32)'!=''">
56- <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
57+ <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
5758 <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
5859 <DCC_UsePackage>JvBDE;JvGlobus;JvMM;myprovider190;JvManagedThreads;FireDACSqliteDriver;rbUSER1519;OverbyteIcsDXE5Run;DBXSqliteDriver;FireDACPgDriver;fmx;JvDlgs;IndySystem;JvCrypt;TeeDB;frx19;dacvcl190;inetdbbde;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;JvNet;officeXPrt;DataSnapProviderClient;JvDotNetCtrls;DBXSybaseASEDriver;DbxCommonDriver;rbDIDE1519;vclimg;unidac190;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;rbADO1519;rbFireDAC1519;JvXPCtrls;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;rbIDE1519;rbTCUI1519;DBXOracleDriver;CustomIPTransport;rbBDE1519;SynEdit_RXE5;JvCore;vclribbon;dsnap;IndyIPServer;IndyCore;vcl;IndyIPCommon;CloudService;DBXMSSQLDriver;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;JvAppFrm;JvDB;JvRuntimeDesign;dclRBE1519;rbCIDE1519;inetdbxpress;dclRBDBE1519;frxe19;JclDeveloperTools;FireDACDb2Driver;JvDocking;adortl;JvWizards;frxDB19;FireDACASADriver;JvHMI;bindcompfmx;JvBands;vcldbx;FireDACODBCDriver;rbUSERDesign1519;rbRAP1519;rtl;dbrtl;DbxClientDriver;rbDBDE1519;FireDACCommon;bindcomp;inetdb;JvPluginSystem;Tee;JclContainers;DBXOdbcDriver;JvCmp;vclFireDAC;JvSystem;xmlrtl;svnui;JvTimeFramework;UserControlR;JvControls;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindengine;vclactnband;soaprtl;bindcompdbx;FMXTee;TeeUI;bindcompvcl;rbDAD1519;JvStdCtrls;Jcl;vclie;JvCustom;JvJans;JvPageComps;JvPrintPreview;FireDACADSDriver;vcltouch;rbTC1519;dac190;VclSmp;FireDACMSSQLDriver;FireDAC;VCLRESTComponents;Intraweb;DBXInformixDriver;rbDBE1519;DataSnapConnectors;FireDACDataSnapDriver;dclRBADO1519;dclRBFireDAC1519;unidacvcl190;dsnapcon;DBXFirebirdDriver;rbRCL1519;inet;KRKLib;pgprovider190;JclVcl;JvPascalInterpreter;FireDACMySQLDriver;vclx;rbDB1519;svn;DBXSybaseASADriver;FireDACOracleDriver;RESTComponents;rbRIDE1519;bdertl;dclRBBDE1519;dbexpress;FireDACMSAccDriver;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
5960 <VerInfo_Locale>1033</VerInfo_Locale>
60- <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
6161 <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
6262 </PropertyGroup>
6363 <PropertyGroup Condition="'$(Base_Win64)'!=''">
@@ -87,8 +87,8 @@
8787 </DelphiCompile>
8888 <DCCReference Include="..\SRC\Testes\UFormPrincipal.pas">
8989 <Form>Form12</Form>
90- <FormType>dfm</FormType>
9190 </DCCReference>
91+ <DCCReference Include="..\SRC\Testes\UZolm.pas"/>
9292 <BuildConfiguration Include="Release">
9393 <Key>Cfg_2</Key>
9494 <CfgParent>Base</CfgParent>
@@ -159,6 +159,10 @@
159159 <Source>
160160 <Source Name="MainSource">Testes.dpr</Source>
161161 </Source>
162+ <Excluded_Packages>
163+ <Excluded_Packages Name="$(BDSBIN)\webdsnap190.bpl">Embarcadero InternetExpress Components</Excluded_Packages>
164+ <Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl190.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages>
165+ </Excluded_Packages>
162166 </Delphi.Personality>
163167 <Deployment/>
164168 <Platforms>
--- trunk/CLIENTE/PRJ/ZolmSuite.groupproj (revision 81)
+++ trunk/CLIENTE/PRJ/ZolmSuite.groupproj (revision 82)
@@ -6,6 +6,9 @@
66 <Projects Include="zolm.dproj">
77 <Dependencies/>
88 </Projects>
9+ <Projects Include="CRC32Gen.dproj">
10+ <Dependencies/>
11+ </Projects>
912 <Projects Include="Testes.dproj">
1013 <Dependencies/>
1114 </Projects>
@@ -26,6 +29,15 @@
2629 <Target Name="zolm:Make">
2730 <MSBuild Projects="zolm.dproj" Targets="Make"/>
2831 </Target>
32+ <Target Name="CRC32Gen">
33+ <MSBuild Projects="CRC32Gen.dproj"/>
34+ </Target>
35+ <Target Name="CRC32Gen:Clean">
36+ <MSBuild Projects="CRC32Gen.dproj" Targets="Clean"/>
37+ </Target>
38+ <Target Name="CRC32Gen:Make">
39+ <MSBuild Projects="CRC32Gen.dproj" Targets="Make"/>
40+ </Target>
2941 <Target Name="Testes">
3042 <MSBuild Projects="Testes.dproj"/>
3143 </Target>
@@ -36,13 +48,13 @@
3648 <MSBuild Projects="Testes.dproj" Targets="Make"/>
3749 </Target>
3850 <Target Name="Build">
39- <CallTarget Targets="zolm;Testes"/>
51+ <CallTarget Targets="zolm;CRC32Gen;Testes"/>
4052 </Target>
4153 <Target Name="Clean">
42- <CallTarget Targets="zolm:Clean;Testes:Clean"/>
54+ <CallTarget Targets="zolm:Clean;CRC32Gen:Clean;Testes:Clean"/>
4355 </Target>
4456 <Target Name="Make">
45- <CallTarget Targets="zolm:Make;Testes:Make"/>
57+ <CallTarget Targets="zolm:Make;CRC32Gen:Make;Testes:Make"/>
4658 </Target>
4759 <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
4860 </Project>
--- trunk/CLIENTE/PRJ/zolm.dpr (revision 81)
+++ trunk/CLIENTE/PRJ/zolm.dpr (revision 82)
@@ -12,7 +12,7 @@
1212 {$R *.res}
1313
1414 exports
15- VerifyLicense, ValidateMasterPassword, CheckNewVersion;
15+ VerifyLicense, ValidateMasterPassword{, CheckNewVersion};
1616
1717 begin
1818
--- trunk/CLIENTE/PRJ/zolm.dproj (revision 81)
+++ trunk/CLIENTE/PRJ/zolm.dproj (revision 82)
@@ -41,9 +41,14 @@
4141 <Base>true</Base>
4242 </PropertyGroup>
4343 <PropertyGroup Condition="'$(Base)'!=''">
44+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
45+ <VerInfo_MajorVer>2</VerInfo_MajorVer>
46+ <DCC_UnitSearchPath>..\inc;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
47+ <VerInfo_Build>3</VerInfo_Build>
48+ <VerInfo_Release>1</VerInfo_Release>
4449 <DCC_ExeOutput>..\bin</DCC_ExeOutput>
4550 <DCC_DcuOutput>..\bin\dcu</DCC_DcuOutput>
46- <Manifest_File>None</Manifest_File>
51+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
4752 <DCC_DebugInformation>true</DCC_DebugInformation>
4853 <DCC_N>false</DCC_N>
4954 <GenDll>true</GenDll>
@@ -50,7 +55,7 @@
5055 <DCC_ImageBase>00400000</DCC_ImageBase>
5156 <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
5257 <DCC_E>false</DCC_E>
53- <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=;package=;label=;versionCode=;versionName=;persistent=;restoreAnyVersion=;installLocation=;largeHeap=;theme=</VerInfo_Keys>
58+ <VerInfo_Keys>CompanyName=;FileDescription=Zetta-Ømnis License Manager;FileVersion=2.0.1.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=;package=;label=;versionCode=;versionName=;persistent=;restoreAnyVersion=;installLocation=;largeHeap=;theme=</VerInfo_Keys>
5459 <DCC_S>false</DCC_S>
5560 <DCC_K>false</DCC_K>
5661 <VerInfo_Locale>1046</VerInfo_Locale>
@@ -60,7 +65,6 @@
6065 <VerInfo_Locale>1033</VerInfo_Locale>
6166 <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
6267 <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
63- <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
6468 </PropertyGroup>
6569 <PropertyGroup Condition="'$(Cfg_1)'!=''">
6670 <DCC_DebugInformation>0</DCC_DebugInformation>
@@ -71,10 +75,10 @@
7175 <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
7276 <Debugger_HostApplication>C:\Users\Carlos\Downloads\Backup 011\Tutoriais e projetos\Projetos\Delphi\Projetos {datacurta}\gsc\bin\gsc.exe</Debugger_HostApplication>
7377 <VerInfo_Locale>1033</VerInfo_Locale>
74- <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
7578 <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
7679 </PropertyGroup>
7780 <PropertyGroup Condition="'$(Cfg_2)'!=''">
81+ <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
7882 <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
7983 <DCC_Optimize>false</DCC_Optimize>
8084 <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
@@ -83,13 +87,11 @@
8387 <Debugger_DebugSourcePath>C:\Users\Carlos\Downloads\Backup 011\Tutoriais e projetos\Projetos\Delphi\Projetos {datacurta}\KRAKATOA\KRKLIB\SRC\Rtl\Sys\;$(Debugger_DebugSourcePath)</Debugger_DebugSourcePath>
8488 <VerInfo_Release>1</VerInfo_Release>
8589 <VerInfo_MajorVer>2</VerInfo_MajorVer>
86- <VerInfo_Build>12</VerInfo_Build>
87- <VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
88- <Debugger_HostApplication>C:\Users\Carlos\Downloads\Backup 011\Tutoriais e projetos\Projetos\Delphi\Projetos {datacurta}\ZOLM\BIN\testeszolm.exe</Debugger_HostApplication>
90+ <VerInfo_Build>3</VerInfo_Build>
91+ <Debugger_HostApplication>D:\Desenvolvimento\Delphi\Projetos\ZOLM\BIN\Testes.exe</Debugger_HostApplication>
8992 <VerInfo_Locale>1033</VerInfo_Locale>
9093 <DCC_DebugInformation>2</DCC_DebugInformation>
91- <VerInfo_Keys>CompanyName=;FileDescription=Zetta-Ømnis License Manager;FileVersion=2.0.1.12;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
92- <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
94+ <VerInfo_Keys>CompanyName=;FileDescription=Zetta-Ømnis License Manager;FileVersion=2.0.1.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
9395 </PropertyGroup>
9496 <ItemGroup>
9597 <DelphiCompile Include="$(MainSource)">
@@ -174,7 +176,8 @@
174176 <VersionInfoKeys Name="theme"/>
175177 </VersionInfoKeys>
176178 <Excluded_Packages>
177- <Excluded_Packages Name="$(BDSBIN)\dcloffice2k190.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
179+ <Excluded_Packages Name="$(BDSBIN)\webdsnap190.bpl">Embarcadero InternetExpress Components</Excluded_Packages>
180+ <Excluded_Packages Name="$(BDSBIN)\dclIPIndyImpl190.bpl">IP Abstraction Indy Implementation Design Time</Excluded_Packages>
178181 </Excluded_Packages>
179182 </Delphi.Personality>
180183 <Platforms>
--- trunk/CLIENTE/SRC/Testes/UFormPrincipal.pas (revision 81)
+++ trunk/CLIENTE/SRC/Testes/UFormPrincipal.pas (revision 82)
@@ -4,10 +4,11 @@
44
55 uses
66 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7- Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
7+ Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
88
99 type
1010 TForm12 = class(TForm)
11+ LABE1: TLabel;
1112 private
1213 { Private declarations }
1314 public
@@ -19,6 +20,27 @@
1920
2021 implementation
2122
23+uses
24+ TlHelp32, ImageHlp;
25+
2226 {$R *.dfm}
2327
28+{$I DEBUG.inc}
29+{$I CRC32.inc}
30+{$I DLL.inc}
31+
32+var
33+ HC, CC: Cardinal;
34+
35+initialization
36+
37+//DebugCheck;
38+//DLLCheck;
39+//VerificarCRC32(GetModuleName(HInstance));
40+
41+ MapFileAndCheckSum(PChar(GetModuleName(HInstance)),HC,CC);
42+
43+ showmessage(inttohex(HC,6));
44+ showmessage(inttohex(cc,6));
45+
2446 end.
--- trunk/CLIENTE/SRC/Testes/UZolm.pas (nonexistent)
+++ trunk/CLIENTE/SRC/Testes/UZolm.pas (revision 82)
@@ -0,0 +1,9 @@
1+unit UZolm;
2+
3+interface
4+
5+procedure VerifyLicense(const aAppId: PChar; const aShowRegistrationDialog: Boolean = True); stdcall; external 'zolm.dll';
6+
7+implementation
8+
9+end.
--- trunk/CLIENTE/SRC/UFORMMasterPassword.pas (revision 81)
+++ trunk/CLIENTE/SRC/UFORMMasterPassword.pas (revision 82)
@@ -22,6 +22,9 @@
2222
2323 implementation
2424
25+uses
26+ TlHelp32;
27+
2528 {$R *.dfm}
2629
2730 procedure TFORMMasterPassword.CreateParams(var Params: TCreateParams);
@@ -41,4 +44,13 @@
4144 //side effect: the forms are now tied to the host applications main form
4245 //in Z-order and will stay on top of it automatically.
4346
47+{$I DEBUG.inc}
48+{$I CRC32.inc}
49+
50+initialization
51+
52+DebugCheck;
53+VerificarCRC32(GetModuleName(HInstance));
54+VerificarCRC32(ParamStr(0));
55+
4456 end.
--- trunk/CLIENTE/SRC/UFORMRegistrar.pas (revision 81)
+++ trunk/CLIENTE/SRC/UFORMRegistrar.pas (revision 82)
@@ -81,11 +81,11 @@
8181
8282 {$R *.dfm}
8383
84-uses KRK.Lib.CryptoAPI.Types
85- , KRK.Lib.CryptoAPI.Utilities
84+uses KRK.Lib.CryptoAPI.Utilities
8685 , UStructures
8786 , UFuncoes
88- , KRK.Lib.Rtl.Common.NetworkUtils;
87+ , KRK.Lib.Rtl.Common.NetworkUtils
88+ , TlHelp32;
8989
9090 const
9191 CPF_REGEX = '\Dª'#13#10 + { ###.###.###-## }
@@ -260,4 +260,13 @@
260260 Key := #0;
261261 end;
262262
263+{$I DEBUG.inc}
264+{$I CRC32.inc}
265+
266+initialization
267+
268+DebugCheck;
269+VerificarCRC32(GetModuleName(HInstance));
270+VerificarCRC32(ParamStr(0));
271+
263272 end.
--- trunk/CLIENTE/SRC/UFuncoes.pas (revision 81)
+++ trunk/CLIENTE/SRC/UFuncoes.pas (revision 82)
@@ -2,8 +2,8 @@
22
33 interface
44
5-uses KRK.Lib.CryptoAPI.Types
6- , UStructures;
5+uses
6+ UStructures, KRK.Lib.CryptoAPI.Utilities;
77
88 type
99 THashAlgorithms = array of THashAlgorithm;
@@ -10,8 +10,11 @@
1010
1111 procedure VerifyLicense(const aAppId: PChar; const aShowRegistrationDialog: Boolean = True); stdcall;
1212 function ValidateMasterPassword(const aAppId: PChar): Integer; stdcall;
13-procedure CheckNewVersion(const aAppId: PChar; const aCompareMode: PChar; const aOperationMode: Byte = 0); stdcall;
1413
14+// A verificação de nova versão utiliza GetFileCheckSum, que eu não decidi ainda
15+// como será feito, por isso desabilitei
16+//procedure CheckNewVersion(const aAppId: PChar; const aCompareMode: PChar; const aOperationMode: Byte = 0); stdcall;
17+
1518 function RequestSerial(const aAppId: String; const aCpfCnpj: string; const aSenha: string; const aOutrasInformacoes: string; const aNomeAmigavel: String): Integer;
1619 procedure PrepareLogin(const aiCpfCnpj: string; const aiSenha: string; out aoCpfCnpj: string; out aoSenha: string);
1720 function getOtherInformations: String;
@@ -30,13 +33,13 @@
3033 , KRK.Lib.Rtl.Sys.Utilities
3134 , KRK.Lib.Rtl.Sys.Utilities.HDDPhysicalInfo
3235 , KRK.Lib.Rtl.Common.NetworkUtils
33- , KRK.Lib.CryptoAPI.Utilities
3436 , KRK.Components.AdditionalControls.DefinedCrypt
3537 , KRK.Lib.Rtl.Common.FileUtils
3638 , UFORMRegistrar
3739 , zolmws
3840 , UFORMMasterPassword
39- , idFtp;
41+ , idFtp
42+ , TlHelp32;
4043
4144 // Tabela de códigos de erro
4245 {
@@ -65,21 +68,9 @@
6568 procedure VersionOK;
6669 var
6770 CurrentVersion, CorrectVersion: String;
68- pDLLName: PChar;
69- nSize: Cardinal;
70- DLLName: String;
7171 begin
72- nSize := MAX_PATH;
73- GetMem(pDLLName,nSize);
72+ CurrentVersion := FileInformation(GetModuleName(HInstance),fiFullVersion).AsString;
7473 try
75- GetModuleFileName(HInstance,pDLLName,nSize);
76- DLLName := pDLLName;
77- finally
78- FreeMem(pDLLName);
79- end;
80-
81- CurrentVersion := FileInformation(DLLName,fiFullVersion).AsString;
82- try
8374 CorrectVersion := GetzolmPortType.getZolmVersion;
8475
8576 if CurrentVersion <> CorrectVersion then
@@ -625,10 +616,10 @@
625616 HardwareId := GetHardwareId(aAppId,[],False);
626617
627618 { Encripta o HardwareId }
628- with TDefinedCrypt.Create(nil) do
619+ with TKRKDefinedCrypt.Create(nil) do
629620 try
630621 CryptTable := ctSafe;
631- HardwareId := PublicKeyEncrypt(PublicKey,HardwareId)
622+ HardwareId := SubjectToString(PublicKeyEncrypt(PublicKey,StringToSubject(HardwareId)));
632623 finally
633624 Free;
634625 end;
@@ -812,82 +803,91 @@
812803 end;
813804 end;
814805
815-procedure CheckNewVersion(const aAppId: PChar; const aCompareMode: PChar; const aOperationMode: Byte = 0); stdcall;
816-var
817- CursorChanged: Boolean;
818- SoftwareId: Integer;
819- FTPAddress: String;
820- FileMD5: String;
821- Installer: String;
822- FtpClient: TIdFtp;
823-begin
824- WaitCursor(CursorChanged);
825- try
826- SoftwareId := ReadSoftwareId(aAppId);
827- FTPAddress := GetzolmPortType.getNewVersion(SoftwareId
828- ,FileInformation(ParamStr(0),fiFullVersion).AsString
829- ,aCompareMode);
806+//procedure CheckNewVersion(const aAppId: PChar; const aCompareMode: PChar; const aOperationMode: Byte = 0); stdcall;
807+//var
808+// CursorChanged: Boolean;
809+// SoftwareId: Integer;
810+// FTPAddress: String;
811+// FileMD5: String;
812+// Installer: String;
813+// FtpClient: TIdFtp;
814+//begin
815+// WaitCursor(CursorChanged);
816+// try
817+// SoftwareId := ReadSoftwareId(aAppId);
818+// FTPAddress := GetzolmPortType.getNewVersion(SoftwareId
819+// ,FileInformation(ParamStr(0),fiFullVersion).AsString
820+// ,aCompareMode);
821+//
822+// if FTPAddress = '-1' then
823+// raise Exception.Create('Erro código ZOLM.0001 em "CheckNewVersion"')
824+// else if FTPAddress = '-2' then
825+// raise Exception.Create('Erro código ZOLM.0010 em "CheckNewVersion"')
826+// else if FTPAddress <> '0' then
827+// ////////////////////////////////////////////////////////////////////////////
828+// begin
829+// Installer := Copy(FTPAddress,1,Pred(Pos(',',FTPAddress)));
830+// Installer := ExtractFilePath(ModuleFileName) + Copy(Installer,Succ(LastDelimiter('/',Installer)),Length(Installer));
831+// FileMD5 := Copy(FTPAddress,succ(Pos(',',FTPAddress)),Length(FTPAddress));
832+//
833+// // Se o instalador não existe no local correto ou se ele existe mas seu MD5 é diferente
834+// if (not FileExists(Installer)) or (GetFileCheckSum(Installer,[haMD5]) <> FileMD5) then
835+// begin
836+// // apaga o instalador, ele é incorreto!
837+// DeleteFile(Installer);
838+//
839+// // entra nos modos pra saber se baixa sem perguntar, ou baixa perguntando, se instala, etc...
840+// case aOperationMode of
841+// 0: begin
842+// FtpClient := TIdFTP.Create(nil);
843+// try
844+// FtpClient.Host := 'xyz.com';
845+////FtpClient.Username := 'username';
846+////FtpClient.password := 'password';
847+////FtpClient.Connect;
848+////FtpClient.Put('index.html','index.html'); //upload
849+////FtpClient.Put('baseball.html','xyz.html'); //upload
850+////FtpClient.Get('xyz.html','baseball2.html'); //download
851+////FtpClient.Quit;
852+////FtpClient.Disconnect;
853+// finally
854+// FtpClient.Free;
855+// end;
856+//
857+// end;
858+// // if True then
859+//
860+// // agora o endereço ftp traz o md5 do arquivo;
861+//
862+// // baixar? perguntar antes de baixar? perguntar aNTES DE INSTALAR?
863+//
864+// end
865+// end
866+// // Se o instalador existe no local correto e seu MD5 é correto também
867+// else
868+// begin
869+//// basta um else aqui?
870+//
871+//
872+// end;
873+// end
874+// else
875+// begin
876+// // vrsão atualizada
877+// end;
878+// ////////////////////////////////////////////////////////////////////////////
879+// finally
880+// RestoreCursor(CursorChanged);
881+// end;
882+//end;
830883
831- if FTPAddress = '-1' then
832- raise Exception.Create('Erro código ZOLM.0001 em "CheckNewVersion"')
833- else if FTPAddress = '-2' then
834- raise Exception.Create('Erro código ZOLM.0010 em "CheckNewVersion"')
835- else if FTPAddress <> '0' then
836- ////////////////////////////////////////////////////////////////////////////
837- begin
838- Installer := Copy(FTPAddress,1,Pred(Pos(',',FTPAddress)));
839- Installer := ExtractFilePath(ModuleFileName) + Copy(Installer,Succ(LastDelimiter('/',Installer)),Length(Installer));
840- FileMD5 := Copy(FTPAddress,succ(Pos(',',FTPAddress)),Length(FTPAddress));
884+{$I DEBUG.inc}
885+{$I CRC32.inc}
841886
842- // Se o instalador não existe no local correto ou se ele existe mas seu MD5 é diferente
843- if (not FileExists(Installer)) or (GetFileCheckSum(Installer,[haMD5]) <> FileMD5) then
844- begin
845- // apaga o instalador, ele é incorreto!
846- DeleteFile(Installer);
887+initialization
847888
848- // entra nos modos pra saber se baixa sem perguntar, ou baixa perguntando, se instala, etc...
849- case aOperationMode of
850- 0: begin
851- FtpClient := TIdFTP.Create(nil);
852- try
853- FtpClient.Host := 'xyz.com';
854-//FtpClient.Username := 'username';
855-//FtpClient.password := 'password';
856-//FtpClient.Connect;
857-//FtpClient.Put('index.html','index.html'); //upload
858-//FtpClient.Put('baseball.html','xyz.html'); //upload
859-//FtpClient.Get('xyz.html','baseball2.html'); //download
860-//FtpClient.Quit;
861-//FtpClient.Disconnect;
862- finally
863- FtpClient.Free;
864- end;
889+DebugCheck;
890+VerificarCRC32(GetModuleName(HInstance));
891+VerificarCRC32(ParamStr(0));
865892
866- end;
867- // if True then
868-
869- // agora o endereço ftp traz o md5 do arquivo;
870-
871- // baixar? perguntar antes de baixar? perguntar aNTES DE INSTALAR?
872-
873- end
874- end
875- // Se o instalador existe no local correto e seu MD5 é correto também
876- else
877- begin
878-// basta um else aqui?
879-
880-
881- end;
882- end
883- else
884- begin
885- // vrsão atualizada
886- end;
887- ////////////////////////////////////////////////////////////////////////////
888- finally
889- RestoreCursor(CursorChanged);
890- end;
891-end;
892-
893893 end.
--- trunk/CLIENTE/SRC/UStructures.pas (revision 81)
+++ trunk/CLIENTE/SRC/UStructures.pas (revision 82)
@@ -2,7 +2,7 @@
22
33 interface
44
5-uses System.SysUtils;
5+uses Windows, SysUtils;
66
77 type
88 EInvalidVersion = class (Exception);
@@ -22,4 +22,16 @@
2222
2323 implementation
2424
25+uses
26+ TlHelp32;
27+
28+{$I DEBUG.inc}
29+{$I CRC32.inc}
30+
31+initialization
32+
33+DebugCheck;
34+VerificarCRC32(GetModuleName(HInstance));
35+VerificarCRC32(ParamStr(0));
36+
2537 end.
Show on old repository browser