<?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:blogger='http://schemas.google.com/blogger/2008' 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-723419036202732437</id><updated>2024-09-01T03:25:31.667-07:00</updated><category term="daily"/><category term="travel"/><title type='text'>K.Shim</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kjshim.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kjshim.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>KJShim</name><uri>http://www.blogger.com/profile/06462425004511457188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIVw_IAOqlLwfwGqD1N4_vsXP0WZN4S6SFUhm97ykSFI8VmDYlJBM4tNeAX78UBMQRTVyM1iKGSZuODmHSr2wY97CQqwE8XZ3oxY7KBPxRaGyQOsOfSQmUBmPSYGhwZA/s220/SV401047.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-723419036202732437.post-5013344838253573879</id><published>2009-07-06T06:00:00.000-07:00</published><updated>2009-07-06T07:00:52.666-07:00</updated><title type='text'>간만의 삽질기 - 가내수공업으로 크랙하기</title><content type='html'>&lt;div&gt;아주 간간히 시간 때우기로 흥미로워 보이는 논문들을 인쇄해서 읽거나 모니터로 스르륵 읽는데, 읽고 나면 잃어 버리기 십상입니다. 다운로드 폴더에 pdf파일들이 쌓여 있다가 모르고 지워버리면 다 날아가버리는 일도 흔하고. 그래서 Paper라는 프로그램 (http://mekentosj.com/papers/)을 한동안 사용했는데 매우 좋습니다. 학교 안이 아니라서 ACM이나 IEEE같은 repository에 바로 접근 못하는 점은 좀 아쉽긴 하지만, 구글 스칼라에서 논문 매치해주고 정리해주는 기능은 특히 훌륭합니다. 뭐 리뷰는 다음에 시간나면 자세히 올리기로 하고, 아무튼. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;이 프로그램은 30일 체험버전을 제공해 주고 있습니다. 나중에 박사 가면 하나 사줄 생각인데, 음... 뭐 지금은 가난한 학생이니 일단은 날짜 제한을 돌아가보고자 약간의 삽질한 것을 기록으로 남겨보고자 합니다. (그래야 나중에 패치되도....다시.....-.-)  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;b&gt;방법&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;1. 일단은 gdb로 바이너리를 까봅시다. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;gdb --annotate=3 /Applications/Papers.app/Contents/MacOS/Papers&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. 심볼들을 보고 어디를 살펴 봐야할지 감을 잡아 봅니다. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:&#39;trebuchet ms&#39;, fantasy;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:&#39;trebuchet ms&#39;, fantasy;&quot;&gt;info functions&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;오호라, 이런 놈이 있군요&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;, fantasy;&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3d8  -[AppDelegate hasExpired]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;, fantasy;&quot;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;브레이크포인트 걸고 프로그램을 몇 번 돌려보니, 정품인지 확인 하는 길목 마다 호출 되는 것 같네요. 얘를 잘 패스 시켜주면 되는가 봅니다. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. hasExpired를 디스어셈블 해봅시다&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;Dump of assembler code for function -[AppDelegate hasExpired]:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3d8 &lt;-[AppDelegate hasExpired]+0&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;mov    0x1e0040,%eax&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3dd &lt;-[AppDelegate hasExpired]+5&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;push   %ebp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3de &lt;-[AppDelegate hasExpired]+6&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;mov    %esp,%ebp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3e0 &lt;-[AppDelegate hasExpired]+8&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;cmpb   $0x0,(%eax)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;b&gt;0x0000e3e3 &lt;-[AppDelegate hasExpired]+11&gt;:&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;b&gt;je     0xe3f4 &lt;-[AppDelegate hasExpired]+28&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3e5 &lt;-[AppDelegate hasExpired]+13&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;mov    0x1e008c,%eax&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3ea &lt;-[AppDelegate hasExpired]+18&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;mov    $0x1,%edx&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3ef &lt;-[AppDelegate hasExpired]+23&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;cmpb   $0x0,(%eax)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3f2 &lt;-[AppDelegate hasExpired]+26&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;je     0xe3f6 &lt;-[AppDelegate hasExpired]+30&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3f4 &lt;-[AppDelegate hasExpired]+28&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;xor    %edx,%edx&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3f6 &lt;-[AppDelegate hasExpired]+30&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;leave  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3f7 &lt;-[AppDelegate hasExpired]+31&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;mov    %edx,%eax&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;0x0000e3f9 &lt;-[AppDelegate hasExpired]+33&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;ret    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;요렇게 생겼는데, 대충 보면 저 처음 나오는 cmpb에서 뭔가 체크를 할 것 같은 느낌이 강하게 옵니다. 몇 번 돌려보고 경험적으로(-_-) 정품이 아니면 +11줄의 je 어쩌고에서 걸리지 않고 +13줄로 넘어간다는 사실을 파악합니다. 그래서 저 je를 jmp로 바꿔주면, 마치 인증 받은 것 처럼 동작하겠구나 라는 사실을 간파할 수 있습니다. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. 바이너리를 까서 저 인스트럭션을 슬쩍 바꿔줍니다. &lt;/div&gt;&lt;div&gt;만일을 위해 /Applications/Papers.app/Contents/MacOS/Papers 이 바이너리를 일단 백업해놓습니다. 아래부터 작업 경로는 /Applications/Papers.app/Contents/MacOS/이라고 가정합시다. file 이나 otool -f 로 바이너리 헤더를 보면 ppc와 i386바이너리가 다 포함된 것을 알 수 있는데, 이 유니버셜 바이너리를 i386용만 분리해 냅시다.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;lipo -thin i386 Papers -o Papers.i386&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. Papers.i386 에서 어디를 고쳐야 될지 계산합니다. otool -l로 섹션과 세그멘트 정보를 조회해보면, 코드 섹션들이 메모리에 로드될 시작 위치(addr)와 바이너리에서의 오프셋(offset)이 보입니다. __text섹션의 __TEXT세그먼트를 보면 되는데,&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;Section&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;  sectname __text&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;   segname __TEXT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;      addr 0x000023d8&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;      size 0x0019bf7f&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;    offset 5080&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;     align 2^2 (4)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;    reloff 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;    nreloc 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;     flags 0x80000400&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; reserved1 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; reserved2 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;요렇게 생겼습니다. 즉, addr 은 0x000023d8, offset은 5080. GDB에서 본 고쳐야하는 코드는 아래 위치 (0x0000e3e3)이니까, &lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;b&gt;0x0000e3e3&lt;/b&gt; &lt;-[AppDelegate hasExpired]+11&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;je     0xe3f4 &lt;-[AppDelegate hasExpired]+28&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;해당 인스트럭션의 바이너리 파일에서의 위치는 &lt;/div&gt;&lt;div&gt;offset + ( 0x0000e3e3 - base_addr&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;(==0x000023d8)&lt;/span&gt;) 입니다. &lt;/div&gt;&lt;div&gt;계산해보면 0x0000d3e3 &lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;(hex계산기 역할을 해준 파이썬 감사를..) 이군요.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6. 바꿀 옵코드 알아내기 &lt;/div&gt;&lt;div&gt;다행히도 이 경우에는 인스트럭션 길이가 똑같아서 삽질을 하지 않을 수 있습니다. 인텔 옵코드의 경우 &lt;a href=&quot;http://download.intel.com/design/PentiumII/manuals/24319102.PDF&quot;&gt;Intel Architecture Software Developer&#39;s Manual, Volume 2: Instruction Set Reference Manual&lt;/a&gt; 여기 참조. je를 jmp로 바꿔야되는데, 참고로 short je는 74, short jmp는 eb. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7. 바이너리 수정&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;xxd papers.i386 &gt; papers.i386.hex &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;텍스트로 고칠 수 있게 아스키 형태로 만듭니다. papers.i386.hex에서 고칠 위치(0x0000d3e3)를 찾아서 74-&gt;eb로 수정 (*-_-*)합니다. 끝이 다가오는 군요. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;8. 다시 유니버셜 바이너리로 합체&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;xxd -r papers.i386.hex papers.i386.patched &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;lipo -replace i386 papers.i386.patched Papers -o Papers.patched &lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;이러면 새 Papers.patched 바이너리가 생성되고 끝! 원래 파일을 잘 바꿔주면 됩니다. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;후기&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;하도 전산과 공돌이 삽질을 안한지 오래 되서 공부도 할 겸 해봤는데, 나름 재미있었네요. 페이징, 세그멘테이션 등 OS들었던 것들 약간 다시 살펴보는 계기가 되기도 했고, 이전에 리눅스 바이너리에 대한 것만 배워서, 일반적으로 이런 건가 했던 것들이 맥OS에서는 다르게 생긴 부분들(ELF가 아니었다니...)을 알게 된 것도 흥미로운 경험이었습니다. ethnic diversity를 체험했다고나 할까요.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;제일 삽질한 부분은, 실제로 바이너리에서 옵코드 찾아 고치는 부분이었습다. 머나먼 옛날 SP 과목 수강한 이후로 처음 해보는 지라 반신반의 하면서 고치고 있는데, 당연히 여기 있겠지 한 인스트럭션이 있어야 할 곳이 0000000000000000000..  이었습니다. 멍하니 한동안 패닉 상태에 빠졌는데, 왜 그런가 하고 생각을 해보니 Universal Binary 때문이더군요. 바이너리를 아키텍쳐별로 뼈와 살을 분리해야되는데, 그걸 하지 않은 것이 문제였습니다. ( otool 이 뼈와 살을 분리하지 않은 유니버셜 바이너리에 대해서는, 해당 머신의 아키텍쳐로 정보를 보여줍니다. 그래서 별 생각 없이 UB를 통째로 열었다가 멍 때리고 있었던 것이었습니다. 나중에서야 otool의 man page를 보니 기본적으로 해당 머신의 아키텍쳐에 해당하는 섹션의 정보를 보여준다고 하더군요 )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;참고문서들입니다. &lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://osxbook.com/&quot;&gt;Mac OS X Internals &lt;/a&gt; : 나름 최근인 2006년에 나온 책-많은 도움이 되었다-인데 한번쯤 그냥이라도 읽어볼만 합니다.&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;lucida grande&#39;, geneva, helvetica, arial, sans-serif;&quot;&gt;&lt;a href=&quot;http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/index.html#//apple_ref/doc/uid/TP40000895&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Mac OS X ABI Mach-O File Format Reference&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color: rgb(0, 0, 0);   font-family:Georgia, fantasy;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;http://blog.dv8.ro/2006/08/patching-mac-os-x-binary.html&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, -webkit-fantasy;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, -webkit-fantasy;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, -webkit-fantasy;&quot;&gt;후기1. 블로거로 코드 들어간 글 쓰기 힘들군요. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, -webkit-fantasy;&quot;&gt;후기2. Mekentosj 형님들께 몇 유로 빚을 졌으니 박사 들어가면 갚아야겠습니다. (__)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia, -webkit-fantasy;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjshim.blogspot.com/feeds/5013344838253573879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kjshim.blogspot.com/2009/07/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default/5013344838253573879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default/5013344838253573879'/><link rel='alternate' type='text/html' href='http://kjshim.blogspot.com/2009/07/blog-post.html' title='간만의 삽질기 - 가내수공업으로 크랙하기'/><author><name>KJShim</name><uri>http://www.blogger.com/profile/06462425004511457188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIVw_IAOqlLwfwGqD1N4_vsXP0WZN4S6SFUhm97ykSFI8VmDYlJBM4tNeAX78UBMQRTVyM1iKGSZuODmHSr2wY97CQqwE8XZ3oxY7KBPxRaGyQOsOfSQmUBmPSYGhwZA/s220/SV401047.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-723419036202732437.post-1087252388710873510</id><published>2009-06-15T10:32:00.000-07:00</published><updated>2009-06-15T10:35:17.990-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="travel"/><title type='text'>취리히 여행 사진</title><content type='html'>&lt;table style=&quot;width:194px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align=&quot;center&quot; style=&quot;height:194px;background:url(http://picasaweb.google.com/s/c/transparent_album_background.gif) no-repeat left&quot;&gt;&lt;a href=&quot;http://picasaweb.google.com/lurker86/20090604Zurich?feat=embedwebsite&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/_Dkn7PnhL4i4/SjZoJcl0arE/AAAAAAAAHKI/ZPSThV-UXRo/s160-c/20090604Zurich.jpg&quot; width=&quot;160&quot; height=&quot;160&quot; style=&quot;margin:1px 0 0 4px;&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align:center;font-family:arial,sans-serif;font-size:11px&quot;&gt;&lt;a href=&quot;http://picasaweb.google.com/lurker86/20090604Zurich?feat=embedwebsite&quot; style=&quot;color:#4D4D4D;font-weight:bold;text-decoration:none;&quot;&gt;20090604 Zurich&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div&gt;누르면 앨범으로..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;# 덧1. &lt;/div&gt;&lt;div&gt;피카사에 사진 캡션 붙이는 기능이 있네. &lt;/div&gt;&lt;div&gt;힘들게 따로 글 쓸 필요 없이 그냥 캡션에 써야 겠다 앞으로.&lt;/div&gt;&lt;div&gt;슬라이드 쇼도 처음 봤는데 좋군. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjshim.blogspot.com/feeds/1087252388710873510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kjshim.blogspot.com/2009/06/blog-post_15.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default/1087252388710873510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default/1087252388710873510'/><link rel='alternate' type='text/html' href='http://kjshim.blogspot.com/2009/06/blog-post_15.html' title='취리히 여행 사진'/><author><name>KJShim</name><uri>http://www.blogger.com/profile/06462425004511457188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIVw_IAOqlLwfwGqD1N4_vsXP0WZN4S6SFUhm97ykSFI8VmDYlJBM4tNeAX78UBMQRTVyM1iKGSZuODmHSr2wY97CQqwE8XZ3oxY7KBPxRaGyQOsOfSQmUBmPSYGhwZA/s220/SV401047.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_Dkn7PnhL4i4/SjZoJcl0arE/AAAAAAAAHKI/ZPSThV-UXRo/s72-c/20090604Zurich.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-723419036202732437.post-8875218209940922470</id><published>2009-06-15T07:41:00.000-07:00</published><updated>2009-06-15T07:45:38.400-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="daily"/><title type='text'>블로그가 날아갔다.</title><content type='html'>http://blog.cubegem.net &lt;div&gt;여기에 블로그를 000webhosts.com 이라는 공짜 호스팅을 이용해서 돌리고 있었는데, &lt;/div&gt;&lt;div&gt;며칠 접속을 안 해줬더니 inactivity 때문에 중단시킨다고 날려버렸다. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;아 내가 나름 열심히 공들여 쓴 글들도 있었는데 화나네. &lt;/div&gt;&lt;div&gt;공짜 서비스라고 저렇게 막 날려버려도 되는건가. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;워드프레스 디비 백업 받아 놓은 게 있긴한데, 다시 워드프레스 설치할 공간이 없기도 하고.&lt;/div&gt;&lt;div&gt;좀 귀찮기도 하고. 시간 나면 살려봐야겠다. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;그냥 이제 방황하지 말고 믿을만한 블로거를 써야겠다. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjshim.blogspot.com/feeds/8875218209940922470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kjshim.blogspot.com/2009/06/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default/8875218209940922470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/723419036202732437/posts/default/8875218209940922470'/><link rel='alternate' type='text/html' href='http://kjshim.blogspot.com/2009/06/blog-post.html' title='블로그가 날아갔다.'/><author><name>KJShim</name><uri>http://www.blogger.com/profile/06462425004511457188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIVw_IAOqlLwfwGqD1N4_vsXP0WZN4S6SFUhm97ykSFI8VmDYlJBM4tNeAX78UBMQRTVyM1iKGSZuODmHSr2wY97CQqwE8XZ3oxY7KBPxRaGyQOsOfSQmUBmPSYGhwZA/s220/SV401047.JPG'/></author><thr:total>0</thr:total></entry></feed>