CINXE.COM

Binary Hacks - O'Reilly Japan

<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Binary Hacks - O'Reilly Japan</title> <link rel="stylesheet" type="text/css" href="/assets/css/font-face.css"> <link rel="stylesheet" type="text/css" href="/assets/css/layout.css"> <link rel="stylesheet" type="text/css" href="/assets/css/layout-books.css"> <link rel="icon" type="image/png" href="https://www.oreilly.com/favicon.ico"> <meta name="format-detection" content="telephone=no"> <meta property="og:title" content="Binary Hacks" /> <meta property="og:type" content="article" /> <meta property="og:image" content="https://www.oreilly.co.jp/books/images/picture_large4-87311-288-5.jpeg" /> <meta property="og:image:secure_url" content="https://www.oreilly.co.jp/books/images/picture_large4-87311-288-5.jpeg" /> <meta property="og:url" content="https://www.oreilly.co.jp/books/9784873112886/" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:site" content="O'Reilly Japan" /> <meta name="twitter:creator" content="oreilly_japan" /> <link href="http://www.oreilly.co.jp/sales/atom.xml" type="application/atom+xml" rel="alternate" title="Sales Information" /> <meta property="og:description" content="本書のテーマは低レイヤのプログラミング技術です。低レイヤとは「生」のコンピュータに近いことを意味します。ソフトウェアの世界は抽象化の積み重ねによって進歩してきました。抽象化は低レイヤの複雑な部分を隠蔽し、より生産性、安全性の高い方法でプログラミングする手段を開発者に提供します。しかし、低レイヤの技術を完全に忘れてプログラミングできるかというと、そうもいきません。性能をとことん追求したい、信頼性をできるだけ高めたい、ときおり発生する「謎のエラー」を解決したい、といった場面では低いレイヤに降りていく必要に迫られます。残念ながら、抽象化は万全ではないためです。本書の目的は、そういった場面で使えるたくさんのノウハウ「Binary Hack」を紹介することです。本書では、Binary Hackを「ソフトウェアの低レイヤの技術 を駆使したプログラミングノウハウ」と定義し、基本的なツールの使い方から、セキュアプログラミング、OSやプロセッサの機能を利用した高度なテクニックまで広くカバーします。(「はじめに」より) ・著者によるサポートサイト " /> <link rel="canonical" href="https://www.oreilly.co.jp//books/9784873112886/" /> <link rel="amphtml" href="https://www.oreilly.co.jp//books/9784873112886/mobile.html"> <!-- Google Tag Manager --> <script>(function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', 'GTM-KR9JFVC');</script> <!-- End Google Tag Manager --> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-M7QE72H4KS"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-M7QE72H4KS'); </script> <style> .collapsible { background-color: white; border: 0; border-bottom: 1px solid rgb(246, 246, 246); margin: 0; padding: 0; cursor: pointer; width: 100%; text-align: left; outline: none; font-size: 1.5rem; font-weight: 700; line-height: 1.5em; } .collapsible:after { content: '\02795'; /* Unicode character for "plus" sign (+) */ font-size: 1.0rem; margin-left: 5px; float: right; } .collapsible-active:after { content: "\2796"; /* Unicode character for "minus" sign (-) */ } .collapsible:hover { box-shadow: 2px0 4px 8px rgb(0, 0, 0, .1); transition: box-shadow .2s; cursor: pointer; } .collapsible+section { padding: 0; margin-bottom: 30px; background-color: white; max-height: 0; overflow: hidden; transition: max-height 0.05s ease-out; } </style> </head> <body> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KR9JFVC" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <div id="skipToMain" class="nav__SkipToMain"><a href="#maincontent">Skip to main content</a></div> <header role="banner" class="nav__GlboalHeader"> <div class="pageWidth"> <nav role="navigation" aria-label="site sections" class="nav__GlobalNav"> <a aria-current="page" title="Go to home page" class="nav__Logo" href="/"><img src="/assets/images/logo_oreilly_japan.svg" alt="O'Reilly logo"></a> <div class="nav__NavItems" id="nav__NavItems"> <div class="nav__NavGroup"> <a class="nav__Link" href="/blog/">Blog</a> <a class="nav__Link active" href="/books/">Books</a> <a class="nav__Link" href="/ebook/">Ebooks</a> <a class="nav__Link" href="/online-learning/">Learning platform</a> <a class="nav__Link" href="/order/">Order</a> <a class="nav__Link" href="/company/">About</a> </div> <div class="nav__CTA"> <a href="/ebook/cart" class="nav__Cart">Cart</a> </div> </div> <button id="nav__MobileBtn" aria-expanded="false" aria-controls="menuList" class="nav__MobileBtn"><span><span></span></span></button> </nav> </div> </header> <main id="maincontent"> <div class="pageWidth"> <h1 itemprop="name"> Binary Hacks </h1> <p class='sub_title'> ―ハッカー秘伝のテクニック100選</p> <span itemprop="publisher" content="オライリー・ジャパン"></span> <div class="contributers"> <span itemprop="author"> 高林 哲、鵜飼 文敏、佐藤 祐介、浜地 慎一郎、首藤 一幸 著 </span> </div> <section class="detail" itemscope itemtype="http://schema.org/Book"> <div class="detail-cover"> <img src="https://www.oreilly.co.jp/books/images/picture_large4-87311-288-5.jpeg" class="cover-photo" alt="[cover photo]" /> </div> <dl class="item-props"> <dt>TOPICS</dt> <dd> <a href="/books/prog/"> Programming </a> </dd> <dt>発行年月日</dt> <dd itemprop="datePublished" content="2006-11-11"> 2006年11月 </dd> <dt>PRINT LENGTH</dt> <dd itemprop="numberOfPages"> 412 </dd> <dt>ISBN</dt> <dd itemprop="isbn"> 978-4-87311-288-6 </dd> <dt>FORMAT</dt> <dd> Print PDF <div class="buying-options"> <div class="option-item"> <div class="option-name">Ebook</div> <div> 3,520円 </div> <a href="/ebook/cart?id=978-4-87311-288-6&mode=add" class="update-button secondary-button"> Ebookを購入する </a> </div> <div class="option-item"> <div class="option-name">Print</div> <div> 3,520円 </div> <div class="link-book-order">書籍のご注文は<a href="https://www.ohmsha.co.jp/book/9784873112886/">オーム社サイト</a>へ </div> </div> </div> </dd> </dl> <div id="detail" class="content"> <p itemprop="description"> 本書のテーマは低レイヤのプログラミング技術です。低レイヤとは「生」のコンピュータに近いことを意味します。ソフトウェアの世界は抽象化の積み重ねによって進歩してきました。抽象化は低レイヤの複雑な部分を隠蔽し、より生産性、安全性の高い方法でプログラミングする手段を開発者に提供します。しかし、低レイヤの技術を完全に忘れてプログラミングできるかというと、そうもいきません。性能をとことん追求したい、信頼性をできるだけ高めたい、ときおり発生する「謎のエラー」を解決したい、といった場面では低いレイヤに降りていく必要に迫られます。残念ながら、抽象化は万全ではないためです。本書の目的は、そういった場面で使えるたくさんのノウハウ「Binary Hack」を紹介することです。本書では、Binary Hackを「ソフトウェアの低レイヤの技術 を駆使したプログラミングノウハウ」と定義し、基本的なツールの使い方から、セキュアプログラミング、OSやプロセッサの機能を利用した高度なテクニックまで広くカバーします。(「はじめに」より) <BR> <BR> <ul> <a href="http://0xcc.net/binhacks/">・著者によるサポートサイト</a><BR> </ul> <br /> </p> </div> <h2 class="collapsible">目次</h2> <section> <div id="toc"> <pre>本書に寄せて クレジット はじめに 1章 イントロダクション 1. Binary Hack入門 2. Binary Hack用語の基礎知識 3. fileでファイルの種類をチェックする 4. odでバイナリファイルをダンプする 2章 オブジェクトファイルHack 5. ELF入門 6. 静的ライブラリと共有ライブラリ 7. lddで共有ライブラリの依存関係をチェックする 8. readelfでELFファイルの情報を表示する 9. objdumpでオブジェクトファイルをダンプする 10. objdumpでオブジェクトファイルを逆アセンブルする 11. objcopyで実行ファイルにデータを埋め込む 12. nmでオブジェクトファイルに含まれるシンボルをチェックする 13. stringsでバイナリファイルから文字列を抽出する 14. c++filtでC++のシンボルをデマングルする 15. addr2lineでアドレスからファイル名と行番号を取得する 16. stripでオブジェクトファイルからシンボルを削除する 17. arで静的ライブラリを操作する 18. CとC++のプログラムをリンクするときの注意点 19. リンク時のシンボルの衝突に注意する 20. GNU/Linuxの共有ライブラリを作るときPICでコンパイルするのはなぜか 21. statifierで動的リンクの実行ファイルを擬似的に静的リンクにする 3章 GNUプログラミングHack 22. GCCのGNU拡張入門 23. GCCでインラインアセンブラを使う 24. GCCのビルトイン関数による最適化を活用する 25. glibcを使わないでHello Worldを書く 26. TLS(スレッドローカルストレージ)を使う 27. glibcでロードするライブラリをシステムに応じて切り替える 28. リンクされているライブラリによってプログラムの動作を変える 29. ライブラリの外に公開するシンボルを制限する 30. ライブラリの外に公開するシンボルにバージョンをつけて動作を制御する 31. main()の前に関数を呼ぶ 32. GCCが生成したコードによる実行時コード生成 33. スタックに置かれたコードの実行を許可/禁止する 34. ヒープ上に置いたコードを実行する 35. PIE(位置独立実行形式)を作成する 36. C++でsynchronized methodを書く 37. C++でシングルトンを生成する 38. g++の例外処理を理解する(throw編) 39. g++の例外処理を理解する(SjLj編) 40. g++の例外処理を理解する(DWARF2編) 41. g++ 例外処理のコストを理解する 4章 セキュアプログラミングHack 42. GCCセキュアプログラミング入門 43. -ftrapvで整数演算のオーバーフローを検出する 44. Mudflap でバッファオーバーフローを検出する 45. -D_FORTIFY_SOURCEでバッファオーバーフローを検出する 46. -fstack-protectorでスタックを保護する 47. bitmaskする定数は符号なしにする 48. 大きすぎるシフトに注意 49. 64ビット環境で0とNULLの違いに気を付ける 50. POSIXのスレッドセーフな関数 51. シグナルハンドラを安全に書く方法 52. sigwaitで非同期シグナルを同期的に処理する 53. sigsafeでシグナル処理を安全にする 54. Valgrindでメモリリークを検出する 55. Valgrindでメモリの不正アクセスを検出する 56. Helgrindでマルチスレッドプログラムのバグを検出する 57. fakerootで擬似的なroot権限でプロセスを実行する 5章 ランタイムHack 58. プログラムがmain()にたどりつくまで 59. システムコールはどのように呼び出されるか 60. LD_PRELOADで共有ライブラリを差し換える 61. LD_PRELOAD で既存の関数をラップする 62. dlopenで実行時に動的リンクする 63. Cでバックトレースを表示する 64. 実行中のプロセスのパス名をチェックする 65. ロードしている共有ライブラリをチェックする 66. プロセスや動的ライブラリがマップされているメモリを把握する 67. libbfdでシンボルの一覧を取得する 68. C++ のシンボルを実行時にデマングルする 69. ffcallでシグネチャを動的に決めて関数を呼ぶ 70. libdwarfでデバッグ情報を取得する 71. dumperで構造体のデータを見やすくダンプする 72. オブジェクトファイルを自力でロードする 73. libunwindでコールチェインを制御する 74. GNU lightningでポータブルに実行時コード生成する 75. スタック領域のアドレスを取得する 76. sigaltstackでスタックオーバーフローに対処する 77. 関数へのenter/exitをフックする 78. シグナルハンドラからプログラムの文脈を書き換える 79. プログラムカウンタの値を取得する 80. 自己書き換えでプログラムの動作を変える 81. SIGSEGVを使ってアドレスの有効性を確認する 82. straceでシステムコールをトレースする 83. ltraceで共有ライブラリの関数呼び出しをトレースする 84. JockeyでLinuxのプログラムの実行を記録、再生する 85. prelinkでプログラムの起動を高速化する 86. livepatchで実行中のプロセスにパッチをあてる 6章 プロファイラ・デバッガHack 87. gprofでプロファイルを調べる 88. sysprofでお手軽にシステムプロファイルを調べる 89. oprofileで詳細なシステムプロファイルを得る 90. GDBで実行中のプロセスを操る 91. ハードウェアのデバッグ機能を使う 92. Cのプログラムの中でブレークポイントを設定する 7章 その他のHack 93. Boehm GCの仕組み 94. プロセッサのメモリオーダリングに注意 95. Portable Coroutine Library(PCL)で軽量な並行処理を行う 96. CPUのクロック数をカウントする 97. 浮動小数点数のビット列表現 98. x86が持つ浮動小数点演算命令の特殊性 99. 結果が無限大やNaNになる演算でシグナルを発生させる 100. 文献案内 索引</pre> </div> </section> </section> <div class="related-items"> <div class="sectionRow__Heading"> <h3>関連書籍</h3> </div> <div class="sectionRow__Content"> <div class="sectionRow__BestLarge" id="bestEbooks"> <div class="sectionRow__Best" id="bestEbook1"> <a class="sectionRow__BestCover" href="/books/9784814400850/"> <img src="https://www.oreilly.co.jp/books/images/picture_large978-4-8144-0085-0.jpeg" alt="Binary Hacks Rebooted"> </a> </div> </div> <div class="sectionRow__BestThumbnails" id="bestEbookThumbnails"> <button class="sectionRow__bestBookThumbnailsItem" data-for="bestEbook1" aria-selected="true" title="Binary Hacks Rebooted"> <img src="https://www.oreilly.co.jp/books/images/picture_large978-4-8144-0085-0.jpeg" alt="94561295732168"> </button> </div> </div> </div> </div> </main> <footer class="footer__FooterSection"> <div class="pageWidth"> <div class="footer__FooterTop"> <div class="footer__List"> <h3><a href="https://www.oreilly.co.jp/company/">About</a></h3> <a href="https://www.oreilly.co.jp/company/">会社概要</a> <a href="https://www.oreilly.co.jp/orj/privacypolicy.shtml">個人情報について</a> <a href="http://www.oreilly.com/">O’Reilly Media</a> </div> <div class="footer__List"> <h3><a href="https://www.oreilly.co.jp/company/">Support</a></h3> <a href="https://www.oreilly.co.jp/feedback/">Contact us</a> <a href="https://www.oreilly.co.jp/bookclub/">Bookclub</a> <a href="https://www.oreilly.co.jp/order/">書籍注文</a> </div> <div class="footer__Apps"> <h3>Download the O’Reilly app</h3> <p>Take O’Reilly with you and learn anywhere, anytime on your phone <span class="nowrap">and tablet.</span> </p> <div class="footer__DownloadLinks"> <a href="https://itunes.apple.com/us/app/safari-to-go/id881697395"><img src="https://cdn.oreillystatic.com/oreilly/images/app-store-logo.png" alt="Apple app store"></a> <a href="https://play.google.com/store/apps/details?id=com.safariflow.queue"><img src="https://cdn.oreillystatic.com/oreilly/images/google-play-logo.png" alt="Google play store"></a> </div> </div> </div> <div class="footer__FooterBase"> <a aria-current="page" class="footer__Logo" title="Go to home page" href="/"><img src="/assets/images/logo_oreilly_japan.svg" alt="O'Reilly logo"></a> <p>© 2022, O’Reilly Japan, Inc. oreilly.co.jpに掲載されているすべてのトレードマークおよび登録商標は、それぞれの所有者に帰属します。</p> </div> </div> </footer> <script src="/assets/scripts/cookies-policy.6d8dcbae.js"></script> <script> let coll = document.getElementsByClassName('collapsible'); for (let i = 0; i < coll.length; i++) { let button = document.createElement('button'); button.setAttribute('type', 'button'); button.setAttribute('class', 'collapsible'); button.textContent = coll[i].textContent; coll[i].replaceWith(button) coll[i].addEventListener('click', function () { this.classList.toggle('collapsible-active'); let content = this.nextElementSibling; if (content.style.maxHeight) { content.style.maxHeight = null; } else { content.style.maxHeight = content.scrollHeight + 'px'; } }); } </script> <script src="/assets/scripts/scripts.js"></script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-6009404-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'UA-6009404-1'); </script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10