expert .net 2.0 il assembler

530 321 0
expert .net 2.0 il assembler

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

CYAN MAGENTA YELLOW BLACK PANTONE 123 CV this print for content only—size & color not accurate 7" x 9-1/4" / CASEBOUND / MALLOY (1.0625 INCH BULK 536 pages 50# Thor) THE EXPERT’S VOICE ® IN .NET Serge Lidin Expert .NET 2.0 IL Assembler An in-depth view of inner workings of the .NET 2.0 common language runtime and the runtime’s own language—the IL assembler BOOKS FOR PROFESSIONALS BY PROFESSIONALS ® Expert .NET 2.0 IL Assembler Dear Reader, This book is about the inner workings of version 2.0 of the Microsoft .NET common language runtime and about the intricacies of programming in the runtime’s own language—the IL assembly language. The IL assembly language (ILAsm), unlike high-level programming languages such as C#, provides access to the full functionality of the .NET runtime. Many compilers and programming tools, ranging from purely academic projects to enterprise systems, use the IL assembler as their back end for code generation. Any .NET application, regard- less of the language it was originally written in, can be represented in ILAsm, so you can always disassemble a .NET assembly or module into ILAsm and see for yourself how it really works. This book is a revision and an extension of my previous book Inside Microsoft .NET IL Assembler, which was the first book to describe the inner workings of ILAsm in the .NET 1.0 runtime. A great deal of time has passed since the release of that version of the runtime (and the IL assembler) in early 2002, and in our industry technologies innovate quickly. Now that the more powerful .NET 2.0 version has been released, I realized I needed to get back to writing. By reading this book you will learn how .NET 2.0 applications are built, how the runtime functions, and how to program in the IL assembly language. You will also discover how to build compilers and tools that generate ILAsm code and how to read and analyze the ILAsm code the IL disassembler shows you. Best regards, Serge Lidin Author of Inside Microsoft .NET IL Assembler Shelve in Programming/ Microsoft/.NET User level: Advanced www.apress.com SOURCE CODE ONLINE forums.apress.com FOR PROFESSIONALS BY PROFESSIONALS ™ Join online discussions: THE APRESS ROADMAP Pro C# 2005 and the .NET 2.0 Platform, Third Edition Pro VB 2005 and the .NET 2.0 Platform, Second Edition Pro ASP.NET 2.0 in C# 2005 / in VB 2005 Expert Service-Oriented Architecture in C#, Second Edition Expert ASP.NET 2.0 Advanced Application Design Expert .NET 2.0 IL Assembler .NET 2.0 IL Assembler Lidin ISBN 1-59059-646-3 9 781590 596463 90000 6 89253 59646 3 Companion eBook Available Companion eBook See last page for details on $10 eBook version Expert Serge Lidin Expert .NET 2.0 IL Assembler Ch00_6463_FINAL 7/27/06 3:00 PM Page i Expert .NET 2.0 IL Assembler Copyright © 2006 by Serge Lidin All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13: 978-1-59059-646-3 ISBN-10: 1-59059-646-3 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Ewan Buckingham Technical Reviewers: Jim Hogg, Vance Morrison Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser, Keir Thomas, Matt Wade Project Manager: Sofia Marchant Copy Edit Manager: Nicole LeClerc Copy Editor: Kim Wimpsett Assistant Production Director: Kari Brooks-Copony Senior Production Editor: Laura Cheu Compositor: Diana Van Winkle, Van Winkle Design Proofreader: Linda Seifert Indexer: Broccoli Information Management Artist: Diana Van Winkle, Van Winkle Design Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com in the Source Code section. You will need to answer questions pertaining to this book in order to successfully download the code. Ch00_6463_FINAL 7/27/06 3:00 PM Page ii To Alenushka, with all my love. Ch00_6463_FINAL 7/27/06 3:00 PM Page iii Ch00_6463_FINAL 7/27/06 3:00 PM Page iv Contents at a Glance About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv PART 1 ■ ■ ■ Quick Start ■CHAPTER 1 Simple Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 ■CHAPTER 2 Enhancing the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 ■CHAPTER 3 Making the Coding Easier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 PART 2 ■ ■ ■ Underlying Structures ■CHAPTER 4 The Structure of a Managed Executable File . . . . . . . . . . . . . . . . . . . 41 ■CHAPTER 5 Metadata Tables Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 PART 3 ■ ■ ■ Fundamental Components ■CHAPTER 6 Modules and Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 ■CHAPTER 7 Namespaces and Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 ■CHAPTER 8 Primitive Types and Signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 ■CHAPTER 9 Fields and Data Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 ■CHAPTER 10 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 ■CHAPTER 11 Generic Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 ■CHAPTER 12 Generic Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 PART 4 ■ ■ ■ Inside the Execution Engine ■CHAPTER 13 IL Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 ■CHAPTER 14 Managed Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 v Ch00_6463_FINAL 7/27/06 3:00 PM Page v PART 5 ■ ■ ■ Special Components ■CHAPTER 15 Events and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 ■CHAPTER 16 Custom Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 ■CHAPTER 17 Security Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 ■CHAPTER 18 Managed and Unmanaged Code Interoperation . . . . . . . . . . . . . . . 363 ■CHAPTER 19 Multilanguage Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 PART 6 ■ ■ ■ Appendixes ■APPENDIX A ILAsm Grammar Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 ■APPENDIX B Metadata Tables Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 ■APPENDIX C IL Instruction Set Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 ■APPENDIX D IL Assembler and Disassembler Command-Line Options . . . . . . . 453 ■APPENDIX E Offline Verification Tool Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 ■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 Ch00_6463_FINAL 7/27/06 3:00 PM Page vi Contents About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv PART 1 ■ ■ ■ Quick Start ■CHAPTER 1 Simple Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Basics of the Common Language Runtime . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Simple Sample: The Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Program Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Class Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Field Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Method Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Global Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Mapped Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Data Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Value Type As Placeholder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Calling Unmanaged Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Forward Declaration of Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 ■CHAPTER 2 Enhancing the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Compacting the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Protecting the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 ■CHAPTER 3 Making the Coding Easier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Compilation Control Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Referencing the Current Class and Its Relatives . . . . . . . . . . . . . . . . . . . . . 37 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 vii Ch00_6463_FINAL 7/27/06 3:00 PM Page vii PART 2 ■ ■ ■ Underlying Structures ■CHAPTER 4 The Structure of a Managed Executable File . . . . . . . . . . . . . 41 PE/COFF Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 MS-DOS Header/Stub and PE Signature . . . . . . . . . . . . . . . . . . . . . . . 42 COFF Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 PE Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Section Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Common Language Runtime Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Header Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Flags Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 EntryPointToken Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 VTableFixups Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 StrongNameSignature Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Relocation Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Text Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Data Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Data Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 V-Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Unmanaged Export Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Thread Local Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Unmanaged Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Managed Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Phase 1: Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Phase 2: Source Code Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Phase 3: Image Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Phase 4: Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 ■CHAPTER 5 Metadata Tables Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 What Is Metadata? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Heaps and Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Heaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 General Metadata Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Metadata Table Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 RIDs and Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 RIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 ■CONTENTSviii Ch00_6463_FINAL 7/27/06 3:00 PM Page viii Coded Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Metadata Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 PART 3 ■ ■ ■ Fundamental Components ■CHAPTER 6 Modules and Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 What Is an Assembly? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Private and Shared Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Application Domains As Logical Units of Execution . . . . . . . . . . . . . . . . . . 94 Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Assembly Metadata Table and Declaration . . . . . . . . . . . . . . . . . . . . . . . . . 97 AssemblyRef Metadata Table and Declaration . . . . . . . . . . . . . . . . . . . . . . 99 Autodetection of Referenced Assemblies . . . . . . . . . . . . . . . . . . . . . 101 The Loader in Search of Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Module Metadata Table and Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . 105 ModuleRef Metadata Table and Declaration . . . . . . . . . . . . . . . . . . . . . . . 105 File Metadata Table and Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Managed Resource Metadata and Declaration . . . . . . . . . . . . . . . . . . . . . 107 ExportedType Metadata Table and Declaration . . . . . . . . . . . . . . . . . . . . . 110 Order of Manifest Declarations in ILAsm . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Single-Module and Multimodule Assemblies . . . . . . . . . . . . . . . . . . . . . . 112 Summary of Metadata Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Assembly Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 AssemblyRef Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Module Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 ModuleRef Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 File Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 ManifestResource Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . 115 ExportedType Table Validity Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 ■CHAPTER 7 Namespaces and Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Class Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 TypeDef Metadata Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 TypeRef Metadata Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 InterfaceImpl Metadata Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 NestedClass Metadata Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 ClassLayout Metadata Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 ■CONTENTS ix Ch00_6463_FINAL 7/27/06 3:00 PM Page ix [...]... interoperation between managed and unmanaged code and discusses practical applications of the IL assembler and IL disassembler to multilanguage projects The book’s five appendixes contain references concerning ILAsm grammar, metadata organization, and IL instruction set and tool features, including the IL assembler, the IL disassembler, and the offline metadata validation tool Ch01_6463_CMP2 4/23/06 12:43 PM... in ILAsm rather than in Visual C++/CLI, C#, or Visual Basic But all NET developers use the IL disassembler now and then, and many use it on a regular basis A cyan thunderbolt—the IL disassembler icon (a silent praise for David Drake and his “Hammer’s Slammers”)—glows on the computer screens of NET developers regardless of their language preferences and problem areas And the text output of the IL disassembler... way History of ILAsm, Part I The first versions of the IL assembler and IL disassembler were developed in early 1998 by Jonathan Forbes The current language is very different from this original one, the only distinct common feature being the leading dots in the directive keywords The assembler and disassembler were built as purely internal tools facilitating the ongoing development of the common language... Ch00_6463_FINAL 7/27/06 3:00 PM Page xxvii ■INTRODUCTION ILAsm Marching On These days the IL assembler is used more and more in the compiler and tool implementation, in education, and in academic research The following compilers (for example), ranging from purely academic projects to industrial-strength systems, produce ILAsm code as their output and let the IL assembler take care of emitting the managed executables:... Australia) • Modula-2 (Queensland University of Technology, Australia) • Moscow ML.NET (Royal Veterinary and Agricultural University, Denmark) • Oberon.NET (Swiss Federal Institute of Technology, Zürich) • S# (Smallscript.com) • SML.NET (Microsoft Research, Cambridge, United Kingdom) The ability of the IL disassembler and IL assembler to work in tandem gave birth to a slew of interesting tools and techniques... prove especially useful for compiler developers who are targeting NET A narrower but growing group of readers who will find the book extremely helpful includes developers who use the IL assembly language directly, such as compiler developers targeting ILAsm as an intermediate step, developers contemplating multilanguage projects, and developers willing to exploit the capabilities of the common language... Reference 433 ■ APPENDIX C IL Instruction Set Reference 445 xvii Ch00_6463_FINAL xviii 7/27/06 3:00 PM Page xviii ■CONTENTS ■ APPENDIX D IL Assembler and Disassembler Command-Line Options 453 IL Assembler 453 IL Disassembler ... The JIT compiler, relying on the results of the loader’s activity, compiles the methods encoded in IL into the native code of the underlying platform Because the runtime is not an interpreter, it does not execute the IL code Instead, the IL code is compiled in memory into the native code, and the native code is executed The JIT compilation is also done on demand, meaning a method is compiled only when... in detail in any book of reasonable (say, luggable) size Rather, this book focuses on the next best thing: the NET IL assembler IL assembly language (ILAsm) is a low-level language, specifically designed to describe every functional feature of the common language runtime If the runtime can do it, ILAsm must be able to express it Unlike high-level languages, and like other assembly languages, ILAsm is... 1999, the assembler and disassembler fell in the lap of Larry Sullivan, head of a development group with the colorful name Common Runtime Odds and Ends Development Team (CROEDT) In April of that year, I joined the team, and Larry passed the assembler and disassembler to me When an alpha version of the common language runtime was presented at a Technical Preview in May 1999, the assembler and disassembler . last page for details on $ 10 eBook version Expert Serge Lidin Expert .NET 2. 0 IL Assembler Ch 00_ 6463_FINAL 7 /27 /06 3 :00 PM Page i Expert .NET 2. 0 IL Assembler Copyright © 20 06 by Serge Lidin All. Edition Expert ASP .NET 2. 0 Advanced Application Design Expert .NET 2. 0 IL Assembler .NET 2. 0 IL Assembler Lidin ISBN 1-5 905 9-646-3 9 7815 90 596463 900 00 6 8 925 3 59646 3 Companion eBook Available Companion. discussions: THE APRESS ROADMAP Pro C# 20 05 and the .NET 2. 0 Platform, Third Edition Pro VB 20 05 and the .NET 2. 0 Platform, Second Edition Pro ASP .NET 2. 0 in C# 20 05 / in VB 20 05 Expert Service-Oriented Architecture in

Ngày đăng: 01/06/2014, 09:43

Từ khóa liên quan

Mục lục

  • Expert .NET 2.0 IL Assembler

    • Table of Content

    • PART 1 Quick Start

      • Chapter 1 Simple Sample

      • Chapter 2 Enhancing the Code

      • Chapter 3 Making the Coding Easier

      • PART 2 Underlying Structures

        • Chapter 4 The Structure of a Managed Executable File

        • Chapter 5 Metadata Tables Organization

        • PART 3 Fundamental Components

          • Chapter 6 Modules and Assemblies

          • Chapter 7 Namespaces and Classes

          • Chapter 8 Primitive Types and Signatures

          • Chapter 9 Fields and Data Constants

          • Chapter 10 Methods

          • Chapter 11 Generic Types

          • Chapter 12 Generic Methods

          • PART 4 Inside the Execution Engine

            • Chapter 13 IL Instructions

            • Chapter 14 Managed Exception Handling

            • PART 5 Special Components

              • Chapter 15 Events and Properties

              • Chapter 16 Custom Attributes

              • Chapter 17 Security Attributes

              • Chapter 18 Managed and Unmanaged Code Interoperation

              • Chapter 19 Multilanguage Projects

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan