Thread: Examining the manifest

  1. #1
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784

    Examining the manifest

    Okay so who knows about the manifest?

    I ran the utility ildasm.exe and can see the manifest for my program but I don't understand it all.
    Code:
    .assembly extern /*23000001*/ mscorlib
    {
      .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
      .ver 1:0:2411:0
    }
    .assembly /*20000001*/ Shakespeare
    {
      // --- The following custom attribute is added automatically, do not uncomment -------
      //  .custom /*0C000001:0A000001*/ instance void [mscorlib/* 23000001 */]System.Diagnostics.DebuggableAttribute/* 01000002 */::.ctor(bool,
      //                                                                                                                                  bool) /* 0A000001 */ = ( 01 00 00 01 00 00 ) 
      .hash algorithm 0x00008004
      .ver 0:0:0:0
    }
    .module Shakespeare.exe
    // MVID: {AF6A66D9-B1B2-44F1-AEE6-18C92AF51EA4}
    .imagebase 0x00400000
    .subsystem 0x00000003
    .file alignment 512
    .corflags 0x00000001
    // Image base: 0x03280000
    Here is another piece

    Code:
    .class /*02000002*/ public auto ansi beforefieldinit Shakespeare
           extends [mscorlib/* 23000001 */]System.Object/* 01000001 */
    {
    } // end of class Shakespeare
    Hey, thats a comment I used in my class.

    Code:
    .method /*06000001*/ public hidebysig static 
            void  Main() cil managed
    // SIG: 00 00 01
    {
      .entrypoint
      // Method begins at RVA 0x2050
      // Code size       31 (0x1f)
      .maxstack  8
      IL_0000:  /* 72   | (70)000001       */ ldstr      "Though this be madness" /* 70000001 */
      IL_0005:  /* 28   | (0A)000002       */ call       void [mscorlib/* 23000001 */]System.Console/* 01000003 */::WriteLine(string) /* 0A000002 */
      IL_000a:  /* 72   | (70)00002F       */ ldstr      "yet there is method in it" /* 7000002F */
      IL_000f:  /* 28   | (0A)000002       */ call       void [mscorlib/* 23000001 */]System.Console/* 01000003 */::WriteLine(string) /* 0A000002 */
      IL_0014:  /* 72   | (70)000063       */ ldstr      "William Shakespeare" /* 70000063 */
      IL_0019:  /* 28   | (0A)000002       */ call       void [mscorlib/* 23000001 */]System.Console/* 01000003 */::WriteLine(string) /* 0A000002 */
      IL_001e:  /* 2A   |                  */ ret
    } // end of method Shakespeare::Main
    This last piece is a Main's constructor : ctor
    Code:
    .method /*06000002*/ public hidebysig specialname rtspecialname 
            instance void  .ctor() cil managed
    // SIG: 20 00 01
    {
      // Method begins at RVA 0x2070
      // Code size       7 (0x7)
      .maxstack  8
      IL_0000:  /* 02   |                  */ ldarg.0
      IL_0001:  /* 28   | (0A)000003       */ call       instance void [mscorlib/* 23000001 */]System.Object/* 01000001 */::.ctor() /* 0A000003 */
      IL_0006:  /* 2A   |                  */ ret
    } // end of method Shakespeare::.ctor

    Here is a tree view of my program:

    Code:
    ___[MOD] C:\MyC#Programs\Shakespeare.exe
       |      M A N I F E S T
       |___[CLS] Shakespeare
       |   |     .class public auto ansi beforefieldinit 
       |   |___[MET] .ctor : void()
       |   |___[STM] Main : void()
       |
    Last edited by Troll_King; 01-06-2002 at 03:40 AM.

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    I'm not entirely sure but I don't think that all the code you've listed is part of the manifest. From what I understand the manifest consists of hashes that contain the filename, version info and the linked modules/assemblies and is used for version control.

    I think it's just the first code section that you've listed and the remainder is the IL code, but I could be wrong.

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    I think that you are correct, but I guess I need to read more about the manifest.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting a C# program with a manifest file to run in the debugger
    By Xarzu Athanasop in forum C# Programming
    Replies: 0
    Last Post: 01-18-2008, 06:34 PM
  2. manifest file
    By George2 in forum C Programming
    Replies: 0
    Last Post: 11-29-2007, 12:14 AM
  3. Examining flags when passed to a function?
    By DominicTrix in forum C++ Programming
    Replies: 5
    Last Post: 02-01-2003, 01:34 PM