Executable

Files that can be loaded and executed by the operating system
Collection
zero Useful+1
zero
Executable file refers to the file that can be loaded and executed by the operating system. In different operating system environments, executable programs are presented in different ways.
Under the Windows operating system, executable programs can be. exe files,. sys files,. com files and other types of files.
Chinese name
Executable
Foreign name
executable file
Extended file name
.exe

interpretation

Announce
edit
as Notepad program notepad.exe , This kind program Usually used to process or assist in processing other files. For example, myfile.txt can be opened by double clicking notepad.exe Notepad Program to edit.
We can do one thing. We can write the order and specific things to do in the mybat.bat file, and then run it to execute the events to be done.
It can be understood as: such files can be "run alone", or understood as "live" files!
If it is described with a common example: clothes, shoes, etc. are ordinary files, then people are executable files! People can make clothes, but clothes must be made by people. Cloth should also be processed into clothes by people!

script

Announce
edit
Not all Executive file They only contain information that can be read by computers. with scripting language All script files written can be Executive file , and the information contained therein can be read by humans, most of which are saved in ASCII text. The reason is that scripting language does not need to go through compiler Precompiled, you can Literal translator (such as Perl, Python, Shell)

development process

Announce
edit
In DOS, the steps to generate an executable file are relatively simple compiler take source program Compile as Obj file , reuse Linker Link the obj file into an exe file, and develop it in different languages process All the same.
The contents in the DOS executable file are source program Written in code And data definition. The only exception is the exe file with overlay, which appends some custom data to the basic exe file. The length of the executable part is determined by File Header The length in offset 0002h and 0004h is given. The part from this length to the actual length of the file is the Overlay part. In this way, even if the size of an exe file with overlay is much larger than 640 KB, it can run in DOS because operating system Load only the real executable, and then program Read the data of the covered part yourself. Some packaging Software The extremely large self extracting package generated uses this structure. The executable part is Unpack code The coverage part is the compressed data. DOS does not specify the data format of the executable file coverage, which is organized by programmers in their own way. If the programmer wants, he can put these data in another file separately.
Win32 executables are called PE files. The basic structure of the PE file is very different from that of the DOS executable file. It takes program The different parts of Nodal region (Section), where a section area can be used to place various resources, such as menus, dialog boxes bitmap cursor , icons, sounds, etc. Although the resource part can be understood as the "overlay" part of the DOS executable, the format of the resource is fixed because it is a standard and very important part of the Win32 executable. So it is the same as DOS Software Development of process Compared with the development of Win32 software, there is one more creation resource file Step of.
To use MASM32 software package For example, in the process of developing software with Win32 assembly, the work that the programmer needs to do is divided into creation code And creating resources, as shown in Figure 2.1.
code Part of the development work is the same as the steps of writing code under DOS. For programmers text editor Writing an assembly source code (*. asm file). And C source code Similarly, the asm file can also use the include statement to contain the header file of data definition and function declaration. The header file of Win32 assembly generally uses inc as the extension. Most include files are compiler software package For example, the Windows.inc file provided with the MASM32 software package defines many parameters and data structure Other inc files are Win32 API function declarations in different DLLs. Finally, the asm file is assembled compiler Compile to an object file with obj extension.
resource file Can include dialog boxes Shortcut key menu , string, version information, and some graphic resources. resource file The source file of“ script ”The extension of the file is generally rc grammar Different types of resources are defined Script file Finally, resources compiler Compile into resource file *. res. resources Script file Many predefined values are also used, so software package In general, the resource header file is also included for the source file to import. MASM32 software package The resource header file in is Resource. h.
stay resource file Different types of resources are recorded in different ways. The dialog resource only records the defined values, such as the size and location of the dialog box, and does not really store the dialog box screen Pixels on. The size, location and other information are not available until Windows finally explains them screen Is drawn as a pixel on; menu , string Shortcut key Etc text Composition; Graphics resources are really composed of pixels script Is defined as a file name by the resource compiler Import from a disk file. The graphic files supported by Windows in resources are bmp Bitmap file , cur cursor file and ico Icon file , these drawing files can be processed with other drawings Software Build. In addition, wav sound files can also be used in resources. The method of creating resources is described in detail in Chapter 5.
Compile well Destination file *. obj and resource file *After. res, the last step is to use Linker Link them into executable files. The function library is used when linking. In DOS environment programming The function library used is Static library Static library Some have been compiled code modular. When the user is in the source program When a function is used in, Linker From the library file, select the Binary code Take it out and combine it with the obj file to generate the final exe file. However, in the Win32 environment, most of the public Function encapsulation stay DLL file Middle, with dynamic link For User program Call. At this time, the library file only needs to contain the location information of the function in the DLL, and no longer needs to have Binary code part. Therefore, when linking, only the location information in the library file is taken out and put into the final executable file. The Win32 library file that only contains location information is called Import Library

Antivirus

Announce
edit
Virus detection and removal

File virus

stay computer virus Most of them are file type. The so-called file type virus refers to that such virus parasitizes on the executable file and spreads by relying on the executable file. Mathematically process In fact, it is the reverse process of virus infection. Through detection, (jump, decoding), we have obtained all the virus bodies code The data used to restore the virus must be in the virus. As long as these data are found, the file can be recovered according to certain programs or methods, that is, the virus can be removed.

Boot virus

There are also many kinds of such viruses. The first virus found in China, the "small ball" virus, is the guiding virus, which occupies floppy disk Or the first a sector , before operating system Get right computer Control, affect the I/O access speed of the system, and interfere with the normal operation of the system; Such viruses can be removed by address method, relative method, logical method, coverage method and special method.

Memory detoxification

Because the live virus in the memory will interfere with the anti-virus Software Therefore, almost all anti-virus software designers should consider memory detoxification. The new memory detoxification technology is to find the location of viruses in memory and reconstruct some of them code To disable its propagation function.

Unknown virus detection

Through the analysis of a large number of viruses, we can grasp the commonness of viruses, classify them according to their development and derivation laws, and summarize the common viruses code (These codes are the root of the existence, spread and attack of viruses). The weighted statistical values of these codes contained in the file are used as the basis for detecting unknown viruses file format Knowledge analysis start code, through a certain degree of Disassembly And prediction jump, and report the unknown virus based on the comprehensive results. This method is based on the unique virus description language, which has the characteristics of accurate description and low false alarm rate.

Package file virus

package program Are some common Tool software , which can wrap executable files and reduce disk size Space occupied To speed up the operation. But after a virus is wrapped, the virus will be protected, making all kinds of anti-virus Software Cannot find. When an executable file that has been wrapped and contains a virus is executed, the virus will spread everywhere, using anti-virus Software After the virus is removed, the virus in the wrapped executable file remains, which is more harmful. Through unique Unpack The wrapping module can check the wrapped virus without destroying the wrapped executable without virus.

Compression tool

There are often some files processed by the compression tool on the disk, which can save disk space and facilitate confidentiality and portability. However, if someone unintentionally compresses a virus infected file with a compression tool, then general anti-virus Software Can't get the virus from Compressed file As found in decompression Algorithms and process processing can eradicate this virus.

Network virus prevention

For stand-alone virus prevention, use the above technologies or use anti-virus with corresponding functions Software Basic guarantee computer system Be free from viruses. Compared with the protection of stand-alone viruses, Network virus The prevention and control of network virus is more difficult Network management integrate. The biggest advantage of network anti-virus is the management function of the network. If the management function is not added, it is difficult to complete the task of network anti-virus. Only the combination of management and prevention can ensure the good operation of the system.
The management function is to manage all network equipment And operations: from the Hub Switch . Server to PC, including access to floppy disks, information exchange on local area networks, and connection with the Internet.
Generally speaking, computer virus The prevention and cure of is to improve operating system and Application software But under the network environment, we should take new preventive measures accordingly. In the network environment, the virus spreads quickly, and it is difficult to remove it with a single anti-virus product Network virus , must be suitable for LAN WAN A full range of anti-virus products.
To achieve computer virus Prevention and control of Computer network system Upper installation Network virus Prevention server; Can be inside Network server Install network virus prevention on Software Anti virus software for stand-alone environment can be installed on a stand-alone

Linux

The format of Linux executable file is ELF, that is, Executable and Linkable Format.
Format:
ELF header
program header table
.txt .rodata .data
Section header table

Mac

The Mac executable file format is Mach-O, that is, Mach Object format.