<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>coden.tistory.com</title>
    <link>https://coden.tistory.com/</link>
    <description></description>
    <language>ko</language>
    <pubDate>Fri, 24 Jul 2026 08:24:59 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>Нуеоп</managingEditor>
    <item>
      <title>_beginthreadex() 오류</title>
      <link>https://coden.tistory.com/68</link>
      <description>&lt;br /&gt;
&lt;STRONG&gt;문제&lt;/STRONG&gt;&lt;br /&gt;
_CrtIsValidHeapPointer&lt;br /&gt;
관련 오류가 발생한 경우, &lt;br /&gt;
&lt;br /&gt;&lt;STRONG&gt;해결방법&lt;br /&gt;
&lt;/STRONG&gt;
&lt;DIV style=&quot;BORDER-BOTTOM: #e7fdb5 1px solid; BORDER-LEFT: #e7fdb5 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #e7fdb5; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #e7fdb5 1px solid; BORDER-RIGHT: #e7fdb5 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;[Properties] -&amp;gt; [Linker] -&amp;gt; [Input] -&amp;gt; [Additional Dependencies]&lt;br /&gt;
nochkclr.obj는 제거, msvcrt.lib는 추가&lt;br /&gt;
&lt;br /&gt;[Properties] -&amp;gt; [Linker] -&amp;gt; [Input] -&amp;gt; [Force Symbol References]&lt;br /&gt;
&lt;A href=&quot;mailto:__DllMainCRTStartup@12&quot;&gt;__DllMainCRTStartup@12&lt;/A&gt; 추가&lt;br /&gt;
&lt;br /&gt;[Properties] -&amp;gt; [Linker] -&amp;gt; [Command Line] -&amp;gt; [Additional options]&lt;br /&gt;
/NOENTRY 추가&lt;br /&gt;
&lt;/DIV&gt;&lt;br /&gt;
&lt;STRONG&gt;관련 검색어&lt;br /&gt;
&lt;/STRONG&gt;Managed Extensions for C++ DLL </description>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/68</guid>
      <comments>https://coden.tistory.com/68#entry68comment</comments>
      <pubDate>Tue, 1 Nov 2011 19:43:09 +0900</pubDate>
    </item>
    <item>
      <title>android에서 R.id 가 생성이 안될경우</title>
      <link>https://coden.tistory.com/65</link>
      <description>&lt;br /&gt;
drawable에서 그림파일에 대문자가 들어간 경우 R이 자동 생성 안될수 잇다.&lt;br /&gt;
&lt;br /&gt;그림파일 이름은 모두 소문자여야 한다 ㅎ</description>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/65</guid>
      <comments>https://coden.tistory.com/65#entry65comment</comments>
      <pubDate>Thu, 29 Sep 2011 01:01:28 +0900</pubDate>
    </item>
    <item>
      <title>OS/161 설치</title>
      <link>https://coden.tistory.com/57</link>
      <description>&lt;span style=&quot;font-family: Courier New;&quot;&gt;(1) OS/161&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;http://www.eecs.harvard.edu/~syrah/os161&lt;/span&gt;&lt;br /&gt;
ftp://ftp.eecs.harvard.edu/pub/os161/os161-1.11.tar.gz&lt;br /&gt;
ftp://ftp.eecs.harvard.edu/pub/os161/sys161-1.14.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;https://t1.daumcdn.net/cfile/tistory/140261454E65841D17&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/gz.gif&quot; style=&quot;vertical-align: middle;&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;os161-1.11.tar.gz&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;https://t1.daumcdn.net/cfile/tistory/2003A7454E65841E14&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/gz.gif&quot; style=&quot;vertical-align: middle;&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;sys161-1.14.tar.gz&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
ftp://ftp.eecs.harvard.edu/pub/os161/toolchain/cs161-gcc-1.5.tgz&lt;br /&gt;
ftp://ftp.eecs.harvard.edu/pub/os161/toolchain/cs161-binutils-1.5.tgz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(2) gcc 버전 변경&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ sudo apt-get install gcc-4.1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd /usr/bin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ sudo mv gcc gcc_bak&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ sudo ln -s gcc-4.1 gcc&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/163FAC3F4E65825307&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F163FAC3F4E65825307&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(3) binutils 설치&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ tar xf cs161-binutils-1.5.tar&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd cs161-binutils-1.5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ ./toolbuild.sh --cs161dir='/home/user/oslab/cs161'&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/142F1F444E65826E07&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F142F1F444E65826E07&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result3-1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/152F1F444E65826E08&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F152F1F444E65826E08&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result3-2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(4) 환경변수 설정&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ vim ~/.bashrc export PATH=/home/user/oslab/cs161:/home/user/oslab/cs161/bin:${PATH}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ source ~/.bashrc&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2026D3414E65828D01&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2026D3414E65828D01&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result4.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(5) GCC MIPS Cross-Compiler&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ tar xf cs161-gcc-1.5.tar&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd cs161-gcc-1.5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ ./toolbuild.sh --cs161dir='/home/user/oslab/cs161'&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/114B93424E6582A333&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F114B93424E6582A333&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result5-1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/124B93424E6582A334&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F124B93424E6582A334&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result5-2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(6) SYS/161&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ tar xf sys161-1.14.tar&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd sys161-1.14&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ ./configure --installdir='/home/user/oslab/sys161' --docdir='/home/user/oslab/sys161/document' mipseb&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1819D5414E6582C211&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1819D5414E6582C211&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1119D5414E6582C214&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1119D5414E6582C214&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-4.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1419D5414E6582C316&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1419D5414E6582C316&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-6.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1519D5414E6582C317&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1519D5414E6582C317&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-7.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;만약 ./configure 가 오류나면,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ vim ./configure&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;17번째줄에 `따옴표를 닫아줘야한다.&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1324D83D4E65832314&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1324D83D4E65832314&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-5.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1809203B4E65833B27&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1809203B4E65833B27&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1909203B4E65833B28&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1909203B4E65833B28&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result6-3.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(7) OS/161&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ tar xf os161-1.11.tar&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd os161-1.11&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ ./configure --ostree='/home/user/oslab/sys161/root' --toolprefix=cs161-&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ make&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd kern/conf&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ ./config ASST0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd ../compile/ASST0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ make depend&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1546313C4E6583561E&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1546313C4E6583561E&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1646313C4E6583561F&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1646313C4E6583561F&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1546313C4E65835620&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1546313C4E65835620&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-3.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1646313C4E65835621&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1646313C4E65835621&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-4.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1846313C4E65835722&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1846313C4E65835722&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-5.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1946313C4E65835723&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1946313C4E65835723&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-6.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2046313C4E65835724&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2046313C4E65835724&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-7.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1146313C4E65835725&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1146313C4E65835725&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-8.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1346313C4E65835826&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1346313C4E65835826&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result7-9.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(8) sys161.conf&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd /home/user/oslab/sys161&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cp sys161.conf.sample root/sys161.conf&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/20750D364E6583761C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F20750D364E6583761C&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result8.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(9) 환경변수 설정&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ vim ~/.bashrc PATH=/home/user/oslab/sys161:${PATH}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ source ~/.bashrc&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/166966344E65838918&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F166966344E65838918&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result9.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(10) 실행&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd /home/user/oslab/sys161/root&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ sys161 kernel&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1860A5334E65839B10&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1860A5334E65839B10&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result10-1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1960A5334E65839B11&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1960A5334E65839B11&quot; width=&quot;664&quot; height=&quot;449&quot; alt=&quot;&quot; filename=&quot;result10-2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(11) main.c 수정&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ vim /home/user/oslab/os161/kern/main/main.c&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;kprintf(&quot;Put-your-group-name-here's system version&quot;); 부분 수정&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/2050A63C4E6583B312&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F2050A63C4E6583B312&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result11-1.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1150A63C4E6583B313&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1150A63C4E6583B313&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result11-2.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;(12) 컴파일&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd /home/user/oslab/os161/kern/compile/ASST0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ cd /home/user/oslab/sys161/root&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;$ sys161 kernel&lt;/span&gt;&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/14228F3A4E6583F12C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F14228F3A4E6583F12C&quot; width=&quot;658&quot; height=&quot;413&quot; alt=&quot;&quot; filename=&quot;result11-3.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;p style=&quot;margin: 0pt;&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;https://t1.daumcdn.net/cfile/tistory/167FEE454E6585171C&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/zip.gif&quot; style=&quot;vertical-align: middle;&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;os1image.zip&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <category>OS161</category>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/57</guid>
      <comments>https://coden.tistory.com/57#entry57comment</comments>
      <pubDate>Thu, 15 Sep 2011 03:00:00 +0900</pubDate>
    </item>
    <item>
      <title>키보드 전역 후킹 예제</title>
      <link>https://coden.tistory.com/63</link>
      <description>&lt;P&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;후킹에는 여러가지 종류가 있다. 그중에서 가장 대표적인 전역 키보드 후킹방법을 설명하겠다. 우선 전체적인 순서는 다음과 같다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;(1) 훅 프로시저 DLL파일을 만든다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;(2) DLL을 로드시킬 프로그램을 작성한다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;www.winapi.co.kr에서 KeyBeep예제를 visual studio 2008에서 돌아가도록 변경한 것이다. 프로젝트 생성부터 차근차근 해보겠다. 먼저 visual studio 2008을 실행시킨다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/203678374E70598A06&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F203678374E70598A06&quot; width=&quot;700&quot; height=&quot;473&quot; alt=&quot;&quot; filename=&quot;1.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;프로젝트를 생성한다. [File]-[New]-[Project...] &lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;위치는 C:\HookEx\로 하고, Solution Name은 KeyHook로 한다. KeyHook 솔루션안에 KeyHookDll 프로젝트와 KeyHookApp 프로젝트, 두 개의 프로젝트를 만들것이다. 우선, KeyHookDll 프로젝트를 생성한다. template은 Win32Project로 한다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/123678374E70598B07&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F123678374E70598B07&quot; width=&quot;700&quot; height=&quot;472&quot; alt=&quot;&quot; filename=&quot;2.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;Application type는 DLL로 하고, Additional options는 아무것도 체크하지 않는다. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/163678374E70598D09&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F163678374E70598D09&quot; width=&quot;615&quot; height=&quot;520&quot; alt=&quot;&quot; filename=&quot;4.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;br /&gt;
&lt;br /&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;Header Files 폴더에 stdafx.h, targetver.h 파일이, Source Files 폴더에 dllmain.cpp, KeyHookDll.cpp, stdafx.cpp 파일이 생성되었다. KeyHookDll.cpp 파일에 다음과 같이 작성한다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/153678374E70598E0A&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F153678374E70598E0A&quot; width=&quot;700&quot; height=&quot;473&quot; alt=&quot;&quot; filename=&quot;5.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;&lt;br /&gt;
&lt;/P&gt;&lt;CODE&gt;&lt;PRE style=&quot;BORDER-BOTTOM: #e7fdb5 1px solid; BORDER-LEFT: #e7fdb5 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #e7fdb5; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #e7fdb5 1px solid; BORDER-RIGHT: #e7fdb5 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style=&quot;FONT-SIZE: 9pt&quot;&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &quot;stdafx.h&quot;

HINSTANCE gModule=NULL;
HHOOK hKeyHook=NULL;

LRESULT CALLBACK KeyHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
	if (nCode&amp;gt;=0) {
		SendMessage(hWndBeeper,WM_USER+1,wParam,lParam);
	}
	return CallNextHookEx(hKeyHook,nCode,wParam,lParam);
}

extern &quot;C&quot; __declspec(dllexport) void InstallHook(HWND hWnd)
{
	hKeyHook=SetWindowsHookEx(WH_KEYBOARD_LL,KeyHookProc,gModule,NULL);
}

extern &quot;C&quot; __declspec(dllexport) void UninstallHook()
{
	UnhookWindowsHookEx(hKeyHook);
}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;PRE&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;dllmain.cpp 파일에는 다음과 같이 작성한다.&lt;/SPAN&gt;&lt;CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;DIV style=&quot;BORDER-BOTTOM: #e7fdb5 1px solid; BORDER-LEFT: #e7fdb5 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #e7fdb5; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #e7fdb5 1px solid; BORDER-RIGHT: #e7fdb5 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;&lt;CODE&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &quot;stdafx.h&quot;

extern HINSTANCE gModule;

BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		gModule = hModule;
		break;
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}&lt;/SPAN&gt;&lt;/CODE&gt;
&lt;/DIV&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/163678374E70598E0B&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F163678374E70598E0B&quot; width=&quot;700&quot; height=&quot;498&quot; alt=&quot;&quot; filename=&quot;6.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
 
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/183678374E70598F0C&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F183678374E70598F0C&quot; width=&quot;615&quot; height=&quot;520&quot; alt=&quot;&quot; filename=&quot;7.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;KeyHookApp프로젝트에 KeyHookApp.cpp파일을 생성하여 다음과 같이 소스를 작성한다.&lt;/SPAN&gt;&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/193678374E70598F0D&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F193678374E70598F0D&quot; width=&quot;700&quot; height=&quot;448&quot; alt=&quot;&quot; filename=&quot;8.PNG&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/P&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;DIV style=&quot;BORDER-BOTTOM: #e7fdb5 1px solid; BORDER-LEFT: #e7fdb5 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #e7fdb5; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #e7fdb5 1px solid; BORDER-RIGHT: #e7fdb5 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &amp;lt; windows.h &amp;gt;
#include &amp;lt; tchar.h &amp;gt;

LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
HINSTANCE g_hInst;
HWND hWndMain;
LPCTSTR lpszClass=_T(&quot;KeyHookApp&quot;);

int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance
	  ,LPSTR lpszCmdParam,int nCmdShow)
{
	HWND hWnd;
	MSG Message;
	WNDCLASS WndClass;
	g_hInst=hInstance;
	
	WndClass.cbClsExtra=0;
	WndClass.cbWndExtra=0;
	WndClass.hbrBackground=(HBRUSH)(COLOR_WINDOW+1);
	WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
	WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
	WndClass.hInstance=hInstance;
	WndClass.lpfnWndProc=(WNDPROC)WndProc;
	WndClass.lpszClassName=lpszClass;
	WndClass.lpszMenuName=NULL;
	WndClass.style=CS_HREDRAW | CS_VREDRAW;
	RegisterClass(&amp;amp;WndClass);

	hWnd=CreateWindow(lpszClass,lpszClass,WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT,CW_USEDEFAULT,600,130,
		NULL,(HMENU)NULL,hInstance,NULL);
	ShowWindow(hWnd,nCmdShow);
	hWndMain=hWnd;
	
	while(GetMessage(&amp;amp;Message,0,0,0)) {
		TranslateMessage(&amp;amp;Message);
		DispatchMessage(&amp;amp;Message);
	}
	return (int)Message.wParam;
}

extern &quot;C&quot; __declspec(dllimport) void InstallHook(HWND hWnd);
extern &quot;C&quot; __declspec(dllimport) void UninstallHook();

typedef void (* INSTALL_HOOK)(HWND);
typedef void (* UNINSTALL_HOOK)(void);
INSTALL_HOOK installHook;
UNINSTALL_HOOK uninstallHook;

LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
	HDC hdc;
	PAINTSTRUCT ps;

	static HINSTANCE hinstDLL = NULL; 
	static TCHAR msg1[128];
	static TCHAR msg2[128];
	static TCHAR msg3[128];
	KBDLLHOOKSTRUCT *kb;

	switch(iMessage) {
	case WM_CREATE:
		hinstDLL=LoadLibrary(_T(&quot;..\\Release\\KeyHookDll.dll&quot;));
		installHook=(INSTALL_HOOK)GetProcAddress(hinstDLL,&quot;InstallHook&quot;);
		uninstallHook=(UNINSTALL_HOOK)GetProcAddress(hinstDLL,&quot;UninstallHook&quot;);
		_stprintf_s(msg1,128,_T(&quot;hinstDLL:%d, installHook:%p, uninstallHook:%p&quot;),hinstDLL,installHook,uninstallHook);
		installHook(hWnd);
		return 0;
	case WM_USER+1:
		BYTE kb_state[256];
		kb =( KBDLLHOOKSTRUCT*)lParam;
		TCHAR key_state[64];
		switch(wParam){
		case WM_KEYDOWN:
			_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_KEYDOWN&quot;));break;
		case WM_KEYUP:
			_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_KEYUP&quot;));break;
		case WM_SYSKEYDOWN:
			_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_SYSKEYDOWN&quot;));break;
		case WM_SYSKEYUP:
			_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_SYSKEYUP&quot;));break;
		default: _stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;Unexpected KeyState&quot;));
		}
		_stprintf_s(msg2,128,_T(&quot;Key Message : %s, lParam : %x &quot;),key_state,lParam);
		_stprintf_s(msg2,128,_T(&quot;입력된 키:%d, lParam : %x &quot;),wParam,lParam);
		_stprintf_s(msg3,128,_T(&quot;vkCode : %c(%d), scanCode : %d&quot;),kb-&amp;gt;vkCode,kb-&amp;gt;vkCode,kb-&amp;gt;scanCode);
		InvalidateRect(hWnd,NULL,TRUE);
		return 0;
	case WM_PAINT:
		hdc=BeginPaint(hWnd, &amp;amp;ps);
		TextOut(hdc,10,10,msg1,lstrlen(msg1));
		TextOut(hdc,10,30,msg2,lstrlen(msg2));
		TextOut(hdc,10,50,msg3,lstrlen(msg3));
		EndPaint(hWnd, &amp;amp;ps);
		return 0;
	case WM_DESTROY:
		uninstallHook();
		FreeLibrary(hinstDLL);
		PostQuitMessage(0);
		return 0;
	}
	return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;&lt;br /&gt;
&lt;br /&gt;이제 해당 프로젝트를 Build한 후 C:\HookEx\Release폴더에 KeyHookDll.dll과 KeyHookApp.exe가 있는지 확인하고, KeyHookApp.exe를 실행시킨다. &lt;/SPAN&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <category>c/c++</category>
      <category>DLL</category>
      <category>Hook</category>
      <category>Hooking</category>
      <category>Keyboard</category>
      <category>keyhook</category>
      <category>전역후킹</category>
      <category>후킹</category>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/63</guid>
      <comments>https://coden.tistory.com/63#entry63comment</comments>
      <pubDate>Wed, 14 Sep 2011 16:47:34 +0900</pubDate>
    </item>
    <item>
      <title>아이피주소(IP 주소) 알아내는 방법</title>
      <link>https://coden.tistory.com/61</link>
      <description>&lt;br /&gt;
공유기 쓰는 컴퓨터에서 자신의 아이피주소 알아내는 방법&lt;br /&gt;
&lt;A href=&quot;http://www.whatismyip.com/&quot;&gt;http://www.whatismyip.com/&lt;/A&gt;&lt;br /&gt;</description>
      <category>IP</category>
      <category>ipaddress</category>
      <category>아이피</category>
      <category>아이피주소</category>
      <category>자기아이피</category>
      <category>자기아이피주소</category>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/61</guid>
      <comments>https://coden.tistory.com/61#entry61comment</comments>
      <pubDate>Thu, 8 Sep 2011 16:27:43 +0900</pubDate>
    </item>
    <item>
      <title>quick sort</title>
      <link>https://coden.tistory.com/58</link>
      <description>&lt;p&gt;&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;BORDER-BOTTOM: #79a5e4 1px dashed; BORDER-LEFT: #79a5e4 1px dashed; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #dbe8fb; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #79a5e4 1px dashed; BORDER-RIGHT: #79a5e4 1px dashed; PADDING-TOP: 10px&quot; class=&quot;txc-textbox&quot;&gt;&lt;p&gt;퀵 정렬은 &lt;a class=&quot;new&quot; title=&quot;분할 해결 알고리즘 (존재하지 않는 문서)&quot; href=&quot;http://ko.wikipedia.org/w/index.php?title=%EB%B6%84%ED%95%A0_%ED%95%B4%EA%B2%B0_%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98&amp;amp;action=edit&amp;amp;redlink=1&quot;&gt;&lt;font color=&quot;#ba0000&quot;&gt;분할 해결&lt;/font&gt;&lt;/a&gt; 전략을 통해 리스트를 정렬한다.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;리스트 가운데서 하나의 원소를 고른다. 이렇게 고른 원소를 &lt;b&gt;피벗&lt;/b&gt;이라고 한다.&lt;/li&gt;
&lt;li&gt;피벗 앞에는 피벗보다 값이 작은 모든 원소들이 오고, 피벗 뒤에는 피벗보다 값이 큰 모든 원소들이 오도록 피벗을 기준으로 리스트를 둘로 나눈다. 이렇게 리스트를 둘로 나누는 것을 &lt;b&gt;분할&lt;/b&gt;이라고 한다. 분할을 마친 뒤에 피벗은 더 이상 움직이지 않는다.&lt;/li&gt;
&lt;li&gt;분할된 두 개의 작은 리스트에 대해 &lt;a class=&quot;new&quot; title=&quot;재귀 (존재하지 않는 문서)&quot; href=&quot;http://ko.wikipedia.org/w/index.php?title=%EC%9E%AC%EA%B7%80&amp;amp;action=edit&amp;amp;redlink=1&quot;&gt;&lt;font color=&quot;#ba0000&quot;&gt;재귀&lt;/font&gt;&lt;/a&gt;적으로 이 과정을 반복한다. 재귀는 리스트의 크기가 0이나 1이 될 때까지 반복된다.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;재귀 호출이 한번 진행될 때마다 최소한 하나의 원소는 최종적으로 위치가 정해지므로, 이 알고리즘은 반드시 끝난다는 것을 보장할 수 있다.&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://ko.wikipedia.org/wiki/%ED%80%B5_%EC%A0%95%EB%A0%AC#.EC.95.8C.EA.B3.A0.EB.A6.AC.EC.A6.98&quot;&gt;http://ko.wikipedia.org/wiki/%ED%80%B5_%EC%A0%95%EB%A0%AC#.EC.95.8C.EA.B3.A0.EB.A6.AC.EC.A6.98&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/152F2F454E6864C614&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F152F2F454E6864C614&quot; width=&quot;677&quot; height=&quot;714&quot; alt=&quot;&quot; filename=&quot;quick.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void shuffle(int *arr);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void swap(int *a, int *b);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void print(int * arr, int st, int ed);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void quick(int *arr);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void partition(int *arr,int _st, int _ed);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;int main(int argc, char *argv[])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int arr[16];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;for(int r=0; r&amp;lt;50; r++){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;for(int i=0; i&amp;lt;16; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;arr[i] = i;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;srand(r);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;shuffle(arr);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;printf(&quot;%10s : &quot;,&quot;shuffle&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;print(arr,0,15);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;quick(arr);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;printf(&quot;%10s : &quot;,&quot;quick&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;print(arr,0,15);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;printf(&quot;=============================================================\n&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;//break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;system(&quot;pause &amp;gt; nul&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void quick(int *arr){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;partition(arr,0,15);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void partition(int *arr,int _st, int _ed){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;int p = _ed;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;int buf_p = arr[p];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;int st=_st,ed=_ed-1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;while(st&amp;lt;ed){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;//if(st&amp;lt;p){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;if( arr[st]&amp;lt;arr[p]){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;st++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;if( arr[ed]&amp;gt;arr[p]){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ed--;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;if( arr[st] &amp;gt; arr[ed]){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;swap(arr+st, arr+ed);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;//printf(&quot;st=%d,ed=%d,p=%d\n&quot;,st,ed,p);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;if( st &amp;lt; p ){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;if( arr[st]&amp;gt;arr[p]){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;swap(arr+st, arr+p);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int t = p;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;p = st;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;st = t;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;st = _st;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;ed = _ed;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;printf(&quot;(%2d)%6s : &quot;,buf_p,&quot;quick&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;print(arr,st,ed);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;if (st &amp;lt; p)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;partition(arr, st, p-1);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;if (ed &amp;gt; p)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;partition(arr, p+1, ed);&amp;nbsp;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;/span&gt;&lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void shuffle(int *arr){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;int n = 100;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;int a,b;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;while(n--){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;a = rand()%16;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;b = rand()%16;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;swap(arr+a,arr+b);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void swap(int *a, int *b){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;int t = *a;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;*a = *b;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;*b = t;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;void print(int * arr, int st, int ed){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;for(int i=0; i&amp;lt;16; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;if( st&amp;lt;=i &amp;amp;&amp;amp; i&amp;lt;=ed){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&quot;%3d&quot;,arr[i]);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;else{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&quot;&amp;nbsp;&amp;nbsp; &quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;}printf(&quot;\n&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;/p&gt;</description>
      <category>c/c++</category>
      <category>c언어</category>
      <category>Quick</category>
      <category>quicksort</category>
      <category>sort</category>
      <category>소스</category>
      <category>소스코드</category>
      <category>소트</category>
      <category>정렬</category>
      <category>퀵소트</category>
      <category>퀵정렬</category>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/58</guid>
      <comments>https://coden.tistory.com/58#entry58comment</comments>
      <pubDate>Thu, 8 Sep 2011 11:08:31 +0900</pubDate>
    </item>
    <item>
      <title>키보드 전역 후킹</title>
      <link>https://coden.tistory.com/56</link>
      <description>&lt;P&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;KeyHookApp.cpp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style=&quot;BORDER-BOTTOM: #dbe8fb 1px solid; BORDER-LEFT: #dbe8fb 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #dbe8fb; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #dbe8fb 1px solid; BORDER-RIGHT: #dbe8fb 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &amp;lt;windows.h&amp;gt;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &amp;lt;tchar.h&amp;gt;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;/*&lt;/SPAN&gt;&lt;br /&gt;
&lt;A href=&quot;http://cboard.cprogramming.com/windows-programming/99678-setwindowshookex-wm_keyboard_ll.html&quot;&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;http://cboard.cprogramming.com/windows-programming/99678-setwindowshookex-wm_keyboard_ll.html&lt;/SPAN&gt;&lt;/A&gt;&lt;br /&gt;
&lt;A href=&quot;http://msdn.microsoft.com/en-us/library/ms644985(v=vs.85).aspx&quot;&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;http://msdn.microsoft.com/en-us/library/ms644985(v=vs.85).aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;*/&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;HINSTANCE g_hInst;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;HWND hWndMain;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;LPCTSTR lpszClass=_T(&quot;KeyHookApp&quot;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp; ,LPSTR lpszCmdParam,int nCmdShow)&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;HWND hWnd;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;MSG Message;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WNDCLASS WndClass;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;g_hInst=hInstance;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.cbClsExtra=0;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.cbWndExtra=0;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.hbrBackground=(HBRUSH)(COLOR_WINDOW+1);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.hInstance=hInstance;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.lpfnWndProc=(WNDPROC)WndProc;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.lpszClassName=lpszClass;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.lpszMenuName=NULL;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;WndClass.style=CS_HREDRAW | CS_VREDRAW;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;RegisterClass(&amp;amp;WndClass);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;hWnd=CreateWindow(lpszClass,lpszClass,WS_OVERLAPPEDWINDOW,&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;CW_USEDEFAULT,CW_USEDEFAULT,600,130,&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;NULL,(HMENU)NULL,hInstance,NULL);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;ShowWindow(hWnd,nCmdShow);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;hWndMain=hWnd;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;while(GetMessage(&amp;amp;Message,0,0,0)) {&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;TranslateMessage(&amp;amp;Message);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;DispatchMessage(&amp;amp;Message);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;return (int)Message.wParam;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;extern &quot;C&quot; __declspec(dllimport) void InstallHook(HWND hWnd);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;extern &quot;C&quot; __declspec(dllimport) void UninstallHook();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;typedef void (* INSTALL_HOOK)(HWND);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;typedef void (* UNINSTALL_HOOK)(void);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;INSTALL_HOOK installHook;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;UNINSTALL_HOOK uninstallHook;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;HDC hdc;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;PAINTSTRUCT ps;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;static HINSTANCE hinstDLL = NULL; &lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;static TCHAR msg1[128];&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;static TCHAR msg2[128];&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;static TCHAR msg3[128];&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;KBDLLHOOKSTRUCT *kb;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;switch(iMessage) {&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_CREATE:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;hinstDLL=LoadLibrary(_T(&quot;..\\Release\\KeyHookDll.dll&quot;));&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;installHook=(INSTALL_HOOK)GetProcAddress(hinstDLL,&quot;InstallHook&quot;);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;uninstallHook=(UNINSTALL_HOOK)GetProcAddress(hinstDLL,&quot;UninstallHook&quot;);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(msg1,128,_T(&quot;hinstDLL:%d, installHook:%p, uninstallHook:%p&quot;),hinstDLL,installHook,uninstallHook);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;installHook(hWnd);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;return 0;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_USER+1:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp; kb =( KBDLLHOOKSTRUCT*)lParam;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;BYTE kb_state[256];&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(msg3,128,_T(&quot;vkCode : %c(%d), scanCode : %d&quot;),kb-&amp;gt;vkCode,kb-&amp;gt;vkCode, kb-&amp;gt;scanCode);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;TCHAR key_state[64];&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;switch(wParam){&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_KEYDOWN:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_KEYDOWN&quot;));break;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_KEYUP:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_KEYUP&quot;));break;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_SYSKEYDOWN:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_SYSKEYDOWN&quot;));break;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_SYSKEYUP:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;WM_SYSKEYUP&quot;));break;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;default: _stprintf_s(key_state,64,_T(&quot;%s&quot;),_T(&quot;Unexpected KeyState&quot;));&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;_stprintf_s(msg2,128,_T(&quot;Key Message : %s, lParam : %x &quot;),key_state,lParam);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;InvalidateRect(hWnd,NULL,TRUE);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;return 0;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_PAINT:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;hdc=BeginPaint(hWnd, &amp;amp;ps);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;TextOut(hdc,10,10,msg1,lstrlen(msg1));&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;TextOut(hdc,10,30,msg2,lstrlen(msg2));&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;TextOut(hdc,10,50,msg3,lstrlen(msg3));&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;EndPaint(hWnd, &amp;amp;ps);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;return 0;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case WM_DESTROY:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;uninstallHook();&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;FreeLibrary(hinstDLL);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;PostQuitMessage(0);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;return 0;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;return(DefWindowProc(hWnd,iMessage,wParam,lParam));&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;br /&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;KeyHookDll.cpp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;br /&gt;
&lt;/P&gt;
&lt;DIV style=&quot;BORDER-BOTTOM: #dbe8fb 1px solid; BORDER-LEFT: #dbe8fb 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #dbe8fb; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #dbe8fb 1px solid; BORDER-RIGHT: #dbe8fb 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &quot;stdafx.h&quot;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;HINSTANCE gModule=NULL;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;HHOOK hKeyHook=NULL;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;HWND gHwnd=NULL;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;LRESULT CALLBACK KeyHookProc(int nCode, WPARAM wParam, LPARAM lParam)&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;if (nCode&amp;gt;=0) {&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;SendMessage(gHwnd,WM_USER+1,wParam,lParam);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;return CallNextHookEx(hKeyHook,nCode,wParam,lParam);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;extern &quot;C&quot; __declspec(dllexport) void InstallHook(HWND hWnd)&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;gHwnd=hWnd;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;hKeyHook=SetWindowsHookEx(WH_KEYBOARD_LL,KeyHookProc,gModule,NULL);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;extern &quot;C&quot; __declspec(dllexport) void UninstallHook()&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;UnhookWindowsHookEx(hKeyHook);&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&lt;SPAN style=&quot;FONT-SIZE: 12pt&quot;&gt;&lt;br /&gt;
dllmain.cpp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;br /&gt;
&lt;/P&gt;
&lt;DIV style=&quot;BORDER-BOTTOM: #dbe8fb 1px solid; BORDER-LEFT: #dbe8fb 1px solid; PADDING-BOTTOM: 10px; BACKGROUND-COLOR: #dbe8fb; PADDING-LEFT: 10px; PADDING-RIGHT: 10px; BORDER-TOP: #dbe8fb 1px solid; BORDER-RIGHT: #dbe8fb 1px solid; PADDING-TOP: 10px&quot; class=txc-textbox&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;#include &quot;stdafx.h&quot;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;extern HINSTANCE gModule;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;BOOL APIENTRY DllMain( HMODULE hModule,&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DWORD&amp;nbsp; ul_reason_for_call,&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPVOID lpReserved&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;switch (ul_reason_for_call)&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case DLL_PROCESS_ATTACH:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;gModule = hModule;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;break;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case DLL_THREAD_ATTACH:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case DLL_THREAD_DETACH:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;case DLL_PROCESS_DETACH:&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;&amp;nbsp;break;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;&amp;nbsp;return TRUE;&lt;/SPAN&gt;&lt;br /&gt;
&lt;SPAN style=&quot;FONT-FAMILY: Courier New&quot;&gt;}&lt;/SPAN&gt;&lt;br /&gt;
&lt;/P&gt;&lt;br /&gt;
&lt;/DIV&gt;</description>
      <category>c/c++</category>
      <category>Hook</category>
      <category>Hooking</category>
      <category>keyhook</category>
      <category>후킹</category>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/56</guid>
      <comments>https://coden.tistory.com/56#entry56comment</comments>
      <pubDate>Mon, 29 Aug 2011 10:39:59 +0900</pubDate>
    </item>
    <item>
      <title>python 한글</title>
      <link>https://coden.tistory.com/53</link>
      <description># -*- coding:utf-8 -*-&lt;br /&gt;</description>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/53</guid>
      <comments>https://coden.tistory.com/53#entry53comment</comments>
      <pubDate>Tue, 16 Aug 2011 20:48:22 +0900</pubDate>
    </item>
    <item>
      <title>pygame</title>
      <link>https://coden.tistory.com/52</link>
      <description>&lt;br /&gt;
http://www.pygame.org&lt;br /&gt;
&lt;A href=&quot;http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame&quot;&gt;http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame&lt;/A&gt;&lt;br /&gt;

&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;https://t1.daumcdn.net/cfile/tistory/110F6E574E4A51B10D&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/exe.gif&quot; style=&quot;vertical-align: middle;&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;pygame-1.9.2pre.win-amd64-py2.7.exe&lt;/a&gt;&lt;/div&gt;
&lt;/P&gt;
&lt;P style=&quot;MARGIN: 0px&quot;&gt;&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;a href=&quot;https://t1.daumcdn.net/cfile/tistory/111159574E4A51B608&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/exe.gif&quot; style=&quot;vertical-align: middle;&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;pygame-1.9.2pre.win32-py2.7.exe&lt;/a&gt;&lt;/div&gt;
&lt;/P&gt;</description>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/52</guid>
      <comments>https://coden.tistory.com/52#entry52comment</comments>
      <pubDate>Tue, 16 Aug 2011 20:17:21 +0900</pubDate>
    </item>
    <item>
      <title>python 의 easy_install</title>
      <link>https://coden.tistory.com/50</link>
      <description>&lt;br /&gt;
ez_install.py 를 다운받고 실행시킨다.&lt;br /&gt;
&lt;br /&gt;c:\Python27\Scripts\easy_install.exe SOME_PACKAGE 를 실행하면,&amp;nbsp; SOME_PACKAGE가 설치된다&lt;br /&gt;
&lt;br /&gt;&lt;A href=&quot;http://api.mongodb.org/python/1.10/installation.html&quot;&gt;http://api.mongodb.org/python/1.10/installation.html&lt;/A&gt;&lt;br /&gt;
&lt;A href=&quot;http://peak.telecommunity.com/DevCenter/EasyInstall#windows-notes&quot;&gt;http://peak.telecommunity.com/DevCenter/EasyInstall#windows-notes&lt;/A&gt;</description>
      <author>Нуеоп</author>
      <guid isPermaLink="true">https://coden.tistory.com/50</guid>
      <comments>https://coden.tistory.com/50#entry50comment</comments>
      <pubDate>Thu, 11 Aug 2011 16:18:47 +0900</pubDate>
    </item>
  </channel>
</rss>