using System; using System.Reflection; using System.Security; [assembly: AssemblyAlgorithmIdAttribute(0x8004)] [assembly: AssemblyVersionAttribute("0:0:0:0")] public static $ArrayType$0x24838b46 ?A0x0026e4c1.unnamed-global-0 /* at D_00009040*/ ; public static $ArrayType$0x8fc3bbef ?A0x0026e4c1.unnamed-global-1 /* at D_00009058*/ ; public static $ArrayType$0xed986b79 ?A0x0026e4c1.unnamed-global-2 /* at D_000090a4*/ ; public static int (*test)(int) /* at D_00009c48*/ ; public unsafe static int** __unep@?MyTest@@$$FYAHH@Z /* at D_000070f8*/ ; public static int MyTest(int num) { printf("The argument is %d\n", num); return 1; } public static void funcPointerAsParam(int (*funcPtr)(int), int arg) { (funcPtr)(arg); } // Note: C# does not support function pointers via calli instruction, // following code is equivalent, but wonot compile. public static int main() { Simple simple = null; Console.WriteLine(new String("Hello World using Managed Extensions!")); simple = new Simple(); Console.WriteLine(100); Console.WriteLine(new String("Hello World using Managed Extensions!")); test = MyTest; int i = (test)(100); int (*local)(int) = MyTest; i = (local)(1000); funcPointerAsParam(MyTest, 10000); return 0; } [assembly: SuppressUnmanagedCodeSecurityAttribute()] [DllImport(/* No map */)] public static int printf(sbyte* b, ...); // Embedded native code // Disassembly of native methods is not supported. // Managed TargetRVA = 0x57c8 [assembly: SuppressUnmanagedCodeSecurityAttribute()] [DllImport(/* No map */)] public static uint _mainCRTStartup(); // Embedded native code // Disassembly of native methods is not supported. // Managed TargetRVA = 0x115f /* .data D_00009040 = bytearray ( 54 68 65 20 61 72 67 75 6D 65 6E 74 20 69 73 20 25 64 0A 00) .data D_00009058 = bytearray ( 48 00 65 00 6C 00 6C 00 6F 00 20 00 57 00 6F 00 72 00 6C 00 64 00 20 00 75 00 73 00 69 00 6E 00 67 00 20 00 4D 00 61 00 6E 00 61 00 67 00 65 00 64 00 20 00 45 00 78 00 74 00 65 00 6E 00 73 00 69 00 6F 00 6E 00 73 00 21 00 00 00) .data D_000090a4 = bytearray ( 48 65 6C 6C 6F 20 57 6F 72 6C 64 20 75 73 69 6E 67 20 4D 61 6E 61 67 65 64 20 45 78 74 65 6E 73 69 6F 6E 73 21 00) .data D_00009c48 = bytearray ( 00 00 00 00) .data D_000070f8 = bytearray ( 00 11 40 00) */ class Simple { public const int i = 100; public static Simple s = new Simple(); } [DebugInfoInPDBAttribute()] [StructLayoutAttribute(LayoutKind.Explicit, Pack=1, Size=20)] struct $ArrayType$0x24838b46 { } [DebugInfoInPDBAttribute()] [StructLayoutAttribute(LayoutKind.Explicit, Pack=1, Size=76)] struct $ArrayType$0x8fc3bbef { } [DebugInfoInPDBAttribute()] [StructLayoutAttribute(LayoutKind.Explicit, Pack=1, Size=38)] struct $ArrayType$0xed986b79 { }