Questions tagged [dnlib]

dnlib is a library that can read, write and create .NET assemblies and modules.

dnlib is a library that can read, write and create .NET assemblies and modules.

See:

38 questions
0
votes
0 answers

Execute method from a loaded assembly

I want to execute a method from a loaded assembly, i saw this Dnlib - Execute IL MethodBody from loaded assembly And, i wanted to do the same think, i search my function thank to a RVA adress(hardcoded), it well found, and I have tried to import it…
Bloodaxe
  • 51
  • 4
0
votes
1 answer

Invalid IL code generated

I'm trying to merge two methods together (one method from my project, one from a dll) and write them to a dll. The original code looks like this: .method public hidebysig static class Storage.DataMap Create() cil managed { .maxstack 8 …
bramhaag
  • 628
  • 1
  • 9
  • 24
0
votes
0 answers

How to use valuetype in dnlib in order to insert Console.ReadKey()

I am using the dnlib and I want to insert Console.ReadKey() at the end of the Console.WriteLines in another executable. The code below partly works. Though the issue is. It produces the MSIL: IL_0028: call void…
SejaVu
  • 1
  • 1
0
votes
1 answer

Read assembly MethodBody, parse its Name in a ListBox and its IL in a TextBox?

I have a WPF MainWindow Form with a ListBox and a TextBox that looks like this: Figure A. WPF MainWindow with Sample Text. Now, the Load Assembly... OnClick button event allows me to select a .NET Assembly and load it up using DnLib Then, if I…
ULI-R0
  • 171
  • 8
0
votes
1 answer

How to edit AssemblyInfo using Mono.Cecil/dnlib?

As the question states, how do I edit assembly information of a compiled executable file using Mono.Cecil? I tried to use FileVersionInfo but it is Read Only and I came to know that there is a possibility with Mono.Cecil/dnlib.
Ravi Kiran
  • 565
  • 1
  • 8
  • 22
0
votes
1 answer

Checking tiny vs. fat .NET method header

I need to enumerate all methods in a .NET module and check if they have tiny or fat header. I decided to use the powerful dnlib .NET modules handling library. There is a dnlib.DotNet.Writer.MethodBody class that indicates the tiny/fat method header…
MazeGen
  • 180
  • 3
  • 14
0
votes
1 answer

Rewriting string in .NET CLR heaps using dnlib

I need to rewrite strings in #US heap in .NET file. I decided to use dnlib that looks like a powerful library to manipulate .NET files. It is underdocumented unfortunately. I load the file the usual way. The ModuleDefMD Load() methods seem to be the…
MazeGen
  • 180
  • 3
  • 14
0
votes
1 answer

Calling A Method That Was Just Created. Error Calculating Max Stack Value

so I was fooling around with DNLIB recently, and I was trying to add methods to a .net file. I got the methods from a previously compiled file, so basically, I was trying to mimic the method. There are 3 methods: GetTheTypes, InvokeIt, and…
Mephobia
  • 31
  • 4
1 2
3