????д???????C#??????????????????д????????????????????????????????????????????е??
?????????exe????????exe??????У????м????????Щ??????????????????exe??????????
???????????C#?????????????IL(Intermediate Language)?????????exe??????涼??IL?????????
????C#?????exe?????window????????????????????PE??????????win32??exe?????????????????????exe?????????
????dll??????????exe?????????????????????

????MS-DOC MZ Header??MS-DOS Stub????????DOS?????????????????exe??DOS????????????????"This program cannot be run in DOS mode"??
????PE Header???????????????Щ??????磺????????????????????Section????????Optional Header???С???????????ο?Winnt.h????_IMAGE_FILE_HEADER??
????PE Optional Header????????????汾????????????????AddressOfEntryPoint??RVA-Relative Virtual Address)???????????е???????????exe??????????С???C#???????????????????.net??????MsCorEE.dll??_CorExeMain()????????????????XP?????XP????????OS Loader????????ж?????PE??????CLR??????????????MsCorEE.dll??_CorExeMain()??????
????Section?к???????????????????C#??????CLR?????????IL?????????檔
????CLR??????????Common Language Runtime?????????????????CLR??????????????й????棬?????????????????
????CLR????????ο?CorHdr.h?е?IMAGE_COR20_HEADER???????£?
1 typedef struct IMAGE_COR20_HEADER
2     {
3         // CLR?汾???
4         ULONG cb;
5         USHORT MajorRuntimeVersion;
6         USHORT MinorRuntimeVersion;
7
8         IMAGE_DATA_DIRECTORY MetaData; //?????
9         ULONG Flags;
10         ULONG EntryPointToken;  //??????Main????
11
12
13         IMAGE_DATA_DIRECTORY Resources;  //???
14         IMAGE_DATA_DIRECTORY StrongNameSignature;  //???????
15
16
17         // Regular fixup and binding information
18         IMAGE_DATA_DIRECTORY CodeManagerTable;
19         IMAGE_DATA_DIRECTORY VTableFixups;
20         IMAGE_DATA_DIRECTORY ExportAddressTableJumps;
21
22         // Precompiled image info (internal use only - set to zero)
23         IMAGE_DATA_DIRECTORY ManagedNativeHeader;
24
25     }
26     IMAGE_COR20_HEADER;
??????????????????????????????GC??????????????????????????????????????
??????????????????????????嵥????ɡ?
??????????????????е??????????????Σ???????????????????壬???????κε???????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????GC????????????????????ж???????????????????????????cpu???????????????????????????????????????????????????????????????????????????????GC?????????????????????????á?
?????嵥????????????????????????塣
??????????IL?????????????ildasm.exe??????
??????????C#?????exe??????????????????exe????????й????лл??