.Net PE File Format Library

Net PE File Format Library is a library to read information from a .net assembly. I wrote this library first for me, because sometimes when I write an unpacker I need to read the value of packed files, fix them and write them to a new one. It’s a lightweight library for .net PE file format; it based on the structure which CFF Explorer categories. That means what you see when you view an assembly with CFF Explorer, you can use this library to read that value. It is not as strong as Mono.Cecil, it can not handle the IL code and so far but I think it will be great in some cases when we just want to read some values of PE file format.

To use this library, you need add a reference to the assembly and declare in header that you’ll use it like this

using DotNetPeFileFormat;

To read values in PE of an assembly, you should create a new instance

PEFileFormat peffSource = new PEFileFormat(txtPath.Text);

And now you can read the values of this assembly, for example

peffSource.WriteDwordToArrayFromIndex(aOriginal, peffSource.OffsetToRva(nEntryPoint, peffSource.NTHeaders), 0xA8);

In above example, you can get the complete NTHeaders of that assembly, change an RVA address to Offset address and use an add-in function to write values into an array.

As I say, this library I wrote for my own uses. But I think I will help someone too. Don’t hesitate to ask if you do not know how to use it and your comments will be appreciated
* Requirements : .NET Framework 2.0
* Version:
* Don’t hesitate to ask if you don’t know how to use it. If you need more functions just post a comment.

LINK DOWN: When you want to post this libray to somewhere. Please post url to my site, that keeps update for this libray when you do that.
Download: http://hintdesk.com/Web/Tool/DotNetPeFileFormat.zip
* [] : Fix bugs
* [] : BETA Version.

Leave a comment

Your email address will not be published. Required fields are marked *