{"id":217375,"date":"2014-03-31T22:00:03","date_gmt":"2014-03-31T18:00:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=217375"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=217375","title":{"rendered":"<span class=\"post_title\">\u041a\u0432\u0430\u0439\u043d \u043d\u0430 \u0410\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435? \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<habracut\/>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u0432\u0430\u0439\u043d (\u043a\u0443\u0430\u0439\u043d) \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0444\u0430\u0439\u043b\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  \u041a\u0432\u0430\u0439\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u0431\u044b\u0442\u044c \u043c\u043e\u0436\u0435\u0442, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0432\u0430\u0439\u043d\u0430 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c Win32 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u043e\u043a\u043d\u043e.<\/p>\n<p>  \u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u0435\u043a \u0447\u0438\u0441\u043b\u043e 48. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043a\u0430\u043a \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438<\/p>\n<p>  push 48 (\u0438\u043b\u0438 \u0436\u0435 push 30h),<\/p>\n<p>  \u0442\u0430\u043a \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 db<\/p>\n<p>  db 06Ah,030h (\u0438\u043b\u0438 \u0436\u0435 db 106,48).<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 db &#8216;j0&#8217;. \u0412\u043e \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u0432\u0430\u0439\u043d, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u2014 \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u0439\u043d\u0430 \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430\u043c\u0438 db \u0432 \u0432\u0438\u0434\u0435<\/p>\n<p>  <b>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a 1<\/b><\/p>\n<pre><code>.386 .model flat,stdcall .code q: db 16-\u0440\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 .... db 16-\u0440\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 end q <\/code><\/pre>\n<p>  (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440 MASM). \u0422\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u0432\u0430\u0439\u043d \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u2014 \u044d\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0439 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u043a\u0438 \u2014 \u0441\u043c. \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0438\u0436\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 2. \u0412\u0430\u0436\u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 1 \u0438 2 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  <b>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a 2<\/b><\/p>\n<pre><code>; @echo off  ; ml \/c \/coff quine.cmd ; pause ; if errorlevel 1 goto exit  ; link \/subsystem:windows \/section:.text,RW quine.obj ; pause ; del quine.obj ; goto exit  .386 .model flat,stdcall option casemap:none  include\t\t\\masm32\\include\\windows.inc  bStr\t\t= 25\t\t\t\t\t\t; \u043a\u043e\u043b-\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u0432\u0430\u0439\u043d\u0430 qLen\t\t= len * 5 + (len \/ bStr + 1) * 4 + len1 + 10\t; \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 stLen\t\t= (qLen \/ 1000h + 1) * 1000h\t\t\t; \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u0432 \u0441\u0442\u0435\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a  .code  ; *** \u0427\u0430\u0441\u0442\u044c 1 - \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 ***  start:\t\tcld \t\tmov edx,[esp]\t\t; \u0441\u0441\u044b\u043b\u043a\u0430 \u0432\u0433\u043b\u0443\u0431\u044c kernel32.dll - \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u0438 2 \t\tsub esp,stLen\t\t; \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u0441\u0442\u0435\u043a\u0435 \t\tmov edi,esp \t\tmov stAddr,edi \t\tlea esi,text \t\txor ecx,ecx \t\tmov cl,len1 rep \t\tmovsb\t\t\t; \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b '.386 .model flat ...'  \t\tlea esi,start \t\tmov bl,bStr cycl:\t\tmov eax,ecx\t\t; \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430. \u041a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438? \t\tdiv bl \t\tor ah,ah \t\tjnz comma \t\tmov ax,0A0Dh\t\t; \u0434\u0430 - \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b db\t\t \t\tstosw \t\tmov eax,'  bd' \t\tstosd \t\tdec edi \t\tjmp j1 comma:\t\tmov al,','\t\t; \u043d\u0435\u0442 - \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0431\u0430\u0439\u0442\u043e\u0432 \t\tstosb j1:\t\tmov al,'h'\t\t; \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 16-\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0439\u0442\u0430 - \u0441\u0443\u0444\u0444\u0438\u043a\u0441 h \t\tshl eax,16 \t\tlodsb \t\tmov ah,al \t\tand al,0Fh \t\tcmp al,10 \t\tsbb al,69h \t\tdas\t\t\t; \u043c\u043b\u0430\u0434\u0448\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0431\u0430\u0439\u0442\u0430 \t\txchg al,ah \t\tshr al,4 \t\tcmp al,10 \t\tsbb al,69h \t\tdas\t\t\t; \u0441\u0442\u0430\u0440\u0448\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \t\tshl eax,8 \t\tmov al,'0'\t\t; \u043f\u0440\u0435\u0444\u0438\u043a\u0441 0 \t\tstosd \t\tinc ecx \t\tcmp ecx,len \t\tjb cycl  \t\tmov ax,0A0Dh\t\t; \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 'end q' \t\tstosw \t\tmov eax,' dne' \t\tstosd \t\tmov eax,'q' \t\tstosd  ; *** \u0427\u0430\u0441\u0442\u044c 2 - \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 API \u0444\u0443\u043d\u043a\u0446\u0438\u0439 ***  \t\txor dx,dx c2:\t\tcmp word ptr [edx],'ZM'\t; MZ-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044f kernel32? \t\tje c1 c3:\t\tsub edx,10000h \t\tjmp c2 c1:\t\tmov ecx,[edx+3Ch] \t\tcmp dword ptr [edx+ecx],'EP' ; PE-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a? \t\tjne c3  \t\tmov ecx,[edx+ecx+78h] \t\tadd ecx,edx\t\t; \u0430\u0434\u0440\u0435\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 kernel32 \t\tpush ecx \t\tmov eax,[ecx+20h] \t\tadd eax,edx\t\t; \u0430\u0434\u0440\u0435\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u043c\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \t\txor ebx,ebx \t\txor ecx,ecx cycl2:\t\tmov esi,[eax+4*ebx] \t\tadd esi,edx \t\tlea edi,GPAname \t\tmov cl,len2 repe\t\tcmpsb\t\t\t; \u043f\u043e\u0438\u0441\u043a \u0441\u0442\u0440\u043e\u043a\u0438 GetProcAddress \t\tje found \t\tinc ebx \t\tjmp cycl2  found:\t\tpop ecx \t\tmov eax,[ecx+24h] \t\tadd eax,edx \t\tmov bx,[eax+2*ebx]\t; \u043e\u0440\u0434\u0438\u043d\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 GetProcAddress \t\tmov eax,[ecx+1ch] \t\tadd eax,edx \t\tmov ebx,[eax+4*ebx] \t\tadd ebx,edx \t\tmov edi,edx\t\t; EBX - \u0430\u0434\u0440\u0435\u0441 GetProcAddress \t\t\t\t\t; EDI - \u0431\u0430\u0437\u0430 \u043c\u043e\u0434\u0443\u043b\u044f kernel32 (\u0430 \u0437\u0430\u0442\u0435\u043c - user32)   \t\txor ecx,ecx\t\t; \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \t\tmov cl,tlen \t\tlea esi,tbl  cycl3:\t\tcmp cl,tlen-tlen2\t \t\tjne j2  \t\tpush ecx \t\tpush offset DLLname \t\tcall eax\t\t; \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 user32.dll \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 LoadLibrary \t\tpop ecx \t\tmov edi,eax  j2:\t\tdec cl \t\tpush ecx \t\tpush [esi+4*ecx] \t\tpush edi \t\tcall ebx\t\t; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GetProcAddress \t\tpop ecx \t\tmov [esi+4*ecx],eax  \t\tor cl,cl \t\tjnz cycl3  ; *** \u0427\u0430\u0441\u0442\u044c 3 - \u0432\u044b\u0432\u043e\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u0432 \u043e\u043a\u043d\u043e MessageBox ***  \t\tpush NULL \t\tcall dword ptr _GetModuleHandle \t\tmov hInst,eax  \t\tcall dword ptr _GetCurrentThreadId  \t\tpush eax \t\tpush NULL \t\tpush offset hProc \t\tpush WH_CBT\t\t\t; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0445\u0443\u043a\u0430 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \t\tcall dword ptr _SetWindowsHookEx \t\tmov hook,eax  \t\tpush MB_OK \t\tpush offset capt \t\tpush stAddr \t\tpush 0 \t\tcall dword ptr _MessageBox\t; \u043e\u043a\u043d\u043e \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043a\u0432\u0430\u0439\u043d\u0430  \t\tpush 0 \t\tcall dword ptr _ExitProcess  ; ***  hProc\t\tproc code:dword,wParam:dword,lParam:dword\t; \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0445\u0443\u043a\u0430 \t\tlocal coord:RECT  \t\tpusha \t\tcmp code,HCBT_ACTIVATE\t\t; \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043e\u043a\u043d\u0430? \t\tjne exit  \t\tpush 0FFFFh \t\tpush wParam \t\tcall dword ptr _GetDlgItem \t\tmov ebx,eax\t\t\t; \u0445\u044d\u043d\u0434\u043b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f  \t\tlea eax,coord \t\tpush eax \t\tpush ebx \t\tcall dword ptr _GetClientRect\t; \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \t\tadd coord.right,20  \t\tpush NULL \t\tpush NULL \t\tpush WM_GETFONT \t\tpush ebx \t\tmov edi,_SendMessage \t\tcall edi\t\t\t; \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0448\u0440\u0438\u0444\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \t\tmov esi,eax  \t\tpush SW_HIDE \t\tpush ebx \t\tcall dword ptr _ShowWindow\t; \u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430  \t\tpush NULL \t\tpush hInst \t\tpush 0FFFFh \t\tpush wParam \t\tpush coord.bottom \t\tpush coord.right \t\tpush coord.top \t\tpush coord.left \t\tpush WS_CHILD+WS_VISIBLE+ES_MULTILINE+ES_READONLY \t\tpush stAddr \t\tpush offset cname \t\tpush WS_EX_WINDOWEDGE \t\tcall dword ptr _CreateWindowEx\t; \u043e\u043a\u043d\u043e EDIT \u0432\u043c\u0435\u0441\u0442\u043e STATIC \t\t\t\t\t\t; \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c  \t\tpush NULL \t\tpush esi \t\tpush WM_SETFONT \t\tpush eax \t\tcall edi\t\t\t; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0448\u0440\u0438\u0444\u0442\u0430  \t\tpush hook \t\tcall dword ptr _UnhookWindowsHookEx ; \u0441\u043d\u044f\u0442\u0438\u0435 \u0445\u0443\u043a\u0430 \t\tpopa \t\txor eax,eax \t\tret  exit:\t\tpopa \t\tpush lParam \t\tpush wParam \t\tpush code \t\tpush hook \t\tcall dword ptr _CallNextHookEx\t; \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \t\tret hProc\t\tendp  ; *** \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435  capt\t\tdb 'Quine',0\t\t\t; \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430 GPAname\t\tdb 'GetProcAddress',0 len2\t\tequ $ - GPAname  GDIname\t\tdb 'GetDlgItem',0\t\t; \u0438\u043c\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 GCRname\t\tdb 'GetClientRect',0 SMname\t\tdb 'SendMessageA',0 SWname\t\tdb 'ShowWindow',0 CWEname\t\tdb 'CreateWindowExA',0 UWHEname\tdb 'UnhookWindowsHookEx',0 CNHEname\tdb 'CallNextHookEx',0 SWHEname\tdb 'SetWindowsHookExA',0 MBname\t\tdb 'MessageBoxA',0 LLname\t\tdb 'LoadLibraryA',0 GMHname\t\tdb 'GetModuleHandleA',0 GCTIname\tdb 'GetCurrentThreadId',0 EPname\t\tdb 'ExitProcess',0  DLLname\t\tdb 'user32.dll',0 cname\t\tdb 'EDIT',0\t\t\t; \u043a\u043b\u0430\u0441\u0441 \u043e\u043a\u043d\u0430  text\t\tdb '.386',13,10,'.model flat,stdcall',13,10,'.code',13,10,'q:' ; \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 len1\t\tequ $ - text  tbl\t\t\tlabel dword\t\t; \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0438\u043c\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430  _GetDlgItem\t\tdd offset GDIname\t; \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 user32.dll _GetClientRect\t\tdd offset GCRname _SendMessage\t\tdd offset SMname _ShowWindow\t\tdd offset SWname _CreateWindowEx\t\tdd offset CWEname _UnhookWindowsHookEx\tdd offset UWHEname _CallNextHookEx\t\tdd offset CNHEname _SetWindowsHookEx\tdd offset SWHEname _MessageBox\t\tdd offset MBname  tbl2\t\t\tlabel dword _LoadLibrary\t\tdd offset LLname\t; \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 kernel32.dll _GetModuleHandle\tdd offset GMHname _GetCurrentThreadId\tdd offset GCTIname _ExitProcess \t\tdd offset EPname tlen2\t\t\tequ ($-tbl2) \/ 4  tlen\t\t\tequ ($-tbl) \/ 4\t\t; \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b  len\t\tequ $ - start\t\t\t; \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0434\u0430  ; *** \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432 \u043a\u0432\u0430\u0439\u043d \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435  hInst\t\tdd ?\t\t\t\t; \u0445\u044d\u043d\u0434\u043b \u043c\u043e\u0434\u0443\u043b\u044f hook\t\tdd ?\t\t\t\t; \u0445\u044d\u043d\u0434\u043b \u0445\u0443\u043a\u0430 stAddr\t\tdd ?\t\t\t\t; \u0430\u0434\u0440\u0435\u0441 \u0442\u0435\u043a\u0441\u0442\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435  end start  :exit <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u044f\u0441\u0435\u043d \u0438\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u041e\u0442\u043c\u0435\u0442\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442 \u043a\u0432\u0430\u0439\u043d\u0430 (\u0442.\u0435. \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 1). \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 db (\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438 \u0448\u0438\u0440\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a \u043a\u0432\u0430\u0439\u043d\u0430), \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439 bStr \u2014 \u043e\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0440\u0430\u0432\u043d\u043e\u0439 25-\u0438. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e API \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0440\u044f\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 GetProcAddress, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f kernel32.dll. \u0417\u0430\u0442\u0435\u043c \u2014 \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GetProcAddress. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u043a\u0432\u0430\u0439\u043d\u0430 \u0432 \u043e\u043a\u043d\u043e MessageBox. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0445\u0443\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u043e\u043a\u043d\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u0432\u0430\u0439\u043d\u0430 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 2 (\u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043a\u0432\u0430\u0439\u043d\u043e\u043c) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 quine.cmd \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b quine.exe. \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f quine.exe, \u0438 \u0438\u0437 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043e\u043a\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0432\u044b\u0434\u0435\u043b\u0438\u0432 \u043c\u044b\u0448\u044c\u044e, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0444\u0430\u0439\u043b quine.asm. \u0418\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 quine.asm \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043a\u0432\u0430\u0439\u043d (\u0441\u043c. \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 1). \u0422\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p>  ml \/c \/coff quine.asm<\/p>\n<p>  \u0430 \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p>  link \/subsystem:windows \/section:.text,RW quine.obj<\/p>\n<p>  (\u0432 \u0441\u0435\u043a\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c). \u0420\u0430\u0437\u043c\u0435\u0440 len \u0441\u0435\u043a\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b 820 \u0431\u0430\u0439\u0442.<\/p>\n<p>  \u041e\u0442\u043b\u0430\u0434\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u0442\u0443\u0440\u0431\u043e \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u043e\u043c, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u043b \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<p>  invoke ExitProcess,0<\/p>\n<p>  \u043f\u0435\u0440\u0435\u0434 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 start (\u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e), \u0438 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<p>  include \\masm32\\include\\kernel32.inc<br \/>  includelib \\masm32\\lib\\kernel32.lib<\/p>\n<p>  \u0418\u043d\u0430\u0447\u0435 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u2014 \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \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\/217375\/\"> http:\/\/habrahabr.ru\/post\/217375\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<habracut\/>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u0432\u0430\u0439\u043d (\u043a\u0443\u0430\u0439\u043d) \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0444\u0430\u0439\u043b\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  \u041a\u0432\u0430\u0439\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u0431\u044b\u0442\u044c \u043c\u043e\u0436\u0435\u0442, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0432\u0430\u0439\u043d\u0430 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c Win32 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u043e\u043a\u043d\u043e.<\/p>\n<p>  \u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u0435\u043a \u0447\u0438\u0441\u043b\u043e 48. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043a\u0430\u043a \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438<\/p>\n<p>  push 48 (\u0438\u043b\u0438 \u0436\u0435 push 30h),<\/p>\n<p>  \u0442\u0430\u043a \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 db<\/p>\n<p>  db 06Ah,030h (\u0438\u043b\u0438 \u0436\u0435 db 106,48).<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 db &#8216;j0&#8217;. \u0412\u043e \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u0432\u0430\u0439\u043d, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u2014 \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u0432\u0430\u0439\u043d\u0430 \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430\u043c\u0438 db \u0432 \u0432\u0438\u0434\u0435<\/p>\n<p>  <b>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a 1<\/b><\/p>\n<pre><code>.386 .model flat,stdcall .code q: db 16-\u0440\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 .... db 16-\u0440\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 end q <\/code><\/pre>\n<p>  (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440 MASM). \u0422\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u0432\u0430\u0439\u043d \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u2014 \u044d\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0439 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u043a\u0438 \u2014 \u0441\u043c. \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0438\u0436\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 2. \u0412\u0430\u0436\u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 1 \u0438 2 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  <b>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a 2<\/b><\/p>\n<pre><code>; @echo off  ; ml \/c \/coff quine.cmd ; pause ; if errorlevel 1 goto exit  ; link \/subsystem:windows \/section:.text,RW quine.obj ; pause ; del quine.obj ; goto exit  .386 .model flat,stdcall option casemap:none  include\t\t\\masm32\\include\\windows.inc  bStr\t\t= 25\t\t\t\t\t\t; \u043a\u043e\u043b-\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u0432\u0430\u0439\u043d\u0430 qLen\t\t= len * 5 + (len \/ bStr + 1) * 4 + len1 + 10\t; \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 stLen\t\t= (qLen \/ 1000h + 1) * 1000h\t\t\t; \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u0432 \u0441\u0442\u0435\u043a\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a  .code  ; *** \u0427\u0430\u0441\u0442\u044c 1 - \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 ***  start:\t\tcld \t\tmov edx,[esp]\t\t; \u0441\u0441\u044b\u043b\u043a\u0430 \u0432\u0433\u043b\u0443\u0431\u044c kernel32.dll - \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u0438 2 \t\tsub esp,stLen\t\t; \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u0441\u0442\u0435\u043a\u0435 \t\tmov edi,esp \t\tmov stAddr,edi \t\tlea esi,text \t\txor ecx,ecx \t\tmov cl,len1 rep \t\tmovsb\t\t\t; \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b '.386 .model flat ...'  \t\tlea esi,start \t\tmov bl,bStr cycl:\t\tmov eax,ecx\t\t; \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430. \u041a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438? \t\tdiv bl \t\tor ah,ah \t\tjnz comma \t\tmov ax,0A0Dh\t\t; \u0434\u0430 - \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b db\t\t \t\tstosw \t\tmov eax,'  bd' \t\tstosd \t\tdec edi \t\tjmp j1 comma:\t\tmov al,','\t\t; \u043d\u0435\u0442 - \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0431\u0430\u0439\u0442\u043e\u0432 \t\tstosb j1:\t\tmov al,'h'\t\t; \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 16-\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0439\u0442\u0430 - \u0441\u0443\u0444\u0444\u0438\u043a\u0441 h \t\tshl eax,16 \t\tlodsb \t\tmov ah,al \t\tand al,0Fh \t\tcmp al,10 \t\tsbb al,69h \t\tdas\t\t\t; \u043c\u043b\u0430\u0434\u0448\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0431\u0430\u0439\u0442\u0430 \t\txchg al,ah \t\tshr al,4 \t\tcmp al,10 \t\tsbb al,69h \t\tdas\t\t\t; \u0441\u0442\u0430\u0440\u0448\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \t\tshl eax,8 \t\tmov al,'0'\t\t; \u043f\u0440\u0435\u0444\u0438\u043a\u0441 0 \t\tstosd \t\tinc ecx \t\tcmp ecx,len \t\tjb cycl  \t\tmov ax,0A0Dh\t\t; \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 'end q' \t\tstosw \t\tmov eax,' dne' \t\tstosd \t\tmov eax,'q' \t\tstosd  ; *** \u0427\u0430\u0441\u0442\u044c 2 - \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 API \u0444\u0443\u043d\u043a\u0446\u0438\u0439 ***  \t\txor dx,dx c2:\t\tcmp word ptr [edx],'ZM'\t; MZ-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u044f kernel32? \t\tje c1 c3:\t\tsub edx,10000h \t\tjmp c2 c1:\t\tmov ecx,[edx+3Ch] \t\tcmp dword ptr [edx+ecx],'EP' ; PE-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a? \t\tjne c3  \t\tmov ecx,[edx+ecx+78h] \t\tadd ecx,edx\t\t; \u0430\u0434\u0440\u0435\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 kernel32 \t\tpush ecx \t\tmov eax,[ecx+20h] \t\tadd eax,edx\t\t; \u0430\u0434\u0440\u0435\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u043c\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \t\txor ebx,ebx \t\txor ecx,ecx cycl2:\t\tmov esi,[eax+4*ebx] \t\tadd esi,edx \t\tlea edi,GPAname \t\tmov cl,len2 repe\t\tcmpsb\t\t\t; \u043f\u043e\u0438\u0441\u043a \u0441\u0442\u0440\u043e\u043a\u0438 GetProcAddress \t\tje found \t\tinc ebx \t\tjmp cycl2  found:\t\tpop ecx \t\tmov eax,[ecx+24h] \t\tadd eax,edx \t\tmov bx,[eax+2*ebx]\t; \u043e\u0440\u0434\u0438\u043d\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 GetProcAddress \t\tmov eax,[ecx+1ch] \t\tadd eax,edx \t\tmov ebx,[eax+4*ebx] \t\tadd ebx,edx \t\tmov edi,edx\t\t; EBX - \u0430\u0434\u0440\u0435\u0441 GetProcAddress \t\t\t\t\t; EDI - \u0431\u0430\u0437\u0430 \u043c\u043e\u0434\u0443\u043b\u044f kernel32 (\u0430 \u0437\u0430\u0442\u0435\u043c - user32)   \t\txor ecx,ecx\t\t; \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \t\tmov cl,tlen \t\tlea esi,tbl  cycl3:\t\tcmp cl,tlen-tlen2\t \t\tjne j2  \t\tpush ecx \t\tpush offset DLLname \t\tcall eax\t\t; \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 user32.dll \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 LoadLibrary \t\tpop ecx \t\tmov edi,eax  j2:\t\tdec cl \t\tpush ecx \t\tpush [esi+4*ecx] \t\tpush edi \t\tcall ebx\t\t; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GetProcAddress \t\tpop ecx \t\tmov [esi+4*ecx],eax  \t\tor cl,cl \t\tjnz cycl3  ; *** \u0427\u0430\u0441\u0442\u044c 3 - \u0432\u044b\u0432\u043e\u0434 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 \u0432 \u043e\u043a\u043d\u043e MessageBox ***  \t\tpush NULL \t\tcall dword ptr _GetModuleHandle \t\tmov hInst,eax  \t\tcall dword ptr _GetCurrentThreadId  \t\tpush eax \t\tpush NULL \t\tpush offset hProc \t\tpush WH_CBT\t\t\t; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0445\u0443\u043a\u0430 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \t\tcall dword ptr _SetWindowsHookEx \t\tmov hook,eax  \t\tpush MB_OK \t\tpush offset capt \t\tpush stAddr \t\tpush 0 \t\tcall dword ptr _MessageBox\t; \u043e\u043a\u043d\u043e \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043a\u0432\u0430\u0439\u043d\u0430  \t\tpush 0 \t\tcall dword ptr _ExitProcess  ; ***  hProc\t\tproc code:dword,wParam:dword,lParam:dword\t; \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0445\u0443\u043a\u0430 \t\tlocal coord:RECT  \t\tpusha \t\tcmp code,HCBT_ACTIVATE\t\t; \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043e\u043a\u043d\u0430? \t\tjne exit  \t\tpush 0FFFFh \t\tpush wParam \t\tcall dword ptr _GetDlgItem \t\tmov ebx,eax\t\t\t; \u0445\u044d\u043d\u0434\u043b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f  \t\tlea eax,coord \t\tpush eax \t\tpush ebx \t\tcall dword ptr _GetClientRect\t; \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \t\tadd coord.right,20  \t\tpush NULL \t\tpush NULL \t\tpush WM_GETFONT \t\tpush ebx \t\tmov edi,_SendMessage \t\tcall edi\t\t\t; \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0448\u0440\u0438\u0444\u0442 \u0442\u0435\u043a\u0441\u0442\u0430 \t\tmov esi,eax  \t\tpush SW_HIDE \t\tpush ebx \t\tcall dword ptr _ShowWindow\t; \u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430  \t\tpush NULL \t\tpush hInst \t\tpush 0FFFFh \t\tpush wParam \t\tpush coord.bottom \t\tpush coord.right \t\tpush coord.top \t\tpush coord.left \t\tpush WS_CHILD+WS_VISIBLE+ES_MULTILINE+ES_READONLY \t\tpush stAddr \t\tpush offset cname \t\tpush WS_EX_WINDOWEDGE \t\tcall dword ptr _CreateWindowEx\t; \u043e\u043a\u043d\u043e EDIT \u0432\u043c\u0435\u0441\u0442\u043e STATIC \t\t\t\t\t\t; \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c  \t\tpush NULL \t\tpush esi \t\tpush WM_SETFONT \t\tpush eax \t\tcall edi\t\t\t; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0448\u0440\u0438\u0444\u0442\u0430  \t\tpush hook \t\tcall dword ptr _UnhookWindowsHookEx ; \u0441\u043d\u044f\u0442\u0438\u0435 \u0445\u0443\u043a\u0430 \t\tpopa \t\txor eax,eax \t\tret  exit:\t\tpopa \t\tpush lParam \t\tpush wParam \t\tpush code \t\tpush hook \t\tcall dword ptr _CallNextHookEx\t; \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \t\tret hProc\t\tendp  ; *** \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435  capt\t\tdb 'Quine',0\t\t\t; \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u043a\u043d\u0430 GPAname\t\tdb 'GetProcAddress',0 len2\t\tequ $ - GPAname  GDIname\t\tdb 'GetDlgItem',0\t\t; \u0438\u043c\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 GCRname\t\tdb 'GetClientRect',0 SMname\t\tdb 'SendMessageA',0 SWname\t\tdb 'ShowWindow',0 CWEname\t\tdb 'CreateWindowExA',0 UWHEname\tdb 'UnhookWindowsHookEx',0 CNHEname\tdb 'CallNextHookEx',0 SWHEname\tdb 'SetWindowsHookExA',0 MBname\t\tdb 'MessageBoxA',0 LLname\t\tdb 'LoadLibraryA',0 GMHname\t\tdb 'GetModuleHandleA',0 GCTIname\tdb 'GetCurrentThreadId',0 EPname\t\tdb 'ExitProcess',0  DLLname\t\tdb 'user32.dll',0 cname\t\tdb 'EDIT',0\t\t\t; \u043a\u043b\u0430\u0441\u0441 \u043e\u043a\u043d\u0430  text\t\tdb '.386',13,10,'.model flat,stdcall',13,10,'.code',13,10,'q:' ; \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 len1\t\tequ $ - text  tbl\t\t\tlabel dword\t\t; \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0438\u043c\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430  _GetDlgItem\t\tdd offset GDIname\t; \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 user32.dll _GetClientRect\t\tdd offset GCRname _SendMessage\t\tdd offset SMname _ShowWindow\t\tdd offset SWname _CreateWindowEx\t\tdd offset CWEname _UnhookWindowsHookEx\tdd offset UWHEname _CallNextHookEx\t\tdd offset CNHEname _SetWindowsHookEx\tdd offset SWHEname _MessageBox\t\tdd offset MBname  tbl2\t\t\tlabel dword _LoadLibrary\t\tdd offset LLname\t; \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 kernel32.dll _GetModuleHandle\tdd offset GMHname _GetCurrentThreadId\tdd offset GCTIname _ExitProcess \t\tdd offset EPname tlen2\t\t\tequ ($-tbl2) \/ 4  tlen\t\t\tequ ($-tbl) \/ 4\t\t; \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b  len\t\tequ $ - start\t\t\t; \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0434\u0430  ; *** \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432 \u043a\u0432\u0430\u0439\u043d \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435  hInst\t\tdd ?\t\t\t\t; \u0445\u044d\u043d\u0434\u043b \u043c\u043e\u0434\u0443\u043b\u044f hook\t\tdd ?\t\t\t\t; \u0445\u044d\u043d\u0434\u043b \u0445\u0443\u043a\u0430 stAddr\t\tdd ?\t\t\t\t; \u0430\u0434\u0440\u0435\u0441 \u0442\u0435\u043a\u0441\u0442\u0430 \u043a\u0432\u0430\u0439\u043d\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435  end start  :exit <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u044f\u0441\u0435\u043d \u0438\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u041e\u0442\u043c\u0435\u0442\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432 \u0441\u0442\u0435\u043a\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442 \u043a\u0432\u0430\u0439\u043d\u0430 (\u0442.\u0435. \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 1). \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 db (\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438 \u0448\u0438\u0440\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a \u043a\u0432\u0430\u0439\u043d\u0430), \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439 bStr \u2014 \u043e\u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0440\u0430\u0432\u043d\u043e\u0439 25-\u0438. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e API \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0440\u044f\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 GetProcAddress, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f kernel32.dll. \u0417\u0430\u0442\u0435\u043c \u2014 \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GetProcAddress. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u043a\u0432\u0430\u0439\u043d\u0430 \u0432 \u043e\u043a\u043d\u043e MessageBox. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0445\u0443\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u043e\u043a\u043d\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u0432\u0430\u0439\u043d\u0430 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u043a\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 2 (\u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043a\u0432\u0430\u0439\u043d\u043e\u043c) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 quine.cmd \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u2014 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b quine.exe. \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f quine.exe, \u0438 \u0438\u0437 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043e\u043a\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0432\u044b\u0434\u0435\u043b\u0438\u0432 \u043c\u044b\u0448\u044c\u044e, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0444\u0430\u0439\u043b quine.asm. \u0418\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 quine.asm \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043a\u0432\u0430\u0439\u043d (\u0441\u043c. \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a 1). \u0422\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p>  ml \/c \/coff quine.asm<\/p>\n<p>  \u0430 \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p>  link \/subsystem:windows \/section:.text,RW quine.obj<\/p>\n<p>  (\u0432 \u0441\u0435\u043a\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c). \u0420\u0430\u0437\u043c\u0435\u0440 len \u0441\u0435\u043a\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b 820 \u0431\u0430\u0439\u0442.<\/p>\n<p>  \u041e\u0442\u043b\u0430\u0434\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u0442\u0443\u0440\u0431\u043e \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440\u043e\u043c, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u043b \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<p>  invoke ExitProcess,0<\/p>\n<p>  \u043f\u0435\u0440\u0435\u0434 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 start (\u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e), \u0438 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<p>  include \\masm32\\include\\kernel32.inc<br \/>  includelib \\masm32\\lib\\kernel32.lib<\/p>\n<p>  \u0418\u043d\u0430\u0447\u0435 \u0434\u0435\u0431\u0430\u0433\u0433\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u2014 \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \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\/217375\/\"> http:\/\/habrahabr.ru\/post\/217375\/<\/a><br \/><\/br><\/br><\/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-217375","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/217375","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=217375"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/217375\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}