
Utility to search for applications compiled by Intel C ++ Compiler and then disable the “processor manager” in them
In continuation of my article “Testing a program compiled by Intel Compiler on an AMD system. "Before" and "after" the patch " decided to automate the process of searching for executable files on the computer compiled by Intel C ++ / Fortran Compiler. The result was a small utility, which is described in detail under the cut. This utility may be useful to owners of processors other than Intel to improve the performance of such programs.
Warning : this article is intended for experienced users and programmers. Perhaps it will be difficult for an unprepared reader to understand.
For those who have not read the article " Will Intel have to remove from the compiler a function that intentionally produces bad code for AMD processors?"let me quote a short excerpt from it: “A compiler for program code can produce several versions of machine code, each of which is optimized for a specific processor and set of instructions, for example, SSE2, SSE3, etc. The system includes a function that determines which type of processor it is running on and selects the most suitable version. This feature is called the processor manager. The Intel processor manager checks not only the instruction set supported by the
processor, but also the processor manufacturer identifier. If the identifier is the string “GenuineIntel”, then the most optimal version of the code is selected. But if the processor is not from Intel, in most cases the slowest possible option will be chosen, even if the processor is fully compatible with the best version ”
Thus, by disabling this same “processor manager”, it is possible to slightly increase the performance of programs and libraries compiled using Intel C ++ Compiler or Intel Fortran Compiler on processors other than Intel. The only question that arises is how to determine, among many thousands of executable files in the system, is this or that program compiled using the Intel Compiler? For this, this utility was written. I will not repeat and describe in detail the technical side of the implementation; this was discussed in my previous article and is described in detail in the README.TXT file that is included with the utility. By the way, before using this utility, I highly recommend reading it. So, Intel Compiler Patcher (hereinafter ICP):

The program has a fairly simple "Spartan" interface, which consists of a main window on which the buttons for managing the program are located, a list of found files and below - information about each found file. Work with the program is reduced to two main stages: 1) directly scanning (searching) files and 2) disabling the processor manager in the found files (patching). Before you start scanning files, you can set the search parameters by clicking the “Options” button, although in general the “default” settings are suitable.

The following is a description of the program settings from the README.TXT file:
"Minimum size" - The minimum size of the scanned files. By default, the size is 500 bytes. You cannot change the parameter downward, since it is unlikely that you will encounter an executable file in Windows less than five hundred bytes.
“Maximum size” - The maximum size of the scanned files. The default is 100 Mb. Reducing this parameter will increase the scanning speed, since ICP loads FULLY each file into RAM.
“Search for files with not the same case” - This parameter should be explained in more detail. Usually, the processor type checking procedure in Intel compilers consists of three signature comparison commands “Genu”, “ineI”, “ntel” with the same register, that is, for example, only with EAX or only with EDX, etc. However, there are executable files in which signature verification is performed with various registers, for example: cmp eax, "Genu"; cmp ebx, "ineI"; cmp edx, ntel. Such a comparison algorithm is usually used simply to identify the processor and does not indicate that the program belongs to Intel Compiler. On the other hand, the program may initially encounter a regular check of the Intel processor manager (comparison with the same register), but somewhere at the end of the program there is already a processor-type verification algorithm written by the programmer. By default, this option is disabled. Its inclusion is not recommended if you do not understand what you are doing.
“Search for files with an odd number of matches” - The verification procedure in the Intel processor manager consists of three comparison commands. So, for example, if the program contains only one cmp eax comparison command, “Genu” does not mean that the program belongs to Intel Compiler, but about its own function for determining the type of processor written by the programmer. However, as in the previous case, it is possible that at the beginning of the program there is a usual check of the Intel processor manager (cmp eax, "Genu"; cmp eax, "ineI"; cmp eax, "ntel"), and somewhere at the end programs - the lone cmp ebx team, "Genu". By default, this option is disabled. Its inclusion is not recommended if you do not understand what you are doing.
“Make backup” - Back up files before changing them
(patch). The file is copied to the same directory where the original file is located, with the extension .orig By default, this function is enabled.
“File Extensions” - indicates files with which extensions to search. By default, ICP searches and verifies all files with the extensions ".EXE", ".DLL", ".ACM", ".AX", ".CPL", ".OCX". Each extension must begin with a period; the delimiter is the symbol ";" (semicolon).
"Language" - the language of the program interface.
“Automatic scrolling of the file list” - Allows you to automatically scroll to the bottom of the list of files when scanning. Enabled by default.
“Include log file” - Allows you to enable logging of program actions. The log file has the name "icc_patch.log" and is created in the directory,
When all settings are configured, you can begin to scan files directly. To do this, click on the “Search” button and select the initial directory from where the recursive traversal of files will begin. The scanning process is displayed in the lower status bar. During scanning, as files are located, they are added to the list in the center of the main window. By clicking on the file name in the list, you can see information about the file, including the found signatures. The scanning process can be stopped by the “Stop” button or wait for completion.

When the scan is completed, it remains only to check the necessary files with checkmarks, click the “Patch” button and wait for completion. Files that are successfully patched are grayed out in the list.
This program can make changes to executable files of third-party developers, firms, and companies. As a result of this, you may violate the terms of the license agreement of the programs on the “inadmissibility of modifying the program and
its parts. Please, before using this program to modify any third-party executable files, read the license terms of these programs.
You can download the program here: http://rghost.ru/users/tronix286/releases/intel-compiler-patcher
Warning : this article is intended for experienced users and programmers. Perhaps it will be difficult for an unprepared reader to understand.
For those who have not read the article " Will Intel have to remove from the compiler a function that intentionally produces bad code for AMD processors?"let me quote a short excerpt from it: “A compiler for program code can produce several versions of machine code, each of which is optimized for a specific processor and set of instructions, for example, SSE2, SSE3, etc. The system includes a function that determines which type of processor it is running on and selects the most suitable version. This feature is called the processor manager. The Intel processor manager checks not only the instruction set supported by the
processor, but also the processor manufacturer identifier. If the identifier is the string “GenuineIntel”, then the most optimal version of the code is selected. But if the processor is not from Intel, in most cases the slowest possible option will be chosen, even if the processor is fully compatible with the best version ”
Thus, by disabling this same “processor manager”, it is possible to slightly increase the performance of programs and libraries compiled using Intel C ++ Compiler or Intel Fortran Compiler on processors other than Intel. The only question that arises is how to determine, among many thousands of executable files in the system, is this or that program compiled using the Intel Compiler? For this, this utility was written. I will not repeat and describe in detail the technical side of the implementation; this was discussed in my previous article and is described in detail in the README.TXT file that is included with the utility. By the way, before using this utility, I highly recommend reading it. So, Intel Compiler Patcher (hereinafter ICP):

The program has a fairly simple "Spartan" interface, which consists of a main window on which the buttons for managing the program are located, a list of found files and below - information about each found file. Work with the program is reduced to two main stages: 1) directly scanning (searching) files and 2) disabling the processor manager in the found files (patching). Before you start scanning files, you can set the search parameters by clicking the “Options” button, although in general the “default” settings are suitable.
Settings

The following is a description of the program settings from the README.TXT file:
"Minimum size" - The minimum size of the scanned files. By default, the size is 500 bytes. You cannot change the parameter downward, since it is unlikely that you will encounter an executable file in Windows less than five hundred bytes.
“Maximum size” - The maximum size of the scanned files. The default is 100 Mb. Reducing this parameter will increase the scanning speed, since ICP loads FULLY each file into RAM.
“Search for files with not the same case” - This parameter should be explained in more detail. Usually, the processor type checking procedure in Intel compilers consists of three signature comparison commands “Genu”, “ineI”, “ntel” with the same register, that is, for example, only with EAX or only with EDX, etc. However, there are executable files in which signature verification is performed with various registers, for example: cmp eax, "Genu"; cmp ebx, "ineI"; cmp edx, ntel. Such a comparison algorithm is usually used simply to identify the processor and does not indicate that the program belongs to Intel Compiler. On the other hand, the program may initially encounter a regular check of the Intel processor manager (comparison with the same register), but somewhere at the end of the program there is already a processor-type verification algorithm written by the programmer. By default, this option is disabled. Its inclusion is not recommended if you do not understand what you are doing.
“Search for files with an odd number of matches” - The verification procedure in the Intel processor manager consists of three comparison commands. So, for example, if the program contains only one cmp eax comparison command, “Genu” does not mean that the program belongs to Intel Compiler, but about its own function for determining the type of processor written by the programmer. However, as in the previous case, it is possible that at the beginning of the program there is a usual check of the Intel processor manager (cmp eax, "Genu"; cmp eax, "ineI"; cmp eax, "ntel"), and somewhere at the end programs - the lone cmp ebx team, "Genu". By default, this option is disabled. Its inclusion is not recommended if you do not understand what you are doing.
“Make backup” - Back up files before changing them
(patch). The file is copied to the same directory where the original file is located, with the extension .orig By default, this function is enabled.
“File Extensions” - indicates files with which extensions to search. By default, ICP searches and verifies all files with the extensions ".EXE", ".DLL", ".ACM", ".AX", ".CPL", ".OCX". Each extension must begin with a period; the delimiter is the symbol ";" (semicolon).
"Language" - the language of the program interface.
“Automatic scrolling of the file list” - Allows you to automatically scroll to the bottom of the list of files when scanning. Enabled by default.
“Include log file” - Allows you to enable logging of program actions. The log file has the name "icc_patch.log" and is created in the directory,
Scanning
When all settings are configured, you can begin to scan files directly. To do this, click on the “Search” button and select the initial directory from where the recursive traversal of files will begin. The scanning process is displayed in the lower status bar. During scanning, as files are located, they are added to the list in the center of the main window. By clicking on the file name in the list, you can see information about the file, including the found signatures. The scanning process can be stopped by the “Stop” button or wait for completion.
Patch

When the scan is completed, it remains only to check the necessary files with checkmarks, click the “Patch” button and wait for completion. Files that are successfully patched are grayed out in the list.
ATTENTION
This program can make changes to executable files of third-party developers, firms, and companies. As a result of this, you may violate the terms of the license agreement of the programs on the “inadmissibility of modifying the program and
its parts. Please, before using this program to modify any third-party executable files, read the license terms of these programs.
Download
You can download the program here: http://rghost.ru/users/tronix286/releases/intel-compiler-patcher