Revisión | 82 (tree) |
---|---|
Tiempo | 2017-12-26 06:19:53 |
Autor | ![]() |
Tentativas de proteger um executável
@@ -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)); |
@@ -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 | + |
@@ -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. |
@@ -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> |
@@ -1,19 +1,26 @@ | ||
1 | 1 | program Testes; |
2 | 2 | |
3 | 3 | 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'; | |
6 | 9 | |
7 | 10 | {$R *.res} |
8 | 11 | |
9 | -procedure VerifyLicense(const aAppId: PChar; const aShowRegistrationDialog: Boolean = True); stdcall; external 'zolm.dll'; | |
10 | - | |
11 | 12 | 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; | |
19 | 26 | end. |
@@ -40,6 +40,7 @@ | ||
40 | 40 | <Base>true</Base> |
41 | 41 | </PropertyGroup> |
42 | 42 | <PropertyGroup Condition="'$(Base)'!=''"> |
43 | + <DCC_UnitSearchPath>..\inc;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> | |
43 | 44 | <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace> |
44 | 45 | <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> |
45 | 46 | <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 @@ | ||
53 | 54 | <DCC_K>false</DCC_K> |
54 | 55 | </PropertyGroup> |
55 | 56 | <PropertyGroup Condition="'$(Base_Win32)'!=''"> |
56 | - <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> | |
57 | + <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon> | |
57 | 58 | <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> |
58 | 59 | <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> |
59 | 60 | <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> | |
61 | 61 | <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> |
62 | 62 | </PropertyGroup> |
63 | 63 | <PropertyGroup Condition="'$(Base_Win64)'!=''"> |
@@ -87,8 +87,8 @@ | ||
87 | 87 | </DelphiCompile> |
88 | 88 | <DCCReference Include="..\SRC\Testes\UFormPrincipal.pas"> |
89 | 89 | <Form>Form12</Form> |
90 | - <FormType>dfm</FormType> | |
91 | 90 | </DCCReference> |
91 | + <DCCReference Include="..\SRC\Testes\UZolm.pas"/> | |
92 | 92 | <BuildConfiguration Include="Release"> |
93 | 93 | <Key>Cfg_2</Key> |
94 | 94 | <CfgParent>Base</CfgParent> |
@@ -159,6 +159,10 @@ | ||
159 | 159 | <Source> |
160 | 160 | <Source Name="MainSource">Testes.dpr</Source> |
161 | 161 | </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> | |
162 | 166 | </Delphi.Personality> |
163 | 167 | <Deployment/> |
164 | 168 | <Platforms> |
@@ -6,6 +6,9 @@ | ||
6 | 6 | <Projects Include="zolm.dproj"> |
7 | 7 | <Dependencies/> |
8 | 8 | </Projects> |
9 | + <Projects Include="CRC32Gen.dproj"> | |
10 | + <Dependencies/> | |
11 | + </Projects> | |
9 | 12 | <Projects Include="Testes.dproj"> |
10 | 13 | <Dependencies/> |
11 | 14 | </Projects> |
@@ -26,6 +29,15 @@ | ||
26 | 29 | <Target Name="zolm:Make"> |
27 | 30 | <MSBuild Projects="zolm.dproj" Targets="Make"/> |
28 | 31 | </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> | |
29 | 41 | <Target Name="Testes"> |
30 | 42 | <MSBuild Projects="Testes.dproj"/> |
31 | 43 | </Target> |
@@ -36,13 +48,13 @@ | ||
36 | 48 | <MSBuild Projects="Testes.dproj" Targets="Make"/> |
37 | 49 | </Target> |
38 | 50 | <Target Name="Build"> |
39 | - <CallTarget Targets="zolm;Testes"/> | |
51 | + <CallTarget Targets="zolm;CRC32Gen;Testes"/> | |
40 | 52 | </Target> |
41 | 53 | <Target Name="Clean"> |
42 | - <CallTarget Targets="zolm:Clean;Testes:Clean"/> | |
54 | + <CallTarget Targets="zolm:Clean;CRC32Gen:Clean;Testes:Clean"/> | |
43 | 55 | </Target> |
44 | 56 | <Target Name="Make"> |
45 | - <CallTarget Targets="zolm:Make;Testes:Make"/> | |
57 | + <CallTarget Targets="zolm:Make;CRC32Gen:Make;Testes:Make"/> | |
46 | 58 | </Target> |
47 | 59 | <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/> |
48 | 60 | </Project> |
@@ -12,7 +12,7 @@ | ||
12 | 12 | {$R *.res} |
13 | 13 | |
14 | 14 | exports |
15 | - VerifyLicense, ValidateMasterPassword, CheckNewVersion; | |
15 | + VerifyLicense, ValidateMasterPassword{, CheckNewVersion}; | |
16 | 16 | |
17 | 17 | begin |
18 | 18 |
@@ -41,9 +41,14 @@ | ||
41 | 41 | <Base>true</Base> |
42 | 42 | </PropertyGroup> |
43 | 43 | <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> | |
44 | 49 | <DCC_ExeOutput>..\bin</DCC_ExeOutput> |
45 | 50 | <DCC_DcuOutput>..\bin\dcu</DCC_DcuOutput> |
46 | - <Manifest_File>None</Manifest_File> | |
51 | + <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> | |
47 | 52 | <DCC_DebugInformation>true</DCC_DebugInformation> |
48 | 53 | <DCC_N>false</DCC_N> |
49 | 54 | <GenDll>true</GenDll> |
@@ -50,7 +55,7 @@ | ||
50 | 55 | <DCC_ImageBase>00400000</DCC_ImageBase> |
51 | 56 | <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace> |
52 | 57 | <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> | |
54 | 59 | <DCC_S>false</DCC_S> |
55 | 60 | <DCC_K>false</DCC_K> |
56 | 61 | <VerInfo_Locale>1046</VerInfo_Locale> |
@@ -60,7 +65,6 @@ | ||
60 | 65 | <VerInfo_Locale>1033</VerInfo_Locale> |
61 | 66 | <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> |
62 | 67 | <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> | |
64 | 68 | </PropertyGroup> |
65 | 69 | <PropertyGroup Condition="'$(Cfg_1)'!=''"> |
66 | 70 | <DCC_DebugInformation>0</DCC_DebugInformation> |
@@ -71,10 +75,10 @@ | ||
71 | 75 | <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''"> |
72 | 76 | <Debugger_HostApplication>C:\Users\Carlos\Downloads\Backup 011\Tutoriais e projetos\Projetos\Delphi\Projetos {datacurta}\gsc\bin\gsc.exe</Debugger_HostApplication> |
73 | 77 | <VerInfo_Locale>1033</VerInfo_Locale> |
74 | - <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> | |
75 | 78 | <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> |
76 | 79 | </PropertyGroup> |
77 | 80 | <PropertyGroup Condition="'$(Cfg_2)'!=''"> |
81 | + <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> | |
78 | 82 | <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames> |
79 | 83 | <DCC_Optimize>false</DCC_Optimize> |
80 | 84 | <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> |
@@ -83,13 +87,11 @@ | ||
83 | 87 | <Debugger_DebugSourcePath>C:\Users\Carlos\Downloads\Backup 011\Tutoriais e projetos\Projetos\Delphi\Projetos {datacurta}\KRAKATOA\KRKLIB\SRC\Rtl\Sys\;$(Debugger_DebugSourcePath)</Debugger_DebugSourcePath> |
84 | 88 | <VerInfo_Release>1</VerInfo_Release> |
85 | 89 | <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> | |
89 | 92 | <VerInfo_Locale>1033</VerInfo_Locale> |
90 | 93 | <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> | |
93 | 95 | </PropertyGroup> |
94 | 96 | <ItemGroup> |
95 | 97 | <DelphiCompile Include="$(MainSource)"> |
@@ -174,7 +176,8 @@ | ||
174 | 176 | <VersionInfoKeys Name="theme"/> |
175 | 177 | </VersionInfoKeys> |
176 | 178 | <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> | |
178 | 181 | </Excluded_Packages> |
179 | 182 | </Delphi.Personality> |
180 | 183 | <Platforms> |
@@ -4,10 +4,11 @@ | ||
4 | 4 | |
5 | 5 | uses |
6 | 6 | 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; | |
8 | 8 | |
9 | 9 | type |
10 | 10 | TForm12 = class(TForm) |
11 | + LABE1: TLabel; | |
11 | 12 | private |
12 | 13 | { Private declarations } |
13 | 14 | public |
@@ -19,6 +20,27 @@ | ||
19 | 20 | |
20 | 21 | implementation |
21 | 22 | |
23 | +uses | |
24 | + TlHelp32, ImageHlp; | |
25 | + | |
22 | 26 | {$R *.dfm} |
23 | 27 | |
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 | + | |
24 | 46 | end. |
@@ -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. |
@@ -22,6 +22,9 @@ | ||
22 | 22 | |
23 | 23 | implementation |
24 | 24 | |
25 | +uses | |
26 | + TlHelp32; | |
27 | + | |
25 | 28 | {$R *.dfm} |
26 | 29 | |
27 | 30 | procedure TFORMMasterPassword.CreateParams(var Params: TCreateParams); |
@@ -41,4 +44,13 @@ | ||
41 | 44 | //side effect: the forms are now tied to the host applications main form |
42 | 45 | //in Z-order and will stay on top of it automatically. |
43 | 46 | |
47 | +{$I DEBUG.inc} | |
48 | +{$I CRC32.inc} | |
49 | + | |
50 | +initialization | |
51 | + | |
52 | +DebugCheck; | |
53 | +VerificarCRC32(GetModuleName(HInstance)); | |
54 | +VerificarCRC32(ParamStr(0)); | |
55 | + | |
44 | 56 | end. |
@@ -81,11 +81,11 @@ | ||
81 | 81 | |
82 | 82 | {$R *.dfm} |
83 | 83 | |
84 | -uses KRK.Lib.CryptoAPI.Types | |
85 | - , KRK.Lib.CryptoAPI.Utilities | |
84 | +uses KRK.Lib.CryptoAPI.Utilities | |
86 | 85 | , UStructures |
87 | 86 | , UFuncoes |
88 | - , KRK.Lib.Rtl.Common.NetworkUtils; | |
87 | + , KRK.Lib.Rtl.Common.NetworkUtils | |
88 | + , TlHelp32; | |
89 | 89 | |
90 | 90 | const |
91 | 91 | CPF_REGEX = '\Dª'#13#10 + { ###.###.###-## } |
@@ -260,4 +260,13 @@ | ||
260 | 260 | Key := #0; |
261 | 261 | end; |
262 | 262 | |
263 | +{$I DEBUG.inc} | |
264 | +{$I CRC32.inc} | |
265 | + | |
266 | +initialization | |
267 | + | |
268 | +DebugCheck; | |
269 | +VerificarCRC32(GetModuleName(HInstance)); | |
270 | +VerificarCRC32(ParamStr(0)); | |
271 | + | |
263 | 272 | end. |
@@ -2,8 +2,8 @@ | ||
2 | 2 | |
3 | 3 | interface |
4 | 4 | |
5 | -uses KRK.Lib.CryptoAPI.Types | |
6 | - , UStructures; | |
5 | +uses | |
6 | + UStructures, KRK.Lib.CryptoAPI.Utilities; | |
7 | 7 | |
8 | 8 | type |
9 | 9 | THashAlgorithms = array of THashAlgorithm; |
@@ -10,8 +10,11 @@ | ||
10 | 10 | |
11 | 11 | procedure VerifyLicense(const aAppId: PChar; const aShowRegistrationDialog: Boolean = True); stdcall; |
12 | 12 | function ValidateMasterPassword(const aAppId: PChar): Integer; stdcall; |
13 | -procedure CheckNewVersion(const aAppId: PChar; const aCompareMode: PChar; const aOperationMode: Byte = 0); stdcall; | |
14 | 13 | |
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 | + | |
15 | 18 | function RequestSerial(const aAppId: String; const aCpfCnpj: string; const aSenha: string; const aOutrasInformacoes: string; const aNomeAmigavel: String): Integer; |
16 | 19 | procedure PrepareLogin(const aiCpfCnpj: string; const aiSenha: string; out aoCpfCnpj: string; out aoSenha: string); |
17 | 20 | function getOtherInformations: String; |
@@ -30,13 +33,13 @@ | ||
30 | 33 | , KRK.Lib.Rtl.Sys.Utilities |
31 | 34 | , KRK.Lib.Rtl.Sys.Utilities.HDDPhysicalInfo |
32 | 35 | , KRK.Lib.Rtl.Common.NetworkUtils |
33 | - , KRK.Lib.CryptoAPI.Utilities | |
34 | 36 | , KRK.Components.AdditionalControls.DefinedCrypt |
35 | 37 | , KRK.Lib.Rtl.Common.FileUtils |
36 | 38 | , UFORMRegistrar |
37 | 39 | , zolmws |
38 | 40 | , UFORMMasterPassword |
39 | - , idFtp; | |
41 | + , idFtp | |
42 | + , TlHelp32; | |
40 | 43 | |
41 | 44 | // Tabela de códigos de erro |
42 | 45 | { |
@@ -65,21 +68,9 @@ | ||
65 | 68 | procedure VersionOK; |
66 | 69 | var |
67 | 70 | CurrentVersion, CorrectVersion: String; |
68 | - pDLLName: PChar; | |
69 | - nSize: Cardinal; | |
70 | - DLLName: String; | |
71 | 71 | begin |
72 | - nSize := MAX_PATH; | |
73 | - GetMem(pDLLName,nSize); | |
72 | + CurrentVersion := FileInformation(GetModuleName(HInstance),fiFullVersion).AsString; | |
74 | 73 | 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 | |
83 | 74 | CorrectVersion := GetzolmPortType.getZolmVersion; |
84 | 75 | |
85 | 76 | if CurrentVersion <> CorrectVersion then |
@@ -625,10 +616,10 @@ | ||
625 | 616 | HardwareId := GetHardwareId(aAppId,[],False); |
626 | 617 | |
627 | 618 | { Encripta o HardwareId } |
628 | - with TDefinedCrypt.Create(nil) do | |
619 | + with TKRKDefinedCrypt.Create(nil) do | |
629 | 620 | try |
630 | 621 | CryptTable := ctSafe; |
631 | - HardwareId := PublicKeyEncrypt(PublicKey,HardwareId) | |
622 | + HardwareId := SubjectToString(PublicKeyEncrypt(PublicKey,StringToSubject(HardwareId))); | |
632 | 623 | finally |
633 | 624 | Free; |
634 | 625 | end; |
@@ -812,82 +803,91 @@ | ||
812 | 803 | end; |
813 | 804 | end; |
814 | 805 | |
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; | |
830 | 883 | |
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} | |
841 | 886 | |
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 | |
847 | 888 | |
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)); | |
865 | 892 | |
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 | - | |
893 | 893 | end. |
@@ -2,7 +2,7 @@ | ||
2 | 2 | |
3 | 3 | interface |
4 | 4 | |
5 | -uses System.SysUtils; | |
5 | +uses Windows, SysUtils; | |
6 | 6 | |
7 | 7 | type |
8 | 8 | EInvalidVersion = class (Exception); |
@@ -22,4 +22,16 @@ | ||
22 | 22 | |
23 | 23 | implementation |
24 | 24 | |
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 | + | |
25 | 37 | end. |