29
Jb Evain @jbevain Visual Studio Platform Team Mono contributor

The Most Important File Format

Embed Size (px)

Citation preview

Page 1: The Most Important File Format

Jb Evain@jbevain

Visual StudioPlatform Team

Mono contributor

Page 2: The Most Important File Format

Visual Studio Tools for Unity

Page 3: The Most Important File Format

The most important file format…

Page 4: The Most Important File Format

… for .NET developers

Page 5: The Most Important File Format

You consume it

Page 6: The Most Important File Format

You produce it

Page 7: The Most Important File Format

A binary format

Page 8: The Most Important File Format

the .NET assembly

Page 9: The Most Important File Format
Page 10: The Most Important File Format

.NET assembly

=

Windows executable

Page 11: The Most Important File Format
Page 12: The Most Important File Format

Why should you care

¯\_(ツ)_/¯

Page 13: The Most Important File Format

Chapter 1The data

Page 14: The Most Important File Format

PE fileHEADERS

SECTION

SECTION

Page 15: The Most Important File Format

.NET metadataHEADERS

Strings

Types MethodsFields Parameters …

Blobs GuidsHeaps

Tables

Page 16: The Most Important File Format
Page 17: The Most Important File Format

.NET metadatavoid Foo::Bar(int i)

Strings

FooBar

i

Type

#1

Method

#1

Parameter

#1

Blobs

instance void(int)Heaps

Tables

Page 18: The Most Important File Format
Page 19: The Most Important File Format

.NET IL

Tables

Heaps

IL

Page 20: The Most Important File Format

Chapter 2The tools

Page 21: The Most Important File Format

using System.Reflection;

Page 22: The Most Important File Format

Not great for

Reading assemblies as data Reading IL code Modifying assemblies

Page 23: The Most Important File Format

1. IKVM.Reflection

Page 24: The Most Important File Format

Great for

Creating new assemblies Porting System.Reflection code

Page 25: The Most Important File Format

2. System.Reflection.Metadata

Page 26: The Most Important File Format

Great for

Reading metadata (very) quickly

Page 27: The Most Important File Format

3. Mono.Cecil

Page 28: The Most Important File Format

Great for

Analyzing assemblies Modifying assemblies

Page 29: The Most Important File Format

Thank you!

@jbevain