The title says it all. I've known about the jmp instruction for awhile, but it never struck me as being even remotely unsafe. I recently had cause to check the CIL specs and was very surprised to discover jmp is considered unverifiable.
Any explanations would be much appreciated.
...
Hi all,
I am trying to modificate an assembly (mine) just by ildassembling it and by modifying the MSIL code.
I just want to pop a MessageBox.
Here is my code :
.module extern Fusion.dll
.module extern kernel32.dll
.module extern advapi32.dll
.module extern aspnet_state.exe
.module extern webengine.dll
.module extern aspnet_wp.e...
Hi all,
I have a aspx webpage which uses an assembly mine (which mades a custom authentification).
I would like to modify MSIL code (so just with ILDASM/ILASM tools) of my assembly in order to log something in a file.
I have tried to add this at the end of the authentification method of my assembly :
IL_0034: ldstr "C:\\path_to_...
Where can I look to get started with writing MSIL in c#?
...
Hi,
I've done much reading and experimentation today regarding sigining of assemblies, and their installation into the GAC via various methods (mscorcfg.msc / drag and drop).
What I thought, was that once a file was in the GAC, you did not need to make references from projects in Visual studio. I know that you CAN make references via t...
I have some set of assemblies. I have disassemble those assemblies using the ISDASM.exe and change the namespace in the IL code and again compile those IL code using the ISASM.exe to get the assemblies without any error.
Here my question is after disassemble and assemble those assemblies product version, File version and the copyright i...
Moles is an isolation framework created by Microsoft. A cool feature of Moles is that it can "mock" static/non-virtual methods and sealed classes (which is not possible with frameworks like Moq). Below is the quick demonstration of what Moles can do:
Assert.AreNotEqual(new DateTime(2012, 1, 1), DateTime.Now);
// MDateTime is part of ...
What is the syntax for defining an array literal in CIL for the purposes of decorating a member with a custom attribute?
I am writing some .NET code in CIL (using ilasm.exe to compile it) and I need to decorate a method with a custom attribute. The constructor for that attribute takes an array of integers as its only parameter. How can ...
I am writing a special-purpose mini-compiler and I often view disassembled CIL to figure out how to do things. But it's often not obvious how to translate the disassembled code to Reflection.Emit calls. Does a reference manual exist or any other source of information for doing this translation?
Edit: yes, mapping the opcodes to ILGenera...
I wrote a small app that I need to distribute to 700+ computers, the problem being that the computers can be running any version of Windows (though most likely XP or better) with any version of .Net framework installed with internet connections all from OC3 to dialup.
I considered bundling .Net with my application but the .net installer...
I'm working on writing a compiler and one feature of this compiler is that it automatically generates GetHashCode(), Equals(object), and Equals({this value type}) methods for value types. Right now the Equals({this value type}) implementation basically generates il equivalent to the il generated by this c#:
public bool Equals(ThisType o...
How does the short circuit evaluation work in the msil interpreter? Does the And instruction contain information about where to jump to if false, and same for the Or with true?
...
I wrote an Int128 type and it works great. I thought I could improve on its performance with a simple idea: Improve the shift operations which are a bit clumsy.
Because they are heavily used in multiplication and division, an improvement would have a ripple effect. So I began creating a dynamic method (to shift low and rotate high), onl...
Does the .NET's Virtual Machine compiles the CIL bytecode (and then execute the code at the lowest level - CPU assembler), or it is an interpreter (that reads the following instructions and execute them) ?
...
I've been having a look at explicit interface implementations in IL. The method Method in the following class (interface IA has a single Method() on it):
public class B : IA
object IA.Method() {
/* code */
}
}
is compiled to the following IL method signature:
.method private hidebysig newslot virtual final instance ob...
Is it possible to insert IL code to C# method?
...
Possible Duplicate:
Is there some way to compile a .NET application to native code?
When you compile a C# application, it is compiled to CIL code, to be interpreted by the framework when it is ran, but im wondering if its possible to generate a native x86 EXE file stub for my application(s).
This way it is not possible to di...
Is there an equivalent of the XADD command in .Net? This is, after all, the most efficient method of locking / checking locks for critical sections or for ensuring accurate increments in a multi-threaded environment.
I looked through the IL opcodes, but couldn't find an equivalent.
...
I am working on a project using ReSharper. On occasion it prompts me that a field can be made readonly. Is there any performance or other benefit to this? I am presuming the benefits would be quite low-level, or would any benefits be purely semantic?
Thanks
With example below the field was initially just private, but resharper prompted...
I am looking for a instruction-level virtual machine debugger for debugging .NET files. The files are release builds and disassembling and then recompiling them is not an option.
...