CIL (Common Intermediate Language) is a low-level language used by Microsoft .NET Framework and Mono.
Questions tagged [il]
477 questions
0
votes
1 answer
How do I emit a call to String.op_Equality in Mono.Cecil
I'm trying to inject code into an assembly using Mono.Cecil. So far it's all been great but now I'm trying to implement this bit of IL:
call bool [mscorlib]System.String::op_Equality(string, string)
How do I do this in Cecil? I know it's something…

Earlz
- 62,085
- 98
- 303
- 499
0
votes
2 answers
Does Micro Focus Visual COBOL compile directly to MSIL?
I am reviewing solutions for migrating COBOL code to the .NET runtime. The two most promising solutions I have found online are NetCOBOL and Micro Focus Visual COBOL.
NetCOBOL compiles directly to MSIL and has Visual Studio integration. By…

smartcaveman
- 41,281
- 29
- 127
- 212
0
votes
1 answer
My completely managed assembly crashes with an AccessViolationException on .Net 4.5?
I've been debugging a very thorny issue.
Basically, I have an obfuscated assembly that crashes in various ways . The unobfuscated assembly has no problems, though there is no guarantee the obfuscator isn't to blame here. (that's what I might be…

Earlz
- 62,085
- 98
- 303
- 499
0
votes
2 answers
Implementing C++/clr's auto_handle functionality in C#
I have been looking for a way to ensure that member variables of a class are cleaned up in all cases such as an exception at the end of the classes constructor.
Because they are member variables, the "try, catch" and "using" patterns are not…

Karsten Pedersen
- 419
- 4
- 11
0
votes
2 answers
Why are anonymous methods not supported in .Net 1.1?
I've been learning a lot about IL recently with my new job. I have a question though that I can't quite find an answer for.
All of the documentation I've seen indicates that anonymous methods(for use in delegates) isn't supported on .Net 1.1.…

Earlz
- 62,085
- 98
- 303
- 499
-1
votes
2 answers
Where does this call come from?
I have some code that very roughly resembled the following:
class C {
string s;
static C a = new C();
static void Main() {
C b = a;
b.s = "hello";
}
The disassembly of the Main method, in Release mode, is as follows:
…

Cactus Golov
- 3,474
- 1
- 21
- 41
-1
votes
2 answers
Why some line labels in ILASM disassembly are omitted?
I have disassembled some code, using telerik JD, and I notice that some labels are omitted, and portion of the code is useless.
IL:
.method assembly hidebysig instance void xxx (
int32 p_intPer
) cil managed noinlining
{
…

justanothercoder
- 223
- 2
- 4
- 10
-1
votes
1 answer
Is there any way to retrieve the compiler-generated code from the .NET assembly in a readable form?
For example, if some C# class in an assembly has a property property, compiler generates set_property and get_property methods, or if there is a lambda, compiler also generates helper class c__DisplayClass or something like it. I can see them when I…

undermind
- 1,779
- 13
- 33
-1
votes
1 answer
Convert exe file to IL (Intermediate Language)
Is there any Command-Line or programmatically way to convert any type of exe file to IL?!
I know it is possible cuz I saw several programs that show me IL codes.
Note : I do this for .Net Framework via ILDASM.EXE (A tool of visual studio) but I'm…

Mohammad Sina Karvandi
- 1,064
- 3
- 25
- 44
-1
votes
1 answer
Is the Castclass OpCode necessary?
CLR allows me to set a field with an object reference regardless of whether a Castclass operation has been performed. Is it ok to set a field if there is certainty that the object reference on top of the stack is of the approperiate type? If so,…

toplel32
- 1,162
- 1
- 7
- 22
-5
votes
1 answer
System.Reflection.Emit::DynamicMethod: Is there a tool to have IL code generated from existing assembly?
I want to create a dynamic method with code that's a bit more than trivial.
So I want to create a hard coded version of the method body and have a compiled version of it examined by some tool that's returning OpCos and parameters to me so I can…

AxD
- 2,714
- 3
- 31
- 53
-7
votes
3 answers
Performance: While-loop
Simple question:
What is best, method 1 or method 2?
Is method 2 faster/better:
List data = Enumerable.Range(0, 10000000).ToList();
int j = 0;
// Method 1
while (j < data.Count)
{
// do something
j++;
}
j = 0;
// Method 2
while…

juFo
- 17,849
- 10
- 105
- 142