{"id":181157,"date":"2013-05-27T22:56:03","date_gmt":"2013-05-27T18:56:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=181157"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=181157","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043a HotPatch<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412 <a href=\"http:\/\/habrahabr.ru\/post\/178393\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043f\u044f\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0434\u0430 \u0432 \u043d\u0435\u0439 \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0432\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:<br \/>  1. \u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043b\u043e\u0432\u0443\u0448\u043a\u0430 \u0441\u043d\u044f\u0442\u0430.<br \/>  2. \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0438\u0442\u0435\u0439.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0442.\u043a. \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u043c\u0438\u043c\u043e \u043d\u0435\u0433\u043e.<br \/>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0433\u0440\u043e\u0437\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a.<\/p>\n<p>  \u041e\u0431\u0435 \u044d\u0442\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433\u0430. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430\/\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0438 \u0442.\u043f. \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0442\u0435\u043b\u0430 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a HopPatch, \u0442.\u043a. \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0445\u043e\u0434\u0430 \u043e\u0442 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433\u043e\u043c \u0447\u0435\u0440\u0435\u0437 JMP NEAR OFFSET \u0438\u043b\u0438 PUSH ADDR + RET (\u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u0439 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c) \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442.\u043a. \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443, \u0431\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0434\u043b\u0438\u043d, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h4>1. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0432\u044b\u0437\u043e\u0432 CreateWindowExW<\/h4>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0442\u0435\u0440\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0435 API \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0441 \u043d\u0435\u0435 \u0441\u043d\u044f\u0442.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430: TMemo, TOpenDialog \u0438 TButton.<\/p>\n<p>  \u0421\u0443\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e CreateWindowExW \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0430\u043b\u043e\u0433. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0438\u0430\u043b\u043e\u0433\u0430 \u0432 TMemo \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u043c \u043e\u043a\u043d\u0430\u0445.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<p>  1. \u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430:<\/p>\n<pre><code class=\"delphi\">const   LOCK_JMP_OPKODE: Word = $F9EB;   JMP_OPKODE: Word = $E9;   type   \/\/ \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u043f\u043b\u0430\u0439\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 JMP NEAR OFFSET   TNearJmpSpliceRec = packed record     JmpOpcode: Byte;     Offset: DWORD;   end;       THotPachSpliceData = packed record     FuncAddr: FARPROC;     SpliceRec: TNearJmpSpliceRec;     LockJmp: Word;   end;   const   NearJmpSpliceRecSize = SizeOf(TNearJmpSpliceRec);   LockJmpOpcodeSize = SizeOf(Word); <\/code><\/pre>\n<p>  2. \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u0438 NEAR JMP \u0438 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 SHORT JMP<\/p>\n<pre><code class=\"delphi\">\/\/ \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043f\u0438\u0449\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 procedure SpliceNearJmp(FuncAddr: Pointer; NewData: TNearJmpSpliceRec); var   OldProtect: DWORD; begin   VirtualProtect(FuncAddr, NearJmpSpliceRecSize,     PAGE_EXECUTE_READWRITE, OldProtect);   try     Move(NewData, FuncAddr^, NearJmpSpliceRecSize);   finally     VirtualProtect(FuncAddr, NearJmpSpliceRecSize,       OldProtect, OldProtect);   end; end;   \/\/ \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 \u043f\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 procedure SpliceLockJmp(FuncAddr: Pointer; NewData: Word); var   OldProtect: DWORD; begin   VirtualProtect(FuncAddr, LockJmpOpcodeSize, PAGE_EXECUTE_READWRITE, OldProtect);   try     asm       mov  ax, NewData       mov  ecx, FuncAddr       lock xchg word ptr [ecx], ax     end;   finally     VirtualProtect(FuncAddr, LockJmpOpcodeSize, OldProtect, OldProtect);   end; end; <\/code><\/pre>\n<p>  3. \u041de\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b THotPachSpliceData<\/p>\n<pre><code class=\"delphi\">\/\/ \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 procedure InitHotPatchSpliceRec(const LibraryName, FunctionName: string;   InterceptHandler: Pointer; out HotPathSpliceRec: THotPachSpliceData); begin   \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438   HotPathSpliceRec.FuncAddr :=     GetProcAddress(GetModuleHandle(PChar(LibraryName)), PChar(FunctionName));   \/\/ \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 \u0441 \u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0430, \u0438\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0442\u0438\u0440\u0430\u0442\u044c   Move(HotPathSpliceRec.FuncAddr^, HotPathSpliceRec.LockJmp, LockJmpOpcodeSize);   \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u043f\u043a\u043e\u0434 JMP NEAR   HotPathSpliceRec.SpliceRec.JmpOpcode := JMP_OPKODE;   \/\/ \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u044b\u0436\u043a\u0430 (\u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u0430 NearJmpSpliceRecSize \u043d\u0435 \u043d\u0443\u0436\u043d\u0430,   \/\/ \u0442.\u043a. \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c)   HotPathSpliceRec.SpliceRec.Offset :=     PAnsiChar(InterceptHandler) - PAnsiChar(HotPathSpliceRec.FuncAddr); end; <\/code><\/pre>\n<p>  \u0412\u0435\u0441\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 SpliceHelper, \u043e\u043d \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0433\u043b\u0430\u0432\u0430\u0445.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"delphi\">var   HotPathSpliceRec: THotPachSpliceData;   WindowList: TStringList; <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 HotPathSpliceRec \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0435. \u0412\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u043e\u043d.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0444\u043e\u0440\u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b THotPachSpliceData.<\/p>\n<pre><code class=\"delphi\">procedure TForm1.FormCreate(Sender: TObject); begin   \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430   InitHotPatchSpliceRec(user32, 'CreateWindowExW',     @InterceptedCreateWindowExW, HotPathSpliceRec);   \/\/ \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u044b\u0436\u043e\u043a \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c NOP-\u043e\u0432   SpliceNearJmp(PAnsiChar(HotPathSpliceRec.FuncAddr) - NearJmpSpliceRecSize,     HotPathSpliceRec.SpliceRec); end; <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"delphi\">function InterceptedCreateWindowExW(dwExStyle: DWORD; lpClassName: PWideChar;   lpWindowName: PWideChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;   hWndParent: HWND; hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall; var   S: string;   Index: Integer; begin   \/\/ \u0441\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442   SpliceLockJmp(HotPathSpliceRec.FuncAddr, HotPathSpliceRec.LockJmp);   try       \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043e\u043a\u043d\u0435     Index := -1;     if not IsBadReadPtr(lpClassName, 1) then     begin       S := 'ClassName: ' + string(lpClassName);       S := IntToStr(WindowList.Count + 1) + ': ' + S;       Index := WindowList.Add(S);     end;       \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e     Result := CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle,       X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);       \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u044b\u0437\u043e\u0432\u0435 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a     if Index &gt;= 0 then     begin       S := S + ', handle: ' + IntToStr(Result);       WindowList[Index] := S;     end;         finally     \/\/ \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442     SpliceLockJmp(HotPathSpliceRec.FuncAddr, LOCK_JMP_OPKODE);   end; end; <\/code><\/pre>\n<p>  \u0418 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<pre><code class=\"delphi\">procedure TForm1.Button1Click(Sender: TObject); begin   \/\/ \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c CreateWindowExW   SpliceLockJmp(HotPathSpliceRec.FuncAddr, LOCK_JMP_OPKODE);   try     \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u043d\u0430\u0445     WindowList := TStringList.Create;     try       \/\/ \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0434\u0438\u0430\u043b\u043e\u0433       OpenDialog1.Execute;       \/\/ \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a       Memo1.Lines.Text := WindowList.Text;     finally       WindowList.Free;     end;   finally     \/\/ \u0441\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442     SpliceLockJmp(HotPathSpliceRec.FuncAddr, HotPathSpliceRec.LockJmp);   end; end; <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043a\u043e\u0434\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043e\u043d \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0434\u0438\u0430\u043b\u043e\u0433 \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u041e\u0442\u043c\u0435\u043d\u0430\u00bb, \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-VbdZjB3mUq8\/UaICRLPddfI\/AAAAAAAAAdE\/TU61q7CtEQo\/s1600\/1.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e TOpenDialog \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f 14 \u043e\u043a\u043e\u043d \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043c, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u043b\u0438 \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u0442\u0430\u043a.<\/p>\n<h4>2. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u043e\u043a\u043e\u043d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/h4>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u043a\u043e\u043d \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043c, \u0432\u0441\u044e \u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0448\u0438\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u043e\u043c \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c\u0438, \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 Spy++ \u043d\u043e \u043c\u044b \u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b, \u0447\u0442\u043e \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0438 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043f\u0435\u0435\u0447\u043d\u043e\u0435.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 TTreeView \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"delphi\">type   TdlgWindowTree = class(TForm)     WindowTreeView: TTreeView;     procedure FormCreate(Sender: TObject);   private     procedure Sys_Windows_Tree(Node: TTreeNode;       AHandle: HWND; ALevel: Integer);   end;   ...   procedure TdlgWindowTree.FormCreate(Sender: TObject); begin   Sys_Windows_Tree(nil, GetDesktopWindow, 0); end;   procedure TdlgWindowTree.Sys_Windows_Tree(Node: TTreeNode;   AHandle: HWND; ALevel: Integer); type   TRootNodeData = record     Node: TTreeNode;     PID: Cardinal;   end; var   szClassName, szCaption, szLayoutName: array[0..MAXCHAR - 1] of Char;   szFileName : array[0..MAX_PATH - 1] of Char;   Result: String;   PID, TID: Cardinal;   I: Integer;   RootItems: array of TRootNodeData;   IsNew: Boolean; begin   \/\/\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f \u043e\u043a\u043d\u0430   while AHandle &lt;&gt; 0 do   begin     \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u043a\u043d\u0430     GetClassName(AHandle, szClassName, MAXCHAR);     \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 (\u0415\u0433\u043e Caption) \u043e\u043a\u043d\u0430     GetWindowText(AHandle, szCaption, MAXCHAR);     \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f     if GetWindowModuleFilename(AHandle, szFileName, SizeOf(szFileName)) = 0 then       FillChar(szFileName, 256, #0);     TID := GetWindowThreadProcessId(AHandle, PID);       \/\/ \u0420\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430     AttachThreadInput(GetCurrentThreadId, TID, True);     VerLanguageName(GetKeyboardLayout(TID) and $FFFF, szLayoutName, MAXCHAR);     AttachThreadInput(GetCurrentThreadId, TID, False);       \/\/ \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442     Result := Format('%s [%s] Caption = %s, Handle = %d, Layout = %s',       [String(szClassName), String(szFileName), String(szCaption),       AHandle, String(szLayoutName)]);       \/\/ \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043a\u0430\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u043a\u043d\u043e     if ALevel in [0..1] then     begin       IsNew := True;       for I := 0 to Length(RootItems) - 1 do         if RootItems[I].PID = PID then         begin           Node := RootItems[I].Node;           IsNew := False;           Break;         end;       if IsNew then       begin         SetLength(RootItems, Length(RootItems) + 1);         RootItems[Length(RootItems) - 1].PID := PID;         RootItems[Length(RootItems) - 1].Node :=             WindowTreeView.Items.AddChild(nil, 'PID: ' + IntToStr(PID));         Node := RootItems[Length(RootItems) - 1].Node;       end;     end;       \/\/ \u041f\u0443\u0441\u043a\u0430\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e     Sys_Windows_Tree(WindowTreeView.Items.AddChild(Node, Result),       GetWindow(AHandle, GW_CHILD), ALevel + 1);       \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0445\u044d\u043d\u0434\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e (\u043d\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e) \u043e\u043a\u043d\u0430     AHandle := GetNextWindow(AHandle, GW_HWNDNEXT);   end; end; <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-K7EjUGBfvQk\/UaIFvIxqZGI\/AAAAAAAAAdQ\/aIhudrENzMw\/s1600\/2.png\" alt=\"image\"\/><\/p>\n<h4>3. \u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h4>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u0435\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<br \/>  1. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u043e\u043c \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0443\u044e \u0434\u0438\u0430\u043b\u043e\u0433.<br \/>  2. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0439 \u0433\u043b\u0430\u0432\u044b<br \/>  3. \u0417\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0434\u0438\u0430\u043b\u043e\u0433 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u043d\u0430\u0445.<\/p>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-EtaS0-vBUCQ\/UaIHIM6JzgI\/AAAAAAAAAdc\/wWLcaQW3zzE\/s1600\/3.png\" alt=\"image\"\/><\/p>\n<p>  \u041a\u0440\u0430\u0441\u043d\u044b\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043e\u043a\u043d\u043e \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c Auto-Suggest DropDown, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043e\u043d\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-Ow9B1ls_UzM\/UaIHp1t8OmI\/AAAAAAAAAdk\/pG6ZOLSRcv0\/s1600\/4.png\" alt=\"image\"\/><\/p>\n<p>  \u0410 \u043e\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0435\u0449\u0435 4 \u043e\u043a\u043d\u0430, \u0434\u0432\u0430 \u0441\u043a\u0440\u043e\u043b\u0431\u0430\u0440\u0430, ListView, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a \u0442\u043e\u043c\u0443-\u0436\u0435 \u0447\u0430\u0439\u043b\u0434\u043e\u043c \u0434\u0435\u0440\u0436\u0438\u0442 SysHeader32. \u0410 \u0432\u043e\u0442 \u044d\u0442\u043e \u0443\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u0425\u044d\u043d\u043b\u044b \u043e\u043a\u043d\u0430 \u0432 \u043e\u0431\u043e\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u043d\u043e \u043d\u0438 ListView, \u043d\u0438 SysHeader32, \u0434\u0430\u0436\u0435 \u0434\u0432\u0443\u0445 \u0441\u043a\u0440\u043e\u043b\u043e\u0432 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u044b \u043d\u0435 \u0432\u0438\u0434\u0438\u043c.<\/p>\n<p>  \u041d\u043e, \u0442\u043e \u0447\u0442\u043e \u043c\u044b \u0438\u0445 \u043d\u0435 \u0432\u0438\u0434\u0438\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0435\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043e\u043a\u043e\u043d \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0431\u044b\u043b \u0441\u043d\u044f\u0442, \u0430 \u044d\u0442\u043e \u043c\u043e\u0433\u043b\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u2014 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 CreateWindowExW \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.<\/p>\n<p>  \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043d\u044f\u0442\u0438\u0435 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430.<\/p>\n<h4>4. \u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 \u0441\u043d\u044f\u0442\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430.<\/h4>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/1.bp.blogspot.com\/-ZU6xpTw4WFk\/UaIK5BTYEiI\/AAAAAAAAAdw\/eUkq-Pw4eJc\/s1600\/5.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 MessageBoxW. \u0421\u0430\u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u0438\u0434\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u044e\u0449\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MOV EDI, EDI, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u044f\u044e\u0449\u0430\u044f\u0441\u044f \u043f\u044f\u0442\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 NOP.<\/p>\n<p>  \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u043c \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0443 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c HotPatch, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u043d\u0430\u043c\u0438 CreateWindowExW.<\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u043c\u0438 \u0431\u0430\u0439\u0442, \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-Fmho-dGF5uo\/UaINeMyVGwI\/AAAAAAAAAeE\/JdkYHe5dmuQ\/s1600\/6.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a.<br \/>  \u0412\u043c\u0435\u0441\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 MOV EDI, EDI \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u043a\u043e\u0434 JMP -7, \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0449\u0438\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e.<br \/>  \u0412\u043c\u0435\u0441\u0442\u043e \u043f\u044f\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 NOP, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u0440\u044b\u0436\u043e\u043a \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CreateWindowExW, \u0430 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 PUSH EBP, \u0442\u043e \u043c\u044b \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a, \u0430 \u0440\u0430\u0437 \u0442\u0430\u043a, \u0442\u043e \u0438 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0435\u0433\u043e \u0441\u043d\u0438\u043c\u0430\u0442\u044c.<\/p>\n<p>  \u0412 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"delphi\">type   TCreateWindowExW = function(dwExStyle: DWORD; lpClassName: PWideChar;     lpWindowName: PWideChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;     hWndParent: HWND; AMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall;   function InterceptedCreateWindowExW(dwExStyle: DWORD; lpClassName: PWideChar;   lpWindowName: PWideChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;   hWndParent: HWND; hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall; var   S: string;   Index: Integer;   ACreateWindowExW: TCreateWindowExW; begin     \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043e\u043a\u043d\u0435   Index := -1;   if not IsBadReadPtr(lpClassName, 1) then   begin     S := 'ClassName: ' + string(lpClassName);     S := IntToStr(WindowList.Count + 1) + ': ' + S;     Index := WindowList.Add(S);   end;     \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e   @ACreateWindowExW := PAnsiChar(HotPathSpliceRec.FuncAddr) + LockJmpOpcodeSize;   Result := ACreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle,     X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);     \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u044b\u0437\u043e\u0432\u0435 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a   if Index &gt;= 0 then   begin     S := S + ', handle: ' + IntToStr(Result);     WindowList[Index] := S;   end;   end; <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0432 \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0440\u0430\u0432\u043d\u044b\u0439 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430, \u043c\u044b \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 ACreateWindowExW, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c \u043d\u0430\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043e\u0442 \u044d\u0442\u043e \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-gbMfS3db2vQ\/UaIPqIR1HBI\/AAAAAAAAAeQ\/k8RTMAAwEEM\/s1600\/7.png\" alt=\"image\"\/><\/p>\n<p>  \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043c\u044b \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0432\u044b\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u043c \u043d\u0430\u043c \u0441\u043f\u0438\u0441\u043a\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-sByfYVVkkTQ\/UaIQKzhTSPI\/AAAAAAAAAeY\/_4XIdJgeDpk\/s1600\/8.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u043c\u044b \u0438 \u043d\u0430\u0448\u043b\u0438 \u043d\u0430\u0448\u0438\u0445 \u00ab\u043f\u043e\u0442\u0435\u0440\u044f\u0448\u0435\u043a\u00bb, \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 26 \u043e\u043a\u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 TOpenDialog, \u0430 \u043d\u0435 14.<\/p>\n<p>  \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432 \u043f\u0440\u0435\u0441\u043b\u043e\u0432\u0443\u0442\u043e\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0441\u0442\u0435\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440, \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0440\u044f\u043a\u043f\u043e\u0439\u043d\u0442 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 InterceptedCreateWindowExW.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-pWUlHNqz_Z8\/UaIR5ojP-0I\/AAAAAAAAAek\/ggHlRpAQS44\/s1600\/9.png\" alt=\"image\"\/><\/p>\n<h4>5. \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0438\u0442\u0435\u0439.<\/h4>\n<p>  \u0421 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0442\u043e \u0436\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SpliceLockJmp \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u00ablock xchg word ptr [ecx], ax\u00bb. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0438\u0442\u0438 \u0438, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0432 \u0441\u0432\u043e\u0435\u0439 \u043d\u0438\u0442\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443, \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u043c\u0438.<\/p>\n<p>  \u0418\u043c\u0435\u043d\u043d\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u0440 \u044d\u0442\u043e\u0439 \u0432\u0435\u0442\u043a\u0438: \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 recv.<\/p>\n<p>  \u0420\u0435\u0448\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043a\u0438\u043c-\u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435.<br \/>  \u041f\u0440\u0430\u0432\u0434\u0430 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0438 \u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430, \u043e\u043d \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c ThreadSafe, \u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435.<\/p>\n<h4>6. \u0412\u0441\u0435\u0433\u0434\u0430 \u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438?<\/h4>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e \u2014 \u043d\u0435\u0442, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430.<br \/>  \u041a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0443 \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 HotPatch, Microsoft \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 NOP \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 MessageBoxW \u0438\u043b\u0438 CreateWindowExW, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f PUSH EBP \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437 \u043e\u043d\u0430 \u043d\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c, \u0442\u0435\u043b\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c MOV EDI, EDI. \u0422\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043d\u043e \u0438 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0434\u043b\u0438\u043d\u043e\u0439 \u0442\u0440\u0438 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0431\u0430\u0439\u0442. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u0435\u0435 \u0442\u0435\u043b\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u043e\u0439, \u0432\u0435\u0434\u044c \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f HotPatch \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u044b (\u043f\u044f\u0442\u044c NOP \u0438 2 \u0431\u0430\u0439\u0442\u0430).<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u043e\u043c\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 RtlCreateUnicodeString.<br \/>  \u041e\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 PUSH $0C.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-7TVt0zuTFhg\/UaIX6rbarxI\/AAAAAAAAAew\/bX_TCyVqG9I\/s1600\/10.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430, \u044d\u0442\u043e \u0433\u0440\u043e\u0437\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438.<\/p>\n<p>  \u0421\u0442\u0430\u043b\u043e \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0437\u0430\u0442\u0435\u0440\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0430\u0436\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-lcajLqVbZ5Q\/UaIZOIlya9I\/AAAAAAAAAe8\/wPTDq1gz7_U\/s1600\/11.png\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0442\u0435\u0440\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 HotPathSpliceRec.LockJmp, \u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043c\u044b \u0435\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c.<\/p>\n<p>  \u041d\u0443 \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u043a\u0443\u0447\u0435 (\u043d\u0443 \u0442\u043e\u0447\u043d\u0435\u0435 \u043d\u0435 \u0432 \u043a\u0443\u0447\u0435, \u0430 \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442.\u043a. Delphi \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c Heap \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e) \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043c\u044b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c CALL \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 HotPathSpliceRec.LockJmp \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u043e \u044d\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0442\u043e\u043f\u043e\u0440\u043d\u043e, \u0432\u0441\u0435-\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e JMP \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 $77B062FB, \u0441\u043c. \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443) \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043e\u0444\u0444\u0441\u0435\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0412 \u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043d\u0430\u0441 \u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0441\u043c \u0432\u0441\u0442\u0430\u0432\u043e\u043a.<\/p>\n<p>  <b>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/b><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 \u0430\u0441\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d, \u0432\u043e\u0437\u043b\u043e\u0436\u0438\u0432 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440.<\/p>\n<p>  \u0422.\u0435. \u0433\u0440\u0443\u0431\u043e \u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"delphi\">function TrampolineRtlCreateUnicodeString(DestinationString: PUNICODE_STRING;   SourceString: PWideChar): Integer; stdcall; begin   asm     db $90, $90, $90, $90, $90, $90, $90   end; end;   function InterceptedRtlCreateUnicodeString(DestinationString: PUNICODE_STRING;   SourceString: PWideChar): Integer; stdcall; begin   Result := TrampolineRtlCreateUnicodeString(DestinationString, SourceString);   ShowMessage(DestinationString^.Buffer); end; <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d\u0430 \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d\u0430 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043e 7 \u0431\u0430\u0439\u0442, \u0447\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0445\u0432\u0430\u0442\u0438\u0442 \u043d\u0430\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0439 \u0437\u0430\u0442\u0435\u0440\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u043f\u044f\u0442\u0438\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0439 NEAR JMP.<br \/>  \u0421\u0430\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430, \u0438 \u0441 \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441.<br \/>  \u0415\u0441\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0438 7 \u0431\u0430\u0439\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430, \u0442\u043e \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e Delphi. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Delphi \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u043e\u043b\u043e\u0433 \u0438 \u044d\u043f\u0438\u043b\u043e\u0433.<\/p>\n<p>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0442\u0447\u0430 \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"delphi\">function TrampolineRtlCreateUnicodeString(DestinationString: PUNICODE_STRING;   SourceString: PWideChar): Integer; stdcall; begin   asm     push $0C        \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u0430\u0442\u0435\u0440\u0442\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440     jmp $77B062FB   \/\/ \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u044b\u0436\u043e\u043a \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e   end; end; <\/code><\/pre>\n<p>  \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043d \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-HPcUzUR-ZiU\/UaIg0HE3NhI\/AAAAAAAAAfI\/Uu1Bk8kc40A\/s1600\/12.png\" alt=\"image\"\/><\/p>\n<p>  \u0422.\u0435. \u043d\u0430 \u0441\u0442\u0435\u043a\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 DestinationString \u0438 SourceString \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 EBP \u0438 ECX, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c.<\/p>\n<p>  \u042d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043c \u043f\u0440\u043e\u0449\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u0434 \u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0437\u0430\u0442\u0438\u0440\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u0440\u043e\u043b\u043e\u0433\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0443 \u0430 \u0432\u0435\u0434\u044c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u0442.\u043a. \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u044b\u0436\u043a\u0430 \u0432 \u0442\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u0438\u0441\u043a\u043e\u0440\u0435\u0436\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0448\u0438\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d, \u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0435\u0435 \u0432\u044b\u0437\u043e\u0432, \u0442.\u0435. \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<pre><code class=\"delphi\">\/\/ \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 procedure InitHotPatchSpliceRecEx(const LibraryName, FunctionName: string;   InterceptHandler, Trampoline: Pointer; out HotPathSpliceRec: THotPachSpliceData); var   OldProtect: DWORD;   TrampolineSplice: TNearJmpSpliceRec; begin   \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438   HotPathSpliceRec.FuncAddr :=     GetProcAddress(GetModuleHandle(PChar(LibraryName)), PChar(FunctionName));   \/\/ \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 \u0441 \u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0430, \u0438\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0442\u0438\u0440\u0430\u0442\u044c   Move(HotPathSpliceRec.FuncAddr^, HotPathSpliceRec.LockJmp, LockJmpOpcodeSize);     \/\/ \u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d   VirtualProtect(Trampoline, LockJmpOpcodeSize + NearJmpSpliceRecSize,     PAGE_EXECUTE_READWRITE, OldProtect);   try     Move(HotPathSpliceRec.LockJmp, Trampoline^, LockJmpOpcodeSize);     TrampolineSplice.JmpOpcode := JMP_OPKODE;     TrampolineSplice.Offset := PAnsiChar(HotPathSpliceRec.FuncAddr) -       PAnsiChar(Trampoline) - NearJmpSpliceRecSize;     Trampoline := PAnsiChar(Trampoline) + LockJmpOpcodeSize;     Move(TrampolineSplice, Trampoline^, SizeOf(TNearJmpSpliceRec));   finally     VirtualProtect(Trampoline, LockJmpOpcodeSize + NearJmpSpliceRecSize,       OldProtect, OldProtect);   end;     \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u043f\u043a\u043e\u0434 JMP NEAR   HotPathSpliceRec.SpliceRec.JmpOpcode := JMP_OPKODE;   \/\/ \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u044b\u0436\u043a\u0430 (\u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u0430 NearJmpSpliceRecSize \u043d\u0435 \u043d\u0443\u0436\u043d\u0430,   \/\/ \u0442.\u043a. \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u0441\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c)   HotPathSpliceRec.SpliceRec.Offset :=     PAnsiChar(InterceptHandler) - PAnsiChar(HotPathSpliceRec.FuncAddr); end; <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0432\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"delphi\">type   UNICODE_STRING = record     Length: WORD;     MaximumLength: WORD;     Buffer: PWideChar;   end;   PUNICODE_STRING = ^UNICODE_STRING;     function  RtlCreateUnicodeString(DestinationString: PUNICODE_STRING;     SourceString: PWideChar): BOOLEAN; stdcall; external 'ntdll.dll';   ...   procedure TForm2.FormCreate(Sender: TObject); begin   \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430 \u0438 \u0442\u0440\u0430\u043c\u043f\u043b\u0438\u043d   InitHotPatchSpliceRecEx('ntdll.dll', 'RtlCreateUnicodeString',     @InterceptedRtlCreateUnicodeString, @TrampolineRtlCreateUnicodeString,     HotPathSpliceRec);   \/\/ \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u044b\u0436\u043e\u043a \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c NOP-\u043e\u0432   SpliceNearJmp(PAnsiChar(HotPathSpliceRec.FuncAddr) - NearJmpSpliceRecSize,     HotPathSpliceRec.SpliceRec); end;   procedure TForm2.Button1Click(Sender: TObject); var   US: UNICODE_STRING; begin   \/\/ \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c RtlCreateUnicodeString   SpliceLockJmp(HotPathSpliceRec.FuncAddr, LOCK_JMP_OPKODE);   try     RtlCreateUnicodeString(@US, 'Test UNICODE String');   finally     \/\/ \u0441\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442     SpliceLockJmp(HotPathSpliceRec.FuncAddr, HotPathSpliceRec.LockJmp);   end; end; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<h4>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433\u0430, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u0448\u0435\u0441\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043a HotPatch-\u0443. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 MOV EDI, EDI \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041e\u043d \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u043f\u0440\u0430\u0432\u0434\u0430 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>  \u0418\u0437\u0432\u0438\u043d\u044f\u044e\u0441\u044c \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0440\u043e\u0431\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043d\u0430 \u043a\u0443\u0441\u043a\u0438 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0432\u0441\u0435 \u0441\u0440\u0430\u0437\u0443, \u043d\u043e \u043a\u0430\u043a \u043c\u043d\u0435 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b\u0438 \u0435\u0449\u0435 \u0433\u043e\u0434 \u043d\u0430\u0437\u0430\u0434, \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043c\u0430\u043b\u044b\u043c\u0438 \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044f \ud83d\ude42<\/p>\n<p>  \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0432 \u043a\u0443\u0447\u0443, \u0442\u043e \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u044d\u0442\u043e \u0437\u0430\u0439\u043c\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0435\u0433\u043e \u043d\u0435\u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0432\u0438\u0434\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 (\u043f\u0440\u0435\u0446\u0435\u0434\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438).<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u0442\u0430\u043a.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u043f\u043e <a href=\"http:\/\/rouse.drkb.ru\/blog\/intercept2.zip\">\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<p>   \u2014 \u00a9 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 (Rouse_) \u0411\u0430\u0433\u0435\u043b\u044c<br \/>  \u041c\u0430\u0439, 2013    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/181157\/\"> http:\/\/habrahabr.ru\/post\/181157\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412 <a href=\"http:\/\/habrahabr.ru\/post\/178393\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043f\u044f\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u0434\u0430 \u0432 \u043d\u0435\u0439 \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0432\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:<br \/>  1. \u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043b\u043e\u0432\u0443\u0448\u043a\u0430 \u0441\u043d\u044f\u0442\u0430.<br \/>  2. \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0438\u0442\u0435\u0439.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0432 \u0446\u0435\u043b\u043e\u043c, \u0442.\u043a. \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u043c\u0438\u043c\u043e \u043d\u0435\u0433\u043e.<br \/>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0433\u0440\u043e\u0437\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a.<\/p>\n<p>  \u041e\u0431\u0435 \u044d\u0442\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433\u0430. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430\/\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0438 \u0442.\u043f. \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0442\u0435\u043b\u0430 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a HopPatch, \u0442.\u043a. \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0445\u043e\u0434\u0430 \u043e\u0442 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0441\u043f\u043b\u0430\u0439\u0441\u0438\u043d\u0433\u043e\u043c \u0447\u0435\u0440\u0435\u0437 JMP NEAR OFFSET \u0438\u043b\u0438 PUSH ADDR + RET (\u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u0439 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c) \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442.\u043a. \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443, \u0431\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0434\u043b\u0438\u043d, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/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-181157","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/181157","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=181157"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/181157\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}