NAME=.NET HelloWorld.dll ProcessSections body and tokens
FILE=bins/dotnet/HelloWorld.dll
CMDS=<<EOF
pdi 12 @ 0x10002130
EOF
EXPECT=<<EOF
0x10002130   method.public.BinaryParserLibrary.BinaryParser.ProcessSections:
0x10002130                   00  nop
0x10002131                   16  ldc.i4.0
0x10002132                   0a  stloc.0
0x10002133                 2b6b  br.s 0x100021a0
0x10002135                   00  nop
0x10002136                   02  ldarg.0
0x10002137           7b02000004  ldfld BinaryParserLibrary.BinaryParser.data:System.Collections.Generic.List`1<byte>
0x1000213c                   06  ldloc.0
0x1000213d           280500002b  call System.Linq.Enumerable.Skip<byte>(System.Collections.Generic.IEnumerable`1<M0>,int):System.Collections.Generic.IEnumerable`1<M0>
0x10002142                 1f10  ldc.i4.s 16
0x10002144           280200002b  call System.Linq.Enumerable.Take<byte>(System.Collections.Generic.IEnumerable`1<M0>,int):System.Collections.Generic.IEnumerable`1<M0>
0x10002149           280300002b  call System.Linq.Enumerable.ToArray<byte>(System.Collections.Generic.IEnumerable`1<M0>):M0[]
EOF
RUN

NAME=.NET HelloWorld.dll RunAnalysis method metadata
FILE=bins/dotnet/HelloWorld.dll
CMDS=<<EOF
pdi 18 @ 0x10002300
EOF
EXPECT=<<EOF
0x10002300   method.public.BinaryParserLibrary.BinaryParser.RunAnalysis:
0x10002300                   00  nop
0x10002301                   02  ldarg.0
0x10002302                   03  ldarg.1
0x10002303           2803000006  call BinaryParserLibrary.BinaryParser.ValidateArgs(this;string[]:args):bool
0x10002308                   16  ldc.i4.0
0x10002309                 fe01  ceq
0x1000230b                   0a  stloc.0
0x1000230c                   06  ldloc.0
0x1000230d                 2c02  brfalse.s 0x10002311
0x1000230f                 2b2d  br.s 0x1000233e
0x10002311                   02  ldarg.0
0x10002312                   1e  ldc.i4.8
0x10002313           8d1a000001  newarr Byte
0x10002318                   25  dup
0x10002319           d004000004  ldtoken <PrivateImplementationDetails>.2E383FDDF78D1ACC795830F56B4EC6464E408C418E67ADD6FA4C017AFA618963:long
0x1000231e           282600000a  call System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array,System.RuntimeFieldHandle):void
0x10002323           2802000006  call BinaryParserLibrary.BinaryParser.LoadData(this;byte[]:inputData):void
0x10002328                   00  nop
EOF
RUN

NAME=.NET HelloWorld.dll AnalyzeMetadata strings and members
FILE=bins/dotnet/HelloWorld.dll
CMDS=<<EOF
pdi 18 @ 0x10002224
EOF
EXPECT=<<EOF
0x10002224   method.public.BinaryParserLibrary.BinaryParser.AnalyzeMetadata:
0x10002224                   00  nop
0x10002225           731f00000a  newobj System.Collections.Generic.Dictionary`2<string,object>..ctor(this;):void
0x1000222a                   0a  stloc.0
0x1000222b                   06  ldloc.0
0x1000222c           7273000070  ldstr "Size"
0x10002231                   02  ldarg.0
0x10002232           7b02000004  ldfld BinaryParserLibrary.BinaryParser.data:System.Collections.Generic.List`1<byte>
0x10002237           6f1000000a  callvirt System.Collections.Generic.List`1<byte>.get_Count(this;):int
0x1000223c           8c19000001  box Int32
0x10002241           6f2000000a  callvirt System.Collections.Generic.Dictionary`2<string,object>.set_Item(this;T0,T1):void
0x10002246                   00  nop
0x10002247                   06  ldloc.0
0x10002248           727d000070  ldstr "Offset"
0x1000224d                   02  ldarg.0
0x1000224e           7b03000004  ldfld BinaryParserLibrary.BinaryParser.offset:int
0x10002253           8c19000001  box Int32
0x10002258           6f2000000a  callvirt System.Collections.Generic.Dictionary`2<string,object>.set_Item(this;T0,T1):void
0x1000225d                   00  nop
EOF
RUN
