The MSIL Assembler generates a portable executable (PE) file from Microsoft intermediate language (MSIL). You can run the resulting executable, which contains MSIL and the required metadata, to determine whether the MSIL performs as expected.
Questions tagged [ilasm]
76 questions
2
votes
1 answer
Is it OK to remove .property statements from ILAsm files for production use?
Still working on my obfuscation program based on modifying ILAsm files. (Ref. Which C# method names should not be obfuscated? )
In looking at the ILAsm code, I get the impression that the .property statements aren't used for anything, at least not…

RenniePet
- 11,420
- 7
- 80
- 106
2
votes
0 answers
How to add call to MessageBox.Show() with dnlib?
I am trying to make a call to MessageBox.Show from dnlib. I have this function that finds the Show method:
MethodDef GetSystemMethod(Type DeclaringType, string Methodname, Type[] MethodParams)
{
var filename =…

catalin00
- 31
- 1
- 4
2
votes
1 answer
which type of the constant does the `ldstr` instruction use?
I am reading the .NET IL Assembler book. There is a quote of the book:
`ldstr` "Enter a number" is an instruction that creates a string object
from the specified string constant and loads a reference to this
object onto the stack. The string…

Andrey Bushman
- 11,712
- 17
- 87
- 182
2
votes
1 answer
signing unsigned interdependent third party libraries
My project uses a set of unsigned third party libraries (compiled in .Net 2.0). I already know how to sign these libraries using ildasm and ilasm. However, the problem is that the thirdparty libraries are interdependent. As a result, after ilasm,…

R D
- 521
- 5
- 12
2
votes
1 answer
How to use .NET Core 2.0 ilasm.exe?
I'm trying https://www.nuget.org/packages/runtime.win-x64.Microsoft.NETCore.ILAsm/ (upon Where is ilasm.exe in Microsoft.NETCore.ILAsm?) on a Win 10 Pro x64 PC. Nothing happens.
Whatever syntax I'm using, still nothing. E.g. no .dll is generated…

Alex
- 2,469
- 3
- 28
- 61
2
votes
1 answer
Why does ILGenerator.Emit() insert nop opcodes in dynamic assembly?
I am building a small compiler in C#, so inevitably I had to meddle with dynamic assemblies and emitting opcodes. Now, the odd thing is that my Emit() calls create additional nop opcodes in the generated module. It is not so much essential in my…

user1171946
- 81
- 6
2
votes
1 answer
ILASM.exe process gets stuck during build
I'm building a WPF library in Visual Studio 2015, and build never completes. In build output diagnostic level I can see the last task launched by msbuild is
calling 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\ILAsm.exe' with /nologo…

rienafairefr
- 364
- 4
- 14
2
votes
1 answer
Missing graphics when disassembling and re-assembling .net program
I have a piece of software. When I disassemble the PE file
ildasm foo.exe /output=foo.il
I get a bunch of files, like foo.MainForm and foo.bar.dll. When I then try to re-assemble the file
ilasm foo.il
I get a working foo.exe back again, but some…

Frank Meulenaar
- 1,207
- 3
- 13
- 23
2
votes
1 answer
Create a signed copy of my assembly on the fly
I need to make a signed copy of my assembly on the fly.
I've tried to do so by adding this script in the post-build event:
call "$(DevEnvDir)..\Tools\vsvars32.bat"
ildasm /all /out=MyAssemblySignedVersion.il $(TargetFileName)
ilasm /dll…

Shani
- 99
- 6
2
votes
2 answers
Compile IL code at runtime using .NET 3.5 and C# from file
I would like to take a file that is an IL file, and at run time compile it back to an exe.
Right now I can use process.start to fire off the command line with parameters (ilasm.exe) but I would like to automate this process from a C# service I…

nitefrog
- 1,760
- 6
- 31
- 59
2
votes
1 answer
How to use ilasm with "release"-mode
I would like to use ilasm to compile il code. There are quite many parameters I can use. In visual studio I can simply tick "Optimize code" in the project settings. How can I enable the ilasm compiler to compile in "release"-mode, optimize the code…

Florian
- 5,918
- 3
- 47
- 86
2
votes
2 answers
.NET compiler - CLR assembly metadata access / reflection from non-managed C++
I have a compiler that targets the .NET runtime (CLR). The current version of the compiler is written in standard C++ (non-managed). The compiler currently lacks support to reference assemblies at compile time, so the way I "import" .NET libraries…

codenheim
- 20,467
- 1
- 59
- 80
2
votes
1 answer
New CIL target: Debugging information
I'm working on a new CIL target, and I'm not very sure on how to deal with debugging information.
I'm implementing a PE writer myself - so it's not depending on ilasm . From what I've seen in the ECMA documentation, there's the CILDB debugging…

Waneck
- 2,450
- 1
- 19
- 31
2
votes
2 answers
ILASM for Compact Framework?
I'm working with Linq expression trees (from the db4o/Mainsoft/Mono port) on the Compact Framework. Since System.Reflection.Emit doesn't exist, I can't compile my LambdaExpressions into delegates, which I want to do for performance reasons.
I…

codekaizen
- 26,990
- 7
- 84
- 140
2
votes
1 answer
Assembly recompilation and assembly load issue
I have an executable (Foo.exe) and a library Bar.dll. Both binaries are NOT strong name signed. The Bar.dll library depends on the executable file and has it specified in its manifest in such manner:

Bartosz
- 732
- 9
- 30