Native executable files protection (.EXE files of PE format) is accomplished by the NwKey32.exe console utility.

NwKey32.exe embeds commands into the application’s code, required to load an external vaccine. Also, the utility executes transformations of the protected application in accordance with the options selected.

Defining List of Files for Protection

The protection utility can protect several files in one session. The list of files for protection (encryption) must be defined at the command prompt after specifying all protection options with all files separated by spaces, for example:

NwKey32.exe /GN3S /PACK /V /Q MyProg1.exe MyProg2.exe MyProg3.exe

In this case the utility will protect files MyProg1.exe, MyProg2.exe и MyProg3.exe, exe located in the current folder, pack their sections and verify its integrity along the way. Also, the autoprotection utility messages will be turned off.

The list of files may contain full paths to the files as well as "*" and "?" symbols, for example:

NwKey32.exe /GS3S C:\MyDir\*.exe

NwKey32.exe /GN3S MyExec.exe

«C:\My Distrib\*.exe» C:\Delphi_Projects\*.exe

In the first case the utility will protect and .EXE files in the current folder, in the second example it will protect file MyExec.exe and all other executive files located in folders C:\My Distrib и C:\delphi_projects. Note that you must specify the extensions of files in the list (except files without extensions) or in the mask defined using "*" and "?" symbols. 

Use of .FIL List File

You may face a situation when the permitted command line length is exceeded because of multitude of parameters and/or files.To avoid this, you can use a so called list file.

List file is a regular text file with .FIL extension containing a list of files for protection. Each file name on the list must be written in a separate line. You can specify the full path and use "*" and "?" symbols if necessary. Example of a list file:

“MyProg.exe”

c:\new_project\*.exe

c:\project-buh\*.exe

c:\new_base\Module*.exe

You need to write the list file name at the command prompt after all protection options in order to use the whole list by the utility (i.e. instead of the list of files listed in the previous section). 

For the utility to distinguish a list file, use symbol "@" to mark the list file at the prompt:

NwKey32.exe /GS3S @MyFil.fil

NwKey32.exe /GC /IMPLICIT_LINKING_SUPPORT @c:\MyDir\MyFil.fil

In the first example filenames will be retrieved from the list file named MyFil.fil located in the current folder. In the second example the utility will use list file MyFil.fil located in C:\MyDir folder.

You can specify several list files at the command prompt. This is convenient for grouping files being protected by their types:

NwKey32.exe /GN3S /GS3S @Progs.fil @Others_Utils.fil

In the example above names of all executable files of an application to be protected were placed in Progs.fil, and filenames of other utilities included into the distribution kit were placed into Others_Utils.fil.

 

 

  • No labels