Questions tagged [cil]

Common Intermediate Language is the object-oriented assembly language used by the .NET Framework, .NET Core, and Mono. .NET languages compile to CIL, which is assembled into an object code that has a bytecode-style format.

Common Intermediate Language (CIL, pronounced either "sil" or "kil") (formerly called Microsoft Intermediate Language or MSIL, and sometimes informally called IL) is the lowest-level human-readable programming language defined by the Common Language Infrastructure (CLI) specification and is used by the .NET Framework, .NET Core, and Mono.

Languages which target a CLI-compatible runtime environment compile to CIL, which is assembled into an object code that has a bytecode-style format. CIL is an object-oriented assembly language, and is stack-based. Its bytecode is translated into native code or executed by a virtual machine.

For CIL the C Intermediate Language (a subset of C), use .

1064 questions
0
votes
1 answer

Correct me if I am wrong about some terms (mfc, win32, in vc++

From what I understand, using Wiki and this question I posted, Microsoft has its own compiler called VC++ which is included in the .net framework along with many other things. And it can make very good applications, due to the following reasons…
user1219198
-1
votes
2 answers

C# program :Convert Hex data to normal text: import library error

This is my C# program: I have to decode Hex data into normal text in readable format. I prefer to use Hex class from apache library which i downloaded from http://commons.apache.org/codec/download_codec.cgi ,which is a jar file. Jar files are not…
-1
votes
1 answer

C# Harmony transpiler crashing when using Call or CallVirt

I'm attempting to mod a game, and I'm using Harmony 1.2.0.1. I've been attempting to use a transpiler to add a separate condition to an if statement, however when the method that I am patching runs, the game completely crashes. I can't find any…
Lionmeow
  • 79
  • 6
-1
votes
1 answer

Could not load file or assembly 'FSharp.Core'

I'm trying to compile a program from IL to exe on GNU/Linux, but can't explain how to dynlink FSharp.Core.dll. I tried to copy and paste it to the same directory where .exe is built, but no luck. I'm actually not sure where the issue can be: in my…
Kakadu
  • 2,837
  • 19
  • 29
-1
votes
1 answer

I tried to modify the IL of the System.String.Concat method through the ICorProfilerCallback interface, but something went wrong

I try to modify the IL of the System.String.Concat method through the ICorProfilerCallback interface, and add my own tracking code before the method is executed。 I modified the IL of other methods and added the tracking code without any problems.…
jiaxiang8756
  • 187
  • 1
  • 1
  • 6
-1
votes
1 answer

What modifications postsharp bring to the cilof my method that prevent me from editing the cil code?

I have this method: public string NestedFoo(SampleClass bar) { var1 = "value set in NestedFoo()"; Var2 = "value set in NestedFoo()"; var3 = "value set in NestedFoo()"; Var4 = "value set in…
Amon
  • 296
  • 1
  • 14
-1
votes
2 answers

Adding a call to a method before a STFLD causes an InvalidProgramException

I have access to a function body Intermediate Language like this : byte[] ilCodes = NestedFooInfo.GetMethodBody().GetILAsByteArray(); I want to be able to modify its IL code so that whenever there is a stfld IL command I call the following method…
Amon
  • 296
  • 1
  • 14
-1
votes
1 answer

Dynamically call overload methods of subclass

I'm writing a game server in C# and now I have a problem of calling appropriate method handling each message by its type correctly. My current solution illustrated in this simple code: public class DynamicBase { public int Method(Abc abc) => 2; …
Hai Nguyen
  • 81
  • 10
-1
votes
2 answers

C# CIL stloc.1 issue

The former question is solved, please proceed to the end. So I have this code here: using Harmony; using RimWorld; using Verse; using UnityEngine; using System.Collections.Generic; using System.Reflection.Emit; using System; using…
joethehat
  • 1
  • 2
-1
votes
1 answer

Mono.Cecil - How to know a method has variable-arguments?

In C# we have __arglist keyword which makes method variable-argument like this: public static void PrintFormat(string format, __arglist) { .... } It compiles to : .method public hidebysig static vararg void PrintFormat ( string format ) cil…
moien
  • 999
  • 11
  • 26
-1
votes
1 answer

It's possible to run an .NET Native Image executable?

The question is simple: i've generated an executable with ngen, his full path is: "C:\Windows\assembly\NativeImages_v4.0.30319_32\NassilDotNet\eddb174e4a81e440633abddb977ab57a\NassilDotNet.ni.exe" When I try to open/execute that executeable, an…
CypherPotato
  • 221
  • 7
  • 18
-1
votes
1 answer

C# IL Emiter load variable type object

So i have something like this public void test(string name, Func fuc) { object x = fuc(); FieldInfo fdt = Dest.GetField(nameDest, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); …
-1
votes
1 answer

Creation of dynamic method using CIL MethodBuilder with IQueryable return type

I have written the dynamic web services for SOAP and REST. Now need to create OData web services that has operations that return IQueryable Interface as per WCF data service specification. I am creating a dynamic method based on IL Emit statements.…
badari
  • 91
  • 1
  • 8
-1
votes
1 answer

Memory allocation for enumerated types in .NET

Now, when I used to work a lot with embedded systems and severe memory constraints I remember we had to be extremely conscious about the types used and how they were used. Now, it is typical of Windows programmer to waste space simply because you…
Lord of Scripts
  • 3,579
  • 5
  • 41
  • 62
-1
votes
1 answer

Given an assembly object can I disassemble it to text?

I'm in a situation where I only have a reference to the managed Assembly Reference object in-memory, i.e. I don't have the dll or actual code. This whole question is about the fact that I have the in-memory representation of…
halivingston
  • 3,727
  • 4
  • 29
  • 42
1 2 3
70
71