1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

public class DotNetPad
{
    public static void Main(string[] args)
    {
var i = Expression.Parameter(typeof(int), "i");
var label = Expression.Label(typeof(void));
Expression.Lambda<Action>(Expression.Block(
    new[] { i },
    Expression.Loop(
        Expression.Block(
            Expression.PostIncrementAssign(i),
            Expression.IfThenElse(Expression.Equal(Expression.Modulo(i, Expression.Constant(15)), Expression.Constant(0)),
                Expression.Call(null, typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }), Expression.Constant("FizzBuzz")),
                Expression.IfThenElse(Expression.Equal(Expression.Modulo(i, Expression.Constant(5)), Expression.Constant(0)),
                    Expression.Call(null, typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }), Expression.Constant("Buzz")),
                    Expression.IfThenElse(Expression.Equal(Expression.Modulo(i, Expression.Constant(3)), Expression.Constant(0)),
                        Expression.Call(null, typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }), Expression.Constant("Fizz")),
                        Expression.Call(null, typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }), Expression.Call(typeof(Convert), "ToString", null, i))
                    )
                )
            ),
            Expression.IfThen(Expression.GreaterThanOrEqual(i, Expression.Constant(100)),
                Expression.Block(
                    Expression.Call(null, typeof(Console).GetMethod("ReadLine")),
                    Expression.Break(label)
                )
            )
        ),
        label
    )
)).Compile()();
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//  Microsoft (R) .NET Framework IL Disassembler.  Version 4.0.30319.1
//  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 extern System.Core
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 4:0:0:0
}
.assembly Gobiner.CSharpPad.Eval.Evil1679506498
{
  .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.
  .hash algorithm 0x00008004
  .ver 0:0:0:0
}
.module Gobiner.CSharpPad.Eval.Evil1679506498.exe
// MVID: {7D64CDBA-71A4-4BE2-AE8D-863122A16CE7}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003       // WINDOWS_CUI
.corflags 0x00000001    //  ILONLY
// Image base: 0x00000000001E0000


// =============== CLASS MEMBERS DECLARATION ===================

.class public auto ansi beforefieldinit DotNetPad
       extends [mscorlib]System.Object
{
  .method public hidebysig static void  Main(string[] args) cil managed
  {
    .entrypoint
    // 
    .maxstack  20
    .locals init (class [System.Core]System.Linq.Expressions.ParameterExpression V_0,
             class [System.Core]System.Linq.Expressions.LabelTarget V_1,
             class [System.Core]System.Linq.Expressions.ParameterExpression[] V_2,
             class [System.Core]System.Linq.Expressions.Expression[] V_3,
             class [mscorlib]System.Type[] V_4,
             class [System.Core]System.Linq.Expressions.Expression[] V_5,
             class [mscorlib]System.Type[] V_6,
             class [System.Core]System.Linq.Expressions.Expression[] V_7,
             class [mscorlib]System.Type[] V_8,
             class [System.Core]System.Linq.Expressions.Expression[] V_9,
             class [mscorlib]System.Type[] V_10,
             class [System.Core]System.Linq.Expressions.Expression[] V_11,
             class [System.Core]System.Linq.Expressions.Expression[] V_12)
    IL_0000:  ldtoken    [mscorlib]System.Int32
    IL_0005:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
    IL_000a:  ldstr      "i"
    IL_000f:  call       class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
                                                                                                                                                   string)
    IL_0014:  stloc.0
    IL_0015:  ldtoken    [mscorlib]System.Void
    IL_001a:  call       class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
    IL_001f:  call       class [System.Core]System.Linq.Expressions.LabelTarget [System.Core]System.Linq.Expressions.Expression::Label(class [mscorlib]System.Type)
    IL_0024:  stloc.1
    IL_0025:  ldc.i4.1
    IL_0026:  newarr     [System.Core]System.Linq.Expressions.ParameterExpression
    IL_002b:  stloc.2
    IL_002c:  ldloc.2
    IL_002d:  ldc.i4.0
    IL_002e:  ldloc.0
    IL_002f:  stelem.ref
    IL_0030:  ldloc.2
    IL_0031:  ldc.i4.1
    IL_0032:  newarr     [System.Core]System.Linq.Expressions.Expression
    IL_0037:  stloc.3
    IL_0038:  ldloc.3
    IL_0039:  ldc.i4.0
    IL_003a:  ldloc.0
    IL_003b:  call       class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::PostIncrementAssign(class [System.Core]System.Linq.Expressions.Expression)
    IL_0040:  ldloc.0
    IL_0041:  ldc.i4.s   15
    IL_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz