Home Page Icon
Home Page
Table of Contents for
Title
Close
Title
by Serge Lidin
.NET IL Assembler
Cover
Title
Copyright
Dedication
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Simple Sample
Basics of the Common Language Runtime
Simple Sample: The Code
Program Header
Class Declaration
Field Declaration
Method Declaration
Global Items
Mapped Fields
Data Declaration
Value Type As Placeholder
Calling Unmanaged Code
Forward Declaration of Classes
Summary
Chapter 2: Enhancing the Code
Compacting the Code
Protecting the Code
Summary
Chapter 3: Making the Coding Easier
Aliasing
Compilation Control Directives
Referencing the Current Class and Its Relatives
Summary
Chapter 4: The Structure of a ManagedExecutable File
PE/COFF Headers
MS-DOS Header/Stub and PE Signature
COFF Header
PE Header
Section Headers
Common Language Runtime Header
Header Structure
Flags Field
EntryPointToken Field
VTableFixups Field
StrongNameSignature Field
Relocation Section
Text Section
Data Sections
Data Constants
V-Table
Unmanaged Export Table
Thread Local Storage
Resources
Unmanaged Resources
Managed Resources
Summary
Phase 1: Initialization
Phase 2: Source Code Parsing
Phase 3: Image Generation
Phase 4: Completion
Chapter 5: Metadata Tables Organization
What Is Metadata?
Heaps and Tables
Heaps
General Metadata Header
Metadata Table Streams
RIDs and Tokens
RIDs
Tokens
Coded Tokens
Metadata Validation
Summary
Chapter 6: Modules and Assemblies
What Is an Assembly?
Private and Shared Assemblies
Application Domains As Logical Units of Execution
Manifest
Assembly Metadata Table and Declaration
AssemblyRef Metadata Table and Declaration
Autodetection of Referenced Assemblies
The Loader in Search of Assemblies
Module Metadata Table and Declaration
ModuleRef Metadata Table and Declaration
File Metadata Table and Declaration
Managed Resource Metadata and Declaration
ExportedType Metadata Table and Declaration
Order of Manifest Declarations in ILAsm
Single-Module and Multimodule Assemblies
Summary of Metadata Validity Rules
Assembly Table Validity Rules
AssemblyRef Table Validity Rules
Module Table Validity Rules
ModuleRef Table Validity Rules
File Table Validity Rules
ManifestResource Table Validity Rules
ExportedType Table Validity Rules
Chapter 7: Namespaces and Classes
Class Metadata
TypeDef Metadata Table
TypeRef Metadata Table
InterfaceImpl Metadata Table
NestedClass Metadata Table
ClassLayout Metadata Table
Namespace and Full Class Name
ILAsm Naming Conventions
Namespaces
Full Class Names
Class Attributes
Flags
Class Visibility and Friend Assemblies
Class References
Parent of the Type
Interface Implementations
Class Layout Information
Interfaces
Value Types
Boxed and Unboxed Values
Instance Members of Value Types
Derivation of Value Types
Enumerations
Delegates
Nested Types
Class Augmentation
Summary of the Metadata Validity Rules
TypeDef Table Validity Rules
Enumeration-Specific Validity Rules
TypeRef Table Validity Rules
InterfaceImpl Table Validity Rules
NestedClass Table Validity Rules
ClassLayout Table Validity Rules
Chapter 8: Primitive Types and Signatures
Primitive Types in the Common Language Runtime
Primitive Data Types
Data Pointer Types
Function Pointer Types
Vectors and Arrays
Modifiers
Native Types
Variant Types
Representing Classes in Signatures
Signatures
Calling Conventions
Field Signatures
Method and Property Signatures
MemberRef Signatures
Indirect Call Signatures
Local Variables Signatures
Type Specifications
Summary of Signature Validity Rules
Chapter 9: Fields and Data Constants
Field Metadata
Defining a Field
Referencing a Field
Instance and Static Fields
Default Values
Mapped Fields
Data Constants Declaration
Explicit Layouts and Union Declaration
Global Fields
Constructors vs. Data Constants
Summary of Metadata Validity Rules
Field Table Validity Rules
FieldLayout Table Validity Rules
FieldRVA Table Validity Rules
FieldMarshal Table Validity Rules
Constant Table Validity Rules
MemberRef Table Validity Rules
Chapter 10: Methods
Method Metadata
Method Table Record Entries
Method Flags
Method Name
Method Implementation Flags
Method Parameters
Referencing the Methods
Method Implementation Metadata
Static, Instance, Virtual Methods
Explicit Method Overriding
Method Overriding and Accessibility
Method Header Attributes
Local Variables
Class Constructors
Class Constructors and the beforefieldinit Flag
Module Constructors
Instance Constructors
Instance Finalizers
Variable Argument Lists
Method Overloading
Global Methods
Summary of Metadata Validity Rules
Method Table Validity Rules
Param Table Validity Rules
MethodImpl Table Validity Rules
Chapter 11: Generic Types
Generic Type Metadata
GenericParam Metadata Table
GenericParamConstraint Metadata Table
TypeSpec Metadata Table
Constraint Flags
Defining Generic Types in ILAsm
Addressing the Type Parameters
Generic Type Instantiations
Defining Generic Types: Inheritance, Implementation, Constraints
Defining Generic Types: Cyclic Dependencies
The Members of Generic Types
Virtual Methods in Generic Types
Nested Generic Types
Summary of the Metadata Validity Rules
Chapter 12: Generic Methods
Generic Method Metadata
MethodSpec Metadata Table
Signatures of Generic Methods
Defining Generic Methods in ILAsm
Calling Generic Methods
Overriding Virtual Generic Methods
Summary of the Metadata Validity Rules
Chapter 13: IL Instructions
Long-Parameter and Short-Parameter Instructions
Labels and Flow Control Instructions
Unconditional Branching Instructions
Conditional Branching Instructions
Comparative Branching Instructions
The switch Instruction
The break Instruction
Managed EH Block Exiting Instructions
EH Block Ending Instructions
The ret Instruction
Arithmetical Instructions
Stack Manipulation
Constant Loading
Indirect Loading
Indirect Storing
Arithmetical Operations
Overflow Arithmetical Operations
Bitwise Operations
Shift Operations
Conversion Operations
Overflow Conversion Operations
Logical Condition Check Instructions
Block Operations
Addressing Arguments and Local Variables
Method Argument Loading
Method Argument Address Loading
Method Argument Storing
Method Argument List
Local Variable Loading
Local Variable Reference Loading
Local Variable Storing
Local Block Allocation
Prefix Instructions
Addressing Fields
Calling Methods
Direct Calls
Indirect Calls
Tail Calls
Constrained Virtual Calls
Addressing Classes and Value Types
Vector Instructions
Vector Creation
Element Address Loading
Element Loading
Element Storing
Code Verifiability
Chapter 14: Managed Exception Handling
EH Clause Internal Representation
Types of EH Clauses
Label Form of EH Clause Declaration
Scope Form of EH Clause Declaration
Processing the Exceptions
Exception Types
Loader Exceptions
JIT Compiler Exceptions
Execution Engine Exceptions
Interoperability Services Exceptions
Subclassing the Exceptions
Unmanaged Exception Mapping
Summary of EH Clause Structuring Rules
Chapter 15: Events and Properties
Events and Delegates
Event Metadata
The Event Table
The EventMap Table
The MethodSemantics Table
Event Declaration
Property Metadata
The Property Table
The PropertyMap Table
Property Declaration
Summary of Metadata Validity Rules
Event Table Validity Rules
EventMap Table Validity Rules
Property Table Validity Rules
PropertyMap Table Validity Rules
MethodSemantics Table Validity Rules
Chapter 16: Custom Attributes
Concept of a Custom Attribute
CustomAttribute Metadata Table
Custom Attribute Value Encoding
Verbal Description of Custom Attribute Value
Custom Attribute Declaration
Classification of Custom Attributes
Execution Engine and JIT Compiler
Interoperation Subsystem
Security
Remoting Subsystem
Visual Studio Debugger
Assembly Linker
Common Language Specification (CLS) Compliance
Pseudocustom Attributes
Summary of Metadata Validity Rules
Chapter 17: Security Attributes
Declarative Security
Declarative Actions
Security Permissions
Access Permissions
Identity Permissions
Custom Permissions
Permission Sets
Changes in Declarative Security in v4.0
Declarative Security Metadata
Permission Set Blob Encoding
Security Attribute Declaration
Summary of Metadata Validity Rules
Chapter 18: Managed and Unmanaged Code Interoperation
Thunks and Wrappers
P/Invoke Thunks
Implementation Map Metadata
IJW Thunks
COM Callable Wrappers
Runtime Callable Wrappers
Data Marshaling
Blittable Types
In/Out Parameters
String Marshaling
Object Marshaling
More Object Marshaling
Array Marshaling
Delegate Marshaling
Interoperation with Windows Runtime
Providing Managed Methods as Callbacks for Unmanaged Code
Managed Methods as Unmanaged Exports
Export Table Group
Summary
Chapter 19: Multilanguage Projects
IL Disassembler
Principles of Round-Tripping
Creative Round-Tripping
Using Class Augmentation
Module Linking Through Round-Tripping
ASMMETA: Resolving Circular Dependencies
IL Inlining in High-Level Languages
Compiling in Debug Mode
Summary
Appendix A: ILAsm Grammar Reference
Lexical Tokens
Auxiliary Lexical Tokens
Data Type Nonterminals
Identifier Nonterminals
Class Referencing
Module-Level Declarations
Compilation Control Directives
Module Parameter Declaration
V-Table Fixup Table Declaration
Manifest Declarations
Managed Types in Signatures
Native Types in Marshaling Signatures
Method and Field Referencing
Class Declaration
Generic Type Parameters Declaration
Class Body Declarations
Field Declaration
Method Declaration
Method Body Declarations
External Source Directives
Managed Exception Handling Directives
IL Instructions
Event Declaration
Property Declaration
Constant Declarations
Custom Attribute Declarations
Verbal Description of Custom Attribute Initialization Blob
Security Declarations
Aliasing of Types, Methods, Fields, and Custom Attributes
Data Declaration
Appendix B: Metadata Tables Reference
Appendix C: IL Instruction Set Reference
Appendix D: IL Assembler and Disassembler Command-Line Options
IL Assembler
IL Disassembler
Output Redirection Options
ILAsm Code-Formatting Options (PE Files Only)
File Output Options (PE Files Only)
File or Console Output Options (PE Files Only)
Metadata Summary Option
Appendix E: Offline Verification Tool Reference
Error Codes and Messages
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Copyright
.NET IL Assembler
Serge Lidin
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset