3

In CCI, it is possible to load a .NET assembly from file:

var assembly = (IAssembly) new PeReader.DefaultHost().LoadUnitFrom("C:\assembly.dll");

But I can't find any way to load it from any stream. I believe it should be possible because I can easly write assembly to stream:

PeWriter.WritePeToStream(assembly , _host, stream);

PeReader has OpenModule method that takes BinaryDocument parameter. But there is not way to create a BinaryDocument from stream instead of file.

Actually I'm interested in any way to read an assembly using CCI but not using slow file I/O.

Piotr Trzpil
  • 282
  • 2
  • 12
  • Are you talking about to Load DLL and Get the Methods, then you can use System.Reflection. – Akshay Joy Feb 25 '13 at 05:44
  • No, I'm interested only in using CCI – Piotr Trzpil Feb 27 '13 at 21:09
  • There is a lot of unsafe code in the sources I looked at. I suspect that a load from stream method could be implemented but the CCI team hasn't gotten around to it yet. Being that it's open source, you could implement the desired method. – Joe Caffeine Sep 23 '13 at 02:04

0 Answers0