{"id":327129,"date":"2022-01-10T08:46:18","date_gmt":"2022-01-10T08:46:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=327129"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=327129","title":{"rendered":"<span>\u041d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e memcpy, \u0432\u0441\u0451 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ml\/zq\/1q\/mlzq1quzuxg74cut-s-gjfmwzau.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/ml\/zq\/1q\/mlzq1quzuxg74cut-s-gjfmwzau.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0412 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043d\u0430\u043c, \u0447\u0442\u043e \u043d\u0430 <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20150727-00\/?p=90821\" rel=\"nofollow noopener noreferrer\">Itanium<\/a> \u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0430\u0441\u044c \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e.<\/p>\n<p>  \u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435, \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e!<\/p>\n<p>  \u041d\u0430 Itanium \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u044f\u0432\u0438\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u043e\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u0430 \u0438 \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0447\u0442\u0435\u043d\u0438\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">struct REMOTE_THREAD_INFO {     int data1;     int data2;     int data3; };  static DWORD CALLBACK RemoteThreadProc(REMOTE_THREAD_INFO* info) {     try {         ... use the info to do something ...     } catch (...) {         ... ignore all exceptions ...     }     return 0; } static void EndOfRemoteThreadProc() { }  \/\/ Error checking elided for expository purposes void DoSomethingCrazy() {     \/\/ Calculate the number of code bytes.     SIZE_T functionSize = (BYTE*)EndOfRemoteThreadProc - (BYTE*)RemoteThreadProc;      \/\/ Allocate memory in the remote process     SIZE_T allocSize = sizeof(REMOTE_THREAD_INFO) + functionSize;     REMOTE_THREAD_INFO* buffer = (REMOTE_THREAD_INFO*)       VirtualAllocEx(targetProcess, NULL, allocSize, MEM_COMMIT,         PAGE_EXECUTE_READWRITE);      \/\/ Write data to the remote process     REMOTE_THREAD_INFO localInfo = { ... };     WriteProcessMemory(targetProcess, buffer,                        &amp;localInfo, sizeof(localInfo));      \/\/ Write code to the remote process     WriteProcessMemory(targetProcess, buffer + 1,                        (void*)RemoteThreadProc, functionSize);      \/\/ Execute it!     CreateRemoteThread(targetProcess, NULL, 0,                        (LPTHREAD_START_ROUTINE)(buffer + 1),                        buffer); }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043b\u043e\u0445, \u0447\u0442\u043e \u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u043d\u0435\u0433\u043e \u043e\u0448\u0438\u0431\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0434\u0430\u0436\u0435 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f.<\/p>\n<p>  \u0421\u043c\u044b\u0441\u043b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0445\u043e\u0442\u0435\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u043a\u043e\u0434 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <code>Virtual\u00adAlloc<\/code> \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u0434 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c. \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u0431\u0430\u0439\u0442\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u044d\u0442\u0438 \u0431\u0430\u0439\u0442\u044b \u043a\u043e\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>Create\u00adRemote\u00adThread<\/code>.<\/p>\n<p>  \u0421\u043a\u0430\u0436\u0443 \u043f\u0440\u044f\u043c\u043e: \u0441\u0430\u043c\u0430 \u0438\u0434\u0435\u044f, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u0430.<\/p>\n<p>  \u041a\u043b\u0438\u0435\u043d\u0442 \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u00ab\u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 32-\u0431\u0438\u0442\u043d\u044b\u0445 x86 \u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 x86\u00bb, \u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Itanium.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044f \u0443\u0434\u0438\u0432\u043b\u0451\u043d, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0434\u0430\u0436\u0435 \u043d\u0430 x86!<\/p>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0432 <code>RemoteThreadProc<\/code> \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>switch<\/code> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432, \u0438 \u044d\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 x86.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043a\u043e\u0434 <i>\u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f<\/i> \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 C++, \u0430 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Microsoft \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 <code>catch<\/code>, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>catch<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0418 \u0435\u0441\u043b\u0438 \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <code>catch<\/code> \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439, \u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0444\u0438\u043b\u044c\u0442\u0440 <code>catch<\/code> \u043a \u0432\u044b\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0438 \u043d\u0430 \u0447\u0442\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u0441\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u043a\u043e\u0434 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0442\u043a\u0430\u043c\u0438 <code>EndOfRemoteThreadProc<\/code> \u0438 <code>RemoteThreadProc<\/code>.<\/p>\n<p>  \u041d\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u043b\u043e\u043a C++ try\/catch \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 C runtime support library.<\/p>\n<p>  \u0418 x86-64, \u0438 Itanium \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u044b \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438 (unwind codes), \u0430 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u043a\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043d\u0435 \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u043e\u0441\u044c, \u0438\u043b\u0438, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043e\u043d\u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0435\u0434\u043a\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <code>EndOfRemoteThreadProc<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0441\u043b\u0435 <code>RemoteThreadProc<\/code>. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u0442 \u0434\u0430\u0436\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <code>EndOfRemoteThreadProc<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c. \u041a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050322-00\/?p=36113\" rel=\"nofollow noopener noreferrer\">\u0441\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 COMDAT<\/a>, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 COMDAT, \u0442\u043e <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/build\/profile-guided-optimizations?view=msvc-160\" rel=\"nofollow noopener noreferrer\">Profile-Guided Optimization<\/a> \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u0430\u043b\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u0436\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u0431\u0430\u0439\u0442\u044b \u043a\u043e\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>RemoteThreadProc<\/code> \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u044b\u043b\u0438 \u0441\u043c\u0435\u0436\u043d\u044b\u043c\u0438! Profile-Guided Optimization \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438 \u043a\u043e\u0434 \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u043d\u044b\u043c \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u044d\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f).<\/p>\n<p>  \u0418 \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 Profile-Guided Optimization \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u0430\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043f\u0438\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u044b\u043b\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0434 \u0441\u0432\u043e\u044e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0441\u043e\u0431\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f Itanium, \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 Itanium.<\/p>\n<p>  \u0423 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 Itanium \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u044b \u043f\u043e 16-\u0431\u0430\u0439\u0442\u043d\u044b\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c, \u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0430 Itanium \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 \u043a\u043e\u0434\u0430, \u0430 \u043d\u0430 <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20150731-00\/?p=90771\" rel=\"nofollow noopener noreferrer\"><code>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u0430\u0440\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439: \u043e\u0434\u0438\u043d \u043d\u0430 gp<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 \u043a\u043e\u0434\u0430<\/a>. (\u0422\u043e\u0442 \u0436\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180816-00\/?p=99505\" rel=\"nofollow noopener noreferrer\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 PowerPC<\/a>.)<\/p>\n<p>  \u042f \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0438\u043c \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043f\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0432\u0438\u0440\u0443\u0441. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432\u0441\u0451 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: \u043a\u043b\u0438\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043d\u043e\u0433\u043e \u041f\u041e! \u0412 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u044a\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u043d\u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442 \u043d\u0435\u0451 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u043d\u0430\u043f\u0443\u0433\u0430\u043d.<\/p>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c<sup>1<\/sup> \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0438\u043d\u044a\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044b\u043b\u0430 \u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u0434\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>Load\u00adLibrary<\/code>. \u041e\u043d\u0430 \u0431\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0431\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435\u043c, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u043f\u043e\u0442\u043e\u043a\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u0431\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0421 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u0438\u0439.<\/p>\n<p>  <sup>1<\/sup> \u042f \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e <i>\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439<\/i> \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043d\u044a\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u041e\u043d \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c <i>\u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439<\/i>.<\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/598781\/\"> https:\/\/habr.com\/ru\/post\/598781\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ml\/zq\/1q\/mlzq1quzuxg74cut-s-gjfmwzau.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/ml\/zq\/1q\/mlzq1quzuxg74cut-s-gjfmwzau.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0412 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043d\u0430\u043c, \u0447\u0442\u043e \u043d\u0430 <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20150727-00\/?p=90821\" rel=\"nofollow noopener noreferrer\">Itanium<\/a> \u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0430\u0441\u044c \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e.<\/p>\n<p>  \u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435, \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e!<\/p>\n<p>  \u041d\u0430 Itanium \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u044f\u0432\u0438\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u043e\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u0430 \u0438 \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0447\u0442\u0435\u043d\u0438\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-327129","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327129"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327129\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}