Skip to content

Instantly share code, notes, and snippets.

@jaredpar
Created February 9, 2021 18:39
Show Gist options
  • Select an option

  • Save jaredpar/a3b0369afffd7d32debf1bdae04c109d to your computer and use it in GitHub Desktop.

Select an option

Save jaredpar/a3b0369afffd7d32debf1bdae04c109d to your computer and use it in GitHub Desktop.
Defines a type C such that && doesn't work the way you expect
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. All rights reserved.
// Metadata version: v4.0.30319
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly lib
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
// --- The following custom attribute is added automatically, do not uncomment -------
// .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 )
.custom instance void [mscorlib]System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(string) = ( 01 00 1C 2E 4E 45 54 46 72 61 6D 65 77 6F 72 6B // ....NETFramework
2C 56 65 72 73 69 6F 6E 3D 76 34 2E 37 2E 32 01 // ,Version=v4.7.2.
00 54 0E 14 46 72 61 6D 65 77 6F 72 6B 44 69 73 // .T..FrameworkDis
70 6C 61 79 4E 61 6D 65 14 2E 4E 45 54 20 46 72 // playName..NET Fr
61 6D 65 77 6F 72 6B 20 34 2E 37 2E 32 ) // amework 4.7.2
.custom instance void [mscorlib]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 03 6C 69 62 00 00 ) // ...lib..
.custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 ) // ...Debug..
.custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 31 2E 30 2E 30 2E 30 00 00 ) // ...1.0.0.0..
.custom instance void [mscorlib]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 05 31 2E 30 2E 30 00 00 ) // ...1.0.0..
.custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 03 6C 69 62 00 00 ) // ...lib..
.custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 03 6C 69 62 00 00 ) // ...lib..
.hash algorithm 0x00008004
.ver 1:0:0:0
}
.module lib.dll
// MVID: {14AC17FD-E914-48B9-BB47-5ACE04294804}
.imagebase 0x10000000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00D60000
// =============== CLASS MEMBERS DECLARATION ===================
.class public auto ansi beforefieldinit C
extends [mscorlib]System.Object
{
.method public hidebysig specialname instance class C
get_Prop() cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: ret
} // end of method C::get_Prop
.method public hidebysig specialname static
class C op_BitwiseAnd(class C left,
class C right) cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldnull
IL_0001: ret
} // end of method C::op_BitwiseAnd
.method public hidebysig specialname static
bool op_True(class C c) cil managed
{
// Code size 5 (0x5)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldnull
IL_0002: cgt.un
IL_0004: ret
} // end of method C::op_True
.method public hidebysig specialname static
bool op_False(class C c) cil managed
{
// Code size 5 (0x5)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldnull
IL_0002: ceq
IL_0004: ret
} // end of method C::op_False
.method public hidebysig specialname static
class C op_Equality(class C left,
class C right) cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.1
IL_0001: ret
} // end of method C::op_Equality
.method public hidebysig specialname static
class C op_Inequality(class C left,
class C right) cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.1
IL_0001: ret
} // end of method C::op_Inequality
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: nop
IL_0007: ret
} // end of method C::.ctor
.property instance class C Prop()
{
.get instance class C C::get_Prop()
} // end of property C::Prop
} // end of class C
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file lib.res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment